Main Content

setAttribute

Set run-time attribute of actor

Since R2022a

    Description

    setAttribute(actorSim,Name=Value) sets the value of the specified run-time attribute for the ActorSimulation actor actorSim. Using this command, you can set one run-time attribute at a time.

    example

    Examples

    collapse all

    Set the pose of an actor. For more information about actor pose, see What Is a RoadRunner Pose Matrix?

    Set the pose of an actor.

    p = [0.1694 0.9855 -0.0000 -90.7324; ...
      -0.9855 0.1694 -0.0000 -12.9314; ...
      -0.0000 0.0000 1.0000 -0.0000; ...
      0 0 0 1.0000];
    setAttribute(actorSim,Pose=p);

    Set the velocity of an actor.

    setAttribute(actorSim,Velocity=[2.6216 3.0288 0.0000]);

    Input Arguments

    collapse all

    Actor for which to set attribute, specified as an ActorSimulation object.

    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: setAttribute(actorSim,Velocity=[17.3 3.0 0]) sets the velocity of an actor to the specified value.

    Actor pose, specified as a 4-by-4 matrix. Indicates the position and orientation of an actor in the RoadRunner Scenario coordinate system. See What Is a RoadRunner Pose Matrix? for more information.

    Example: Pose=[0.1694 0.9855 -0.0000 -90.7324; -0.9855 0.1694 -0.0000 -12.9314; -0.0000 0.0000 1.0000 -0.0000; 0 0 0 1.0000]

    Actor velocity in the x-, y- and z- directions, specified as a 1-by-3 vector. Units are in meters per second.

    Example: Velocity=[17.6216 3.0288 0.0000]

    Angular velocity of actor in the x-, y-and z- directions, specified as a 1-by-3 vector. Units are in radians per second.

    Example: AngularVelocity=[0.6216 0.0288 1.0000]

    Run-time pose of each wheel of actor, specified as a multidimensional 4-by-4-by-N array. N is the number of wheels of the vehicle-type actor.

    WheelPoses is set for wheels starting from the leftmost side on the front axle, moving to the right. After the first axle is complete, the leftmost wheel on the second axle is taken into consideration before moving to the right, and so on.

    Version History

    Introduced in R2022a