Prebuilt Driving Scenarios in Driving Scenario Designer
The Driving Scenario Designer app provides a library of prebuilt scenarios representing common driving maneuvers. The app also includes scenarios representing European New Car Assessment Programme (Euro NCAP®) test protocols and cuboid versions of the prebuilt scenes used in the 3D simulation environment.
Choose a Prebuilt Scenario
To get started, open the Driving Scenario Designer app. At the MATLAB® command prompt, enter drivingScenarioDesigner
.
In the app, the prebuilt scenarios are stored as MAT-files and organized into folders. To open a prebuilt scenario file, from the app toolstrip, select Open > Prebuilt Scenario. Then select a prebuilt scenario from one of the folders.
Euro NCAP
These scenarios represent Euro NCAP test protocols. The app includes scenarios for testing autonomous emergency braking, emergency lane keeping, and lane keep assist systems. For more details, see Euro NCAP Driving Scenarios in Driving Scenario Designer.
Intersections
These scenarios involve common traffic patterns at four-way intersections and roundabouts.
File Name | Description |
---|---|
EgoVehicleGoesStraight_BicycleFromLeftGoesStraight_Collision.mat | The ego vehicle travels north and goes straight through an intersection. A bicycle coming from the left side of the intersection goes straight and collides with the ego vehicle. |
EgoVehicleGoesStraight_PedestrianToRightGoesStraight.mat | The ego vehicle travels north and goes straight through an intersection. A pedestrian in the lane to the right of the ego vehicle also travels north and goes straight through the intersection. |
EgoVehicleGoesStraight_VehicleFromLeftGoesStraight.mat | The ego vehicle travels north and goes straight through an intersection. A vehicle coming from the left side of the intersection also goes straight. The ego vehicle crosses in front of the other vehicle. |
EgoVehicleGoesStraight_VehicleFromRightGoesStraight.mat | The ego vehicle travels north and goes straight through an intersection. A vehicle coming from the right side of the intersection also goes straight and crosses through the intersection first. |
Roundabout.mat | The ego vehicle travels north and crosses the path of a pedestrian while entering a roundabout. The ego vehicle then crosses the path of another vehicle as both vehicles drive through the roundabout. |
Simulation 3D
These scenarios are cuboid versions of several of the prebuilt scenes available in the 3D simulation environment. You can add vehicles and trajectories to these scenarios. Then, you can include these vehicles and trajectories in your Simulink® model to simulate them in the 3D environment. This environment is rendered using the Unreal Engine® from Epic Games®. For more details on these scenarios, see Cuboid Versions of 3D Simulation Scenes in Driving Scenario Designer.
Turns
These scenarios involve turns at four-way intersections.
File Name | Description |
---|---|
EgoVehicleGoesStraight_VehicleFromLeftTurnsLeft.mat | The ego vehicle travels north and goes straight through an intersection. A vehicle coming from the left side of the intersection turns left and ends up in front of the ego vehicle. |
EgoVehicleGoesStraight_VehicleFromRightTurnsRight.mat | The ego vehicle travels north and goes straight through an intersection. A vehicle coming from the right side of the intersection turns right and ends up in front of the ego vehicle. |
EgoVehicleGoesStraight_VehicleInFrontTurnsLeft.mat | The ego vehicle travels north and goes straight through an intersection. A vehicle in front of the ego vehicle turns left at the intersection. |
EgoVehicleGoesStraight_VehicleInFrontTurnsRight.mat | The ego vehicle travels north and goes straight through an intersection. A vehicle in front of the ego vehicle turns right at the intersection. |
EgoVehicleTurnsLeft_PedestrianFromLeftGoesStraight.mat | The ego vehicle travels north and turns left at an intersection. A pedestrian coming from the left side of the intersection goes straight. The ego vehicle completes its turn before the pedestrian finishes crossing the intersection. |
EgoVehicleTurnsLeft_PedestrianInOppLaneGoesStraight.mat | The ego vehicle travels north and turns left at an intersection. A pedestrian in the opposite lane goes straight through the intersection. The ego vehicle completes its turn before the pedestrian finishes crossing the intersection. |
EgoVehicleTurnsLeft_VehicleInFrontGoesStraight.mat | The ego vehicle travels north and turns left at an intersection. A vehicle in front of the ego vehicle goes straight through the intersection. |
EgoVehicleTurnsRight_VehicleInFrontGoesStraight.mat | The ego vehicle travels north and turns right at an intersection. A vehicle in front of the ego vehicle goes straight through the intersection. |
U-Turns
These scenarios involve U-turns at four-way intersections.
File Name | Description |
---|---|
EgoVehicleGoesStraight_VehicleInOppLaneMakesUTurn.mat | The ego vehicle travels north and goes straight through an intersection. A vehicle in the opposite lane makes a U-turn. The ego vehicle ends up behind the vehicle. |
EgoVehicleMakesUTurn_PedestrianFromRightGoesStraight.mat | The ego vehicle travels north and makes a U-turn at an intersection. A pedestrian coming from the right side of the intersection goes straight and crosses the path of the U-turn. |
EgoVehicleMakesUTurn_VehicleInOppLaneGoesStraight.mat | The ego vehicle travels north and makes a U-turn at an intersection. A vehicle traveling south in the opposite direction goes straight and ends up behind the ego vehicle. |
EgoVehicleTurnsLeft_Vehicle1MakesUTurn_Vehicle2GoesStraight.mat | The ego vehicle travels north and turns left at an intersection. A vehicle in front of the ego vehicle makes a U-turn at the intersection. A second vehicle, a truck, comes from the right side of the intersection. The ego vehicle ends up in the lane next to the truck. |
EgoVehicleTurnsLeft_VehicleFromLeftMakesUTurn.mat | The ego vehicle travels north and turns left at an intersection. A vehicle coming from the left side of the intersection makes a U-turn. The ego vehicle ends up in the lane next to the other vehicle. |
EgoVehicleTurnsRight_VehicleFromRightMakesUTurn.mat | The ego vehicle travels north and turns right at an intersection. A vehicle coming from the right side of the intersection makes a U-turn. The ego vehicle ends up behind the vehicle, in an adjacent lane. |
Modify Scenario
After you choose a scenario, you can modify the parameters of the roads and actors. For example, from the Actors tab on the left, you can change the position or velocity of the ego vehicle or other actors. From the Roads tab, you can change the width of the lanes or the type of lane markings.
You can also add or modify sensors. For example, from the Sensors tab, you can change the detection parameters or the positions of the sensors. By default, in Euro NCAP scenarios, the ego vehicle does not contain sensors. All other prebuilt scenarios have at least one front-facing camera or radar sensor, set to detect lanes and objects.
Generate Synthetic Sensor Data
To generate detections from the sensors, on the app toolstrip, click Run. As the scenario runs, the Ego-Centric View displays the scenario from the perspective of the ego vehicle. The Bird’s-Eye Plot displays the detections.
Export the sensor data.
To export sensor data to the MATLAB workspace, on the app toolstrip, select Export > Export Sensor Data. Name the workspace variable and click OK. The app saves the sensor data as a structure containing sensor data such as the actor poses, object detections, and lane detections at each time step.
To export a MATLAB function that generates the scenario and its sensor data, select Export > Export MATLAB Function. This function returns the sensor data as a structure, the scenario as a
drivingScenario
object, and the sensor models as System objects. By modifying this function, you can create variations of the original scenario. For an example of this process, see Create Driving Scenario Variations Programmatically.
Save Scenario
Because prebuilt scenarios are read-only, save a copy of the driving scenario to a new folder. To save the scenario file, on the app toolstrip, select Save > Scenario File As.
You can reopen this scenario file from the app. Alternatively, at the MATLAB command prompt, you can use this syntax.
drivingScenarioDesigner(scenarioFileName)
drivingScenario
object. At the MATLAB command prompt, use this syntax, where scenario
is the name of
the exported
object.drivingScenarioDesigner(scenario)
sensors
is a sensor object or a cell
array of such
objects.drivingScenarioDesigner(scenario,sensors)
drivingScenario
object
into your model. This block does not directly read sensor data. To add sensors that you created
in the app to a Simulink model, generate a model containing your scenario and sensors by selecting Export > Export Simulink Model. In the model, the generated Scenario Reader block reads the
scenario and the generated sensor blocks define the sensors.See Also
Apps
Blocks
Objects
drivingScenario
|drivingRadarDataGenerator
|visionDetectionGenerator
|lidarPointCloudGenerator
|insSensor
Related Topics
- Create Driving Scenario Interactively and Generate Synthetic Sensor Data
- Euro NCAP Driving Scenarios in Driving Scenario Designer
- Cuboid Versions of 3D Simulation Scenes in Driving Scenario Designer
- Test Open-Loop ADAS Algorithm Using Driving Scenario
- Test Closed-Loop ADAS Algorithm Using Driving Scenario