setAttribute
Description
setAttribute(
sets the value of the specified runtime attribute for the actorSim
,Name=Value
)ActorSimulation
actor actorSim
. Using this command, you can set one runtime attribute at
a time.
Examples
Set Runtime 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
— Runtime pose of each wheel of actor
array
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
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 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)