Skip to content

Commit

Permalink
feat(out_of_lane): ignore lanelets beyond the last path point
Browse files Browse the repository at this point in the history
Signed-off-by: Maxime CLEMENT <maxime.clement@tier4.jp>
  • Loading branch information
maxime-clem committed Sep 25, 2024
1 parent f874652 commit 8574fb9
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@ lanelet::ConstLanelets calculate_ignored_lanelets(
const auto is_path_lanelet = contains_lanelet(path_lanelets, l.second.id());
if (!is_path_lanelet) ignored_lanelets.push_back(l.second);
}
// ignore lanelets beyond the last path pose
const auto beyond =
planning_utils::calculateOffsetPoint2d(ego_data.path.points.back().point.pose, params.front_offset, 0.0);
const lanelet::BasicPoint2d beyond_point(beyond.x(), beyond.y());
const auto beyond_lanelets = lanelet::geometry::findWithin2d(
route_handler.getLaneletMapPtr()->laneletLayer, beyond_point, 0.0);
for (const auto & l : beyond_lanelets) {
const auto is_path_lanelet = contains_lanelet(path_lanelets, l.second.id());
if (!is_path_lanelet) ignored_lanelets.push_back(l.second);
}
return ignored_lanelets;
}

Expand Down

0 comments on commit 8574fb9

Please sign in to comment.