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

How to republish tf as topic

asked 2011-12-19 04:15:39 -0500

tom gravatar image

updated 2011-12-19 04:41:01 -0500

I'd like to provide yaw-correction for my IMU algorithm running on an embedded platform using /map -> /base_link tf obtained via gmapping. For that I need yaw-angle as ROS topic, not a tf. I'd like to write a simple node to listen to tf's and republish the data as soon as it comes. I've read in some post the best way to do it would be subscribing to /tf-topic.

I'm assuming this is actually the best solution, so my main question is how to programatically subscribe to `/tf' and only react to certain tf being published. Do you know a good existing example of such behaviour? I'm also open to other suggestions.


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2011-12-19 04:31:51 -0500

DimitriProsser gravatar image

I'm not sure why you want to do it with a topic. tf provides a very simple method to find transforms, the TransformListener. This gives you the ability to always look up the most recent transform between two frames, which is what I believe you are trying to do.

If, for some reason, you HAVE to subscribe to /tf, you can write a node that has a subscriber to the /tf topic, checks the "header.frame_id" and "child_frame_id" fields and determines whether or not to republish based on that information.

edit flag offensive delete link more


Thanks, I'll try it. It has to be a topic, as I don't have means on my embedded platform to listen to tf's, just topics. Besides I have a very limited bandwidth so I have to limit data transfer to necessary minimum.
tom gravatar image tom  ( 2011-12-19 04:44:11 -0500 )edit
In that case, give option B a shot.
DimitriProsser gravatar image DimitriProsser  ( 2011-12-19 04:57:27 -0500 )edit

Question Tools


Asked: 2011-12-19 04:15:39 -0500

Seen: 1,309 times

Last updated: Dec 19 '11