4. Transform Trees

4.1. Learning Objectives

In this example, we will learn to

  • Add a TF publisher to publish the camera positions as part of the TF tree.

  • Publish pose of objects relative to the camera

Prerequisite

4.2. Add a TF Publisher

Let’s add cameras to a TF tree, so that we can track the camera’s position in the global frame.

  • Create -> Isaac -> ROS -> Pose Tree to add the TF tree rostopic. At this point, it is not connected to any particular object, therefore the publisher isn’t publishing. We need to add the objects to the TF tree topic so that it can calculate the corresponding transforms and publish them.

  • To add the cameras to the TF tree, open the newly added ROS_PoseTree, in its Raw USD Properties, add both Camera_1 and Camera_2 to the targetPrims field.

  • Examine the raw transform tree in a ROS-enabled terminal: rostopic echo /tf. You should find both cameras on the TF tree. Move the camera around inside the viewport and see how the camera’s pose changes.

Robot Linkage Transforms

To get the transforms of each linkage on an articulated robot, add the robot’s articulation root to the targetPrims field. All the linkages subsequent to the articulation root will be published automatically. Add /World/turtlebot3_burger to the targetPrims field, and see that the transforms of all the links of the robot, fixed or articulated, will be published on the /tf topic.

Publish Relative Transforms

By default, the transforms are in reference to the world frame. You can check that the /base_link transform of the turtlebot is published relative to the /World. If you wish to get the transforms relative to something else, such as a camera, make sure to indicate that in the parentPrim field. Add Camera_1 in the parentPrim field, Stop and Play the simulation between property changes, and you can see that the /base_link transform is now relative to Camera_1. You can choose to publish multiple transform trees to the same /tf rostopic, or you can change the name of the rostopic and start a separate one.

4.3. Summary

4.3.1. Next Steps

Continue on to the next tutorial in our ROS Tutorials series, April Tags, to learn how to detect April Tags.