Skip to content

feat(autoware_lanelet2_extension): replace remaining lanelet2_extension utilities functions - bpp packages#12085

Merged
soblin merged 22 commits intoautowarefoundation:mainfrom
sarun-hub:feat/bpp/replace_remaining_utilities
Feb 20, 2026
Merged

feat(autoware_lanelet2_extension): replace remaining lanelet2_extension utilities functions - bpp packages#12085
soblin merged 22 commits intoautowarefoundation:mainfrom
sarun-hub:feat/bpp/replace_remaining_utilities

Conversation

@sarun-hub
Copy link
Copy Markdown
Contributor

@sarun-hub sarun-hub commented Feb 13, 2026

Description

This PR is a small PR separated from #12014 for behavior_path_planner packages in planning component

These functions in autoware_lanelet2_extension that are ported in #760, and will be deprecated in autoware_lanelet2_extension PR #95.
This PR will replace their usage:
Target functions:

  • getArcCoordinates
  • getLateralDistanceToCenterline
  • getLateralDistancetoClosestLanelet -> get_lateral_distance_to_centerline
  • combineLaneletsShape
    =========================================================
  • getCenterlineWithOffset
  • getRightBoundWithOffset
  • getLeftBoundWithOffset
    ==========================================================
  • getExpandedLanelet -> ported get_dirty_expanded_lanelet
  • getExpandedLanelets -> ported get_dirty_expanded_lanelets

Note:
❌: does not exist in autoware_universe - bpp packages

Related links

autoware_core PR #842
autoware_lanelet2_extension PR #95
planning #12083
bvp #12084
evaluator #12086

Parent Issue:

  • Link

How was this PR tested?

Pass CI and Evaluator (CommonScenario_Basic)

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>
Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>
(autoware_behavior_path_goal_planner_module)

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>
(autoware_behavior_path_start_planner_module)

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>
Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>
Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>
Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>
Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>
@sarun-hub sarun-hub self-assigned this Feb 13, 2026
@github-actions github-actions Bot added the component:planning Route planning, decision-making, and navigation. (auto-assigned) label Feb 13, 2026
@sarun-hub sarun-hub added run:deploy-docs Mark for deploy-docs action generation. (used-by-ci) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) and removed component:planning Route planning, decision-making, and navigation. (auto-assigned) labels Feb 13, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 13, 2026

Thank you for contributing to the Autoware project!

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

Please ensure:

@github-actions github-actions Bot added the component:planning Route planning, decision-making, and navigation. (auto-assigned) label Feb 13, 2026
@github-actions
Copy link
Copy Markdown

Documentation URL: https://autowarefoundation.github.io/autoware_universe/pr-12085/
Modified URLs:

@sarun-hub sarun-hub removed the run:deploy-docs Mark for deploy-docs action generation. (used-by-ci) label Feb 13, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 13, 2026

Codecov Report

❌ Patch coverage is 57.22892% with 71 lines in your changes missing coverage. Please review.
✅ Project coverage is 23.52%. Comparing base (ce479fd) to head (ce6832f).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
..._start_planner_module/src/start_planner_module.cpp 30.00% 14 Missing ⚠️
..._module/src/pull_over_planner/bezier_pull_over.cpp 0.00% 8 Missing ⚠️
...are_behavior_path_lane_change_module/src/scene.cpp 38.46% 8 Missing ⚠️
...e_behavior_path_planner_common/src/utils/utils.cpp 70.83% 4 Missing and 3 partials ⚠️
...th_goal_planner_module/src/goal_planner_module.cpp 66.66% 4 Missing and 1 partial ⚠️
...ior_path_goal_planner_module/src/goal_searcher.cpp 66.66% 4 Missing and 1 partial ⚠️
...are_behavior_path_goal_planner_module/src/util.cpp 42.85% 2 Missing and 2 partials ⚠️
...havior_path_lane_change_module/src/utils/utils.cpp 63.63% 2 Missing and 2 partials ⚠️
...ing_planner_module/src/sampling_planner_module.cpp 0.00% 4 Missing ⚠️
...ath_static_obstacle_avoidance_module/src/utils.cpp 55.55% 3 Missing and 1 partial ⚠️
... and 5 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12085      +/-   ##
==========================================
+ Coverage   18.13%   23.52%   +5.39%     
==========================================
  Files        1839     1873      +34     
  Lines      126417   127990    +1573     
  Branches    44329    46910    +2581     
==========================================
+ Hits        22922    30110    +7188     
- Misses      84399    85206     +807     
+ Partials    19096    12674    -6422     
Flag Coverage Δ *Carryforward flag
daily 20.58% <0.00%> (-0.03%) ⬇️ Carriedforward from e168db4
daily-cuda 18.09% <0.00%> (-0.04%) ⬇️ Carriedforward from e168db4
differential 19.53% <57.57%> (?)
total-cuda 18.09% <0.00%> (-0.04%) ⬇️ Carriedforward from e168db4

