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

fix(behavior_path_planner): pull over emergency stop #2601

Merged
merged 1 commit into from
Dec 30, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -653,14 +653,16 @@ PathWithLaneId PullOverModule::generateStopPath()
status_.is_safe ? status_.pull_over_path.start_pose
: (closest_start_pose_ ? closest_start_pose_.value() : *search_start_pose);

// if stop pose is behind current pose, stop as soon as possible
// if stop pose is closer than min_stop_distance, stop as soon as possible
const size_t ego_idx = findEgoIndex(reference_path.points);
const size_t stop_idx = findFirstNearestSegmentIndexWithSoftConstraints(
reference_path.points, stop_pose, common_parameters.ego_nearest_dist_threshold,
common_parameters.ego_nearest_yaw_threshold);
const double ego_to_stop_distance = calcSignedArcLength(
reference_path.points, current_pose.position, ego_idx, stop_pose.position, stop_idx);
if (ego_to_stop_distance < 0.0) {
const double current_vel = planner_data_->self_odometry->twist.twist.linear.x;
const double min_stop_distance = std::pow(current_vel, 2) / parameters_.maximum_deceleration / 2;
if (ego_to_stop_distance < min_stop_distance) {
return generateEmergencyStopPath();
}

Expand Down