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): die when using getExtendedCurrentLanes in the last lane #2256

Merged
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
fix(behavior_path_planner): die when using getExtendedCurrentLanes in…
… the last lane

Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
  • Loading branch information
kosuke55 committed Nov 9, 2022
commit 9277fc3370ce2ed6083a8886968d2212927cb408
8 changes: 6 additions & 2 deletions planning/behavior_path_planner/src/utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2030,11 +2030,15 @@ lanelet::ConstLanelets getExtendedCurrentLanes(

// Add next lane
const auto next_lanes = route_handler->getNextLanelets(current_lanes.back());
current_lanes.push_back(next_lanes.front());
if (!next_lanes.empty()) {
current_lanes.push_back(next_lanes.front());
}

// Add previous lane
const auto prev_lanes = route_handler->getPreviousLanelets(current_lanes.front());
current_lanes.insert(current_lanes.begin(), prev_lanes.front());
if (!prev_lanes.empty()) {
current_lanes.insert(current_lanes.begin(), prev_lanes.front());
}

return current_lanes;
}
Expand Down