Main Content

Overview of Scenario Variant Generation

The Scenario Variant Generator for Automated Driving Toolbox™ support package enables you to automatically generate multiple scenarios by varying the parameters of a seed scenario. Using these generated scenarios, you can perform exhaustive safety assessments of various automated driving applications, such as autonomous emergency braking (AEB), lane keep assist (LKA), and adaptive cruise control (ACC). The support package provides examples to test these applications as per European New Car Assessment Programme (Euro NCAP®) test protocols.

The process of generating scenario variants from the seed scenario involves these steps:

  1. Read the seed scenario and extract its parameters.

  2. Specify actor and collision property variations with reference to the parameters of the seed scenario.

  3. Generate variant descriptors from parameters extracted from the seed scenario and the specified variation properties.

  4. Generate scenario variants.

Scenario variant generation workflow

To generate scenario variants, you must have a seed scenario. You can create a seed scenario using a drivingScenario object. For more information, see Create Driving Scenario Programmatically. Alternatively, you can use prebuilt scenarios representing European New Car Assessment Programme (Euro NCAP) test protocols. For more information, see Euro NCAP Driving Scenarios in Driving Scenario Designer. Also, you can use a scenario in RoadRunner Scenario as a seed scenario for creating scenario variants. For more information, see Create Scenario Descriptor from RoadRunner Scenario example.

Extract Parameters

The first step of generating scenario variants is to extract the parameters from a seed scenario. Use the getScenarioDescriptor function to read a seed scenario and extract its parameters. The function stores the extracted parameters in a ScenarioDescriptor object.

This table shows the different parameters that the getScenarioDescriptor function extracts from the seed scenario.

Extracted ParametersDescription
Scene Parameters

Static parameters related to roads, lanes, and barriers.

Examples — Road centers, road width, number of lanes, lane types

Actor Parameters

Dynamic parameters related to the actors of the seed scenario.

Examples — Speed, yaw, waypoints, dimensions

Simulator Parameters

Parameters related to the simulation platform.

Examples — Sample time, stop time

If two actors in the seed scenario collide, you can extract the collision information stored in the ScenarioDescriptor object by using the getCollisionData function. The getCollisionData function extracts this collision information from the seed scenario.

  • Simulation time at which the collision occurs.

  • Coordinates of the collision point.

  • Speed of the actors at the time of the collision.

  • Sides of each actor on which the collision occurs.

  • Point of collision relative to the collision side of each actor.

You can use the identifyActorOfInterest function to identify ego and target actor IDs in a seed scenario descriptor.

Specify Variation Properties

To generate scenario variants, you must modify the actor and collision properties of the seed scenario.

Create a variationProperties object to store new values for the actor and collision properties.

  • Use the varyActorProperties object function to specify new values for actor properties such as dimensions, waypoints, speed, and yaw.

  • Use the varyCollisionProperties object function to specify new values for the collision sides and collision points.

You can also specify variation properties as tables in Microsoft® Excel® spreadsheets to generate scenario variants. For more information, see the Generate Scenario Variants Using Excel Spreadsheets example.

Generate Scenario Descriptor Variants

You can use the parameters extracted from the seed scenario and the specified variation properties to generate scenario descriptor variants.

Use the generateVariants function to modify the actor and collision parameters of the seed scenario with the variant values. The generateVariants function returns ScenarioDescriptor object variants that contain the modified parameters.

The generateVariants function automatically computes the required constraints to generate the ScenarioDescriptor object variants. For example, if you want to reduce the speed of an actor, but keep the collision point constant, the generateVariants function can compute the required wait time for the actor to maintain the collision point.

For information about how to perform parameter variations, see the Generate Scenario Variants for Testing AEB Pedestrian Systems example.

Generate Scenario Variants

After generating the ScenarioDescriptor object variants, obtain the scenario variants by using the getScenario function. This function constructs the scenario from the parameters stored in a ScenarioDescriptor object and returns the scenario as a drivingScenario object or a RoadRunner ScenarioSimulation object.

You can visualize the generated variants, or export the generated variants to the ASAM OpenSCENARIO® file format. For more information, see the Generate Variants of ACC Target Cut-In Scenario example.

See Also


Related Topics