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 (#5489)

Signed-off-by: satoshi-ota <[email protected]>
  • Loading branch information
satoshi-ota authored Nov 7, 2023
1 parent f357bd3 commit 338e1e4
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2902,8 +2902,15 @@ 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_stop_line = data.to_return_point - min_return_distance;
const auto to_stop_line = data.to_return_point - min_return_distance - buffer;

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

0 comments on commit 338e1e4

Please sign in to comment.