Skip to content

Commit 19c7cb7

Browse files
feat(out_of_lane): ignore lanelets beyond the last path point (#1554)
* feat(out_of_lane): ignore lanelets beyond the last path point Signed-off-by: Maxime CLEMENT <maxime.clement@tier4.jp> * style(pre-commit): autofix --------- Signed-off-by: Maxime CLEMENT <maxime.clement@tier4.jp> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 6215c64 commit 19c7cb7

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 = planning_utils::calculateOffsetPoint2d(
98+
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)