ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
If your message is called data
then you'd access the x
, y
, and z
components of the direction
attribute as:
x = data.direction.x
y = data.direction.y
z = data.direction.z
2 | No.2 Revision |
If your message is called data
then you'd access the x
, y
, and z
components of the direction
attribute as:
x = data.direction.x
y = data.direction.y
z = data.direction.z
You can access the attributes of messages by using the .
operator.
3 | No.3 Revision |
If your message is called data
then you'd access the x
, y
, and z
components of the direction
attribute as:
x = data.direction.x
y = data.direction.y
z = data.direction.z
This is assuming Python. You can access the attributes of messages by using the .
operator.operator. If you're using C++, replace the .
with a ->
.
4 | No.4 Revision |
If your message is called data
then you'd access the x
, y
, and z
components of the direction
attribute as:
x = data.direction.x
y = data.direction.y
z = data.direction.z
This is assuming Python. You can access the attributes of messages by using the .
operator. If you're using C++, replace the first .
with a ->
.. So it becomes
x = data->direction.x
y = data->direction.y
z = data->direction.z