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

have send tf data from multiple robot in rviz

asked 2019-08-03 00:13:36 -0500

Usui gravatar image

updated 2022-04-17 11:06:24 -0500

lucasw gravatar image

ROS Kinetic:

I am using 2 robot and I am not sure how to display in in rviz with amcl. What I have is each robot has its own tf. I would do

<remap from="tf" to="tf1"/>

is that wrong? I think it is wrong because rviz can only take in one tf. I did some reading and it said instead to do.

<node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" >
<param name="tf_prefix" value="robot_0"/>


<node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" >
<param name="tf_prefix" value="robot_1"/>

Is one of these method right? Or is there another solution. Any help is appreciated! Thank you!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-08-06 12:53:03 -0500

luc gravatar image

Having multiple robots on the same roscore is a real tricky challenge. I'd recommend looking into how to solve that problem before you look into solving the TF problem. Additionally, AMCL will only localize one robot - so you won't be able to use the same instance of that program with more than one entity you're trying to localize.

See this post for a good amount of information:

Hope this helps!

edit flag offensive delete link more


That post is uses 2 robot with amcl also. I can get 2 robot using multi machine. Do you think tf_prefix in the robot_state_publisher be able to get 2 robot in an rviz? I just need to transform it to the same global frame.

Usui gravatar image Usui  ( 2019-08-06 13:09:53 -0500 )edit

They must have two separate AMCL processes running to localize the two robots. You may be able to use a container approach to run two roscores on one machine. Because of the way tf operates, I dont think the prefix alone will help reconcile having two robots on one roscore. Look at the API of the tf2 buffer - it does not look as if there is a way to specify the prefix here:

luc gravatar image luc  ( 2019-08-08 01:11:25 -0500 )edit

@luc Okay so I started on it and I have a problem. Here's the question:

Usui gravatar image Usui  ( 2019-08-08 12:43:55 -0500 )edit

@Usui I'll check out that question. If this answer helped you, please mark it as correct!

luc gravatar image luc  ( 2019-08-16 16:45:54 -0500 )edit

Question Tools



Asked: 2019-08-03 00:13:36 -0500

Seen: 470 times

Last updated: Aug 06 '19