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

Parent TF frame in camera_pose_calibration

asked 2011-05-28 16:45:32 -0500

mkoval gravatar image

updated 2011-05-31 05:43:29 -0500

The individual calibrations are correct, but the calibration_tf_publisher saves all of the transforms relative to the /world frame (e.g. /world -> cam1 and /world -> /cam2 instead of /cam1 -> /cam2). The resulting TF tree is incorrect because /world is different for each pairwise calibration [1].

Is there any way I can save the transformation between the cameras without including the /world parent frame?

If I was calibrating three cameras (cam1 through cam3), I would calibrate cam1-cam2 and cam2-cam3 separately. Currently, the calibration_tf_publisher would save the following transforms:

  • /world-/cam1 (calibration 1)
  • /world-/cam2 (calibration 1)
  • /world-/cam2 (calibration 2)
  • /world-/cam3 (calibration 2)

Because the world frame is arbitrary and differs between the two calibrations, there are two conflicting transforms from /world to /cam2. I would prefer that calibration_tf_publisher directly publish the transformation between the cameras (with no /world intermediate):

  • /cam1-/cam2 (calibration 1)
  • /cam2-/cam3 (calibration 2)

I don't think this would cause any problems with multiple-camera calibration, either: all of the transforms could be published as children of the first camera.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2011-05-31 07:12:28 -0500

Wim gravatar image

You point out correctly that the camera_pose_calibration package only supports the case where all camera's simultaneously can see the same checkerboard target. The usecase where you calibrate different sets of camera's at different times is not well supported.

You could modify the calibration_tf_publisher (or the calibrator itself, either way works) to publish frames relative to one of the camera's you are calibrating. This can work, but be careful because the resulting code can easily be used wrongly: when you first calibrate cam1 -> cam2, and then you calibrate cam3 -> cam2, then cam2 will have two parent frames in tf (cam1 and cam3). This means the tf tree is invalid and you won't be able to do any meaningful tf queries. So to use your workaround correctly, you would have to calibrate cam1- -> cam2 first, and then cam2 -> cam3 (and not cam3 -> cam2).

It would be better to design a full solution to calibrate more distributed sets of camera's, but that would obviously be much more involved than the suggested workaround.

edit flag offensive delete link more


Thanks for the insight. I realized that forming cycles in the TF tree would be a problem, but hadn't considered a transform having multiple parents. I guess I will write a custom transform publisher for my specific use case.
mkoval gravatar image mkoval  ( 2011-06-01 15:55:04 -0500 )edit

answered 2011-05-31 02:17:51 -0500

Wim gravatar image

What do you mean with "/world is different for each pairwise calibration"? The poses of all the camera's are published relative to an arbitrary frame called "world". Every time you re-run the calibration, the world frame can be in a different location. The relative poses between the camera's should still be correct though.

It sounds like you would prefer the calibration_tf_publisher to have a different behavior. What kind of tf tree would you like to see? E.g. in the case you have 3 camera's cam1, cam2 and cam3, how would you like to see them connected? In any case, it is easy to write an alternative calibration_tf_publisher. When the calibration finishes, the result is published on the 'camera_calibration' topic. Based on the information from that topic, we can basically publish any tf tree you'd like.

edit flag offensive delete link more


I have edited my question with a three-camera example. I am considering modifying the calibrator to publish all of the transformations relative to /cam1 instead of /world. Why do you suggest modifying calibration_tf_publisher instead? Thanks for the reply!
mkoval gravatar image mkoval  ( 2011-05-31 05:50:35 -0500 )edit

Question Tools

1 follower


Asked: 2011-05-28 16:45:32 -0500

Seen: 554 times

Last updated: May 31 '11