setAttribute
Description
setAttribute(
sets the value of the specified run-time attribute for the
actorSim
,Name=Value
)ActorSimulation
actor actorSim
. Using this command,
you can set one run-time attribute at a time.
Examples
Set Run-time Attributes of Actor
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
actorSim
— Actor
ActorSimulation
object
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.
Pose
— Actor pose
4-by-4 matrix
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]
Velocity
— Actor velocity
1-by-3 vector
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]
AngularVelocity
— Angular velocity of actor
1-by-3 vector
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]
WheelPoses
— Run-time pose of each wheel of actor
array
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
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)