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 Scenario Variant Generator for Automated Driving Toolbox™ support package. You can install Scenario Variant Generator for Automated Driving Toolbox 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 actor property variations.
disp(variation.ActorVariationProperties)
1×2 struct array with fields: ActorID Speed Dimension Waypoints 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 with fields
Length
, Width
, and
Height
. Units are in meters.
Example: Dimension=struct("Length",7,"Width",2,"Height",4)
specifies actor dimension variations.
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. For more information on how to use this argument, see Limitations.
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.
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. For more information on how to use this argument, see Limitations.
Example: waypoints=[0 0 0; 10 0 0; 20 0 0]
specifies three
variant actor waypoints.
Speed
— Variant speed of actor
[]
(default) | scalar | P-element vector
Variant speed of the actor, specified as a scalar or a P-element vector. Units are in meters per second.
If you specify a scalar, the function applies the same speed to all the waypoints of the actor. If you specify a vector, the behavior of the function changes based on the relative number of waypoints.
Relative Number of Waypoints | Description |
---|---|
The number of speed values P equals the number of waypoints M. | Each speed value applies to its respective waypoint. |
The number of speed values P is less than the number of waypoints M. | The first P speed values apply to the initial
P waypoints. The |
The number of speed values P is greater than the number of waypoints M. | The first M speed values apply to their
respective 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.
Limitations
To apply actor waypoint variations, you must specify actor speed variations.
To apply actor yaw angle variations, you must specify actor waypoint and actor speed variations.
Tips
To apply actor property variations to your seed scenario, use the
generateVariants
function.
Version History
Introduced in R2023a
Abrir ejemplo
Tiene una versión modificada de este ejemplo. ¿Desea abrir este ejemplo con sus modificaciones?
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de 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)