Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(map loader): visualize bus stop area and bicycle_lane #8777

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
1 change: 1 addition & 0 deletions map/map_loader/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<maintainer email="[email protected]">NGUYEN Viet Anh</maintainer>
<maintainer email="[email protected]">Taiki Yamada</maintainer>
<maintainer email="[email protected]">Shintaro Sakoda</maintainer>
<maintainer email="[email protected]">Mamoru Sobue</maintainer>

<license>Apache License 2.0</license>
<author email="[email protected]">Ryohsuke Mitsudome</author>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@
lanelet::ConstLanelets shoulder_lanelets = lanelet::utils::query::shoulderLanelets(all_lanelets);
lanelet::ConstLanelets crosswalk_lanelets =
lanelet::utils::query::crosswalkLanelets(all_lanelets);
lanelet::ConstLanelets bicycle_lane_lanelets =
lanelet::utils::query::bicycleLaneLanelets(all_lanelets);

Check warning on line 99 in map/map_loader/src/lanelet2_map_loader/lanelet2_map_visualization_node.cpp

View check run for this annotation

Codecov / codecov/patch

map/map_loader/src/lanelet2_map_loader/lanelet2_map_visualization_node.cpp#L99

Added line #L99 was not covered by tests
lanelet::ConstLineStrings3d partitions = lanelet::utils::query::getAllPartitions(viz_lanelet_map);
lanelet::ConstLineStrings3d pedestrian_polygon_markings =
lanelet::utils::query::getAllPedestrianPolygonMarkings(viz_lanelet_map);
Expand Down Expand Up @@ -130,6 +132,8 @@
std::vector<lanelet::NoParkingAreaConstPtr> no_parking_reg_elems =
lanelet::utils::query::noParkingAreas(all_lanelets);
lanelet::ConstLineStrings3d curbstones = lanelet::utils::query::curbstones(viz_lanelet_map);
std::vector<lanelet::BusStopAreaConstPtr> bus_stop_reg_elems =
lanelet::utils::query::busStopAreas(all_lanelets);

Check warning on line 136 in map/map_loader/src/lanelet2_map_loader/lanelet2_map_visualization_node.cpp

View check run for this annotation

Codecov / codecov/patch

map/map_loader/src/lanelet2_map_loader/lanelet2_map_visualization_node.cpp#L136

Added line #L136 was not covered by tests

std_msgs::msg::ColorRGBA cl_road;
std_msgs::msg::ColorRGBA cl_shoulder;
Expand All @@ -155,6 +159,8 @@
std_msgs::msg::ColorRGBA cl_no_parking_areas;
std_msgs::msg::ColorRGBA cl_curbstones;
std_msgs::msg::ColorRGBA cl_intersection_area;
std_msgs::msg::ColorRGBA cl_bus_stop_area;
std_msgs::msg::ColorRGBA cl_bicycle_lane;
set_color(&cl_road, 0.27, 0.27, 0.27, 0.999);
set_color(&cl_shoulder, 0.15, 0.15, 0.15, 0.999);
set_color(&cl_cross, 0.27, 0.3, 0.27, 0.5);
Expand All @@ -179,6 +185,8 @@
set_color(&cl_no_parking_areas, 0.42, 0.42, 0.42, 0.5);
set_color(&cl_curbstones, 0.1, 0.1, 0.2, 0.999);
set_color(&cl_intersection_area, 0.16, 1.0, 0.69, 0.5);
set_color(&cl_bus_stop_area, 0.863, 0.863, 0.863, 0.5);
set_color(&cl_bicycle_lane, 0.0, 0.3843, 0.6274, 0.5);

visualization_msgs::msg::MarkerArray map_marker_array;

Expand Down Expand Up @@ -286,6 +294,24 @@
&map_marker_array, lanelet::visualization::intersectionAreaAsMarkerArray(
intersection_areas, cl_intersection_area));

insert_marker_array(

Check warning on line 297 in map/map_loader/src/lanelet2_map_loader/lanelet2_map_visualization_node.cpp

View check run for this annotation

Codecov / codecov/patch

map/map_loader/src/lanelet2_map_loader/lanelet2_map_visualization_node.cpp#L297

Added line #L297 was not covered by tests
&map_marker_array,
lanelet::visualization::busStopAreasAsMarkerArray(bus_stop_reg_elems, cl_bus_stop_area));

Check warning on line 299 in map/map_loader/src/lanelet2_map_loader/lanelet2_map_visualization_node.cpp

View check run for this annotation

Codecov / codecov/patch

map/map_loader/src/lanelet2_map_loader/lanelet2_map_visualization_node.cpp#L299

Added line #L299 was not covered by tests

insert_marker_array(

Check warning on line 301 in map/map_loader/src/lanelet2_map_loader/lanelet2_map_visualization_node.cpp

View check run for this annotation

Codecov / codecov/patch

map/map_loader/src/lanelet2_map_loader/lanelet2_map_visualization_node.cpp#L301

Added line #L301 was not covered by tests
&map_marker_array,
lanelet::visualization::laneletDirectionAsMarkerArray(bicycle_lane_lanelets, "bicycle_lane_"));
insert_marker_array(
&map_marker_array, lanelet::visualization::laneletsBoundaryAsMarkerArray(

Check warning on line 305 in map/map_loader/src/lanelet2_map_loader/lanelet2_map_visualization_node.cpp

View check run for this annotation

Codecov / codecov/patch

map/map_loader/src/lanelet2_map_loader/lanelet2_map_visualization_node.cpp#L303-L305

Added lines #L303 - L305 were not covered by tests
bicycle_lane_lanelets, cl_ll_borders /* use ll_border color */,
viz_lanelets_centerline_, "bicycle_lane_"));
insert_marker_array(
&map_marker_array, lanelet::visualization::generateLaneletIdMarker(

Check warning on line 309 in map/map_loader/src/lanelet2_map_loader/lanelet2_map_visualization_node.cpp

View check run for this annotation

Codecov / codecov/patch

map/map_loader/src/lanelet2_map_loader/lanelet2_map_visualization_node.cpp#L307-L309

Added lines #L307 - L309 were not covered by tests
bicycle_lane_lanelets, cl_lanelet_id /* use lanelet_id color */));
insert_marker_array(
&map_marker_array, lanelet::visualization::laneletsAsTriangleMarkerArray(

Check warning on line 312 in map/map_loader/src/lanelet2_map_loader/lanelet2_map_visualization_node.cpp

View check run for this annotation

Codecov / codecov/patch

map/map_loader/src/lanelet2_map_loader/lanelet2_map_visualization_node.cpp#L311-L312

Added lines #L311 - L312 were not covered by tests
"bicycle_lane_lanelets", bicycle_lane_lanelets, cl_bicycle_lane));

Check warning on line 314 in map/map_loader/src/lanelet2_map_loader/lanelet2_map_visualization_node.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ Getting worse: Large Method

Lanelet2MapVisualizationNode::on_map_bin increases from 195 to 219 lines of code, threshold = 70. Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function.
pub_marker_->publish(map_marker_array);
}

Expand Down
Loading