Main Content

importScenario

R2026b

Import file into RoadRunner Scenario

Since R2022a

    Description

    importScenario(rrApp,filename,formatname) imports an ASAM OpenSCENARIO® file or a CSV file trajectory into the currently open scenario.

    importScenario(rrApp,filename,formatname,importoptions) sets options for import using importoptions.The import options configuration is specified as one of the import options objects compatible with the file specified in the filename argument.

    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.

    Path of the file to import, specified as a character vector or string scalar. filename is the absolute or relative path to the file to be imported. If you specify a relative path, then you must specify a path to a file in the Assets folder of the current project.

    Example: importScenario(rrApp,"C:\RR\MyProject\Assets\FourWaySignal.xosc","OpenSCENARIO XML"), imports the file FourWaySignal.xosc from the Assets folder of the current project.

    Data Types: char | string

    Import format name, specified as "OpenSCENARIO XML" or "CSV Trajectory". Format name options are case-insensitive.

    • "OpenSCENARIO XML" — Import an ASAM OpenSCENARIO XML file

    • "CSV Trajectory" — Import a vehicle trajectory from a CSV file

    Example: importScenario(rrApp,"C:\RR\MyProject\Assets\FourWaySignal.xosc","OpenSCENARIO XML"), specifies that the file to be imported, FourWaySignal.xosc, is in the ASAM OpenSCENARIO XML format.

    Data Types: char | string

    Import options configuration, specified as an openScenarioXMLImportOptions or csvTrajectoryImportOptions object.

    • openScenarioXMLImportOptions object — Options to import an ASAM OpenSCENARIO XML file. To use this object for this argument, you must specify formatname as "OpenSCENARIO XML" and specify an ASAM OpenSCENARIO XML file with the .xosc extension to the filename argument.

    • csvTrajectoryImportOptions object — Options to import a vehicle trajectory from a CSV file. To use this object for this argument, you must specify formatname as "CSV Trajectory" and specify a CSV file to the filename argument. When specifying options for importing CSV files with csvTrajectoryImportOptions, you can also modify the attributes of any actors imported with the trajectory by using the actorImportOptions object.

    Version History

    Introduced in R2022a

    expand all