Skip to content

Commit

Permalink
feat(map_loader): show intersection areas
Browse files Browse the repository at this point in the history
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
  • Loading branch information
satoshi-ota committed Oct 25, 2023
1 parent f400b91 commit dce9649
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);

Expand All @@ -133,7 +135,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_hatched_road_markings_line, cl_no_parking_areas, 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 @@ -156,6 +158,7 @@ void Lanelet2MapVisualizationNode::onMapBin(
setColor(&cl_hatched_road_markings_area, 0.3, 0.3, 0.3, 0.5);
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_intersection_area, 0.16, 1.0, 0.69, 0.5);

visualization_msgs::msg::MarkerArray map_marker_array;

Expand Down Expand Up @@ -242,6 +245,10 @@ void Lanelet2MapVisualizationNode::onMapBin(
&map_marker_array,
lanelet::visualization::noParkingAreasAsMarkerArray(no_parking_reg_elems, cl_no_parking_areas));

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

pub_marker_->publish(map_marker_array);
}

Expand Down

0 comments on commit dce9649

Please sign in to comment.