Skip to content

Commit

Permalink
checked on psim
Browse files Browse the repository at this point in the history
Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp>
  • Loading branch information
soblin committed May 31, 2022
1 parent e81b18d commit 1270880
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

#include <memory>
#include <string>
#include <utility>
#include <vector>

namespace rviz_plugins
Expand Down Expand Up @@ -131,8 +132,8 @@ TrafficLightPublishPanel::TrafficLightPublishPanel(QWidget * parent) : rviz_comm

void TrafficLightPublishPanel::onSetTrafficLightState()
{
// const auto traffic_light_id = traffic_light_id_input_->value();
const auto traffic_light_id = 0; // TODO(Mamoru Sobue): use select from items
const auto traffic_light_id_str = traffic_light_id_input_->currentText();
const auto traffic_light_id = std::stoi(traffic_light_id_str.toStdString());
const auto color = light_color_combo_->currentText();
const auto shape = light_shape_combo_->currentText();
const auto status = light_status_combo_->currentText();
Expand Down Expand Up @@ -369,14 +370,14 @@ void TrafficLightPublishPanel::onVectorMap(
lanelet::LaneletMapPtr lanelet_map(new lanelet::LaneletMap);
lanelet::utils::conversion::fromBinMsg(*msg, lanelet_map);
lanelet::ConstLanelets all_lanelets = lanelet::utils::query::laneletLayer(lanelet_map);
// TODO(Mamoru Sobue) extract from tl_reg_elem.trafficLights()
std::vector<lanelet::TrafficLightConstPtr> tl_reg_elems =
lanelet::utils::query::trafficLights(all_lanelets);
std::string info = "traffic light ids = ";
std::string info = "Fetching traffic lights :";
std::string delim = " ";
for (auto && tl_reg_elem_ptr : tl_reg_elems) {
for (auto && traffic_light : tl_reg_elem_ptr->trafficLights()) {
auto id = static_cast<int>(traffic_light.id());
info += (std::to_string(id) + ", ");
info += (std::exchange(delim, ", ") + std::to_string(id));
traffic_light_ids_.insert(id);
}
}
Expand Down

0 comments on commit 1270880

Please sign in to comment.