Main Content

openScenarioExportOptions

Specify options for customizing RoadRunner files exported to ASAM OpenSCENARIO 1.x format

Since R2022a

    Description

    The openScenarioExportOptions object enables you to specify options for customizing RoadRunner scene and scenario files exported to the ASAM OpenSCENARIO® 1.x format.

    Creation

    Description

    options = openScenarioExportOptions creates a default ASAM OpenSCENARIO 1.x export options configuration object.

    options = openScenarioExportOptions(Name=Value) specifies properties using one or more name-value arguments. For example, MoveNonInstantaneousInitActions=false specifies not to move any non-instantaneous InitActions to stories upon export.

    Properties

    expand all

    ASAM OpenSCENARIO file version to export, specified as either 1.0 or 1.1.

    Example: options = openScenarioExportOptions(OpenScenarioVersion=1.1); exports the file to the ASAM OpenSCENARIO 1.1 format.

    Data Types: double

    Scene graph file export and customization options, specified as a sceneGraphExportOptions (RoadRunner Scenario) object. These options specify whether to export an OpenSceneGraph file with the ASAM OpenSCENARIO file, and options for its export.

    Export location of the ASAM OpenDRIVE file that accompanies the exported ASAM OpenSCENARIO file, specified as an absolute or relative file path. You must specify a path that ends in the .xodr file extension. If you specify a relative path, then RoadRunner saves the exported ASAM OpenDRIVE file relative to the ASAM OpenSCENARIO file path.

    If the specified filename already exists at the specified location, then RoadRunner overwrites the data in the existing file.

    Export options for the ASAM OpenDRIVE file, specified as an openDriveExportOptions object.

    Example: options = openScenarioExportOptions(OpenDriveOptions=openDriveExportOptions(ExportObjects=true)); specifies for RoadRunner to also export all scene props as <object> entries when exporting an ASAM OpenDRIVE file.

    Option to move non-instantaneous InitActions to stories upon export, specified as a logical 1 (true) or 0 (false).

    No-ops (no operations) action type, specified as one of these options:

    • "Unspecified" — No no-ops action specified.

    • "UserDefined" — Use a user-defined action as a placeholder.

    • "Empty" — Use an empty action as a placeholder.

    No-ops actions do not have specific behaviors, but they impact scenario logic, serving as substitutes for actions specific to RoadRunner and absent from ASAM OpenSCENARIO. Select the placeholder type used to reflect these actions in the exported data.

    Examples

    collapse all

    When you export your RoadRunner scenario, you can specify options for the exported ASAM OpenSCENARIO file by using the openScenarioExportOptions.

    Create a roadrunner object, specifying the path to an existing project. For example, this code shows the path to a project, on a Windows® machine, located at "C:\RR\MyProject". This code assumes that RoadRunner is installed in the default location, and returns an object, rrApp, that provides functions for performing basic tasks such as opening, closing, and saving scenes and projects.

    rrApp = roadrunner(ProjectFolder="C:\RR\MyProject");

    Open an existing scenario in RoadRunner Scenario by using the openScenario function with the roadrunner object rrApp and the filename of the specific scenario that you want to open.

    filename = "TrajectoryCutIn.rrscenario";
    openScenario(rrApp,filename)

    Set your ASAM OpenSCENARIO export options by specifying the properties of an openScenarioExportOptions object. Then, export your scenario using the exportScenario function, specifying the openScenarioExportOptions object as input.

    For more information on exporting your scenario with MATLAB®, see exportScenario (RoadRunner Scenario).

    filename = "TrajectoryCutIn.rrscenario.xosc";
    formatname = "OpenSCENARIO";
    options = openScenarioExportOptions(OpenScenarioVersion=1.0,MoveNonInstantaneousInitActions=false);
    exportScenario(rrApp,filename,formatname,options)

    Version History

    Introduced in R2022a

    expand all