Package Summary

Tags No category tags.
Version 0.12.5
License Apache License 2.0

Repository Summary

Checkout URI
VCS Type git
VCS Version eloquent
Last Updated 2020-02-12
CI status No Continuous Integration
Package Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

Has examples of using the tf2 Python API.

Additional Links

No additional links.


  • Tully Foote


  • Shane Loretz

Python examples for tf2

This package has examples for using the tf2_ros API from python. It shows how to broadcast and receive transforms between frames. The example transforms might be seen on a small two wheel robot.

Broadcasting Transforms

tf2 publishes two types of transforms: static and dynamic. Static transforms are constant, and never change once published. Dynamic transforms are frequently changing, and re-published every time the do.

Both broadcasters can be run with

ros2 launch examples_tf2_py broadcasters.launch.xml

ros2 run examples_tf2_py dynamic_broadcaster

This is an example of a dynamic transform publisher. Transforms showing the rotation of two wheels are published frequently.

ros2 run examples_tf2_py static_broadcaster

This is an example of a static transform publisher. The transforms to sensors on the robot are published once at startup, and then never changed.

Receiving Transforms

Transforms are broadcast to all listeners, who then use the data. If a transform is not immediately available then users of the data may choose to wait for it.

ros2 run examples_tf2_py waits_for_transform

This example blocks until a transform is received. It must be run with a MultiThreadedExecutor so the TransformListener can execute callbacks for it's subscriptions.

ros2 run examples_tf2_py async_waits_for_transform

This example uses coroutines to wait for a transform. The coroutine is suspended without blocking the executor, so it works with a SingleThreadedExecutor.

Frame Dumper

ros2 run examples_tf2_py frame_dumper

This example periodically outputs information about all frames it is aware of.


Changelog for package examples_tf2_py

0.12.5 (2020-01-17)

0.12.4 (2019-11-19)

  • Add Python examples for tf2_ros (#161)

Wiki Tutorials

See ROS Wiki Tutorials for more details.

Source Tutorials

Not currently indexed.

Dependant Packages

No known dependants.


No message files found.


No service files found


No plugins found.

Recent questions tagged examples_tf2_py at