Main Content

varyActorProperties

Add variations to actor properties

Since R2023a

Description

example

varyActorProperties(variations,actorID,Name=Value) adds property variations for the actor 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 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.

Examples

collapse all

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

collapse all

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.

InstancesDescription

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 generateVariant function applies the Pth speed value to the rest (M-P) waypoints while generating the scenario variants.

The number of speed values P is greater than the number of waypoints M.

Initial M speed values are applicable to M waypoints. The generateVariant function ignores the rest (P-M) speed values while generating the scenario variants.

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 generateVariants function.

Version History

Introduced in R2023a

expand all