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 one of the import options objects compatible with the file specified in the filename argument. This argument specifies the options that can be used with import. Only csvTrajectoryImportOptions object is supported.

    Import Format Options ObjectDescription Properties
    csvTrajectoryImportOptions

    Specifies options for importing RoadRunner scene and scenario to CSV trajectories.

    csvTrajectoryImportOptions (Name=Value) creates an import options configuration object for 'CSV Trajectory' format with properties specified as one or more name-value arguments. If a default property value is "auto", the RoadRunner application determines what value to use and sets the property to that value.

    ActorImportOptions

    Optional attributes to apply to the actor, specified as an actorImportOptions object.

    Default: "auto"

    SpawnTime

    Time to delay (in seconds) before adding the actor to the scenario.

    Default: "auto"

    RemoveTime

    Time to delay (in seconds) before removing the actor from the scenario.

    Default: "auto"

    Example: options = csvTrajectoryImportOptions(SpawnTime=1);

    actorImportOptions

    Specifies options for importing actors with CSV Trajectory.

    actorImportOptions (Name=Value) creates an actor options configuration object with properties specified as one or more name-value arguments. If a default property value is "auto", the RoadRunner application determines what value to use and sets the property to that value.

    Name

    Name to be given to new actor.

    Default: "auto".

    ID

    ID of the actor.

    Default: "auto".

    Color

    Color of the actor, specified as a string, such as "blue" or a hex value, such as "#0072BD".

    Default: "auto".

    AssetPath

    Asset path in the RoadRunner Asset Library.

    Default: "auto".

    BehaviorAssetPath

    Behavior asset path in the RoadRunner Asset Library.

    Default: "auto".

    Example: options = actorImportOptions(Color="Green");

    Data Types: char | string

    Version History

    Introduced in R2022a