scenic.formats.opendrive.xodr_parser

Parser for OpenDRIVE (.xodr) files.

Summary of Module Members

Functions

buffer_union

warn

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

Signal

Traffic lights, stop signs, etc.

SignalReference

Exceptions

OpenDriveWarning

Member Details

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

Cubic polynomial.

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

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

to_points(num, extra_points=[])[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. Additional points at s values in extra_points are included if they are contained in the curve (unless they are extremely close to one of the equally-spaced points).

abstract point_at(s)[source]

Get an (x, y, s) point along the curve at the given s coordinate.

rel_to_abs(point)[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]

Bases: Curve

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]

Bases: Curve

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]

Bases: Curve

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]

Bases: Curve

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

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

class Signal(id_, country, type_, subtype, orientation, validity=None)[source]

Traffic lights, stop signs, etc.