Skip to content

Commit 1875a80

Browse files
go-sakayoriAriiees
authored andcommitted
refactor(static_avoidance): modify getAdjacentLane function (autowarefoundation#7843)
add getLeftOppositeLanelers in getAdjacentLane function Signed-off-by: Go Sakayori <gsakayori@gmail.com>
1 parent 2e6b570 commit 1875a80

File tree

1 file changed

+11
-0
lines changed
  • planning/behavior_path_planner/autoware_behavior_path_static_obstacle_avoidance_module/src

1 file changed

+11
-0
lines changed

planning/behavior_path_planner/autoware_behavior_path_static_obstacle_avoidance_module/src/utils.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -1993,6 +1993,17 @@ lanelet::ConstLanelets getAdjacentLane(
19931993
lanes.push_back(opt_right_lane.value());
19941994
}
19951995

1996+
const auto left_opposite_lanes = rh->getLeftOppositeLanelets(lane);
1997+
if (!is_right_shift && !left_opposite_lanes.empty()) {
1998+
lanes.push_back(left_opposite_lanes.front());
1999+
2000+
for (const auto & prev_lane : rh->getPreviousLanelets(left_opposite_lanes.front())) {
2001+
if (!exist(prev_lane.id())) {
2002+
lanes.push_back(prev_lane);
2003+
}
2004+
}
2005+
}
2006+
19962007
const auto right_opposite_lanes = rh->getRightOppositeLanelets(lane);
19972008
if (is_right_shift && !right_opposite_lanes.empty()) {
19982009
lanes.push_back(right_opposite_lanes.front());

0 commit comments

Comments
 (0)