You're reading the documentation for a development version. For the latest released version, please have a look at Galactic.

tf2 Tutorials

Many of the tf2 tutorials are available for both C++ and Python. The tutorials are streamlined to complete either the C++ track or the Python track. If you want to learn both C++ and Python, you should go through the tutorials once for C++ and once for Python.

Workspace setup

If you have not yet created a workspace in which to complete the tutorials, follow this tutorial.

Learning tf2

  1. Introduction to tf2.

    This tutorial will give you a good idea of what tf2 can do for you. It shows off some of the tf2 power in a multi-robot example using turtlesim. This also introduces using tf2_echo, view_frames, and rviz.

  2. Writing a tf2 static broadcaster (Python) (C++).

    This tutorial teaches you how to broadcast static coordinate frames to tf2.

  3. Writing a tf2 broadcaster (Python) (C++).

    This tutorial teaches you how to broadcast the state of a robot to tf2.

  4. Writing a tf2 listener (Python) (C++).

    This tutorial teaches you how to use tf2 to get access to frame transformations.

  5. Adding a frame (Python) (C++).

    This tutorial teaches you how to add an extra fixed frame to tf2.

  6. Learning about tf2 and time (Python) (C++).

    This tutorial teaches you to use the timeout in lookup_transform function to wait for a transform to be available on the tf2 tree.

  7. Time travel with tf2 (Python) (C++).

    This tutorial teaches you about advanced time travel features of tf2.

Debugging tf2

  1. Quaternion fundamentals.

    This tutorial teaches you basics of quaternion usage in ROS 2.

  2. Debugging tf2 problems.

    This tutorial teaches you about a systematic approach for debugging tf2 related problems.