examples_tf2_py package from geometry2 repoexamples_tf2_py geometry2 tf2 tf2_eigen tf2_geometry_msgs tf2_kdl tf2_msgs tf2_py tf2_ros tf2_sensor_msgs tf2_tools
|Tags||No category tags.|
|License||Apache License 2.0|
- 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.
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.
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
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
ros2 run examples_tf2_py frame_dumper
This example periodically outputs information about all frames it is aware of.