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(obstacle_cruise_planner): add calculation of obstacle distance to ego #6057

Merged
merged 2 commits into from
Jan 17, 2024
Merged
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
8 changes: 5 additions & 3 deletions planning/obstacle_cruise_planner/src/planner_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,21 @@
}

tier4_planning_msgs::msg::StopReasonArray makeStopReasonArray(
const rclcpp::Time & current_time, const geometry_msgs::msg::Pose & stop_pose,
const PlannerData & planner_data, const geometry_msgs::msg::Pose & stop_pose,
const StopObstacle & stop_obstacle)
{
// create header
std_msgs::msg::Header header;
header.frame_id = "map";
header.stamp = current_time;
header.stamp = planner_data.current_time;

// create stop factor
StopFactor stop_factor;
stop_factor.stop_pose = stop_pose;
geometry_msgs::msg::Point stop_factor_point = stop_obstacle.collision_point;
stop_factor_point.z = stop_pose.position.z;
stop_factor.dist_to_stop_pose = motion_utils::calcSignedArcLength(

Check warning on line 53 in planning/obstacle_cruise_planner/src/planner_interface.cpp

View check run for this annotation

Codecov / codecov/patch

planning/obstacle_cruise_planner/src/planner_interface.cpp#L53

Added line #L53 was not covered by tests
planner_data.traj_points, planner_data.ego_pose.position, stop_pose.position);
stop_factor.stop_factor_points.emplace_back(stop_factor_point);

// create stop reason stamped
Expand Down Expand Up @@ -359,7 +361,7 @@
// Publish Stop Reason
const auto stop_pose = output_traj_points.at(*zero_vel_idx).pose;
const auto stop_reasons_msg =
makeStopReasonArray(planner_data.current_time, stop_pose, *closest_stop_obstacle);
makeStopReasonArray(planner_data, stop_pose, *closest_stop_obstacle);
stop_reasons_pub_->publish(stop_reasons_msg);
velocity_factors_pub_->publish(makeVelocityFactorArray(planner_data.current_time, stop_pose));

Expand Down
Loading