Main Content

importScene

Import scene into RoadRunner using MATLAB

Since R2022a

    Description

    importScene(rrApp,filename,formatname) imports data from a file specified by filename into the currently open scene. The specified file must be in a format RoadRunner supports.

    importScene(rrApp,filename,formatname,importoptions) sets options for import using the importoptions argument.

    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 a new scene in the current project. The newScene function opens a blank scene in the currently open project.

    newScene(rrApp);

    Set import options by creating an openDriveImportOptions object that disables the import of signals and objects from the file.

    options = openDriveImportOptions(ImportSignals=false,ImportObjects=false);

    Specify the path to an ASAM OpenDRIVE file. Then, use the importScene function to import data from the specified ASAM OpenDRIVE file into the blank open scene.

    filename = "C:\RR\MyProject\Exports\FourWaySignal.xodr";
    formatname = "OpenDRIVE";
    importScene(rrApp,filename,formatname,options);

    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 file to import into RoadRunner, specified as a character vector or string scalar. This argument specifies the absolute or relative file path of the file to import. If you specify a relative path, then the path is relative to the Assets folder of the current project.

    Note

    When you import HERE HD Map data into RoadRunner, the filename argument must be an empty character vector or string scalar.

    Example: importScene(rrApp,"C:\RR\MyProject\Exports\FourWaySignal.xodr","OpenDRIVE",options), "C:\RR\MyProject\Exports\FourWaySignal.xodr" represents the absolute file path of the file to be imported.

    Data Types: char | string

    Import format name, specified as a character vector or string scalar. This value must correspond to a valid import format supported by RoadRunner. Format name options are case-insensitive. RoadRunner supports these options:

    • "OpenDRIVE" — Import ASAM OpenDRIVE® data.

    • "RoadRunner HD Map" — Import RoadRunner HD Map data.

    • "HERE HD Map" — Import HERE HD Map data. For this option, the filename argument must be an empty character vector or string scalar. (since R2024a)

    • "TomTom HD Map" — Import TomTom HD Map data. For this option, the filename argument must be an empty character vector or string scalar. (since R2024b)

    Example: importScene(rrApp,"FourWaySignal.xodr","OpenDRIVE",options) "OpenDRIVE" specifies that the imported file FourWaySignal.xodr is in the ASAM OpenDRIVE 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. Supported objects are:

    • openDRIVEImportOptions

    • roadrunnerHDMapImportOptions

    • hereHDMapImportOptions (since R2024a)

    • tomtomHDMapImportOptions (since R2024b)

    Import FormatsDescription Properties
    openDriveImportOptions

    Options for importing ASAM OpenDRIVE files into RoadRunner scene.

    openDriveImportOptions(Name=Value) creates an import options configuration object for the ASAM OpenDRIVE 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.

    ImportObjects

    Map all <object> entries in the imported file to props or markings, specified as a logical 1 (true) or 0 (false).

    Default: 0

    ImportHeadingOffsetRelativeToOrientation

    Import the <hOffset> (heading offset) values of <signal> entries as being relative to <orientation>, which is the direction of travel of the road that the signal applies to. By default, the heading offset is relative to the heading of the road, regardless of the direction of travel, specified as a logical 1 (true) or 0 (false).

    Default: auto

    SmoothFitRoadGeometryOptions (since R2024a)

    Smooth fit road geometry options, specified as a smoothFitRoadGeometryOptions object.

    LaneOptions

    Lane import options specified as a laneImportOptions object.

    Offset

    Offset of the imported ASAM OpenDRIVE scene, relative to the center of the RoadRunner scene, specified as a three-element vector of form [x y z]. Values are in meters.

    Projection

    Projection of the imported ASAM OpenDRIVE scene, specified as a projectionImportOptions. If the file does not have projection information, then RoadRunner uses the projection of the scene. If both the scene and the file do not have projection information, then RoadRunner uses the Transverse Mercator projection centered at 0 degrees latitude and longitude.

    ImportSignals

    Map all <signal> entries in the imported file to signals or signs, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    ProjectionMode

    Projection mode, specified as : "Unspecified", "FullProjection", "TranslateOnly", "NoProjection".

    ImportRegion (since R2024a)

    Area of the road network to be imported from an ASAM OpenDRIVE file, specified as a 2-by-2 matrix [xMin yMin; xMax yMax]. The first row, xMin and yMin, represents the position of the lower-left corner of a 2D axis-aligned box. The second row, xMax and yMax, represents the position of the upper-right corner of the box.

    Default: "auto"

    Example: options = openDriveImportOptions(ImportSignals=true);

    laneImportOptions

    laneImportOptions(Name=Value) creates an 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.

    ConvertShoulderToCurb

    Specify this property as logical 1 (true) to import lanes with "curb" markings and type "shoulder" as type "curb" if this option is enabled. Otherwise, the function imports these lanes as type "shoulder", specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    ConvertLaneHeights

    Map all <height> entries to imported lanes, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    MedianLaneType

    Map all <lane> types as "median" or "raised median", specified as: "Unspecified", "Median", "RaisedMedian".

    Default: "auto"

    Example:

    options = laneImportOptions(MedianLaneType="RaisedMedian"); creates a lane import options object that maps all lanes as a raised median lane type.

    projectionImportOptions

    projectionImportOptions(Name=Value) creates an options configuration object for a map projection 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.

    Projection

    Geospatial projection and datum used to represent spatial coordinates in the map. This property supports valid WKT (including ESRI WKT) or PROJ.4 projection strings. Specified as a string scalar or character vector.

    Default: "auto"

    Example:

    options = projectionImportOptions(Projection="utm +zone=11 +datum=WGS84 + units=m +no_defs +ellps=WGS84 +towgs84=0,0,"); creates projection a projection import options object that uses a PROJ.4 projection string.

    roadrunnerHDMapImportOptions

    Options for importing RoadRunner HD Map files into RoadRunner scene.

    roadrunnerHDMapImportOptions(Name=Value) creates an import options configuration object for the RoadRunner HD Map 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.

    ImportStep

    Import step, specified as one of the following strings: "Unspecified or "Load".

    Default: "auto"

    LoadOptions

    Load options, specified as roadrunnerHDMapLoadOptions.

    Default: "auto"

    BuildOptions

    Build options, specified as roadrunnerHDMapBuildOptions.

    Default: "auto"

    Example:

    options = roadrunnerHDMapImportOptions(ImportStep="Load"); creates a RoadRunner HD map import options that loads the map.

    roadrunnerHDMapLoadOptions

    Options for loading RoadRunner HD Map files into RoadRunner scene.

    roadrunnerHDMapLoadOptions(Name=Value) creates an options configuration object for loading the RoadRunner HD Map 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.

    Offset

    Offset of the imported HD map, relative to the center of the RoadRunner scene, specified as a 3-element vector.

    Projection

    Projection of the imported HD map scene, specified as a projectionImportOptions. If the projection is not set, then RoadRunner uses the file's projection. If the file does not have projection information, then RoadRunner uses the projection of the scene. If both the scene and the file do not have projection information, then RoadRunner uses the Transverse Mercator projection centered at 0 degrees latitude and longitude.

    Example:

    options = roadrunnerHDMapLoadOptions(Offset=[0 10 0]); creates a RoadRunner HD map load options with the specified offset.

    roadrunnerHDMapBuildOptions

    Options for building RoadRunner HD Map files into RoadRunner scene.

    roadrunnerHDMapBuildOptions(Name=Value) creates an options configuration object for building the RoadRunner HD Map 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.

    FitCrossSections

    Fit cross sections, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    DetectAsphaltSurfaces

    Detect asphalt surfaces, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    ClearSceneOfExistingData

    Clear the scene of existing data , specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    CurvatureBlend

    Position of fit arcs used from transition from line to arc, specified as a scalar double value.

    Default: "auto"

    AutoDetectBridgesOptions

    Options to auto detect bridges, specified as a autoDetectBridgesOptions.

    Default: "auto"

    UseLaneGroups (since R2024a)

    Flag to use lane groups, specified as a logical 1 (true) or 0 (false).

    When you use lane groups, RoadRunner builds a distinct road by combining only those lanes that are part of the same lane group.

    Set this property to false to ignore the lane group data, which enables RoadRunner to combine more lanes together to build a road. RoadRunner combines all the lanes, between junctions, into a single road. This enables you to build a smaller number of longer roads than you can build by using lane groups.

    Default: "auto"

    Example:

    options = roadrunnerHDMapBuildOptions(DetectAsphaltSurfaces=true); creates a RoadRunner HD map build options that detects asphalt surfaces.

    autoDetectBridgesOptions

    Options for auto detecting bridges.

    autoDetectBridgesOptions(Name=Value) creates an options configuration object for auto detecting bridges when building the RoadRunner HD Map. 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.

    BridgeSpanInflation

    Length of the bridge span specified as a scalar double value.

    Default: "auto"

    Example:

    options = autoDetectBridgesOptions(BridgeSpanInflation=35); creates options that set bridge span inflation.

    smoothFitRoadGeometryOptions (since R2024a)

    Options for smoothly fitting road geometry.

    smoothFitRoadGeometryOptions(Name=Value) creates an 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.

    Tolerance

    Tolerance for fit, specified as a double.

    Default: "auto"

    MaxDepth

    Maximum depth, specified as an integer.

    Default: "auto"

    Example:

    options = smoothFitRoadGeometryOptions(Tolerance=0.5); creates options for smoothly fitting road geometry.

    hereHDMapImportOptions (since R2024a)

    Options for importing HERE HD Map data into RoadRunner scene.

    hereHDMapImportOptions creates options configuration object with default properties for importing HERE HD Map data.

    hereHDMapImportOptions(Name=Value) sets properties using 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.

    LoadOptions

    Load options, specified as a hereHDMapLoadOptions object.

    Default: "auto"

    BuildOptions

    Build options, specified as a roadrunnerHDMapBuildOptions object.

    Default: "auto"

    hereHDMapLoadOptions (since R2024a)

    Options for loading HERE HD Map data into RoadRunner scene.

    hereHDMapLoadOptions creates an options configuration object with default properties for loading HERE HD Map data.

    hereHDMapLoadOptions(Name=Value) sets properties using 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.

    ProtoFilesOptions

    Options to load HERE HD Map data from protobuf files, specified as a hereProtoFilesOptions object.

    Default: "auto"

    hereProtoFilesOptions (since R2024a)

    Options for importing data from HERE HD Map protobuf files into RoadRunner scene.

    hereProtoFilesOptions creates an options configuration object with default properties for importing HERE HD Map data from protobuf files.

    hereProtoFilesOptions(Name=Value) sets properties using 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.

    RootFolder

    Absolute path to the root folder containing HERE HD Map protobuf files, specified as a character vector or string scalar.

    Default: "auto"

    UncompressUsingGZIP

    Extract contents of a GNU ZIP file containing HERE HD Map protobuf files, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    Example:

    options = hereProtoFilesOptions(UncompressUsingGZIP=true); extracts the contents of a GNU ZIP file containing HERE protobuf files.

    tomtomHDMapImportOptions (since R2024b)

    Options for importing TomTom HD Map data into RoadRunner scene.

    tomtomHDMapImportOptions creates options configuration object with default properties for importing TomTom HD Map data.

    tomtomHDMapImportOptions(Name=Value) sets properties using 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.

    LoadOptions

    Load options, specified as a tomtomHDMapLoadOptions object.

    Default: "auto"

    BuildOptions

    Build options, specified as a roadrunnerHDMapBuildOptions object.

    Default: "auto"

    tomtomHDMapLoadOptions (since R2024b)

    Options for loading TomTom HD Map data into RoadRunner scene.

    tomtomHDMapLoadOptions creates an options configuration object with default properties for loading TomTom HD Map data.

    tomtomHDMapLoadOptions(Name=Value) sets properties using 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.

    DataFilesOptions

    Options to load TomTom HD Map data from data files, specified as a tomtomHDMapFilesOptions object.

    Default: "auto"

    tomtomHDMapFilesOptions (since R2024b)

    Options for importing TomTom HD Map files into RoadRunner scene.

    tomtomHDMapFilesOptions creates an options configuration object with default properties for importing TomTom HD Map files.

    tomtomHDMapFilesOptions(Name=Value) sets properties using 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.

    DataFormat

    Data format, specified as: "Unspecified", "Avro", "GeoPackage".

    Default: "auto"

    RootFolder

    Absolute path to the root folder containing TomTom HD Map files, specified as a character vector or string scalar.

    Default: "auto"

    Example:

    options = tomtomHdMapFilesOptions(DataFormat = "Avro");

    Version History

    Introduced in R2022a

    expand all