Skip to content

Convert between OpenDRIVE and Lanelet2

drawtonomy imports both OpenDRIVE (.xodr) and Lanelet2 (.osm) into the same internal lane model, and can export either format. That makes the editor a practical bridge between the two: import one, edit it visually, and export the other — no install, no account, all in the browser.

Because both formats describe lane-level networks, the conversion is faithful for the parts that matter most in simulation and HD-map work: lane geometry, lane connectivity, junctions, and regulatory elements — traffic lights, traffic signs, stop lines, and right-of-way — all carry across in both directions.

Both formats describe lane-level road networks, but they store geometry differently — OpenDRIVE uses analytical primitives (arcs, spirals, polynomials), Lanelet2 uses polylines (linestrings). drawtonomy samples OpenDRIVE geometry into polylines on import, which is the representation Lanelet2 already uses natively. See What is OpenDRIVE? for a side-by-side of the two formats.

  1. Import the .xodr and select the roads you need.
  2. Edit lanes, connections, and boundaries as needed.
  3. Open the File menu → Export.osm (Lanelet2).

Lane boundaries become way linestrings and each lane becomes a relation type=lanelet, so the result loads into Autoware-aware tools or back into drawtonomy.

  1. Import the .osm.
  2. Edit as needed.
  3. Open the File menu → ExportOpenDRIVE / OpenSCENARIO / esmini.

The result targets OpenDRIVE 1.8 and plays back in esmini.

FeatureCarries across a conversion?
Lane geometry✓ (sampled to polylines)
Lane Next / Previous connectivity
Junctions / intersection areas✓ — connectivity and intersection geometry
Traffic lights✓ — mapped between Lanelet2 regulatory elements and OpenDRIVE <signal> + lane validity
Traffic signs (incl. speed limits)✓ — same regulatory mapping in both directions
Stop lines and right-of-way
Analytical curvature of roads you drawRe-fitted — sampled, not exact clothoid coefficients (fine for simulators)
3D detail (elevation, banking, bridges)✗ — drawtonomy is a 2D canvas