OpenDRIVE Road Networks (.xodr)
@modelscript/opendrive (languages/opendrive) provides compiler, analytical 3D clothoid sampling, path-following DAE lowering, and vehicle dynamics integration for the ASAM OpenDRIVE standard.
Supported Extensions & Standards
| Extension | Standard / Format | Description |
|---|---|---|
.xodr, .xml | ASAM OpenDRIVE v1.4–v1.7 | Description of road networks, lanes, junctions, and spatial road geometry |
Key Capabilities
1. Analytical 3D Fresnel Clothoid Sampling
- Evaluates road reference lines parameterized by arc length
with smooth curvature transitions: - Euler Clothoids: Spiral transitions computed via numerical Fresnel integrals:
- Arcs & Polynomials: Straight lines, constant-curvature circular arcs, and cubic parameter polynomials.
- Euler Clothoids: Spiral transitions computed via numerical Fresnel integrals:
- Computes elevation profiles (
), crossfall/camber angles, and superelevation banking.
2. Multi-Lane Topology & Junction Network
- Analyzes lane sections (
<laneSection>), driving lanes, sidewalks, and shoulders. - Reconstructs predecessor/successor road connections, junction path conflicts, and lane boundary polylines.
3. Path-Following Vehicle DAE Lowering
- Compiles OpenDRIVE tracks directly into curvilinear Frenet-Serret coordinates (
) within @modelscript/runtime'sDAEBuilderarena: - Enables high-speed closed-loop vehicle chassis simulation with @modelscript/simpack and @modelscript/adams.
4. GENSYS Track Export
- Projections (
opendrive-to-gensys.ts) convert OpenDRIVE centerlines and gauge profiles into GENSYS.geomand.traxgeometry files for railway and guideway vehicle testing.
Static Analysis & Pre-Flight Linter Rules
8 rules6 error2 warning Run with msx opendrive lint
| Code | Rule | Severity | Message |
|---|---|---|---|
M7801 | road-tangency-discontinuity | error | Tangency discontinuity between geometry segments in road '<roadId>' at s=<s>: position gap <value>m, heading gap <value>rad. |
M7802 | unlinked-lane-boundary | error | Unlinked lane connection: lane '<laneId>' in road '<roadId>' links to non-existent <dir> lane '<targetId>'. |
M7803 | clothoid-curvature-divergence | error | Clothoid curvature rate of change in road '<roadId>' at s=<s> diverges (<value> 1/m^2). |
M7804 | overlapping-junction-paths | warning | Connecting path in junction '<junctionId>' between road '<road1>' and '<road2>' conflicts without priority control. |
M7805 | elevation-gradient-extreme | warning | Extreme elevation gradient in road '<roadId>' at s=<s>: slope <value>% exceeds standard 15% safety threshold. |
M7806 | negative-lane-width | error | Negative or zero lane width in lane '<laneId>' of road '<roadId>' at sOffset=<sOffset>m. |
M7807 | duplicate-road-id | error | Duplicate road ID '<roadId>' detected in roadway network. |
M7808 | missing-center-lane | error | Lane section in road '<roadId>' at s=<s> is missing mandatory center lane (ID 0). |
Generated from languages/opendrive/src/lints/rules.ts. All languages →
CLI Usage
bash
# Lint an OpenDRIVE road network
msx opendrive lint HighwayInterchange.xodr
# Sample 3D road centerline and lane boundaries at 0.5m resolution
msx opendrive track HighwayInterchange.xodr --step 0.5 -o track_points.json
# Lower road geometry to DAE path-following arena
msx opendrive to-dae HighwayInterchange.xodr --out=road.dae.json
# Project into GENSYS track geometry format
msx opendrive to-gensys HighwayInterchange.xodr -o TrackGeometry.geom
