Main Content

Programmatic Scenario Authoring

Programmatically create driving scenarios by using adrivingScenarioobject

ThedrivingScenarioobject enables you to author driving scenarios from the MATLAB®command line. Use this object to design complex road networks or parking lots and specify actors and their trajectories. You can then generate synthetic data from these scenarios by using sensor models and visualize this data on a bird's-eye plot.

The flexible interface of thedrivingScenarioobject enables you to create variations of a scenario for rapidly testing driving algorithms under various conditions. For more details, seeCreate Driving Scenario Variations Programmatically.

Functions

expand all

Scenarios

drivingScenario Create driving scenario
advance Advance driving scenario simulation by one time step
plot Plot driving scenario
record Run driving scenario and record actor states
restart Restart driving scenario simulation from beginning
updatePlots Update driving scenario plots
export Export driving scenario toASAM OpenDRIVEorASAM OpenSCENARIOfile

Actors

actor Add actor to driving scenario
vehicle Add vehicle to driving scenario
trajectory Create actor or vehicle trajectory in driving scenario
smoothTrajectory Create smooth, jerk-limited actor trajectory in driving scenario
state Inertial ground-truth state of actor
actorPoses 位置s, velocities, and orientations of actors in driving scenario
actorProfiles Physical and radar characteristics of actors in driving scenario
barrier Add a barrier to a driving scenario
chasePlot Ego-centric projective perspective plot
targetMeshes Mesh vertices and faces relative to specific actor
targetOutlines Outlines of targets viewed by actor
targetPoses Target positions and orientations relative to ego vehicle
driving.scenario.targetsToEgo Convert target poses from scenario to ego coordinates
driving.scenario.targetsToScenario Convert target poses from ego to scenario coordinates

Roads

road Add road to driving scenario or road group
roadNetwork Add road network to driving scenario
roadBoundaries Get road boundaries
driving.scenario.roadBoundariesToEgo Convert road boundaries to ego vehicle coordinates
roadMesh Mesh representation of roads near actor
driving.scenario.RoadGroup Store specifications for road junction or intersection
roadGroup Add road junction or intersection to driving scenario

Lanes

lanespec Create road lane specifications
laneType Create road lane type object
laneMarking Create road lane marking object
laneMarkingVertices Lane marking vertices and faces in driving scenario
currentLane Get current lane of actor
laneBoundaries Get lane boundaries of actor lane
clothoidLaneBoundary Clothoid-shaped lane boundary model
computeBoundaryModel Compute lane boundary points from clothoid lane boundary model
compositeLaneSpec Create multiple lane specifications for road
laneSpecConnector Define road segment connector specifications

Parking Lots

parkingLot Add parking lot to driving scenario
parkingSpace Define parking space for parking lot
insertParkingSpaces Insert parking spaces into parking lot
parkingLaneMarkingVertices Parking lane marking vertices and faces in driving scenario
drivingRadarDataGenerator Generate radar sensor detections and tracks from driving scenario
visionDetectionGenerator Generate vision detections for driving scenario
lidarPointCloudGenerator Generate lidar point cloud data for driving scenario
insSensor Inertial navigation system and GNSS/GPS simulation model
ultrasonicDetectionGenerator Generate ultrasonic range detections in driving scenario

Mesh Creation

extendedObjectMesh Mesh representation of extended object
translate Translate mesh along coordinate axes
rotate Rotate mesh about coordinate axes
scale Scale mesh in each dimension
applyTransform Apply forward transformation to mesh vertices
join Join two object meshes
scaleToFit Auto-scale object mesh to match specified cuboid dimensions
show Display the mesh as a patch on the current axes

Prebuilt Meshes

driving.scenario.bicycleMesh Mesh representation of bicycle in driving scenario
driving.scenario.carMesh Mesh representation of car in driving scenario
driving.scenario.pedestrianMesh Mesh representation of pedestrian in driving scenario
driving.scenario.truckMesh Mesh representation of truck in driving scenario
driving.scenario.jerseyBarrierMesh Mesh representation of Jersey barrier in driving scenario
driving.scenario.guardrailMesh Mesh representation of guardrail in driving scenario

Plotter Creation

birdsEyePlot Plot detections, tracks, and sensor coverages around vehicle
coverageAreaPlotter 覆盖范围plotter for bird's-eye plot
detectionPlotter Detection plotter for bird's-eye plot
trackPlotter Track plotter for bird's-eye plot
laneBoundaryPlotter Lane boundary plotter for bird's-eye plot
laneMarkingPlotter Lane marking plotter for bird's-eye plot
meshPlotter Mesh plotter for bird's-eye plot
pathPlotter Path plotter for bird's-eye plot
pointCloudPlotter Point cloud plotter for bird's-eye plot
outlinePlotter Outline plotter for bird's-eye plot
rangeDetectionPlotter Range detection plotter for bird's-eye-plot

Plotter Display

plotCoverageArea Display sensor coverage area on bird's-eye plot
plotDetection Display object detections on bird's-eye plot
plotLaneBoundary Display lane boundaries on bird’s-eye plot
plotLaneMarking Display lane markings on bird’s-eye plot
plotParkingLaneMarking Display parking lane markings on bird’s-eye plot
plotMesh Display object meshes on bird's-eye plot
plotOutline Display object outlines on bird's-eye plot
plotBarrierOutline Display barrier outlines on bird's-eye plot
plotPath Display actor paths on bird’s-eye plot
plotPointCloud Display generated point cloud on bird's-eye plot
plotRangeDetection Display range detections on bird's-eye-plot
plotTrack Display object tracks on bird's-eye plot

Plotter Utilities

findPlotter Find plotters associated with bird’s-eye plot
clearData Clear data from specific plotter of bird’s-eye plot
clearPlotterData Clear data from bird’s-eye plot

Topics

Driving Scenarios

Sensors