Main Content

prepareSimulation

Submit simulation data to RoadRunner Scenario simulation engine using MATLAB

Since R2024a

    Description

    prepareSimulation(rrApp) submits simulation data, such as the scenario definition and map definition, to the RoadRunner Scenario simulation engine. This enables you to validate your scenario and makes the simulation data available to clients, such as MATLAB® or CARLA, without first running the simulation.

    For example, scenarios might contain errors that prevent the simulation from running. If you programmatically generate a series of scenarios by varying a parameter across a range of values, and you do not know if RoadRunner Scenario can run the resulting simulations, use prepareSimulation to run the validation first.

    Examples

    collapse all

    Prepare a simulation in RoadRunner Scenario using MATLAB.

    Create a roadrunner object, specifying the path to an existing project. For example, this code shows the path to a project, on a Windows® machine, located at "C:\RR\MyProject". This code assumes that RoadRunner is installed in the default location, and returns an object, rrApp, that provides functions for performing basic workflow tasks such as opening, closing, and saving scenes and projects.

    rrApp = roadrunner(ProjectFolder="C:\RR\MyProject");

    Open an existing scenario in RoadRunner Scenario by using the openScenario function with the roadrunner object, rrApp, and the filename of the specific scenario that you want to open. This MATLAB code opens the desired scenario in RoadRunner Scenario.

    filename = "TrajectoryCutIn.rrscenario";
    openScenario(rrApp,filename)

    Prepare the simulation by using the prepareSimulation function.

    prepareSimulation(rrApp)

    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.

    Version History

    Introduced in R2024a