Main Content

Convert Asset Data Between RoadRunner and ASAM OpenDRIVE

RoadRunner enables you to import scenes from and export scenes to the ASAM OpenDRIVE® (.xodr) file format.

RoadRunner assets are represented in ASAM OpenDRIVE using parent elements, such as Objects, Signals, and Markings, and child elements, such as Type, SubType, FilePath, in an XML configuration file. During the export process, RoadRunner uses this configuration file to map the existing assets in the scene to the appropriate parent element and child element for ASAM OpenDRIVE representation. During the import process, RoadRunner resolves the mapping between ASAM OpenDRIVE and the existing RoadRunner assets in the current project. RoadRunner then uses this mapping to place the assets in the scene.

To specify assets when importing, and to specify Type or Subtype when exporting scenes to the ASAM OpenDRIVE file format, you can modify the asset mapping file manually or interactively. For more information on how to customize assets interactively, see Configure Asset Mapping File Interactively.

Configure Asset Mapping File Manually

Open Asset Configuration File

The asset configuration file is an XML file named OpenDriveAssetData.xml. Each RoadRunner project has its own OpenDriveAssetData.xml configuration file, which is shared by all the scenes in the project. This file is located in the Project folder of the RoadRunner project.

Open the OpenDriveAssetData.xml file from this location, where ProjectFolder is the path to the folder of the RoadRunner project. For more details on the project folder layout, see RoadRunner Project and Scene System.

ProjectFolder/Project/OpenDriveAssetData.xml

Explore File Structure

The OpenDriveAssetData.xml file has a top-level element, OpenDriveAssetData, containing Objects, Signals, and Markings elements that specify props, signals, and lane markings, respectively.

This XML code shows a template of the OpenDriveAssetData.xml file, and lists the significance of the element tags. The Type and FilePath are required fields for Objects, Signals, and Markings tags, whereas others are optional fields that may only be required during import. For more details about these elements, see ASAM OpenDRIVE Representations.

<?xml version="1.0"?>
<OpenDriveAssetData>
    <Objects>
        ...
        <Object>   
            <Type> OpenDRIVE "type" </Type>
            <Id> OpenDRIVE object "id" </Id>
            <Name> OpenDRIVE object "name" </Name>
            <Radius> OpenDRIVE object "radius" </Radius>
            <Height> OpenDRIVE object "height" </Height >
            <FilePath> Relative file path to RoadRunner asset </FilePath>
        </Object>
        ...
    </Objects>
    <Markings>
        ...
        <RoadMark>
            <Type> OpenDRIVE "type" </Type>
            <Color> OpenDRIVE "color" </Color>
            <FilePath> Relative file path to RoadRunner asset </FilePath>
        </RoadMark>
        ...
    </Markings>
    <Signals>
        ...
        <Signal>
            <Type> OpenDRIVE "type" </Type>
            <SubType> OpenDRIVE "subtype" </SubType>
            <Id> OpenDRIVE signal "id" </Id>
            <Name> OpenDRIVE signal "name" </Name>
            <Country> OpenDRIVE signal "country" </Country>
            <Value> OpenDRIVE signal "value" </Value>
            <FilePath> Relative file path to RoadRunner asset </FilePath>
            <Variant> Variant of RoadRunner signal/sign asset (integer, where 0 is the first variant, 1 is the second, etc.) </Variant>
        </Signal>
    ...
    </Signals>
</OpenDriveAssetData>

Configure Assets for Export

Use this process to configure assets for export:

  1. Open the OpenDriveAssetData.xml file in a text editor. When you create a new project, the associated OpenDriveAssetData.xml file contains template code that you can modify.

  2. Add corresponding Object, Signal, or Marking entries in the configuration file for unmapped props, signs, signals, or markings, and for additional assets that you have added to your scene in the RoadRunner canvas.

    For example, after adding a Drum01 (prop), ContinentalCrosswalk (marking), and Sign_CrossRoadAhead (signal) to a scene, the OpenDriveAssetData.xml configuration file has this structure:

    <?xml version="1.0"?>
    <OpenDriveAssetData>
        <Objects>
            ...
            <Object>   
                <Type>obstacle</Type>
                <FilePath>Props/TrafficControl/Drum01.fbx_rrx</FilePath>
            </Object>
            ...
        </Objects>
        <Markings>
            ...
            <RoadMark>
                <Type>broken</Type>
                <FilePath>Markings/DashedSingleWhite.rrlms</FilePath>
            </RoadMark>
            ...
        </Markings>
        <Signals>
            ...
            <Signal>
                <Type>Sign_CrossRoadAhead</Type> 
                <FilePath>Signs/Sign_CrossRoadAhead.svg_rrx</FilePath>
            </Signal>
        ...
        </Signals>
    </OpenDriveAssetData>

    Use obstacle as the Type for the Drum01 asset. To determine the standard Type values for other assets, refer to ASAM OpenDRIVE 1.4 (or 1.5) Object Type specifications.

    To determine the FilePath value for Drum01, navigate to the Library Browser in RoadRunner. Under the Props folder, select the TrafficControl folder and click Drum01. In the Attributes pane, the text Drum01.fbx_rrx next to the Prop Model label is the file name for the prop Drum01.The relative file path is constructed by navigating through the folders Props and TrafficControl to locate the file Drum01.fbx_rrx. Hence, the value for the FilePath tag for Drum01 is /Props/TrafficControl/Drum01.fbx_rrx.RoadRunner editor showing the folder hierarchy to determine the file path for an asset

  3. Save your project and export it to an ASAM OpenDRIVE file. You do not need to restart RoadRunner after creating or modifying the OpenDriveAssetData.xml file.

    To verify that the object Drum01 has been exported correctly in the ASAM OpenDRIVE format, select the OpenDRIVE Export Preview Tool.

    A sample scene in RoadRunner editor to verify a properly configured asset.

    The Object Type is obstacle, which implies that the RoadRunner asset has been mapped correctly to the ASAM OpenDRIVE representation.

    A sample scene in RoadRunner editor to verify an improperly configured asset.

    If a prop or a signal is missing in the OpenDriveAssetData.xml file, its Object Type is -1 in the OpenDRIVE Export Preview Tool. For example, if you add the prop Luminaire_Arm_12ft to the scene editing canvas, but not to the configuration file, the Object Type displays as -1 in the OpenDRIVE Export Preview Tool because it is not configured in the corresponding OpenDriveAssetData.xml file.

