varyActorProperties
Description
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.
Note
This function requires the Automated Driving Toolbox™ Test Suite for Euro NCAP® Protocols support package. You can install the Automated Driving Toolbox Test Suite for Euro NCAP Protocols support package from the Add-On Explorer. For more information about installing add-ons, see Get and Manage Add-Ons.
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: []
Add Variations to Properties of Multiple Actors
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
variations
— Variation properties
variationProperties
object
Variation properties, specified as a variationProperties
object.
actorID
— ID of actor
positive integer
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.
Dimension
— Dimensions of actor
[]
(default) | structure
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
— Waypoints of actor
[]
(default) | M-by-3 matrix
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
— Speed of actor
[]
(default) | scalar | P-element vector
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
— Yaw angle of actor
[]
(default) | M-element vector
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
generateVariants
function.
Version History
Introduced in R2023aR2024a: Vary front and rear overhang of actor
You 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 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 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)