Skip to content
Beta.xodr@modelscript/opendrive 8 diagnostic rules
Parser WASM GLR
Diagnostics 8 rules
DAE Arena Lowering
Simulation Co-sim / Export
Projections GENSYS
Live ExampleHighwayClothoidCurve.xodr

ASAM OpenDRIVE 1.7 Highway Alignment & Clothoid Spiral

Analytical road reference line combining a straight entry tangent, Euler clothoid transition spiral, and constant-radius circular arc.

Playground
Source (29 lines)
1<?xml version="1.0" encoding="UTF-8"?>
2<OpenDRIVE>
3  <header revMajor="1" revMinor="7" name="HighwayClothoidSegment" />
4  <road name="PrimaryExpressway" length="380.0" id="1" junction="-1">
5    <planView>
6      <geometry s="0.0" x="0.0" y="0.0" hdg="0.0" length="140.0">
7        <line />
8      </geometry>
9      <geometry s="140.0" x="140.0" y="0.0" hdg="0.0" length="100.0">
10        <spiral curvStart="0.0" curvEnd="0.004" />
11      </geometry>
12      <geometry s="240.0" x="239.5" y="6.6" hdg="0.2" length="140.0">
13        <arc curvature="0.004" />
14      </geometry>
15    </planView>
16    <lanes>
17      <laneSection s="0.0">
18        <right>
19          <lane id="-1" type="driving" level="false">
20            <width sOffset="0.0" a="3.75" b="0.0" c="0.0" d="0.0" />
21          </lane>
22          <lane id="-2" type="driving" level="false">
23            <width sOffset="0.0" a="3.75" b="0.0" c="0.0" d="0.0" />
24          </lane>
25        </right>
26      </laneSection>
27    </lanes>
28  </road>
29</OpenDRIVE>
OpenDRIVE Plan-View Road Geometry & Lanes
PrimaryExpressway (#1)
Drag to pan · Click % to reset

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 ​

ExtensionStandard / FormatDescription
.xodr, .xmlASAM OpenDRIVE v1.4–v1.7Description 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 s with smooth curvature transitions:
    • Euler Clothoids: Spiral transitions computed via numerical Fresnel integrals:x(s)=x0+∫0scos⁡(θ0+κ0τ+κ˙2τ2)dτ
    • Arcs & Polynomials: Straight lines, constant-curvature circular arcs, and cubic parameter polynomials.
  • Computes elevation profiles (z(s)), 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 (s,d,θe) within @modelscript/runtime's DAEBuilder arena:s˙=vcos⁡θe1−d⋅κ(s),d˙=vsin⁡θe,θ˙e=ψ˙−s˙κ(s)
  • 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 .geom and .trax geometry files for railway and guideway vehicle testing.

Static Analysis & Pre-Flight Linter Rules ​

8 rules6 error2 warning Run with msx opendrive lint

CodeRuleSeverityMessage
M7801road-tangency-discontinuityerrorTangency discontinuity between geometry segments in road '<roadId>' at s=<s>: position gap <value>m, heading gap <value>rad.
M7802unlinked-lane-boundaryerrorUnlinked lane connection: lane '<laneId>' in road '<roadId>' links to non-existent <dir> lane '<targetId>'.
M7803clothoid-curvature-divergenceerrorClothoid curvature rate of change in road '<roadId>' at s=<s> diverges (<value> 1/m^2).
M7804overlapping-junction-pathswarningConnecting path in junction '<junctionId>' between road '<road1>' and '<road2>' conflicts without priority control.
M7805elevation-gradient-extremewarningExtreme elevation gradient in road '<roadId>' at s=<s>: slope <value>% exceeds standard 15% safety threshold.
M7806negative-lane-widtherrorNegative or zero lane width in lane '<laneId>' of road '<roadId>' at sOffset=<sOffset>m.
M7807duplicate-road-iderrorDuplicate road ID '<roadId>' detected in roadway network.
M7808missing-center-laneerrorLane 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

Open-Core under the GNU AGPL v3 License; Enterprise Edition (ee/) under the ModelScript Enterprise License. • Trademark Policy