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

Is there a way to subscribe to tf data?

asked 2011-10-27 03:05:20 -0600

sebsch gravatar image

updated 2011-10-27 03:12:41 -0600

Up to now, I have used tf as described in the tutorial Writing a tf listener: Whenever I need some positions transformed, I just use lookupTransform.

I am considering using tf data to control a robot and would like the robot to react whenever new tf information becomes available, i.e. subscribe to tf data. Is this possible at all?

The only possible way I see at the moment is having a polling loop as shown in the tutorial. This is bad because it introduces latency (especially if I choose a low rate) and wastes cpu time (especially if I choose a high rate).

Is there really no different option?

edit retag flag offensive close merge delete


I'm interested in this as well. So far I used a workaround - publishing a on dummy topic every time I publish a new tf. Then I subscribe to the dummy topic and use it as a trigger to lookup the tf.
Ivan Dryanovski gravatar image Ivan Dryanovski  ( 2011-10-27 03:17:07 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2011-10-27 03:43:21 -0600

AHornung gravatar image

There is a topic "/tf" where tf information is published on as type tf/tfMessage (which contains the actual transforms). Why not subscribe to that? All tf information will be published on that topic however, so you may have to inspect the messages and only trigger your control on the right transforms.

edit flag offensive delete link more


Seems like I could not see the wood for the trees. Of course, this is exactly what I need. Thanks!
sebsch gravatar image sebsch  ( 2011-10-27 03:46:58 -0600 )edit
joan gravatar image joan  ( 2011-11-27 21:18:04 -0600 )edit

answered 2018-02-12 12:19:26 -0600

atom12 gravatar image

How do you do either of those things no clear guide anywhere.

edit flag offensive delete link more

Question Tools


Asked: 2011-10-27 03:05:20 -0600

Seen: 5,673 times

Last updated: Oct 27 '11