tf is a package that lets the user keep track of multiple coordinate
frames over time. tf maintains the relationship between coordinate
frames in a tree structure buffered in time, and lets the user
transform points, vectors, etc between any two coordinate frames at
any desired point in time.
Migration: Since ROS Hydro, tf has been "deprecated" in favor of tf2. tf2 is an iteration on tf providing generally the same feature set more efficiently. As well as adding a few new features.
As tf2 is a major change the tf API has been maintained in its current form. Since tf2 has a superset of the tf features with a subset of the dependencies the tf implementation has been removed and replaced with calls to tf2 under the hood. This will mean that all users will be compatible with tf2. It is recommended for new work to use tf2 directly as it has a cleaner interface. However tf will continue to be supported for through at least J Turtle.
tf is a library for keeping track of coordinate frames. There are both C++ and Python bindings.
For most ROS use cases, the basic tf::Transformer library is not used directly.
There are two helper classes to provide sending and recieving of ROS transform messages. tf::TransformBroadcaster and tf::TransformListener.
The tf::TransformListener class inherits from tf::Transformer to provide all the functionality of the basic library. In addition, it provides methods to transform data ROS messages directly and it automatically listens for transforms published on ROS.
The tf::MessageFilter is the recommended method for receiving almost any sensor data from ROS. Data in ROS can be published with respect to any known frame. The tf::MessageFilter class makes it easy to use this data by providing callbacks only when it is possible to transform it into your desired target frame.
The tf::MessageFilter class can subscribe to any ROS datatype that has a ROS Header.
The tf::TransformBroadcaster class is the complement to the tf::TransformListener class. The broadcaster class provides a simple API for broadcasting coordinate frame transforms to other ROS nodes.
The send_transform command is the easiest way to report transforms for fixed offsets. It is a simple command-line utility that repeatedly publishes the fixed-offset transform to ROS.
Data Types used in tf
- Quaternion typedef of btQuaternion
- Vector3 typedef of btVector3
- Point typedef of btVector3
- Transform typedef of btTransform
- Pose typedef of btTransform
-Stamped version of all of the above inherits from the data type and also has:
- ros::Time stamp_
- std::string frame_id_
- std::string child_frame_id_ (only used for Stamped<Transform> )
There are analogous ROS messages in std_msgs to the Stamped data types.