# scenic.simulators.formats.opendrive.xodr_parser¶

Parser for OpenDRIVE (.xodr) files.

## Summary of Module Members¶

Functions

 buffer_union

Classes

 Clothoid An Euler spiral with curvature varying linearly between CURV0 and CURV1. Cubic A curve defined by the cubic polynomial a + bu + cu^2 + du^3. Curve Geometric elements which compose road reference lines. Junction Lane LaneSection Line A line segment between (x0, y0) and (x1, y1). ParamCubic A curve defined by the parametric equations u = a_u + b_up + c_up^2 + d_up^3, v = a_v + b_vp + c_vp^2 + d_up^3, with p in [0, p_range]. Poly3 Cubic polynomial. Road RoadLink Indicates Roads a and b, with ids id_a and id_b respectively, are connected. RoadMap

## Member Details¶

class Poly3(a, b, c, d)[source]

Bases: object

Cubic polynomial.

class Curve(x0, y0, hdg, length)[source]

Bases: object

Geometric elements which compose road reference lines. See the OpenDRIVE Format Specification for coordinate system details.

abstract to_points(num)[source]

Sample NUM evenly-spaced points from curve. Points are tuples of (x, y, s) with (x, y) absolute coordinates and s the arc length along the curve.

rel_to_abs(points)[source]

Convert from relative coordinates of curve to absolute coordinates. I.e. rotate counterclockwise by self.hdg and translate by (x0, x1).

class Cubic(x0, y0, hdg, length, a, b, c, d)[source]

A curve defined by the cubic polynomial a + bu + cu^2 + du^3. The curve starts at (X0, Y0) in direction HDG, with length LENGTH.

class ParamCubic(x0, y0, hdg, length, au, bu, cu, du, av, bv, cv, dv, p_range=1)[source]

A curve defined by the parametric equations u = a_u + b_up + c_up^2 + d_up^3, v = a_v + b_vp + c_vp^2 + d_up^3, with p in [0, p_range]. The curve starts at (X0, Y0) in direction HDG, with length LENGTH.

class Clothoid(x0, y0, hdg, length, curv0, curv1)[source]

An Euler spiral with curvature varying linearly between CURV0 and CURV1. The spiral starts at (X0, Y0) in direction HDG, with length LENGTH.

class Line(x0, y0, hdg, length)[source]

A line segment between (x0, y0) and (x1, y1).

Bases: object

Indicates Roads a and b, with ids id_a and id_b respectively, are connected.