roadrunner-scenario-simulating

Simulate RoadRunner scenarios programmatically via MATLAB APIs and Simulink co-simulation.

995|122|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill roadrunner-scenario-simulating
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: roadrunner-scenario-simulating
Source: https://github.com/matlab/matlab-agentic-toolkit/tree/main/skills-catalog/automotive/roadrunner-scenario-simulating
Command: npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill roadrunner-scenario-simulating

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Running, stepping through, and controlling RoadRunner scenario simulations from MATLAB involves many non-obvious API rules (call ordering, asynchronous stepping, cell-array indexing, read-only observers), and mistakes like confusing RoadRunner APIs with drivingScenario cause silent failures or errors.

Core Features & Use Cases

  • Simulation Control: Run scenarios to completion with simulateScenario or step frame-by-frame with createSimulation, SimulationCommand, and SimulationStatus polling.
  • Actor Co-Simulation: Control actors externally via MATLAB System objects or Simulink RoadRunner Scenario Reader/Writer blocks, and monitor state with read-only observers.
  • Sensors & Logs: Attach vision, radar, ultrasonic, and lidar sensors to actors, read target poses and lane boundaries, and retrieve simulation logs and scenario variables.
  • Use Case: An engineer needs to step through a scenario, read each vehicle's pose and velocity per frame, and export the trajectory log for plotting — this Skill provides the exact call order and correct getAttribute patterns.

Quick Start

Ask your agent to step through the currently open RoadRunner scenario at 0.01 second steps and log the ego vehicle's pose at each frame.

Frequently Asked Questions about roadrunner-scenario-simulating

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I step through a RoadRunner scenario simulation from MATLAB?

Call createSimulation(rrApp) first, then simulateScenario(rrApp, IsSteppingStart=true, IsBlocking=false), and advance with set(rrSim, SimulationCommand="Step"). Add pause(stepSize) after each Step because the command is asynchronous and commands are dropped without waiting.

How do I read an actor's pose and velocity during a RoadRunner simulation?

Get actors with get(rrSim, "ActorSimulation"), which returns a cell array, then call getAttribute(actorSim, "Pose") or getAttribute(actorSim, "Velocity"). Dot-property access like actorSim.Pose does not exist, and index 1 is always the world actor.

What is the difference between RoadRunner scenario simulation and drivingScenario?

drivingScenario belongs to Automated Driving Toolbox and is a MATLAB-native scenario tool with unrelated APIs. RoadRunner scenario simulation uses simulateScenario and createSimulation on the roadrunner object, and the two must never be mixed.

Can I control a RoadRunner actor from Simulink?

Yes, build a model with a root-level RoadRunner Scenario block plus Reader and Writer blocks, publish it with Simulink.publish.publishActorBehavior, and assign the behavior to the actor. Start co-simulation with set_param(model, SimulationCommand="start"), never sim().

Why does my RoadRunner step loop skip frames or drop commands?

The Step command is asynchronous, so issuing steps without waiting causes commands to pile up and be silently dropped. Add pause(stepSize) after each set(rrSim, SimulationCommand="Step") call.

When should I not use this RoadRunner simulation approach?

Do not use it for launching RoadRunner, authoring scenarios, building scenes, or exporting trajectories to CSV. Observers are read-only and cannot call setAttribute, and actors are only queryable while the simulation is running or paused.