Skip to content

Commit 8574fb9

Browse files
committed
feat(out_of_lane): ignore lanelets beyond the last path point
Signed-off-by: Maxime CLEMENT <maxime.clement@tier4.jp>
1 parent f874652 commit 8574fb9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

planning/behavior_velocity_out_of_lane_module/src/lanelets_selection.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,16 @@ lanelet::ConstLanelets calculate_ignored_lanelets(
9393
const auto is_path_lanelet = contains_lanelet(path_lanelets, l.second.id());
9494
if (!is_path_lanelet) ignored_lanelets.push_back(l.second);
9595
}
96+
// ignore lanelets beyond the last path pose
97+
const auto beyond =
98+
planning_utils::calculateOffsetPoint2d(ego_data.path.points.back().point.pose, params.front_offset, 0.0);
99+
const lanelet::BasicPoint2d beyond_point(beyond.x(), beyond.y());
100+
const auto beyond_lanelets = lanelet::geometry::findWithin2d(
101+
route_handler.getLaneletMapPtr()->laneletLayer, beyond_point, 0.0);
102+
for (const auto & l : beyond_lanelets) {
103+
const auto is_path_lanelet = contains_lanelet(path_lanelets, l.second.id());
104+
if (!is_path_lanelet) ignored_lanelets.push_back(l.second);
105+
}
96106
return ignored_lanelets;
97107
}
98108

0 commit comments

Comments
 (0)