Skip to content

Commit

Permalink
fix(lane_change): add guard to neigibor lanelets (autowarefoundation#…
Browse files Browse the repository at this point in the history
…5245)

Signed-off-by: kosuke55 <[email protected]>
  • Loading branch information
kosuke55 authored and TakaHoribe committed Oct 13, 2023
1 parent 7ac2439 commit cc5d206
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,9 @@ bool NormalLaneChange::getLaneChangePaths(

const auto target_neighbor_preferred_lane_poly_2d =
utils::lane_change::getTargetNeighborLanesPolygon(route_handler, current_lanes, type_);
if (target_neighbor_preferred_lane_poly_2d.empty()) {
return false;
}

const auto target_objects = getTargetObjects(current_lanes, target_lanes);
debug_filtered_objects_ = target_objects;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ lanelet::BasicPolygon2d getTargetNeighborLanesPolygon(
{
const auto target_neighbor_lanelets =
utils::lane_change::getTargetNeighborLanes(route_handler, current_lanes, type);
if (target_neighbor_lanelets.empty()) {
return {};
}
const auto target_neighbor_preferred_lane_poly = lanelet::utils::getPolygonFromArcLength(
target_neighbor_lanelets, 0, std::numeric_limits<double>::max());

Expand Down

0 comments on commit cc5d206

Please sign in to comment.