Start RoadRunner application using MATLAB
roadrunner object enables you to perform common workflow tasks
in the RoadRunner application, such as opening, closing, and saving scenes and projects, from the
MATLAB® command line. You can also use object functions to import data from files and
export scenes from RoadRunner to other formats.
Before you create a
roadrunner object for the first time, you must
install RoadRunner and activate your RoadRunner license interactively. For more information, see Install and Activate RoadRunner (RoadRunner).
roadrunner object requires a license for Automated Driving Toolbox™.
rrApp = roadrunner(
starts RoadRunner from the default installation folder location, and opens a new scene in an
existing project at the location specified by
rrApp = roadrunner opens RoadRunner for a ProjectFolder and InstallationFolder defined using MATLAB's
settings API or
rrApp = roadrunner( sets the
properties using name-value pairs.
ProjectFolder — RoadRunner project folder path
RoadRunner project folder path, specified as a string scalar. You can customize the
ProjectFolder using MATLAB's
settings API or
roadrunnerSetup function. For details about the
RoadRunner project folder structure, see RoadRunner Project and Scene System (RoadRunner).
roadrunner("C:\My Project") opens the project located in
C:\My Project folder in the RoadRunner application on a Windows® machine.
InstallationFolder — Location of local RoadRunner installation folder
Location of local RoadRunner installation folder, specified as a string scalar. You can customize the
InstallationFolder using MATLAB's
settings API or
These are the default RoadRunner installation locations on Windows and Linux® platforms:
C:\Program Files\RoadRunner R20NNx\bin\win64
Linux, Ubuntu® –
R20NNx is the release version you
are using. To customize the default value of the RoadRunner installation folder, use the MATLAB settings API.
NoDisplay — Start RoadRunner in console mode
false or 0 (default) |
true or 1
Start RoadRunner in console mode in a non-graphical environment, specified as
logical 0 (false) or
logical 1 (true). For more
details on starting RoadRunner in console mode, see Control RoadRunner Programmatically in Console Mode (RoadRunner).
Ports — Start RoadRunner on specified
Start RoadRunner on specified
specified as a matrix of size 1-by-2. RoadRunner API server port (
apiPort) and RoadRunner Scenario simulation API server port (
automatically assigned by default when you launch the RoadRunner application. The server runs locally at localhost:port after you open a
RoadRunner project. If the ports assigned are not free, a connection error occurs. In
this case, you can explicitly assign values to
cosimPort using the
roadrunner object or the
[54321, 54322]) starts RoadRunner and RoadRunner Scenario on
cosimPort 54321 and
|Create new RoadRunner scene using MATLAB|
|Open RoadRunner scene using MATLAB|
|Save RoadRunner scene using MATLAB|
|Export RoadRunner scene using MATLAB|
|Export RoadRunner scene to custom format using MATLAB|
|Import scene into RoadRunner using MATLAB|
|Create new scenario in RoadRunner Scenario using MATLAB|
|Open scenario in RoadRunner Scenario using MATLAB|
|Save scenario in RoadRunner Scenario using MATLAB|
|Export scenario from RoadRunner Scenario using MATLAB|
|Import file into RoadRunner Scenario using MATLAB|
|Create RoadRunner Scenario simulation using MATLAB|
|Get the value of RoadRunner scenario variable using MATLAB|
|Set RoadRunner scenario variable using MATLAB|
|Remap anchors in RoadRunner Scenario in MATLAB|
Start RoadRunner Application from Default Installation Folder
Specify the path to an existing project using the P
rojectFolder variable. For example, this code shows the path to a project, on a Windows® machine, located at
projectFolder = "C:\RR\MyProject";
roadrunner object and open RoadRunner by specifying your project as the location where you want to create a scene. This example assumes that RoadRunner is installed in its default location.
rrApp = roadrunner(ProjectFolder=projectFolder);
Change Default RoadRunner Installation Folder Settings
Modify the default RoadRunner installation folder settings by using the MATLAB
You can specify a value for the
InstallationFolder property of a
roadrunner object that persists across MATLAB sessions, or for a given MATLAB session, using the
To set a persistent default value for the
InstallationFolder property, edit the value of
PersonalValue.The specified value persists across multiple MATLAB sessions for an individual user.
s = settings; s.roadrunner.application.InstallationFolder.PersonalValue = "C:\Program Files\RoadRunner R2022a\bin\win64";
You can also set a temporary default value for the
InstallationFolder property. the specified value persists for only the current MATLAB session, and is cleared at the end of the session.
s = settings; s.roadrunner.application.InstallationFolder.TemporaryValue = "C:\MyRoadRunner Install\bin\win64";
Start Multiple RoadRunner Application Instances Simultaneously
Open multiple RoadRunner applications by creating multiple instances of the
roadrunner object. You can use each instance to programmatically interact with the RoadRunner application that it opens. The scenes used in this code are included in RoadRunner projects by default.
Open a first instance of RoadRunner by specifying the
Lane Keep project. In this example, the project is located on the path
rrApp1 = roadrunner("C:\RR\Lane Keep");
FourWaySignal scene in the first project.
Open a second instance of RoadRunner by specifying the
USCity project. In this example, the project is located on the path
rrApp2 = roadrunner("C:\RR\USCity");
SanAntonio scene in the second project
Start RoadRunner Application in Console Mode
Specify the path to an existing project using the
projectFolder variable. For example, this code shows the path to a project, on a Windows® machine, located at
projectFolder = "C:\RR\MyProject";
roadrunner object and open RoadRunner by specifying your project as the location where you want to create a scene. This example assumes that RoadRunner is installed in its default location. Specify the
NoDisplay property to launch the application in console mode using a non-graphical terminal.
rrApp = roadrunner(projectFolder,InstallationFolder="C:\Program Files\RoadRunner R2022b\bin\win64",NoDisplay=true);
roadrunnerobject and its associated functions are supported only in RoadRunner R2022a and later.
The project you specify using the
projectFolderargument, when creating the
roadrunnerobject must already exist.
InstallationFolderproperty do not support Unicode characters in the path.
roadrunnerobject and its associated functions are not supported in MATLAB Online™.
roadrunnerobject from the MATLAB workspace does not close the RoadRunner application associated with it. You must manually close the RoadRunner application. Also, exiting from the current MATLAB session does not close any RoadRunner applications created by
Introduced in R2022a