For information on how to configure <Objects>, <Markings>, and <Signals> interactively using the Asset Mapping dialog box, see Configure Asset Mapping File Interactively.

Configure Imported Assets

The ASAM OpenDRIVE import option in RoadRunner uses an OpenDriveAssetData.xml configuration file to convert ASAM OpenDRIVE data to the internal road format by mapping ASAM OpenDRIVE representations to RoadRunner assets. For more details about importing an ASAM OpenDRIVE file into RoadRunner, see Importing ASAM OpenDRIVE Files.

An object, roadMark, or signal defined in the imported ASAM OpenDRIVE file may not have a type value specified or may have an undefined type value of -1. In this case, you can use other attributes such as name, height, and radius to correlate ASAM OpenDRIVE representations to RoadRunner assets.

For example, this imported ASAM OpenDRIVE snippet shows that type=-1 for object id=21.

<?xml version="1.0" encoding="UTF-8"?>
<OpenDRIVE>
    ...
        <objects>
            <object id="21" type="-1" name="post" height="3.65" radius="0.05"/>
        </objects>
    ...
</OpenDRIVE>
Use the name attribute in the OpenDriveAssetData.xml configuration file to identify the object.
<Object>
        <Name>post</Name>
        <Height>3.65</Height>
        <FilePath>Props/Signals/Signal_Post_12ft.fbx</FilePath>
</Object>

Note

The OpenDriveAssetData.xml file is case-sensitive. The mappings are expected to be upper-case, for example, <Type>pole</Type>.

Note that this is different than the lower-case attributes in ASAM OpenDRIVE files, for example type="pole".

For information on how to configure <Objects>, <Markings>, and <Signals> interactively using the Asset Mapping dialog box, see Configure Asset Mapping File Interactively.

Configure Objects

Each <Object> element in <Objects> specifies the RoadRunner object type to use to render an imported ASAM OpenDRIVE object type. This table describes the configurable elements within an <Object> element.

<Object> ElementRequired or OptionalDescription
<Type>Required for export. Optional for import.

Object type, based on the valid types specified by the ASAM OpenDRIVE Map service.

<Id>Optional, used only for import.

Object ID, based on the valid IDs specified by the ASAM OpenDRIVE Map service.

<Name>Optional, used only for import.

Object name, based on the valid names specified by the ASAM OpenDRIVE Map service.

<ReferencePosition>Optional.

Object reference position, specified by the ASAM OpenDRIVE Map service.

<Radius>Optional, used only for import.

Object radius, in meters. RoadRunner matches each imported object to the asset of the specified <Type> that has the nearest specified <Radius>.

For example, suppose an imported object of type Utility has a radius of 0.13 meters, and the asset mapping file specifies three objects of type <Utility> with <Radius> values of 0.22, 0.26, and 0.27 meters. RoadRunner renders the object using the asset that has a radius of 0.22 meters.

<Height>Optional, used only for import.

Object height, in meters. RoadRunner matches each imported object to the asset of the specified <Type> that has the nearest specified <Height>.

<Ignore>Optional.

If true, RoadRunner ignores the object while exporting the scene. Otherwise, RoadRunner includes the object while exporting.

<FilePath>Required.Path to the asset file used to render the object. This path is relative to the Assets folder of the RoadRunner project.

For information on how to configure <Objects> interactively using the Asset Mapping dialog box, see Configure Asset Mapping File Interactively.

Configure Markings

Each <RoadMark> element in <Markings> specifies the asset to use to render an imported marking. This table describes the configurable elements within a <RoadMark> element.

<RoadMark> ElementRequired or OptionalDescription
<Type>Required for export. Optional for import.

Road marking type, based on the valid types specified by the ASAM OpenDRIVE Map service.

