Main Content

MATLAB Functions for Scenario Authoring

Create and modify RoadRunner scenario elements, such as actors, logic phases, and waypoints, using MATLAB®

Automated Driving Toolbox™ offers functions that enable you to programmatically author scenarios in RoadRunner, such as by adding actors, creating routes, and building scenario logic, from the MATLAB command-line interface. By authoring scenarios programmatically, you can quickly build and modify simulation parameters without switching between applications, automate repetitive authoring tasks, and generate scenario variations for automated tests.

Functions

expand all

roadrunnerAPIRoadRunner authoring API (Since R2025a)
ScenarioCurrent RoadRunner scenario (Since R2025a)
validateCheck RoadRunner scenario for critical errors (Since R2025a)

Extract Project Object

ProjectSpecify RoadRunner project folder (Since R2025a)

Add Actors, Create Assets, and Retrieve Assets

addActorAdd actor to RoadRunner scenario (Since R2025a)
createAssetCreate new asset (Since R2025a)
getAssetExtract object for specified asset (Since R2025a)

Actor and Asset Types

VehicleSpecify vehicle actor (Since R2025a)
CharacterSpecify character actor (Since R2025a)
MovableObjectSpecify movable object actor (Since R2025a)
CharacterAssetCharacter asset type (Since R2025a)
MovableObjectAssetMovable object asset type (Since R2025a)
VehicleAssetVehicle asset type (Since R2025a)
BehaviorAssetBehavior asset type (Since R2025a)
AlignedBoxAxis-aligned bounding box (Since R2025a)

Add Points and Specify Anchors for Scenario Objects

addPointAdd point to route (Since R2025a)
autoAnchorAnchor point to nearest road (Since R2025a)
anchorToPointSet specified point as anchor (Since R2025a)
findSceneAnchorExtract object for specified scene anchor (Since R2025a)

Anchor Types and Points

PointPoint in RoadRunner scenario (Since R2025a)
ScenarioAnchorPointScenario anchor point (Since R2025a)
SceneAnchorPointScene anchor point (Since R2025a)

Routes

RouteSequence of waypoints (Since R2025a)
RouteSegmentRoute segment (Since R2025a)

Extract Phase Logic and Initial Phase

PhaseLogicRoadRunner scenario phase logic (Since R2025a)
initialPhaseForActorExtract object for actor initial phase (Since R2025a)

Add New Phases

addPhaseInSerialCreate logic phase that executes sequentially during simulation (Since R2025a)
addPhaseInParallelCreate logic phase that executes concurrently during simulation (Since R2025a)
addPhaseCreate new phase of specified type (Since R2025a)

Phase Types

SerialPhaseSpecify options for customizing logic phase that executes child phases sequentially (Since R2025a)
ParallelPhaseSpecify options for customizing logic phase that executes child phases concurrently (Since R2025a)
ActorActionPhaseSpecify logic phase that executes actor action (Since R2025a)
SystemActionPhaseSpecify logic phase that executes system action (Since R2025a)

Add Actions and Conditions

addActionAdd action to logic phase (Since R2025a)
findActionsExtract actions from logic phase (Since R2025a)
setEndConditionAssign end condition to specified phase (Since R2025a)
setFailConditionAssign fail condition to simulation (Since R2025a)
removeRemove condition object from RoadRunner scenario (Since R2025a)

Action Types

ChangeSpeedActionSpecify Change Speed action (Since R2025a)
ChangeLaneActionSpecify Change Lane action (Since R2025a)
ChangeLateralOffsetActionSpecify Change Lateral Offset action (Since R2025a)
ChangeLongitudinalDistanceActionSpecify Change Longitudinal Distance action (Since R2025a)
WaitActionSpecify Wait action (Since R2025a)

Condition Types

ActorSpeedConditionSpecify Actor Speed condition (Since R2025a)
DurationConditionSpecify Duration condition (Since R2025a)
CollisionConditionSpecify Collision condition (Since R2025a)
PhaseStateConditionSpecify Phase State condition (Since R2025a)
DistanceToActorConditionSpecify Distance To Actor condition (Since R2025a)
DistanceToPointConditionSpecify Distance To Point condition (Since R2025a)
LongitudinalDistanceToActorConditionSpecify Longitudinal Distance To Actor condition (Since R2025a)

Topics