Skip to content

Commit

Permalink
fix(goal_planner): fix detection_polygons visualiztion
Browse files Browse the repository at this point in the history
Signed-off-by: kosuke55 <[email protected]>
  • Loading branch information
kosuke55 committed Nov 15, 2023
1 parent b5d6c51 commit d716d31
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1752,16 +1752,16 @@ void GoalPlannerModule::setDebugData()
"map", rclcpp::Clock{RCL_ROS_TIME}.now(), "detection_polygons", 0, Marker::LINE_LIST,
tier4_autoware_utils::createMarkerScale(0.01, 0.0, 0.0),
tier4_autoware_utils::createMarkerColor(0.0, 0.0, 1.0, 0.999));

const double ego_z = planner_data_->self_odometry->pose.pose.position.z;

Check warning on line 1755 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1755

Added line #L1755 was not covered by tests
for (const auto & ego_polygon : debug_data_.ego_polygons_expanded) {
for (size_t ep_idx = 0; ep_idx < ego_polygon.outer().size(); ++ep_idx) {
const auto & current_point = ego_polygon.outer().at(ep_idx);
const auto & next_point = ego_polygon.outer().at((ep_idx + 1) % ego_polygon.outer().size());

marker.points.push_back(
tier4_autoware_utils::createPoint(current_point.x(), current_point.y(), 0.0));
tier4_autoware_utils::createPoint(current_point.x(), current_point.y(), ego_z));
marker.points.push_back(
tier4_autoware_utils::createPoint(next_point.x(), next_point.y(), 0.0));
tier4_autoware_utils::createPoint(next_point.x(), next_point.y(), ego_z));

Check warning on line 1764 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ Getting worse: Complex Method

GoalPlannerModule::setDebugData already has high cyclomatic complexity, and now it increases in Lines of Code from 114 to 115. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
}
}
debug_marker_.markers.push_back(marker);
Expand Down

0 comments on commit d716d31

Please sign in to comment.