variationProperties
Description
The variationProperties
object stores scenario property
variations, such as actor, collision, scene, and Euro NCAP® test bench properties, to use to create scenario variants.
Creation
Description
creates an
empty variations
= variationPropertiesvariationProperties
object, variations
.
Note
This object requires the Automated Driving Toolbox™ Test Suite for Euro NCAP® Protocols support package. You can install Automated Driving Toolbox Test Suite for Euro NCAP Protocols from the Add-On Explorer. For more information about installing add-ons, see Get and Manage Add-Ons.
Properties
ActorVariationProperties
— Actor variation properties
structure
Actor variation properties, specified as a structure. The structure contains these fields:
ActorID
— ID of the actor, specified as a positive integer.Speed
— Speed of the actor, specified as a scalar or an M-element row vector. M is the number of waypoints. Units are in meters per second.Dimension
— Dimensions of the actor, specified as a structure with fieldsLength
,Width
,Height
,RearOverhang
, andFrontOverhang
. Units are in meters.Waypoints
— Waypoints of the actor, specified as an M-by-3 matrix. M is the number of waypoints. Each row represents the actor position in the form [x y z]. Units are in meters.Yaw
— Yaw angle of the actor, specified as an M-element column vector. M is the number of waypoints. Units are in radians.By default, the fields of the
ActorVariationProperties
structure are empty arrays,[]
.
Note
To set the fields of the ActorVariationProperties
structure,
you must use the varyActorProperties
object function.
CollisionVariationProperties
— Collision variation properties
[]
(default) | structure
Collision variation properties, specified as a structure. The structure contains these fields:
Actor1ID
— ID of the first colliding actor in the pair, specified as a positive integer.Actor2ID
— ID of the second colliding actor in the pair, specified as a positive integer.Actor1CollisionFraction
— Point of collision relative to the collision side of the first actor, specified as a scalar in the range [0, 1]. For more information, see Collision Fraction.Actor1CollisionSide
— Side of the first actor at which the collision occurs, specified as"Front"
,"Left"
,"Back"
, or"Right"
.Actor2CollisionFraction
— Point of collision relative to the collision side of the second actor, specified as a scalar in the range [0, 1]. For more information, see Collision Fraction.Actor2CollisionSide
— Side of the second actor at which the collision occurs, specified as"Front"
,"Left"
,"Back"
, or"Right"
.VariationType
— Parameter to change to generate variant with collision, specified as"WaitTime"
,"EntryTime"
, or"Waypoints"
.
Note
To set the fields of the CollisionVariationProperties
structure, you must use the varyCollisionProperties
object function.
SceneVariationProperties
— Scene variation properties
structure
Scene variation properties, specified as a structure. The structure contains these fields:
RoadID
— ID of the road, specified as a positive integer.LaneID
— ID of the lane, specified as a positive integer.Width
— Width of the road or lane, specified as a positive scalar. Units are in meters.LaneType
— Type of the lane, specified as"driving"
or"parking"
.Marking
— Lane markings of the road, specified as"solid"
,"dashed"
,"doublesolid"
, or"doubledashed"
.MarkingColor
— Marking color of the lane or road boundaries, specified as"white"
or"yellow"
.MarkingWidth
— Marking width of the road or lane boundaries, specified as a positive scalar or a two-element numeric row vector. Units are in meters.
By default, the fields of the SceneVariationProperties
structure are empty arrays, []
.
Note
To set the fields of the SceneVariationProperties
structure,
you must use the varySceneProperties
object function.
TestVariationProperties
— Euro NCAP test bench variation properties
structure
Euro NCAP test bench variation properties, specified as a structure. The structure contains these fields:
StartTestTime
— Time to start safety assessment test. Units are in seconds.EndTestTime
— Time to end safety assessment test. Units are in seconds.HandoverTime
— Time to hand-over of control for Euro NCAP safety assessment testing, specified as a scalar. Units are in seconds.
By default, the fields of the TestVariationProperties
structure
are empty arrays, []
.
Note
To set the fields of the TestVariationProperties
structure,
you must use the varyTestProperties
object function.
Object Functions
varyActorProperties | Add variations to actor properties |
varyCollisionProperties | Add variations to collision properties |
varySceneProperties | Add variations to scene properties |
varyTestProperties | Add variations to Euro NCAP test bench properties |
Examples
Add Variations to Speed and Waypoint Actor Properties
Create an empty variationProperties
object.
variation = variationProperties;
Display empty actor properties.
disp(variation.ActorVariationProperties)
ActorID: [] Speed: [] Dimension: [] Waypoints: [] Yaw: []
Add speed and waypoint variations to the actor with an ActorID
of 1
.
waypoints = [0 0 0; 10 0 0]; varyActorProperties(variation,1,Speed=10,Waypoints=waypoints);
Display the actor property variations.
disp(variation.ActorVariationProperties)
ActorID: 1 Speed: 10 Dimension: [] Waypoints: [2×3 double] Yaw: []
Vary Scene Properties to Generate Scenario Variants
Load a driving scenario into the workspace.
load("scenarioWithSingleActor.mat")
Create a scenario descriptor from the input seed scenario.
seedScenarioDescriptor = getScenarioDescriptor(scenario,Simulator="DrivingScenario");
Create a variationProperties
object.
variation1 = variationProperties;
Add scene property variations to a road by specifying the road ID, width of the road, and marking color of the road boundaries.
roadID = 1;
varySceneProperties(variation1,roadID,Width=30,MarkingColor="yellow")
Using the seed scenario descriptor and the scene variation, generate a scenario variant descriptor.
scenarioVariantDescriptor1 = generateVariants(seedScenarioDescriptor,variation1);
Generate a variant scenario, as a drivingScenario
object, from the scenario variant descriptor object.
scenarioVariant1 = getScenario(scenarioVariantDescriptor1,Simulator="DrivingScenario");
Create another variationProperties
object.
variation2 = variationProperties;
Add scene property variations to a lane by specifying the road ID, lane ID, width of the lane, lane marking, and marking color of the lane boundaries.
roadID = 1; laneID = 2; varySceneProperties(variation2,roadID,laneID,Width=10,Marking="solid",MarkingColor="white")
Using the seed scenario descriptor and the scene variation, generate another scenario variant descriptor.
scenarioVariantDescriptor2 = generateVariants(seedScenarioDescriptor,variation2);
Generate another variant scenario, as a drivingScenario
object, from the scenario variant descriptor object.
scenarioVariant2 = getScenario(scenarioVariantDescriptor2,Simulator="DrivingScenario");
Create a custom figure window to plot the seed scenario and the scenario variants.
figScene = figure; set(figScene,Position=[200 200 900 300]) hCarViewPanel1 = uipanel(figScene,Position=[0 0 0.33 1],Title="Input Seed Scenario"); hCarPlot1 = axes(hCarViewPanel1); hCarViewPanel2 = uipanel(figScene,Position=[0.34 0 0.33 1],Title='Generated Scenario Variant1'); hCarPlot2 = axes(hCarViewPanel2); hCarViewPanel3 = uipanel(figScene,Position=[0.68 0 0.33 1],Title='Generated Scenario Variant2'); hCarPlot3 = axes(hCarViewPanel3);
Plot the seed scenario and its variants. Observe the scene variation in the generated scenario variants.
plot(scenario,Waypoints="on",Parent=hCarPlot1) plot(scenarioVariant1,Waypoints="on",Parent=hCarPlot2) plot(scenarioVariant2,Waypoints="on",Parent=hCarPlot3)
Tips
To apply actor property variations and collision variations to your seed scenario, use the
generateVariants
function.
Version History
Introduced in R2023aR2024b: variationProperties
object contains new properties
The variationProperties
object contains these additional properties:
SceneVariationProperties
TestVariationProperties
Commande MATLAB
Vous avez cliqué sur un lien qui correspond à cette commande MATLAB :
Pour exécuter la commande, saisissez-la dans la fenêtre de commande de MATLAB. Les navigateurs web ne supportent pas les commandes MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)