Skip to content

Commit

Permalink
feat(map_loader): show intersection areas (#5401)
Browse files Browse the repository at this point in the history
Signed-off-by: satoshi-ota <[email protected]>
  • Loading branch information
satoshi-ota authored Oct 25, 2023
1 parent 5a76057 commit 4eb0d45
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ void Lanelet2MapVisualizationNode::onMapBin(
viz_lanelet_map, "no_obstacle_segmentation_area_for_run_out");
lanelet::ConstPolygons3d hatched_road_markings_area =
lanelet::utils::query::getAllPolygonsByType(viz_lanelet_map, "hatched_road_markings");
lanelet::ConstPolygons3d intersection_areas =
lanelet::utils::query::getAllPolygonsByType(viz_lanelet_map, "intersection_area");
std::vector<lanelet::NoParkingAreaConstPtr> no_parking_reg_elems =
lanelet::utils::query::noParkingAreas(all_lanelets);
lanelet::ConstLineStrings3d curbstones = lanelet::utils::query::curbstones(viz_lanelet_map);
Expand All @@ -134,7 +136,7 @@ void Lanelet2MapVisualizationNode::onMapBin(
cl_speed_bumps, cl_crosswalks, cl_parking_lots, cl_parking_spaces, cl_lanelet_id,
cl_obstacle_polygons, cl_no_stopping_areas, cl_no_obstacle_segmentation_area,
cl_no_obstacle_segmentation_area_for_run_out, cl_hatched_road_markings_area,
cl_hatched_road_markings_line, cl_no_parking_areas, cl_curbstones;
cl_hatched_road_markings_line, cl_no_parking_areas, cl_curbstones, cl_intersection_area;
setColor(&cl_road, 0.27, 0.27, 0.27, 0.999);
setColor(&cl_shoulder, 0.15, 0.15, 0.15, 0.999);
setColor(&cl_cross, 0.27, 0.3, 0.27, 0.5);
Expand All @@ -158,6 +160,7 @@ void Lanelet2MapVisualizationNode::onMapBin(
setColor(&cl_hatched_road_markings_line, 0.5, 0.5, 0.5, 0.999);
setColor(&cl_no_parking_areas, 0.42, 0.42, 0.42, 0.5);
setColor(&cl_curbstones, 0.1, 0.1, 0.2, 0.999);
setColor(&cl_intersection_area, 0.16, 1.0, 0.69, 0.5);

visualization_msgs::msg::MarkerArray map_marker_array;

Expand Down Expand Up @@ -248,6 +251,10 @@ void Lanelet2MapVisualizationNode::onMapBin(
&map_marker_array,
lanelet::visualization::lineStringsAsMarkerArray(curbstones, "curbstone", cl_curbstones, 0.2));

insertMarkerArray(
&map_marker_array, lanelet::visualization::intersectionAreaAsMarkerArray(
intersection_areas, cl_intersection_area));

pub_marker_->publish(map_marker_array);
}

Expand Down

0 comments on commit 4eb0d45

Please sign in to comment.