RoadRunner can export scenes to the OpenDRIVE® (.xodr) file format.
RoadRunner can export scenes to the OpenDRIVE® 1.4 format. The OpenDRIVE export option exports an OpenDRIVE (.xodr) file containing the layout of the scene and an optional MathWorks GeoJSON file.
Export to OpenDRIVE
From the menu, select File > Export > OpenDRIVE (.xodr).
To preview the OpenDRIVE export and explore exported data interactively, use the OpenDRIVE Export Preview Tool
The OpenDRIVE export dialog box has several options to conform to various simulator needs.
|Database Version||A user-defined identifier for the exported scene. Useful for versioning exports of the same scene.|
|Database Name (optional)||A user-defined name for the exported scene.|
A hint to the exporter for the driving side of the scene. Travel direction is explicitly defined in RoadRunner using the Lane Travel Direction.
The travel direction in OpenDRIVE is implicit based on the country and side of the road.
|Export individual markings as <line>||Export additional lane marking data (spacing, dash length, and individual paint strip widths).|
|Export props||When this attribute is selected, props are exported as <object> entries. Refer to the Props section.|
When this attribute is selected, the RoadRunner scene clamps distances to be a multiple of 1 cm to prevent very short roads.
Note: This clamping is performed on the scene itself, so it can cause very small changes to the roads in the scene.
|Export Auxiliary Data||
Exports a MathWorks GeoJSON file along with the exported OpenDRIVE file. For more details, see Exporting to GeoJSON.
This section describes how various types of RoadRunner objects are represented in OpenDRIVE.
Roads, Lanes, and Junctions
Roads, lanes, and junctions are exported to OpenDRIVE using the standard <road>, <lane>, and <junction> entries.
For each road in a scene, RoadRunner creates one or more <road> entries. Whenever a road ends or a junction begins or ends, RoadRunner creates a unique <road> entry. OpenDRIVE <road> entries cannot extend through a junction, so the geometry is cut and exported as separate roads.
Note: The <shape>, <crossfall>, <surface>, and <railroad> entries are not used.
For each lane in a scene, RoadRunner creates one or more <lane> entries. The resulting <lane> entry is placed on one side or the other of the center lane, depending on its travel direction or the travel direction of neighboring lanes and the selected Driving Side during export. Whenever a lane starts or ends, RoadRunner creates a new <laneSection> entry.
Note: The "level" flag in <lane> entries is not used. The <height>, <material>, <visibility>, and <access> entries are also not used.
For each junction in a scene, RoadRunner creates a <junction> entry. RoadRunner exports some junctions as one <junction> entry due to overlapping maneuver roads or corners. A connecting <road> entry is exported for each maneuver road in each junction. Where possible, the exporter prefers the geometry and lane markings of nonmaneuver roads that extend through the junction. The resulting geometry of each connecting road might be the combination of multiple maneuver and nonmaneuver roads.
Note: The <priority> entry is not used.
Note: Prop polygons are not exported, but if you run the 'bake' operation to convert them to points, you can export them in point format.
With the exception of traffic signals and signs (see below), point props are exported as OpenDRIVE <object> instances. The exported prop includes sufficient information to identify the prop type and the oriented bounding box (OBB) of the prop model.
In OpenDRIVE, objects are stored on roads. The position and orientation of a given object depends on the geometry of the road it is assigned to. RoadRunner props are freely positioned in the world, so the export process must choose a road for each prop to export. In most cases, RoadRunner selects the road closest to the prop.
Note: In some cases, it is impossible to represent a prop's position in OpenDRIVE. In this image, the bush on the right is past the end of the road and there is no other road in the scene. In this case, the prop is not exported and a warning is displayed during export.
Exported props include the following attributes:
|name||Name of the prop asset (for example, "Signal_Post_30ft")|
|s/t||Inertial position of the prop point|
|hdg/roll/pitch||Inertial rotations of the prop point|
|zOffset||Relative height of the prop point|
|height/width/length||Dimensions of the prop model's bounding box|
|type||Object type, as defined by the configuration XML file for the point's asset (refer to OpenDRIVE User Asset Configuration)|
Crosswalks and Marking Polygons
Unlike that example, RoadRunner exports the polygon vertices as <cornerLocal> objects (rather than <cornerRoad> objects), which means that the vertices are defined relative to the pivot point specified in the attributes of the <object> parent.
This example code shows the representation of the crosswalk polygon in the previous image.
Crosswalks and Marking Polygon Attributes
Exported crosswalks and marking polygons include the following attributes.
|name||Name of the marking (for example, "ContinentalCrosswalk")|
|s/t||Inertial position of the pivot point|
|hdg/roll/pitch||Inertial rotations of the pivot point|
|zOffset||Relative height of the pivot point|
|height/width/length||Dimensions of an oriented bounding box fit to the polygon's vertices. The 'width' is treated as the dimension along the road, and the 'length' is treated as the dimension across the road.|
Object type, as defined by the configuration XML file for the marking's asset (refer to OpenDRIVE User Asset Configuration)
Traffic Signals and Signs
RoadRunner exports traffic signals and signs as OpenDRIVE <signal> objects.
For optimal behavior, traffic signals and signs for controlled intersections should be mapped to junction gates by using the Signal Tool. Traffic signals are exported only if they are mapped to junction gates. Signs are exported regardless if they are mapped to junction gates and are automatically mapped to the nearest road if not explicitly mapped.
If you need to add a traffic signal outside of a controlled intersection (for example, for a freeway onramp or pedestrian crossing), you can use the Custom Junction Tool to create a junction along a single road.
Signals and Signal References
When a signal or sign is mapped to a junction gate, it appears in the OpenDRIVE export as a <signal> instance and one or more <signalReference> instances, where:
- <signal> defines the physical location of the signal. Use <signal> to derive the 3D location of the signal, regardless of which roads or lanes are controlled by the signal. In most cases, the signal is mapped to the closest road (similar to the approach used for Props). This mapping might have no logical association to the signal (for example, the signal could be a nearby side street).
<signalReference> associates the signal to the roads and lanes that are controlled by the signal. Signal references indicate the semantic relationship between the signal and the road network (as opposed to <signal>, which is used purely for geometric positioning). Signal references are present for each maneuver road gate associated with the signal (through the Signal Tool).
Exported signals and signs include the following attributes:
Refer to Prop Attributes.
"hOffset" is treated the same as the <object> "hdg" attribute.
|type/subtype||Signal type and subtype, as defined by the configuration XML file for the signal's asset (refer to OpenDRIVE User Asset Configuration)|
|country||"OpenDRIVE" is always used.|
Specify "yes" for dynamic junction signalization and "no" for static signalization (for example, "All Go" or "All Stop")
|value||Unused (set to "-1" in all cases).|
|text||Unused (set to empty string in all cases).|
RoadRunner exports parking spaces as an <object> with type "parking" and an additional <parkingSpace> entry under the <object> following section 126.96.36.199.5 in the OpenDRIVE 1.4H specification. Markings on a parking space are exported as <marking> under the <parkingSpace> entry following section 188.8.131.52.6 in the OpenDRIVE 1.4H specification.
During export, parking spaces will be assigned to the <road> closest to the "entry point" of the parking space. The "entry point" of the parking space is drawn with blue arrows and corresponds to side="rear" for markings.
Exported parking spaces include the following attributes.
Refer to Prop Attributes.
|type||Always set to "parking".|
|side (attribute for <marking> entries under <parkingSpace>)||Side of the marking (left, right, front, or rear), where the rear is the entry point of the parking space.|
|type/width/color (attributes for <marking> entries under <parkingSpace>)||
Same properties as <roadMark> entries for <lane>.
OpenDRIVE User Asset Configuration
The OpenDRIVE exporter uses a configuration XML file to map RoadRunner props, signals, signs, and markings to the appropriate <object> or <signal> "id" and "subtype". This configuration file is also used to define the correlation during import.
Export a Custom Prop or Signal
- Copy the
OpenDriveAssetData.xmlfile located in the RoadRunner install location under
AssetsInstall/ResourceAssetsto the "Project" folder in your project (next to the "Project.rrproj" file).
- Open the new
OpenDriveAssetData.xmlfile in a text editor.
- Add entries for new objects, markings, or signals.
- Save your file and export an OpenDRIVE file.
You do not need to restart RoadRunner after creating or modifying the
Here is the definition of the format of the
Here is a list of features that are not exported from RoadRunner to OpenDRIVE.