Main Content

Simulate RoadRunner Scenarios with MATLAB and Simulink

Develop MATLAB® and Simulink® behaviors, publish actor behavior, simulate behaviors in RoadRunner Scenario simulation, and control simulation and access simulation parameters

Automated Driving Toolbox™ provides a framework for simulating scenarios in RoadRunner with actors modeled in MATLAB and Simulink. To get started using RoadRunner with MATLAB, see Connect MATLAB and RoadRunner to Control and Analyze Simulations.

These are the steps of the workflow:

  • Author MATLAB System objects or Simulink models to define actor behavior.

  • Associate actor behavior in RoadRunner.

  • Optionally, publish an actor behavior.

  • Tune parameters defined in MATLAB or Simulink for RoadRunner simulations.

  • Simulate a scenario using the RoadRunner user interface, or control simulations programmatically from MATLAB.

  • Inspect simulation results using the simulation log.

  • Replay a scenario simulation from a saved simulation log.

For more information, see Overview of Simulating RoadRunner Scenarios with MATLAB and Simulink.


expand all

ScenarioSimulationCreate, access, and control scenario simulation (Since R2022a)
ActorSimulationAccess and modify runtime specifications of actor (Since R2022a)
ActorModelView static specifications of actor (Since R2022a)
SensorSimulationAdd sensors and access sensor data from scenario simulation (Since R2023a)
ScenarioLogView scenario simulation outcomes at any time step (Since R2022a)


expand all

sim3d.scenario.ActorBehaviorDefine RoadRunner actors that use Unreal Engine viewer visualization (Since R2023b)


expand all

addObserverAdd observer to scenario simulation (Since R2022a)
getGet value of scenario simulation parameter (Since R2022a)
loadLoad saved simulation log (Since R2023a)
removeObserverRemove observer from scenario simulation (Since R2022a)
reportDiagnostic Report information, warning or error message during scenario simulation (Since R2022a)
saveSave simulation log to file for later use (Since R2023a)
setSet value of scenario simulation parameter (Since R2022a)
Simulink.ScenarioSimulation.findReturn scenario simulations or actors in current MATLAB session (Since R2022a)
sendEventSend event to scenario (Since R2022b)
receiveEventReceive event from scenario (Since R2023a)
convertToStructConvert actor to MATLAB structure (Since R2022a)
getGet scenario or static attribute of actor (Since R2022a)
getActionGet actions associated with actor (Since R2022a)
getAttributeGet runtime attribute of actor (Since R2022a)
setAttributeSet runtime attribute of actor (Since R2022a)
getAttribute Return static attribute of actor (Since R2022a)
Simulink.ActorSimulation.createMATLABStructCreate MATLAB structure for bus object for RoadRunner (Since R2024a)
Simulink.ActorSimulation.loadLoad built-in RoadRunner bus definitions into MATLAB workspace (Since R2024a)
addSensorsAdd sensors to vehicle actors in RoadRunner scenario (Since R2023a)
targetPosesGet positions and orientations of targets in sensor range relative to host vehicle (Since R2023a)
laneBoundariesGet lane boundaries relative to host vehicle (Since R2023a)
publishActorGenerate package for actor simulation (Since R2022a)
publishActorBehaviorGenerate proto file for actor simulation (Since R2022a)
publishCustomActionGenerate asset file for user-defined action (Since R2022b)
publishCustomEventGenerate asset file for user-defined event (Since R2023a)
viewView logged scenario simulation data (Since R2024a)
getGet logged scenario simulation data (Since R2022a)
onSimulationStartSpecify code to run at start of simulation (Since R2023b)
onSimulationStopSpecify code to run at end of simulation (Since R2023b)
onSimulationStep Specify code to run at each time step (Since R2023b)
matrix2transformConvert 4-by-4 pose matrix to translation, rotation, and scale vectors (Since R2023b)
transform2matrixConvert translation, rotation, and scale vectors to 4-by-4 pose matrix (Since R2023b)


RoadRunner ScenarioDefine interface for Simulink actor model (Since R2022a)
RoadRunner Scenario ReaderReads selected topic from RoadRunner scenario (Since R2022a)
RoadRunner Scenario WriterWrite selected topic to RoadRunner scenario (Since R2022a)


Bird's-Eye ScopeVisualize sensor coverages, detections, and tracks