Skip to content

Commit

Permalink
fix(route_handler): fix getting next lane logic to prevent from unexp…
Browse files Browse the repository at this point in the history
…ected path cut (autowarefoundation#5355)

Signed-off-by: satoshi-ota <[email protected]>
  • Loading branch information
satoshi-ota authored Oct 20, 2023
1 parent a57671d commit 55e0dea
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions planning/route_handler/src/route_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -855,12 +855,11 @@ bool RouteHandler::getNextLaneletWithinRoute(
return false;
}

lanelet::ConstLanelet start_lanelet;
const bool flag_check = getClosestLaneletWithinRoute(route_ptr_->start_pose, &start_lanelet);
const auto start_lane_id = route_ptr_->segments.front().preferred_primitive.id;

const auto following_lanelets = routing_graph_ptr_->following(lanelet);
for (const auto & llt : following_lanelets) {
if (!(flag_check && start_lanelet.id() == llt.id()) && exists(route_lanelets_, llt)) {
if (start_lane_id != llt.id() && exists(route_lanelets_, llt)) {
*next_lanelet = llt;
return true;
}
Expand Down

0 comments on commit 55e0dea

Please sign in to comment.