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 run 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, click here for some brief instructions .

  Show EOL distros: 

Create a file named ~/tutorials.rosinstall with the following content:

- other: { local-name: workspace }

To overlay on the ROS distro you are using:

rosinstall ~/tutorials /opt/ros/$ROS_DISTRO>> ~/tutorials.rosinstall

To use this workspace whenever you open a new terminal setup your ROS environment by typing:

source ~/tutorials/setup.bash

Sourcing this file adds ~/tutorials/workspace to your ROS_PACKAGE_PATH.

Any packages you create in that directory will be found by rospack.

An alternative to source your script file is to add it to your .bashrc, but remember that this will persist in your .bashrc into the future, and you can only have one environment setup. For more on what this is doing see this page

Create a catkin workspace like so:

$ source /opt/ros/$ROS_DISTRO/setup.bash
$ mkdir -p ~/tutorial_ws/src
$ cd ~/tutorial_ws
$ catkin_init_workspace src
$ catkin_make

And now source the setup file from the result-space, so that packages you add to this workspace's src folder will be findable by rospack, and the built binaries by rosrun and roslaunch:

$ source devel/setup.bash

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.

C++

Python

  1. Writing a tf2 static broadcaster (C++)

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

  2. Writing a tf2 broadcaster (C++)

    This tutorial teaches you how to broadcast coordinate frames of a robot to tf2.

  3. Writing a tf2 listener (C++)

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

  4. Adding a frame (C++)

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

  5. Learning about tf2 and time (C++)

    This tutorial teaches you to wait for a transform to be available on the tf2 tree when using the lookupTransform() function.

  6. Time travel with tf2 (C++)

    This tutorial teaches you about advanced time travel features of tf2

  7. Create Data Conversion Package (C++)

    This tutorial will teach you how to create the methods required to convert C++ datatypes using the tf2 convert methods.

  1. Writing a tf2 static broadcaster (Python)

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

  2. Writing a tf2 broadcaster (Python)

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

  3. Writing a tf2 listener (Python)

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

  4. Adding a frame (Python)

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

  5. Learning about tf2 and time (Python)

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

  6. Time travel with tf2 (Python)

    This tutorial teaches you about advanced time travel features of tf2

  7. Create Data Conversion Package (Python)

    This tutorial will teach you how to create the methods required to convert Python datatypes using the tf2 convert methods.

Debugging tf2

  1. Quaternion Basics

    The basics of quaternion usage in ROS.

  2. Debugging tf2 problems

    This tutorial gives a systematic approach for debugging tf2 related problems.

Using sensor messages with tf2

  1. Using Stamped datatypes with tf2_ros::MessageFilter

    This tutorial describes how to use tf2_ros::MessageFilter to process Stamped datatypes.

Setting up your robot with tf2

  1. Setting up your robot using tf

    This tutorial provides a guide to set up your robot to start using tf.

  2. tf を用いたロボットのセットアップ

    このチュートリアルでは tf を使ってロボットをセットアップする方法を学びます.

  3. 为你的机器人配置 tf

    This tutorial provides a guide to set up your robot to start using tf.

  1. Using the robot state publisher on your own robot

    This tutorial explains how you can publish the state of your robot to tf, using the robot state publisher.

  2. Utiliser le "robot state publisher" pour votre propre robot

    Ce tutoriel explique comment vous pouvez publier l'état de votre robot à tf, en utilisant le "robot state publisher".

  3. Using the robot state publisher on your own robot

    このチュートリアルでは robot state publisher を使うことで,どのようにしてロボットの状態を tf に publish できるのかを学びます.

Extending tf2

  1. Transforming your own datatypes

    This tutorial explains which methods you need to implement to make tf2 transform your own datatypes.

Migrating from tf1 to tf2

  1. Converting Datatypes

    This is a quick description of the changes in syntax for converting datatypes.

  2. Migrating a TransformListener from tf to tf2

    This is a guide for converting a tf TransformListener class to a tf2 Listener class

  3. Migrating a TransformBroadcaster from tf to tf2

    This is a guide for converting a tf TransformBroadcaster class to a tf2 Broadcaster class

Create a new tutorial:

Wiki: tf2/Tutorials (last edited 2017-05-11 22:13:35 by TullyFoote)