Skip to content

feat(map_based_prediction): apply the custom find-nearest function#12128

Merged
ktro2828 merged 3 commits intoautowarefoundation:mainfrom
ktro2828:feat/map-based-prediction/find-nearest
Feb 25, 2026
Merged

feat(map_based_prediction): apply the custom find-nearest function#12128
ktro2828 merged 3 commits intoautowarefoundation:mainfrom
ktro2828:feat/map-based-prediction/find-nearest

Conversation

@ktro2828
Copy link
Contributor

@ktro2828 ktro2828 commented Feb 18, 2026

Description

Because the builtin lanelet2::findNearest(...) function doesn't consider the 3D spaces, it tend to take a longer time and consume higher computational costs in the case that lanelet has 3D dimensional overlaps.

In autowarefoundation/autoware_core#839, the custom fined nearest function is added.

Key changes:

Lanelet type updates for const-correctness:

  • Changed function signatures and variable types from lanelet::Lanelet to lanelet::ConstLanelet in both header (utils.hpp) and implementation (utils.cpp) files, including in calculateLocalLikelihood and checkCloseLaneletCondition. [1] [2] [3]

Nearest lanelet search improvements:

  • Replaced the use of lanelet::geometry::findNearest with experimental::lanelet2_utils::find_nearest for finding surrounding lanelets, which now returns ConstLanelet pairs.

Const removal where mutable lanelets are needed:

  • Used experimental::lanelet2_utils::remove_const to convert ConstLanelet to a mutable Lanelet where necessary for downstream processing. [1] [2]

Include updates:

  • Added the autoware/lanelet2_utils/nn_search.hpp header to provide the new nearest neighbor search functionality.

Related links

Private Links:

How was this PR tested?

Checkout autoware_core to ktro2828:feat/lanelet2_utils/find_nearest and build:

cd src/core/autoware_core
gh pr checkout 839
cd ../../../
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release --packages-up-to autoware_map_based_prediction

The following view shows the prediction visualization comparison (left: before, right: after).
Although the previous results are flicking due to high latency, the updated results are stable.

Screencast.from.2026.02.18.18.09.39.webm

The following figure shows the performance profile comparison:

perf_comp_find_nearest

Notes for reviewers

THIS PR MUST BE MERGED AFTER autowarefoundation/autoware_core#839 HAS DONE!!

Interface changes

None.

Effects on system behavior

None.

@github-actions github-actions bot added the component:perception Advanced sensor data processing and environment understanding. (auto-assigned) label Feb 18, 2026
@github-actions
Copy link

github-actions bot commented Feb 18, 2026

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@ktro2828 ktro2828 marked this pull request as ready for review February 18, 2026 09:16
@technolojin technolojin added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Feb 24, 2026
Copy link
Contributor

@YoshiRi YoshiRi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but could you add some comments?

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
@ktro2828 ktro2828 force-pushed the feat/map-based-prediction/find-nearest branch from aba121b to 17380db Compare February 24, 2026 03:29
Copy link
Contributor

@YoshiRi YoshiRi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codecov
Copy link

codecov bot commented Feb 25, 2026

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 18.61%. Comparing base (ae88de5) to head (a56ffd7).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...eption/autoware_map_based_prediction/src/utils.cpp 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12128      +/-   ##
==========================================
+ Coverage   18.11%   18.61%   +0.50%     
==========================================
  Files        1841     1872      +31     
  Lines      126643   127654    +1011     
  Branches    44419    46807    +2388     
==========================================
+ Hits        22941    23764     +823     
- Misses      84592    85340     +748     
+ Partials    19110    18550     -560     
Flag Coverage Δ *Carryforward flag
daily 20.61% <ø> (+0.01%) ⬆️ Carriedforward from a2ee3ef
daily-cuda 18.14% <ø> (+0.03%) ⬆️ Carriedforward from a2ee3ef
differential 2.33% <0.00%> (?)
differential-cuda 3.19% <0.00%> (?)
total-cuda 18.11% <ø> (+<0.01%) ⬆️ Carriedforward from a2ee3ef

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ktro2828 ktro2828 enabled auto-merge (squash) February 25, 2026 02:32
@ktro2828 ktro2828 merged commit 8823256 into autowarefoundation:main Feb 25, 2026
44 checks passed
@github-project-automation github-project-automation bot moved this from To Triage to Done in Software Working Group Feb 25, 2026
@ktro2828 ktro2828 deleted the feat/map-based-prediction/find-nearest branch February 25, 2026 02:58
ktro2828 added a commit to tier4/autoware_universe that referenced this pull request Feb 26, 2026
…utowarefoundation#12128)

* feat: apply the custom find-nearest function

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

* chore: update comment

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

---------

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:perception Advanced sensor data processing and environment understanding. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants