5.3.4 Simple APIs of tf2_ros

Course subject(s) Module 5. Robot Vision

In this lecture, we will learn about a few simple APIs of the tf2_ros package.

Simple API commands:

  • TF Buffer: Cache transform information
      • tf2_buffer = tf2_ros.Buffer() # Default 10.0 s
      • tf2_buffer = tf2_ros.Buffer(rospy.Duration(<desired_duration>)
  • TF Listener: Sunscribes to the /tf topic
      • tf2_listener = tf2_ros.TransformListener(tf2_buffer)
  • Transform pose
      • tf2_buffer.lookup_transform()
      • tf2_buffer.transform()

TF Buffer: concept

  • tf2_buffer stores information for specified duration
      • Stores tf messages of the /tf topic
      • Buffer always has the latest transform information
      • Resolves almost all errors
Creative Commons License
Hello (Real) World with ROS - Robot Operating System by TU Delft OpenCourseWare is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Based on a work at https://online-learning.tudelft.nl/courses/hello-real-world-with-ros-robot-operating-systems//.
Back to top