*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.

const auto combine_lanelet = lanelet::utils::combineLaneletsShape(concat_lanelets);
// concat_lanelets is already confirmed to have at least one lanelet (nearest lanelet)
const auto combine_lanelet =
*autoware::experimental::lanelet2_utils::combine_lanelets_shape(concat_lanelets);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do not dereference optional without null-check ! In this case you should return false if it was nullopt

// store combined lane and its front lane
const auto & combined_and_first = std::pair<lanelet::ConstLanelet, lanelet::ConstLanelet>(
lanelet::utils::combineLaneletsShape(combined_lane_elems), combined_lane_elems.front());
*autoware::experimental::lanelet2_utils::combine_lanelets_shape(combined_lane_elems),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd prefer

  • (0) do not check combine_lane_elems
  • (1) obtain combine_lanelets_shape of optional type directly
  • (2) do the process

sarun-hub and others added 4 commits February 16, 2026 15:46
Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>
Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>
Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>
const auto combined_target_lane = lanelet::utils::combineLaneletsShape(target_lanes);
const auto combined_target_lane_opt =
autoware::experimental::lanelet2_utils::combine_lanelets_shape(target_lanes);
if (!combined_target_lane_opt.has_value()) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (!combined_target_lane_opt.has_value()) {
if (!combined_target_lane_opt) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@zulfaqar-azmi-t4
Thank you for your review and comments!

In this PR (and other related PRs), I used the same expression for the consistency.

Is there any performance issue with using has_value() instead of implicitly converting opt to bool (only opt)?
Is it okay to keep has_value() for consistency?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It is just about style, there is no performance issue since operator bool() is called internally

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for the explanation. Within lane change module, normally we're using if (!combined_target_lane_opt) { directly. Personally I would like to keep the consistency that way. But then it is also okay, so I'll leave it to you,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the suggestion. I’ve updated it to keep consistency with the lane change module (I found one more usage of has_value, so I removed it there too).

…ets opt

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>
@sarun-hub sarun-hub added run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) and removed run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) labels Feb 19, 2026
@soblin soblin merged commit 734e363 into autowarefoundation:main Feb 20, 2026
43 of 44 checks passed
@github-project-automation github-project-automation Bot moved this from To Triage to Done in Software Working Group Feb 20, 2026
mkquda pushed a commit to tier4/autoware_universe that referenced this pull request Mar 16, 2026
…on utilities functions - bpp packages (autowarefoundation#12085)

* replace getArcCoordinates in bpp packages

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>

* replace getArcCoordinates usage in bpp packages (2)

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>

* replace getArcCoordinates in bpp package (3)

(autoware_behavior_path_goal_planner_module)

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>

* replace getArcCoordinates in bpp package(4)

(autoware_behavior_path_start_planner_module)

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>

* replace getLateralDistanceToClosestLanelet in bpp package

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>

* replace getExpandedLanelet(s) in bpp package

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>

* replace combineLaneletsShape in bpp packages

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>

* fix wrong condition in bpp

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>

* style(pre-commit): autofix

* remove directly dereference opt for combine_lanelet

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>

* remove log if lanelet is empty

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>

* bind reference to optional value for combine_lanelets_shape

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>

* remove log and simply return outside else in get_dirty_expanded_lanelets opt

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>

* remove .has_value in lane_change_module for consistency

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>

---------

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: Mamoru Sobue <hilo.soblin@gmail.com>
mkquda pushed a commit to tier4/autoware_universe that referenced this pull request Apr 22, 2026
…on utilities functions - bpp packages (autowarefoundation#12085)

* replace getArcCoordinates in bpp packages

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>

* replace getArcCoordinates usage in bpp packages (2)

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>

* replace getArcCoordinates in bpp package (3)

(autoware_behavior_path_goal_planner_module)

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>

* replace getArcCoordinates in bpp package(4)

(autoware_behavior_path_start_planner_module)

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>

* replace getLateralDistanceToClosestLanelet in bpp package

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>

* replace getExpandedLanelet(s) in bpp package

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>

* replace combineLaneletsShape in bpp packages

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>

* fix wrong condition in bpp

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>

* style(pre-commit): autofix

* remove directly dereference opt for combine_lanelet

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>

* remove log if lanelet is empty

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>

* bind reference to optional value for combine_lanelets_shape

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>

* remove log and simply return outside else in get_dirty_expanded_lanelets opt

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>

* remove .has_value in lane_change_module for consistency

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>

---------

Signed-off-by: Sarun Mukdapitak <sarun.mukda@gmail.com>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: Mamoru Sobue <hilo.soblin@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:planning Route planning, decision-making, and navigation. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants