Skip to content

feat: add autoware_lanelet2_map_divider package#409

Open
mitsudome-r wants to merge 13 commits into
autowarefoundation:mainfrom
mitsudome-r:feat/add-autoware-lanelet2-map-divider
Open

feat: add autoware_lanelet2_map_divider package#409
mitsudome-r wants to merge 13 commits into
autowarefoundation:mainfrom
mitsudome-r:feat/add-autoware-lanelet2-map-divider

Conversation

@mitsudome-r

@mitsudome-r mitsudome-r commented Apr 22, 2026

Copy link
Copy Markdown
Member

Description

This is part of autowarefoundation/autoware_core#887

Add a new autoware_lanelet2_map_divider package that splits a single Lanelet2 (.osm) map into grid-aligned segments and emits a metadata file compatible with lanelet2_map_loader's selected-map-loading mode.

  • New ROS 2 node autoware_lanelet2_map_divider_node with a launch file
  • Loads the input map using the projector from map_projector_info.yaml (MGRS, LocalCartesianUTM, LocalCartesian, TransverseMercator, and Local supported), computes the axis-aligned bounding box of all points, and queries laneletLayer, areaLayer, lineStringLayer, and pointLayer per cell to build per-cell LaneletMaps.
  • Writes one <prefix>_<gx>_<gy>.osm file per non-empty cell under <OUTPUT_DIR>/lanelet2_map.osm/ with the same projector used at load time, plus lanelet2_map_metadata.yaml (x_resolution, y_resolution, and file: [min_x, min_y] entries).
  • Includes README and a gtest suite (test_lanelet2_map_divider).

How was this PR tested?

  • Built the package with colcon build --packages-select autoware_lanelet2_map_divider.
  • Ran the included gtest suite (test_lanelet2_map_divider) via colcon test.
  • Verified end-to-end by running the divider on a sample lanelet2_map.osm, inspecting the generated lanelet2_map.osm/<gx>_<gy>.osm files and lanelet2_map_metadata.yaml, and confirming lanelet2_map_loader can consume the output in selected-map-loading mode.

Notes for reviewers

None.

Effects on system behavior

None.

@github-actions

github-actions Bot commented Apr 22, 2026

Copy link
Copy Markdown

Thank you for contributing to the Autoware project!

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

Please ensure:

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a new autoware_lanelet2_map_divider ROS 2 package to split a single Lanelet2 .osm into grid-aligned per-cell map files and emit lanelet2_map_metadata.yaml compatible with lanelet2_map_loader’s selected-map-loading mode.

Changes:

  • Introduces Lanelet2MapDivider library and Lanelet2MapDividerNode component/executable for dividing and exporting per-cell .osm tiles + metadata.
  • Adds launch/config/schema + README documenting usage and output format.
  • Adds a gtest suite that builds a synthetic map, runs the divider, and validates output tiles/metadata.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
