Skip to content

Commit

Permalink
fix(behavior_path_planner): drivable area not properly extended (#1817)
Browse files Browse the repository at this point in the history
fix drivable area not properly extended when
enable_avoidance_over_opposite_direction is true

Signed-off-by: Muhammad Zulfaqar Azmi <zulfaqar.azmi@tier4.jp>

Signed-off-by: Muhammad Zulfaqar Azmi <zulfaqar.azmi@tier4.jp>
  • Loading branch information
zulfaqar-azmi-t4 authored Sep 8, 2022
1 parent ef4d64d commit edfe616
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1706,18 +1706,14 @@ void AvoidanceModule::generateExtendedDrivableArea(ShiftedPath * shifted_path) c
lanelet::ConstLanelets extended_lanelets = current_lanes;

for (const auto & current_lane : current_lanes) {
if (!parameters_->enable_avoidance_over_opposite_direction) {
if (!parameters_->enable_avoidance_over_same_direction) {
break;
}

const auto extend_from_current_lane = std::invoke(
[this, &route_handler](const lanelet::ConstLanelet & lane) {
const auto ignore_opposite = !parameters_->enable_avoidance_over_opposite_direction;
if (ignore_opposite) {
return route_handler->getAllSharedLineStringLanelets(lane, true, true, ignore_opposite);
}

return route_handler->getAllSharedLineStringLanelets(lane);
const auto enable_opposite = parameters_->enable_avoidance_over_opposite_direction;
return route_handler->getAllSharedLineStringLanelets(lane, true, true, enable_opposite);
},
current_lane);
extended_lanelets.reserve(extended_lanelets.size() + extend_from_current_lane.size());
Expand Down

0 comments on commit edfe616

Please sign in to comment.