<Color>Optional.

Road marking color, based on the valid colors specified by the ASAM OpenDRIVE Map service.

<FilePath>Required.

Path to the asset file used to render the road marking. This path is relative to the Assets folder of the RoadRunner project.

For information on how to configure <Markings> interactively using the Asset Mapping dialog box, see Configure Asset Mapping File Interactively.

Configure Signals

Each <Signal> element in <Signals> specifies the asset to use to render an imported signal. This table describes the configurable elements within a <Signal> element.

<Signal> ElementRequired or OptionalDescription
<Type>Required for export. Optional for import.

Signal type, based on the valid types specified by the ASAM OpenDRIVE Map service.

<SubType>Optional.

Signal subtype, based on the valid subtypes specified by the ASAM OpenDRIVE Map service.

<Id>Optional, used only for import.

Signal ID, based on the valid IDs specified by the ASAM OpenDRIVE Map service.

<Name>Optional, used only for import.

Signal name, based on the valid names specified by the ASAM OpenDRIVE Map service.

<ReferencePosition>Optional.

Signal reference position, specified by the ASAM OpenDRIVE Map service.

<Country>Optional, used only for import.

Country name, based on the valid names specified by the ASAM OpenDRIVE Map service.

<Variant>Optional, used only for import.

Signal variant, based on the valid variants specified by the ASAM OpenDRIVE Map service.

<Value>Optional, used only for import.

Signal value, specified by the ASAM OpenDRIVE Map service.

<FilePath>Required.

Path to the asset file used to render the signal. This path is relative to the Assets folder of the RoadRunner project.

For information on how to configure <Signals> interactively using the Asset Mapping dialog box, see Configure Asset Mapping File Interactively.

Configure Asset Mapping File Interactively

In the Assets menu, select Asset Mapping to open the Asset Mapping dialog box. set Select Map type: to ASAM OpenDRIVE. This enables the Objects, Markings, and Signals tabs, which you can use to interactively map assets by updating the OpenDriveAssetData.xml configuration file. For more information on the configuration file, see Explore File Structure.

Asset mapping dialog box for ASAM OpenDRIVE maps

In each tab, you can click an entry to select it or double-click it to edit it.

Double-click an entry in the FilePath column to enable a ... button. Click the button to browse to and specify assets from the Assets folder.

To configure objects interactively, select the Objects tab and edit these table entries.

  • Type — Object type, based on the valid types specified by the ASAM OpenDRIVE Map service.

  • Id — Object ID, based on the valid IDs specified by the ASAM OpenDRIVE Map service.

  • Name — Object name, based on the valid names specified by the ASAM OpenDRIVE Map service.

  • ReferencePosition — Object reference position, specified by the ASAM OpenDRIVE Map service.

  • Radius — Object radius, specified by the ASAM OpenDRIVE Map service.

  • Height — Object height, specified by the ASAM OpenDRIVE Map service.

  • Ignore — If true, RoadRunner ignores the object while exporting the scene. Otherwise, RoadRunner includes the object while exporting.

  • FilePath — Path to the asset file used to render the object. This path is relative to the Assets folder of the RoadRunner project.

To configure road markings interactively, select the Markings tab and edit these table entries.

  • Type — Road marking type, based on the valid types specified by the ASAM OpenDRIVE Map service.

  • Color — Road marking color, based on the valid colors specified by the ASAM OpenDRIVE Map service.

  • FilePath — Path to the asset file used to render the road marking. This path is relative to the Assets folder of the RoadRunner project.

To configure signals interactively, select the Signals tab and edit these table entries.

  • Type — Signal type, based on the valid types specified by the ASAM OpenDRIVE Map service.

  • SubType — Signal subtype, based on the valid subtypes specified by the ASAM OpenDRIVE Map service.

  • Id — Signal ID, based on the valid IDs specified by the ASAM OpenDRIVE Map service.

  • Name — Signal name, based on the valid names specified by the ASAM OpenDRIVE Map service.

  • ReferencePosition — Signal reference position, specified by the ASAM OpenDRIVE Map service.

  • Country — Country name, based on the valid names specified by the ASAM OpenDRIVE Map service.

  • Variant — Signal variant, based on the valid variants specified by the ASAM OpenDRIVE Map service.

  • Value — Signal value, specified by the ASAM OpenDRIVE Map service.

  • FilePath — Path to the asset file used to render the signal. This path is relative to the Assets folder of the RoadRunner project.

When you select an entry in the table, the Asset Mapping dialog box displays a preview of that asset.

Note

Previews are not displayed for invalid file paths and these paths are represented red.

You can select multiple entries in the table by clicking the check box next to each entry you want to select. Selecting entries enables the Remove Selected Entries button. Click this button to remove the selected entries. You can also add new entries for mapping assets by clicking Add New Entry.

Save the customized asset mappings to the OpenDriveAssetData.xml configuration file by clicking Apply Changes.

You can discard the changes by clicking Cancel. Clicking Cancel returns a prompt confirming whether you want to apply the changes, discard the changes, or cancel the operation and return to asset mapping.

See Also

|

Related Topics

External Websites