ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

You actually linked to the API documentation, which you should definitely read through AFTER going through the tutorials http://wiki.ros.org/tf/Tutorials.

A transform represents a transformation from frame A to frame B. So could you be more specific about what you mean by 'calculating its pose'. If you mean get the vectors representing the translation and rotation from A to B, there's a few ways (in C++ anyways, python will be somewhat similar):

1&2) First waitForTransform, to make sure the transform is available.

1) lookupTransform, then getOrigin and getRotation on the transform object

2) Initialize a Stamped<pose> in frame B with a position vector of (0,0,0), and a quaternion of (0,0,0,1), then transformPose to frame A.


tf::poseStampedTFToMsg and similar are helper methods in C++ to convert between the tf and ROS message representation of various objects. A tf representation is used to perform actual mathematical operations, while the ROS message representation is used for communication (publishing/subscribing/broadcasting tf).

A Pose contains a position and an orientation, a Stamped<pose> also contains frame and time information needed to transform the pose from one frame to another. Similar pattern applies to vectors, quaternions etc.