# 5. Transform Trees and Odometry¶

## 5.1. Learning Objectives¶

In this example, we will learn to

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

• Publish an articulation tree on TF

• Odometry Publisher

Prerequisite

## 5.2. TF Tree Publisher¶

### 5.2.1. TF Publisher¶

Assuming you’ve already gone through the ROS camera tutorial and have two cameras on stage already, let’s add those cameras to a TF tree, so that we can track the camera’s position in the global frame.

1. In a new or existing Action Graph window, add a ROS1 Publish Transform Tree node, and connect it up with On Playback Tick and Isaac Read Simulation Time, like the image below.

2. In the Property tab for the ROS1 Publish Transform Tree node, add both Camera_1 and Camera_2 to the targetPrims field.

3. Examine the 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.

### 5.2.2. Articulation 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.

Important

If you find that the generated tf tree for an articulated robot chose the wrong link as the root link, use the following step to manually select the articulation root link. This is commonly seen when importing robots using the URDF Importer with “Merge Fixed Link” checked, as well as for mobile robots.

• Select the robot’s root prim on the Stage Tree, in its “Raw USD Properties” tab, find the “Articulation Root” Section. Delete it by click on the “X” on the right upper corner inside the section.

• Select the desired link on the Stage Tree, inside its “Raw USD Properties” Tab, click on the +ADD button, and add Physics > Articulation Root.

### 5.2.3. 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.

## 5.3. Odometry Publisher¶

To setup Odometry publisher, compose an Action Graph that matches the following image.

In the Property tab for the Isaac Compute Odometry Node, add the Turtlebot to its Chassis Prim input field. This node calculates the position of the robot. Its output is fed into both a publisher for the /odom Rostopic, and a TF publisher that publishes the singular transform from /odom frame to /base_link frame.

## 5.4. Summary¶

This tutorial covered

• TF publisher to publish sensors and full articulation trees

• Raw TF publisher to publish individual transforms

• Odometry Publisher

### 5.4.1. Next Steps¶

Continue on to the next tutorial in our ROS Tutorials series, Teleport Service, to learn how to use the Teleport Service ROS Bridge.