Ask Your Question
0

How to republish tf as topic

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

tom gravatar image

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

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.

Cheers.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

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

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

Comments

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 imagetom ( 2011-12-19 04:44:11 -0600 )edit
In that case, give option B a shot.
DimitriProsser gravatar imageDimitriProsser ( 2011-12-19 04:57:27 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

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

Seen: 697 times

Last updated: Dec 19 '11