Main Content

setAttribute

Set runtime attribute of actor

    Description

    example

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

    Examples

    collapse all

    Set the pose of an actor.

    setAttribute(actorSim,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]

    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 a Simulink.ActorSimulation object.

    Example: setAttribute(actorSim,AngularVelocity=[0.4100 0.5000 0.0000])

    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, 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]) sets the pose of an actor to the specified value.

    Actor pose, specified as a 4-by-4 array. Indicates the position and orientation of an actor in the RoadRunner Scenario coordinate system.

    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]

    Runtime 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