Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

Commit

Permalink
feat(map_loader): show intersection areas (#211)
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 authored Oct 25, 2023
1 parent c3a1a19 commit 6054e6b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,14 @@ visualization_msgs::msg::MarkerArray generateLaneletIdMarker(
visualization_msgs::msg::MarkerArray obstaclePolygonsAsMarkerArray(
const lanelet::ConstPolygons3d & obstacle_polygons, const std_msgs::msg::ColorRGBA & c);

/**
* [intersectionAreaAsMarkerArray creates marker array to visualize intersection area]
* @param intersection_areas [intersection area polygon]
* @param c [color of the marker]
*/
visualization_msgs::msg::MarkerArray intersectionAreaAsMarkerArray(
const lanelet::ConstPolygons3d & intersection_areas, const std_msgs::msg::ColorRGBA & c);

/**
* [noObstacleSegmentationAreaAsMarkerArray creates marker array to visualize no obstacle
* segmentation area]
Expand Down
19 changes: 19 additions & 0 deletions tmp/lanelet2_extension/lib/visualization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1458,6 +1458,25 @@ void visualization::pushArrowsMarker(
}
}

visualization_msgs::msg::MarkerArray visualization::intersectionAreaAsMarkerArray(
const lanelet::ConstPolygons3d & intersection_areas, const std_msgs::msg::ColorRGBA & c)
{
visualization_msgs::msg::MarkerArray marker_array;
if (intersection_areas.empty()) {
return marker_array;
}

visualization_msgs::msg::Marker marker = createPolygonMarker("intersection_area", c);
for (const auto & polygon : intersection_areas) {
pushPolygonMarker(&marker, polygon, c);
}

if (!marker.points.empty()) {
marker_array.markers.push_back(marker);
}
return marker_array;
}

visualization_msgs::msg::MarkerArray visualization::noObstacleSegmentationAreaAsMarkerArray(
const lanelet::ConstPolygons3d & no_obstacle_segmentation_area,
const std_msgs::msg::ColorRGBA & c)
Expand Down

0 comments on commit 6054e6b

Please sign in to comment.