Skip to content

Commit

Permalink
fix(goal_planner): fix detection_polygons visualiztion (#5596)
Browse files Browse the repository at this point in the history
  • Loading branch information
kosuke55 authored Nov 15, 2023
1 parent a76d360 commit fa5d7db
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;
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));
}
}
debug_marker_.markers.push_back(marker);
Expand Down

0 comments on commit fa5d7db

Please sign in to comment.