Skip to content

Add Lanelet2 Map Conversion - #572

Draft
lee-scieninc wants to merge 2 commits into
Emerge-Lab:3.0from
scien-inc:lanelet2-bin-viz
Draft

Add Lanelet2 Map Conversion#572
lee-scieninc wants to merge 2 commits into
Emerge-Lab:3.0from
scien-inc:lanelet2-bin-viz

Conversation

@lee-scieninc

Copy link
Copy Markdown

Hello, I'm Joonho Lee, an engineer at SCIEN, a TIER IV partner company.
Thank you for reviewing this contribution.

What

  • Add an optional Lanelet2 OSM to PufferDrive 3.0 binary converter.
  • Add binary validation and a PNG map preview command.
  • Add a small straight-road fixture and focused tests.

Why

Lanelet2 maps need projection, topology conversion, and binary validation before
they can be loaded by PufferDrive. This adds a reproducible command-line path for
that workflow.

Notes

  • The converter detects the local UTM projection and metre origin.
  • Lanelet2 road and highway relations become drivable lanes.
  • Shared boundary endpoints create directed lane links.
  • Crop coordinates use metres from the detected local origin.
  • Emitted road IDs are validated against their binary indices.
  • The source Lanelet2 map is not included because it may contain
    security-sensitive or copyrighted data.

Testing

  • python -m pytest -q tests/unit_tests/test_lanelet2_tools.py — 19 passed
  • python -m compileall -q data_utils/lanelet2_*.py data_utils/visualize_map_bin.py — passed
  • Standard and cropped conversion, validation, and PNG rendering — passed
  • PufferDrive Drive load, reset, and one step — passed with finite rewards

Usage

python -m pip install -e ".[lanelet2]"

python data_utils/lanelet2_to_bin.py INPUT.osm OUTPUT.bin \
  --validation-report validation.json

python data_utils/visualize_map_bin.py OUTPUT.bin \
  --png preview.png

Optional crop:

python data_utils/lanelet2_to_bin.py INPUT.osm OUTPUT.bin \
  --crop XMIN YMIN XMAX YMAX

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant