ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Building tf_tree

asked 2018-02-01 06:37:14 -0500

JayDe gravatar image


I am somewhat confused on how to setup an appropriate tf tree for my application. I am using the iai_kinect2 package ( ) to run my kinect v2s. With the option "publish_tf" set to true, the bridge will publish the following transforms (sorry, cannot upload pictures):

  • camera1_link -> camera1_rgb_optical_frame -> camera1_ir_optical_frame
  • camera2_link -> camera2_rgb_optical_frame -> camera2_ir_optical_frame

I now calibrated my Kinects using images from the *_ir_optical_frame. So I thought I could include wolrd->camera1_ir_optical_frame and world -> camera2_ir_optical_frame into my tf tree. Which, since each frame is only allowed to have one parent, does not work as intended.

My question now is: What is the most elegant way of building the tf tree I want?


PS. I am using ROS1 Kinetic on a Ubuntu 16.04 machine (Ubuntu 4.4.0-31.50-generic 4.4.13)

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2018-02-03 02:35:11 -0500

NEngelhard gravatar image

The camera_link-frame is the parent frame of your camera-subtree so you should use this one to attach your camera to the tf-tree. You use the world->IR Transformation only as an intermediate result to compute the pose of the camera_link-frame relative to the world and then add the world->camera_link-Transformation to the tf-tree. so roughly T(world->camera_link) = T(world->IR) * T^-1(camera_link->IR)

edit flag offensive delete link more


Hi! Thanks, I suppose that is how you do it. Even though it introduces increased possibility for errors when the transformation between rgb and ir is not very good/precise.

JayDe gravatar image JayDe  ( 2018-02-05 02:19:05 -0500 )edit

You would have the same error for the rgb-camera if you use ir-frame as parent for the subtree.

NEngelhard gravatar image NEngelhard  ( 2018-02-05 03:48:08 -0500 )edit

answered 2018-02-02 10:22:17 -0500

I'm not quite sure I understand the problem, TF links a symmetric so as long as there aren't any circular links everything should work okay. Could you explain what you mean by 'does not work as expected' a little more?

edit flag offensive delete link more


In the setup I described above the *_ir_optical_frames would have two parents each, which seems to cause problems. The behavior I observed then was that the point clouds I wanted to watch - which are published in the *_ir_optical_frames - were only updated occasionally, felt like a huge lag.

JayDe gravatar image JayDe  ( 2018-02-05 02:22:09 -0500 )edit

Question Tools



Asked: 2018-02-01 06:37:14 -0500

Seen: 265 times

Last updated: Feb 03 '18