importScene
Description
importScene(
imports data from a file specified by rrApp
,filename
,formatname
)filename
into the currently open
scene. The specified file must be in a format RoadRunner supports.
importScene(
sets options for import using the rrApp
,filename
,formatname
,importoptions
)importoptions
argument.
Examples
Import Scene from ASAM OpenDRIVE® File to RoadRunner
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
rrApp
— RoadRunner application
roadrunner
object
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.
filename
— Path of file to import into RoadRunner
character vector | string scalar
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
formatname
— Import format name
character vector | string scalar
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, thefilename
argument must be an empty character vector or string scalar. (since R2024a)"TomTom HD Map"
— Import TomTom HD Map data. For this option, thefilename
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
importoptions
— Import options configuration
valid import options object
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 Formats | Description | Properties | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
openDriveImportOptions | Options for importing ASAM OpenDRIVE files into RoadRunner scene.
If a default property value is |
Example: | ||||||||||||||||||
laneImportOptions |
If a default property value is |
Example:
| ||||||||||||||||||
projectionImportOptions |
If a default property value is
|
Example:
| ||||||||||||||||||
roadrunnerHDMapImportOptions | Options for importing RoadRunner HD Map files into RoadRunner scene.
If a default property value is |
Example:
| ||||||||||||||||||
roadrunnerHDMapLoadOptions | Options for loading RoadRunner HD Map files into RoadRunner scene.
If a default property value is |
Example:
| ||||||||||||||||||
roadrunnerHDMapBuildOptions | Options for building RoadRunner HD Map files into RoadRunner scene.
If a default property value is |
Example:
| ||||||||||||||||||
autoDetectBridgesOptions | Options for auto detecting bridges.
If a default property value is |
Example:
| ||||||||||||||||||
smoothFitRoadGeometryOptions (since R2024a) | Options for smoothly fitting road geometry.
If a default property value is
|
Example:
| ||||||||||||||||||
| Options for importing HERE HD Map data into RoadRunner scene.
If a default property
value is |
| ||||||||||||||||||
| Options for loading HERE HD Map data into RoadRunner scene.
If a default property
value is |
| ||||||||||||||||||
| Options for importing data from HERE HD Map protobuf files into RoadRunner scene.
If a default property
value is |
Example:
| ||||||||||||||||||
| Options for importing TomTom HD Map data into RoadRunner scene.
If a default property
value is |
| ||||||||||||||||||
| Options for loading TomTom HD Map data into RoadRunner scene.
If a default property
value is |
| ||||||||||||||||||
| Options for importing TomTom HD Map files into RoadRunner scene.
If a default property
value is |
Example:
|
Version History
Introduced in R2022aR2024b: Import TomTom HD Map data
The importoptions
argument now supports these option configuration
objects, which enable you to import TomTom HD map data into RoadRunner.
tomtomHDMapImportOptions
— Options for importing TomTom HD Map data into RoadRunner scene.tomtomHDMapLoadOptions
— Options for loading TomTom HD Map data into RoadRunner scene.tomtomHDMapFilesOptions
— Options for importing data from TomTom HD Map files into RoadRunner scene.
R2024a: New properties for openDriveImportOptions
As of R2024a, you can specify two new properties for the
openDriveImportOptions
object:
SmoothFitRoadGeometryOptions
— Smooth fit road geometry options.ImportRegion
— Area of the road network to be imported from an ASAM OpenDRIVE file.
R2024a: Specify options for smoothly fitting road geometry with smoothFitRoadGeometryOptions
As of R2024a, you can use the smoothFitRoadGeometryOptions
object to specify options for smoothly fitting
road geometry by modifying its Tolerance
and MaxDepth
properties.
R2024a: Import HERE HD Map data
The importoptions
argument now supports these option configuration
objects, which enable you to import HERE HD map data into RoadRunner.
hereHDMapImportOptions
— Options for importing HERE HD Map data into RoadRunner scene.hereHDMapLoadOptions
— Options for loading HERE HD Map data into RoadRunner scene.hereProtoFilesOptions
— Options for importing data from HERE HD Map protobuf files into RoadRunner scene.
R2024a: Toggle use of lane groups to build roads
When you configure import options for building RoadRunner HD Map, you can now specify the UseLaneGroups
property of
the roadrunnerHDMapBuildOptions
object. Use this property to toggle the
use of lane groups when you build the roads from imported HD map data.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)