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(route_handler): query shoulder lane in getLaneletSequence() if only_route_lanes is false and the arg is shoulder type (#6567) #1182

Merged
merged 1 commit into from
Mar 8, 2024
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
16 changes: 13 additions & 3 deletions planning/route_handler/src/route_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,12 +643,22 @@ lanelet::ConstLanelets RouteHandler::getLaneletSequence(
return lanelet_sequence;
}

lanelet::ConstLanelets lanelet_sequence_forward =
getLaneletSequenceAfter(lanelet, forward_distance, only_route_lanes);
const lanelet::ConstLanelets lanelet_sequence_forward = std::invoke([&]() {
if (only_route_lanes) {
return getLaneletSequenceAfter(lanelet, forward_distance, only_route_lanes);
} else if (lanelet::utils::contains(shoulder_lanelets_, lanelet)) {
return getShoulderLaneletSequenceAfter(lanelet, forward_distance);
}
return lanelet::ConstLanelets{};
});
const lanelet::ConstLanelets lanelet_sequence_backward = std::invoke([&]() {
const auto arc_coordinate = lanelet::utils::getArcCoordinates({lanelet}, current_pose);
if (arc_coordinate.length < backward_distance) {
return getLaneletSequenceUpTo(lanelet, backward_distance, only_route_lanes);
if (only_route_lanes) {
return getLaneletSequenceUpTo(lanelet, backward_distance, only_route_lanes);
} else if (lanelet::utils::contains(shoulder_lanelets_, lanelet)) {
return getShoulderLaneletSequenceUpTo(lanelet, backward_distance);
}
}
return lanelet::ConstLanelets{};
});
Expand Down
Loading