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

feat(map_loader): show intersection areas #211

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
}
}

visualization_msgs::msg::MarkerArray visualization::intersectionAreaAsMarkerArray(

Check warning on line 1461 in tmp/lanelet2_extension/lib/visualization.cpp

View check run for this annotation

Codecov / codecov/patch

tmp/lanelet2_extension/lib/visualization.cpp#L1461

Added line #L1461 was not covered by tests
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;
}

Check warning on line 1478 in tmp/lanelet2_extension/lib/visualization.cpp

View check run for this annotation

Codecov / codecov/patch

tmp/lanelet2_extension/lib/visualization.cpp#L1478

Added line #L1478 was not covered by tests

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