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.
Why a shared model makes this possible
Section titled “Why a shared model makes this possible”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.
OpenDRIVE → Lanelet2
Section titled “OpenDRIVE → Lanelet2”- Import the
.xodrand select the roads you need. - Edit lanes, connections, and boundaries as needed.
- 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.
Lanelet2 → OpenDRIVE
Section titled “Lanelet2 → OpenDRIVE”- Import the
.osm. - Edit as needed.
- Open the File menu → Export → OpenDRIVE / OpenSCENARIO / esmini.
The result targets OpenDRIVE 1.8 and plays back in esmini.
What does and doesn’t carry across
Section titled “What does and doesn’t carry across”| Feature | Carries 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 draw | Re-fitted — sampled, not exact clothoid coefficients (fine for simulators) |
| 3D detail (elevation, banking, bridges) | ✗ — drawtonomy is a 2D canvas |