Hauptinhalt

exportCustomFormat

Export RoadRunner scene or scenario using custom export configuration

Since R2022a

    Description

    exportCustomFormat(rrApp,filename,formatname) exports a scene or scenario from the current RoadRunner project using an export configuration defined in the ExportConfigurations.xml file of the project. You can use this function with custom configurations that you define yourself, or with built-in configurations included with RoadRunner Scenario.

    • Custom configurations — Define your own export configuration in the ExportConfigurations.xml file and specify the corresponding format name. To create a custom configuration, follow these steps:

      1. Create an XML file that defines the configuration of the custom export format.

      2. Save the XML file to the Project folder of the RoadRunner project that you want to contain the export option, and name it ExportConfigurations.xml.

      For more details on creating an ExportConfigurations.xml file, see Export Custom Formats (RoadRunner).

    • Built-in configurations — If you have a RoadRunner Scenario license, the Project folder of each RoadRunner project already includes a default ExportConfigurations.xml file. This file includes built-in configurations for exporting scenarios to simulator-specific ASAM OpenSCENARIO® XML files. You can use these built-in format names directly, or add your own custom configurations to the same file.

      For more information on simulator-specific ASAM OpenSCENARIO XML file export, see Export Simulator‑Specific ASAM OpenSCENARIO XML Files (RoadRunner Scenario).

    example

    Examples

    collapse all

    Open a project in RoadRunner using the roadrunner function by specifying the location in which to create a project. This example assumes that RoadRunner is installed in its default location in Windows®.

    Specify the path to an existing project. For example, this code shows the path to a project located on C:\RR\MyProject. The function returns a roadrunner object, rrApp, that provides functions for performing basic workflow tasks such as opening, closing, and saving scenes and projects.

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

    Open an existing scene in RoadRunner.

    filename = "FourWaySignal.rrscene";
    openScene(rrApp,filename);

    Create an ExportConfigurations.xml file to configure custom export format. Then, use the exportCustomFormat function to export the currently open RoadRunner scene to the custom format specified in the ExportConfigurations.xml file.

    customfilename = "customExport.zip";
    formatname = "My Custom Format";
    exportCustomFormat(rrApp,customfilename,formatname);

    Export a RoadRunner scenario to a simulator-specific ASAM OpenSCENARIO® XML file format using a configuration defined in the ExportConfigurations.xml file of a RoadRunner project.

    Open a project in RoadRunner using the roadrunner function by specifying the location of an existing project. This example assumes that RoadRunner is installed in its default location in Windows®.

    Specify the path to an existing project. For example, this code shows the path to a project located on C:\RR\MyProject. The function returns a roadrunner object, rrApp, that provides functions for performing basic asks such as opening, closing, and saving scenes and projects.

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

    Open an existing scenario in RoadRunner.

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

    If you have a RoadRunner Scenario license, the Project folder of each RoadRunner project already includes a default ExportConfigurations.xml file with simulator-specific configurations. Use the exportCustomFormat function to export the currently open scenario using the CarMaker® configuration defined in the ExportConfigurations.xml file.

    customfilename = "CarMakerExport";
    formatname = "CarMaker";
    exportCustomFormat(rrApp,customfilename,formatname);

    Input Arguments

    collapse all

    RoadRunner application associated with a project, specified as a roadrunner object. This object provides functions for performing common workflow tasks such as opening, closing, and saving scenes and projects. rrApp provides functions that support importing data from files and exporting scenes to other formats from RoadRunner.

    File path for the exported content, specified as a character vector or string scalar. This argument specifies the absolute or relative file path to the exported file. If you specify a relative path, then the exported file is saved relative to the Exports folder of the current project. If any folders in the specified path do not exist, RoadRunner tries to create them. filename must include the extension of the exported file.

    The extension depends on the custom format you define (for example, .zip) in the ExportConfigurations.xml file.

    Example: "customExport.zip"

    Data Types: char | string

    Export format name, specified as a character vector or string scalar. This argument must match the name of a configuration in the ExportConfigurations.xml file of your RoadRunner project. The format name is case sensitive.

    You can specify the name of any configuration defined in the ExportConfigurations.xml file, including both user-defined custom configurations and built-in configurations.

    If you have a RoadRunner Scenario license, the ExportConfigurations.xml file includes built-in configurations for exporting scenarios to simulator-specific ASAM OpenSCENARIO XML files. When you specify one of these built-in format names, RoadRunner Scenario automatically applies export settings tailored to the target simulator, ensuring reliable import behavior while reducing manual setup and common export issues. This table lists the supported simulators and their corresponding format names:

    SimulatorFormat Name
    CARLA 0.9.15"CARLA Scenario"
    CarMaker® 14"CarMaker"

    When you export using a built-in simulator-specific format, RoadRunner Scenario also generates auxiliary files alongside the primary .xosc file. For more information on the files, see Export Simulator‑Specific ASAM OpenSCENARIO XML Files (RoadRunner Scenario).

    Example: "My Custom Format"

    Data Types: char | string

    Version History

    Introduced in R2022a

    expand all