Ask Your Question
0

How to send tf data from multiple namespaces to Rviz?

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

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 answers.ros.org , 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.

[1] http://answers.ros.org/question/12877...

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

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

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

Comments

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 imagenickoe ( 2014-10-24 13:30:08 -0600 )edit

Ok, I did just that by making the node sending the tf prefix the frame id with the namespace using the method in http://answers.ros.org/question/62620... I did nothing to robot_state_publisher.

nickoe gravatar imagenickoe ( 2014-10-26 08:32:06 -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

1 follower

Stats

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

Seen: 1,381 times

Last updated: Oct 24 '14