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

How to send tf data from multiple namespaces to Rviz?

asked 2014-10-24 09:28:43 -0500

nickoe gravatar image

My setup: I have setup a launch file with two groups defining the namespaces for two robots, and launching rviz together with a joint_state_publisher, robot_state_publisher, ned_static_transform_publisher and a robot_description parameter.

The goal is to simulate multiple robots, each in its own namespace and visualize in Rviz.

Each robot sends tf transforms with sendTransform() from tf.TransformBroadcaster(), but they become the same /tf when seen in rqt_graph, and in rviz it means that my robot model is updating to the two robots seperatepositions, and not having a seperate model for each.

I have tried to used the tf_prefix, but that does not do any thing. I am using Indigo. I have found that it might be because that method is not valid since Hydro. See [1].

I have searched quite a bit around via google and directly on the , but only found older posts saying to use tf prefixes as , and also a lot saying that it does not work any more. But I have not found a solution. I have thought about writing another node that takes the poes from the two robots and let this send the transforms.

I hope someone has another and more elegant solution that the one I just proposed. Any pointers or help is appreciated.


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-10-24 10:23:59 -0500

dornhege gravatar image

The principle of the tf_prefix still works, but the implementation is different. AFAIK the currently recommended method is to simple name tf frames "correctly", i.e. robot_a's base_link frame should just be named /robot_a/base_link. The TF library is agnostic to that.

The robot_state_publisher however needs to prefix frames correctly. If it doesn't this won't work easily.

edit flag offensive delete link more


Ok, thank you for your reply. Would that mean that I should somehow make my node figure out what namespace it is in and prefix that to the frame id? Adn what should I modify for robot_state_publisher?

<node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
nickoe gravatar image nickoe  ( 2014-10-24 13:30:08 -0500 )edit

Ok, I did just that by making the node sending the tf prefix the frame id with the namespace using the method in I did nothing to robot_state_publisher.

nickoe gravatar image nickoe  ( 2014-10-26 08:32:06 -0500 )edit

Question Tools

1 follower


Asked: 2014-10-24 09:27:37 -0500

Seen: 2,316 times

Last updated: Oct 24 '14