Main Content

importScenario

Import file into RoadRunner Scenario using MATLAB

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. You can import only CSV trajectory files.

    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"), imports the file FourWaySignal.xosc from the Assets folder of the current project.

    Data Types: char | string

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

    • "OpenSCENARIO" — Import an ASAM OpenSCENARIO file

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

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

    Data Types: char | string

    Import options configuration, specified as a csvTrajectoryImportOptions object. To use 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 with the actorImportOptions object.

    Version History

    Introduced in R2022a