map/autoware_lanelet2_map_divider/src/lanelet2_map_divider.cpp Core map loading, grid partitioning, tile writing, and metadata generation
map/autoware_lanelet2_map_divider/src/lanelet2_map_divider.hpp Public API for configuring/running the divider
map/autoware_lanelet2_map_divider/src/lanelet2_map_divider_node.cpp ROS 2 node wrapper to run divider from parameters
map/autoware_lanelet2_map_divider/src/lanelet2_map_divider_node.hpp Node declaration
map/autoware_lanelet2_map_divider/src/local_projector.hpp Local projector helper for projector_type: Local
map/autoware_lanelet2_map_divider/test/test_lanelet2_map_divider.cpp gtest coverage for tiling + metadata behaviors
map/autoware_lanelet2_map_divider/launch/lanelet2_map_divider.launch.xml Launch entrypoint with args and parameter wiring
map/autoware_lanelet2_map_divider/config/lanelet2_map_divider.param.yaml Default parameter file used by launch
map/autoware_lanelet2_map_divider/schema/lanelet2_map_divider.schema.json Parameter schema for documentation/validation
map/autoware_lanelet2_map_divider/README.md User-facing documentation and format description
map/autoware_lanelet2_map_divider/CMakeLists.txt Build/test targets and component registration
map/autoware_lanelet2_map_divider/package.xml Package dependencies and metadata

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread map/autoware_lanelet2_map_divider/src/lanelet2_map_divider.cpp Outdated
Comment thread map/autoware_lanelet2_map_divider/src/lanelet2_map_divider.cpp
Comment thread map/autoware_lanelet2_map_divider/src/lanelet2_map_divider.cpp
Comment thread map/autoware_lanelet2_map_divider/schema/lanelet2_map_divider.schema.json Outdated
Comment thread map/autoware_lanelet2_map_divider/launch/lanelet2_map_divider.launch.xml Outdated
Comment thread map/autoware_lanelet2_map_divider/schema/lanelet2_map_divider.schema.json Outdated
@mitsudome-r mitsudome-r marked this pull request as draft April 24, 2026 04:13
@mitsudome-r mitsudome-r marked this pull request as ready for review April 28, 2026 02:41
mitsudome-r and others added 11 commits April 28, 2026 11:42
Signed-off-by: Ryohsuke Mitsudome <ryohsuke.mitsudome@tier4.jp>
Signed-off-by: Ryohsuke Mitsudome <ryohsuke.mitsudome@tier4.jp>
Signed-off-by: Ryohsuke Mitsudome <ryohsuke.mitsudome@tier4.jp>
Signed-off-by: Ryohsuke Mitsudome <ryohsuke.mitsudome@tier4.jp>
Signed-off-by: Ryohsuke Mitsudome <ryohsuke.mitsudome@tier4.jp>
Signed-off-by: Ryohsuke Mitsudome <ryohsuke.mitsudome@tier4.jp>
Signed-off-by: Ryohsuke Mitsudome <ryohsuke.mitsudome@tier4.jp>
Signed-off-by: Ryohsuke Mitsudome <ryohsuke.mitsudome@tier4.jp>
Signed-off-by: Ryohsuke Mitsudome <ryohsuke.mitsudome@tier4.jp>
@mitsudome-r mitsudome-r force-pushed the feat/add-autoware-lanelet2-map-divider branch from 6196556 to 8e2fca5 Compare April 28, 2026 02:42
mitsudome-r and others added 2 commits April 28, 2026 11:44
Signed-off-by: Ryohsuke Mitsudome <ryohsuke.mitsudome@tier4.jp>
@codecov

codecov Bot commented Apr 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 59.85915% with 57 lines in your changes missing coverage. Please review.
✅ Project coverage is 7.26%. Comparing base (700c544) to head (35240f7).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
..._lanelet2_map_divider/src/lanelet2_map_divider.cpp 63.71% 8 Missing and 33 partials ⚠️
...let2_map_divider/src/lanelet2_map_divider_node.cpp 6.25% 2 Missing and 13 partials ⚠️
...oware_lanelet2_map_divider/src/local_projector.hpp 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main    #409      +/-   ##
========================================
+ Coverage   7.02%   7.26%   +0.23%     
========================================
  Files        497     501       +4     
  Lines      32735   32863     +128     
  Branches    3736    3819      +83     
========================================
+ Hits        2301    2386      +85     
- Misses     29079   29083       +4     
- Partials    1355    1394      +39     
Flag Coverage Δ *Carryforward flag
differential-humble 38.02% <38.02%> (?)
differential-jazzy 35.91% <35.91%> (?)
total 3.33% <ø> (+<0.01%) ⬆️ Carriedforward from 700c544
total-humble 4.93% <ø> (+<0.01%) ⬆️ Carriedforward from 700c544
total-jazzy 4.77% <ø> (+<0.01%) ⬆️ Carriedforward from 700c544

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants