Skip to content

Conversation

sarun-hub
Copy link
Contributor

@sarun-hub sarun-hub commented Oct 9, 2025

Description

This PR is to implement functions to create artificial lanelet object including

  • Create lanelet::BasicLineString3d or lanelet::ConstLineString3d from lanelet::BasicPoint3d or lanelet::ConstPoint3d
  • Create lanelet::ConstLanelet from right_points and left_points
  • List up the places where default initialization like lanelet::ConstLanelet lanelet{}, lanelet::ConstLineString3d line{}; is happening.
  • Add remove_const function.

Related links

Default initialization of lanelet::ConstLanelet, lanelet::ConstLineString3d and lanelet::BasicLineString3d

lanelet::ConstLanelet

autoware_core
common - autoware_lanelet2_utils/test/lanelet_sequence.cpp:53-55 (test)

planning - autoware_route_handler/route_handler.cpp:2159

autoware_universe
Planning -> behavior_path_planner

Perception

autoware_lanelet2_extension

lanelet::ConstLineString3d - doesn't exist

lanelet::BasicLineString3d

autoware_universe
Planning

Parent Issue:

  • Link

How was this PR tested?

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

Signed-off-by: Sarun Mukdapitak <[email protected]>
Copy link

github-actions bot commented Oct 9, 2025

Thank you for contributing to the Autoware project!

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

Please ensure:

@sarun-hub sarun-hub self-assigned this Oct 10, 2025
@sarun-hub sarun-hub added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Oct 10, 2025
Copy link

codecov bot commented Oct 10, 2025

Codecov Report

❌ Patch coverage is 95.34884% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.38%. Comparing base (8e90daa) to head (b19c074).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
common/autoware_lanelet2_utils/src/conversion.cpp 95.34% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #669      +/-   ##
==========================================
+ Coverage   51.06%   54.38%   +3.31%     
==========================================
  Files         325      327       +2     
  Lines       21444    25101    +3657     
  Branches     9316    11794    +2478     
==========================================
+ Hits        10950    13650    +2700     
- Misses       9540    10305     +765     
- Partials      954     1146     +192     
Flag Coverage Δ *Carryforward flag
differential 49.80% <95.34%> (?)
total 51.06% <ø> (ø) Carriedforward from 91ed41c

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

Signed-off-by: Sarun Mukdapitak <[email protected]>
* @return ConstLanelet
*/

std::optional<lanelet::ConstLanelet> create_const_lanelet(
Copy link
Contributor

Choose a reason for hiding this comment

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

This overload is not necessary (Because we shoud avoid usage of non-const Point3d)

Copy link
Contributor Author

@sarun-hub sarun-hub Oct 15, 2025

Choose a reason for hiding this comment

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

Note:
Since both BasicPoint3d and ConstPoint3d need to be converted into LineString3d before converting into ConstLanelet, I decided to implement overload for Point3d (because there is only Point3d constructor for LineString3d).
When I remove this overload, the last part of remaining types will be duplicate.
If you have any suggestion on how to shortcut from BasicPoint3d to ConstLanelet, please let me know.

const std::vector<lanelet::Point3d> & left_points,
const std::vector<lanelet::Point3d> & right_points);

std::optional<lanelet::ConstLanelet> create_const_lanelet(
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you rename to

  • create_safe_linestring
  • create_safe_lanelet
    ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note:
I also remove 3d from the function name for create_basic_linestring3d -> create_basic_linestring.

@sarun-hub sarun-hub marked this pull request as ready for review October 15, 2025 03:34
@sarun-hub sarun-hub requested review from a team, kosuke55 and maxime-clem as code owners October 15, 2025 03:34
@sarun-hub sarun-hub added the run:deploy-docs Mark for deploy-docs action generation. (used-by-ci) label Oct 15, 2025
Copy link

@sasakisasaki sasakisasaki self-assigned this Oct 15, 2025
Copy link
Contributor

@sasakisasaki sasakisasaki left a comment

Choose a reason for hiding this comment

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

I have read all the changed parts. I agree with merging this PR 👍

@soblin soblin merged commit c14eba0 into autowarefoundation:main Oct 15, 2025
31 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) run:deploy-docs Mark for deploy-docs action generation. (used-by-ci)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants