Skip to content

Commit

Permalink
fix(avoidance): fix avoidance return dead point calculation logic for…
Browse files Browse the repository at this point in the history
… high curverture path (autowarefoundation#5489) (#1063)

Signed-off-by: satoshi-ota <[email protected]>
  • Loading branch information
satoshi-ota committed Jan 14, 2024
1 parent fa9b6c6 commit 9a6da84
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2956,11 +2956,19 @@ void AvoidanceModule::insertReturnDeadLine(
return;
}

// Consider the difference in path length between the shifted path and original path (the path
// that is shifted inward has a shorter distance to the end of the path than the other one.)
const auto & to_reference_path_end = data.arclength_from_ego.back();
const auto to_shifted_path_end = calcSignedArcLength(
shifted_path.path.points, getEgoPosition(), shifted_path.path.points.size() - 1);
const auto buffer = std::max(0.0, to_shifted_path_end - to_reference_path_end);

const auto min_return_distance = helper_.getMinAvoidanceDistance(shift_length);

const auto to_goal = calcSignedArcLength(
shifted_path.path.points, getEgoPosition(), shifted_path.path.points.size() - 1);
const auto to_stop_line = to_goal - min_return_distance - parameters_->remain_buffer_distance;
const auto to_stop_line =
to_goal - min_return_distance - parameters_->remain_buffer_distance - buffer;

// If we don't need to consider deceleration constraints, insert a deceleration point
// and return immediately
Expand Down

0 comments on commit 9a6da84

Please sign in to comment.