ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
According to the documentation for tf2_msgs/TFMessage
(here), the transforms
field is a list/array, so you'll need to index into it:
geometry_msgs/TransformStamped[] transforms
Something like msg.transforms[0].transform.translation.x
.
But realise that you may receive multiple TransformStamped
s in a single message, so always using the first might not be what you want.