주요 콘텐츠

openScenarioXMLExportOptions

R2026b

Specify options for customizing RoadRunner files exported to ASAM OpenSCENARIO XML format

Renamed from openScenarioExportOptions in R2025a

    Description

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

    Creation

    Description

    options = openScenarioXMLExportOptions creates a default ASAM OpenSCENARIO XML export options configuration object.

    options = openScenarioXMLExportOptions(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 XML file version to export, specified as either 1.0 or 1.1.

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

    Data Types: double

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

    Export location of the ASAM OpenDRIVE file that accompanies the exported ASAM OpenSCENARIO XML 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 openDriveXMLExportOptions object.

    Example: options = openScenarioXMLExportOptions(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.

    • "EmptyPrivate" — Use an empty private 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.

    Option to reference a catalog, specified as a catalogOptions object. This option specifies for RoadRunner Scenario to reference a catalog when exporting your scenario to an ASAM OpenSCENARIO XML format.

    Option to relocate the origin of each vehicle from the geometric center of the vehicle to the midpoint of the rear axle of the vehicle, specified as a logical 1 (true) or 0 (false). By default, RoadRunner Scenario exports the vehicle origin to the geometric center of the vehicle. If you specify this option as true, RoadRunner Scenario relocates the vehicle origin to the midpoint of the rear axle of the vehicle for export.

    Option to export floating point values with double precision, specified as a logical 1 (true) or 0 (false). If you specify this option as true, RoadRunner Scenario exports the floating point attribute values of actors and elements with double precision. If you specify this property as false, RoadRunner Scenario rounds floating point values up at six digits after the decimal point.

    Options for exporting mesh files for the actors in a scenario, specified as an actorMeshSettings object. This option specifies to export the actor meshes to one of various formats, which improves interoperability with external simulators.

    Option to replace the runningState element in the exported .xosc file, specified as a logical 1 (true) or 0 (false). By default, RoadRunner Scenario exports a startTransition element under the StoryboardElementStateCondition element. To export a runningState element under StoryboardElementStateCondition, specify this option as true.

    Option to export an EnvironmentAction element in the exported .xosc file, specified as a logical 1 (true) or 0 (false). By default, RoadRunner Scenario does not export an EnvironmentAction element. To export an EnvironmentAction element under the Storyboard element, specify this option as true.

    Option to export the traffic signals of the scenario in the .xosc file, specified as a logical 1 (true) or 0 (false). By default, RoadRunner Scenario does not export traffic signals in the .xosc file. To export traffic signals, specify this option as true.

    Position type used for exporting scenario entities, specified as one of these options:

    • "Unspecified" — No position type specified.

    • "LanePosition" — Export the position of the entity using lane‑based coordinates. The exported .xosc file defines the position by the road ID, lane ID, and the longitudinal s‑coordinate along the reference line of the road.

    • "WorldPosition" — Export the position of the entity in global coordinates. The exported .xosc file defines the position in the world coordinate system.

    • "RoadPosition" — Export the position of the entity using road‑based coordinates. The exported .xosc file defines the position relative to the coordinate system of the road.

    Examples

    collapse all

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

    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 XML export options by specifying the properties of an openScenarioXMLExportOptions object. Then, export your scenario using the exportScenario function, specifying the openScenarioXMLExportOptions object as input.

    For more information on exporting your scenario with MATLAB®, see exportScenario.

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

    Version History

    Introduced in R2022a

    expand all