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(lane_change): guard invalid lc start point #3257

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
9 changes: 9 additions & 0 deletions planning/behavior_path_planner/src/util/lane_change/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,15 @@ std::pair<bool, bool> getLaneChangePaths(
// lane changing start pose is at the end of prepare segment
const auto & lane_changing_start_pose = prepare_segment.points.back().point.pose;

const auto target_distance_from_lane_change_start_pose = util::getArcLengthToTargetLanelet(
original_lanelets, target_lanelets.front(), lane_changing_start_pose);
// In new architecture, there is a possibility that the lane change start pose is behind of the
// target lanelet, even if the condition prepare_distance > target_distance is satisfied. In
// that case, the lane change shouldn't be executed.
if (target_distance_from_lane_change_start_pose > 0.0) {
break;
}

const auto shift_length =
lanelet::utils::getLateralDistanceToClosestLanelet(target_lanelets, lane_changing_start_pose);

Expand Down