Skip to content

Commit

Permalink
feat(out_of_lane): ignore lanelets beyond the last path point (#1554)
Browse files Browse the repository at this point in the history
* feat(out_of_lane): ignore lanelets beyond the last path point

Signed-off-by: Maxime CLEMENT <[email protected]>

* style(pre-commit): autofix

---------

Signed-off-by: Maxime CLEMENT <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
maxime-clem and pre-commit-ci[bot] authored Oct 8, 2024
1 parent 6215c64 commit 19c7cb7
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 19c7cb7

Please sign in to comment.