varyActorProperties
Description
Add-On Required: This feature requires the Automated Driving Toolbox Test Suite for Euro NCAP Protocols add-on.
varyActorProperties(
adds property variations for the actor variations,actorID,Name=Value)actorID to the
variationProperties object variations by using one
or more name-value arguments. For example, Speed=10 specifies a variant
actor speed of 10 meters per second.
Examples
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: []
Create an empty variationProperties object.
variation = variationProperties;
Display empty actor properties.
disp(variation.ActorVariationProperties)
ActorID: []
Speed: []
Dimension: []
Waypoints: []
Yaw: []
Add a speed variation to the actor with an ActorID of 1.
varyActorProperties(variation,1,Speed=10);
Add a waypoint variation to the actor with an ActorID of 2.
waypoint = [0 0 0; 10 0 0]; varyActorProperties(variation,2,Waypoints=waypoint);
Display the property variations for an actor with an ActorID of 1.
disp(variation.ActorVariationProperties(1))
ActorID: 1
Speed: 10
Dimension: []
Waypoints: []
Yaw: []
Display the property variations for an actor with an ActorID of 2.
disp(variation.ActorVariationProperties(2))
ActorID: 2
Speed: []
Dimension: []
Waypoints: [2×3 double]
Yaw: []
Input Arguments
Variation properties, specified as a variationProperties object.
ID of the actor, specified as a positive integer.
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN, where Name is
the argument name and Value is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: varyActorProperties(variation,1,Speed=10) specifies a variant
actor speed of 10 meters per second.
Dimensions of the actor, specified as a structure. The structure must contain at
least one of these fields: Length, Width, or
Height. You can also specify the
RearOverhang and FrontOverhang fields, as
a pair. FrontOverhang specifies the distance between the front of
the vehicle and the front axle. RearOverhang specifies the
distance between the rear axle and the rear of the vehicle. Specify each field as a
numeric scalar, in meters. For more information on vehicle dimensions, see Actor and Vehicle Positions and Dimensions.
Example: Dimension=struct("Length",7,"Width",2,"Height",4)
specifies actor dimension variations for length, width, and height.
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.
Example: waypoints=[0 0 0; 10 0 0; 20 0 0] specifies three actor
waypoints.
Speed of the actor, specified as a scalar or an P-element vector. Units are in meters per second.
If you specify it as a scalar, the same speed is applicable to all the specified waypoints. If you specify it as a vector, these instances are applicable.
| Instances | Description |
|---|---|
The number of speed values P is equal to the number of waypoints M. | Each speed value is applicable to its respective waypoint. |
The number of speed values P is smaller than the number of waypoints M. | P speed values are applicable to initial
P waypoints. The |
The number of speed values P is greater than the number of waypoints M. | Initial M speed values are applicable to
M waypoints. The |
Example: Speed=10 specifies a variant actor speed of 10 meters
per second.
Yaw angle of the actor, specified as an M-element vector. M is the number of waypoints for the actor. Units are in radians.
Example: Yaw=[1 1 1] specifies variant yaw angles of an actor
for three waypoints.
Tips
To apply actor property variations to your seed scenario, use the
generateVariantsfunction.
Version History
Introduced in R2023aYou can now specify front and rear overhang variations for an actor by specifying the
RearOverhang and FrontOverhang fields, as a
pair, to the Dimension name-value argument.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
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)