Main Content

Export Driving Scenario to ASAM OpenDRIVE File

ASAM OpenDRIVE® is an open file format that enables you to specify large and complex road networks. Using the Driving Scenario Designer app, you can export the roads, lanes, junctions, and actors in a driving scenario to an ASAM OpenDRIVE file. There may be variations between the original scenario and the exported scenario. For details, see Limitations.

The app supports exporting driving scenarios to OpenDRIVE® file versions V1.4, V1.5, and ASAM OpenDRIVE file version V1.6.

To programmatically export the roads, lanes, junctions, and actors in a drivingScenario object to an OpenDRIVE file, use the export object function of the drivingScenario object.

Load Scenario File

To open the Driving Scenario Designer app, enter this command at the MATLAB® command prompt:

drivingScenarioDesigner

To load a scenario file, on the app toolstrip, click Open > Scenario File. The file you select must be a valid driving scenario session file with the .mat file extension.

From your MATLAB root folder, navigate to and open this file:

matlabroot/examples/driving/data/LeftTurnScenario.mat

The Scenario Canvas tab displays the scenario.

Actual scenario

Note

You can also create a scenario by using the Driving Scenario Designer app, and then export the scenario to an ASAM OpenDRIVE file. For information about how to create a scenario, see Create Driving Scenario Interactively and Generate Synthetic Sensor Data.

Export to ASAM OpenDRIVE

To export the roads, lanes, junctions, and actors in the scenario to an ASAM OpenDRIVE file, on the app toolstrip, click Export > ASAM OpenDRIVE File.

Export menu for OpenDRIVE in DSD app

The app opens the OpenDRIVE Export dialog box . Specify file information using these options:

  • File Path — Specify a name for the output ASAM OpenDRIVE file with either the .xodr or .xml file extension. By default, the app saves the file in the current working directory. To specify a different file location, click Browse. If a file with the specified name already exists, the app overwrites the existing file.

  • File Version — Specify the file format version for the output file as Version 1.4, Version 1.5, or Version 1.6.

  • Export Actors — Select this parameter to export actors to ASAM OpenDRIVE file.

Once you have specified the file information, click Export.

Export scenario window for saving the file

Inspect Exported Scenario

To inspect the exported scenario using the Driving Scenario Designer app, on the app toolstrip, select Import > ASAM OpenDRIVE File. Select the exported ASAM OpenDRIVE file and click Open. The app does not support importing actors specified in ASAM OpenDRIVE file. See Import ASAM OpenDRIVE Roads into Driving Scenario for more details.

Actual ScenarioExported Scenario

Actual scenario

Exported ODR scenario

Notice that the exported road network shows minor variations at the road junction. For more information about the variations, see Limitations.

Limitations

Roads

  • The cubic polynomial and the parametric cubic polynomial geometry types in the scenario are exported as spiral geometry types. This causes some variations in the exported road geometry if the road is a curved road. For example, in the figure below, notice that the sharp corners in the input road became relatively smooth when exported to the ASAM OpenDRIVE format.

    Input RoadExported ASAM OpenDRIVE Road

    Original road

    Exported road

  • When segments of adjacent roads overlap with each other, the app does not export the overlapping segments of the roads.

    Input RoadsExported ASAM OpenDRIVE Roads

    Input overlapping roads

    Exported roads

Lanes

  • When a road with multiple lane specifications has any segment containing only one lane, the app does not export multiple lane specifications. Instead the specifications of the first road segment are applied to the entire road while exporting.

    Input RoadExported ASAM OpenDRIVE Road

    The first segment of the original road has only one lane.

    Original road with lane add

    The entire exported road has the same specification as the first segment of the input road.

    Exported road without lane add

  • When a road with multiple lane specifications contains a taper between two road segments, the app exports the road without taper.

    Input RoadExported ASAM OpenDRIVE Road

    Original road with taper

    Exported road without taper

  • When a road consisting of multiple segments is connected to a junction, the app does not export the road.

Junctions

  • The junctions of the road network are processed without lane connection information, so the junction shapes may not be accurate in the exported scenario.

    Input RoadExported ASAM OpenDRIVE Road

    Original junction

    Exported junction

Actors

  • The app does not export any actor that is present either on a junction or on a road with multiple road segments.

  • While exporting a user-defined actor, the app sets the type of object to 'none'.

ASAM OpenDRIVE Import

  • When you export a driving scenario object that contains an imported ASAM OpenDRIVE scenario, the limitations of ASAM OpenDRIVE import apply to ASAM OpenDRIVE export. For information on the limitations of ASAM OpenDRIVE import, see Import ASAM OpenDRIVE Roads into Driving Scenario.

See Also

Apps

Objects

Functions

Related Topics

External Websites