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

tf re-boadcaster

asked 2012-02-08 05:02:04 -0500

baxelrod gravatar image

I would like a way to publish tf transforms, but using a standard ros::Publisher instead of the tf::TransformBroadcaster. (I won't go into the reasons why).

The only way I think this can be done is to publish stamped transforms on a designated topic, then having a second node which subscribes to this topic and simply re-publishes them with the transform broadcaster.

Any other ideas? Is there a standard node that does this already? (I know about the robot_state_publisher which almost fits my needs).

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2012-02-08 13:39:29 -0500

tfoote gravatar image

I'm not sure I'm entirely clear on your use case. I've commented on @Pablo Iñigo Blasco answer that you can easily implement the tf protocol. It's just publishing a tf/TFMessage on the /tf topic.

You can publish it yourself on a topic of your choice, and populate the message yourself using a standard ros::Publisher just as done inside the TransformBroadcaster does internally. See the source code, ~ 30 lines

edit flag offensive delete link more


Thanks for the pointer to the code. That is kind of what i expected to see after i did some initial testing. Simply publishing to /tf won't work for me because i will have multiple nodes.
baxelrod gravatar image baxelrod  ( 2012-02-09 00:50:24 -0500 )edit

answered 2012-02-08 06:03:55 -0500

You said that you wanted to use ros::Publisher to send tf messages. That's of course possible.

It is not clear what you want to do. In any case it sounds like the tf_remap node could be useful for you. If the first node publishes on a topic ie: /my_tf then the tf_remap node could republish each message of this topic to the /tf topic.

edit flag offensive delete link more


Your post makes me think, what is the difference between using the tf::TransformBroadcaster and publishing to the /tf topic?
baxelrod gravatar image baxelrod  ( 2012-02-08 06:34:26 -0500 )edit
There's nothing especially fancy inside the tf::TransformBroadcaster, it's only ~30 lines . Source here: The tf_prefix stuff is deprecated and you could ignore it. And the rest is just helper accessors.
tfoote gravatar image tfoote  ( 2012-02-08 13:34:27 -0500 )edit

Question Tools


Asked: 2012-02-08 05:02:04 -0500

Seen: 476 times

Last updated: Feb 08 '12