How to connect TF for multiple robots in SLAM

asked 2016-10-24 15:58:45 -0600

arttp2 gravatar image

updated 2016-10-25 07:14:50 -0600

Update2: After making the changes mentioned in the comment about rosparams, I was able to generate the following TF tree. image description

Yet the map is not getting constructed the way it does for the single robot. Like I am using the stage sim of the navigation_stage package in Indigo


No transform from [robot_0/map] to [map]

After resolving the issue of base scan as mentioned in my comment, i am not able to get a common correct map.


I have 3 pr2 in Stage Simulator trying SLAM. Single Robot version works correctly but tweaking the same launch files and world files seems to launch correctly expect it does not show the laser scans in RViz.

Here is the laser scan error:

For frame [/robot_0/base_laser_link]: No transform to fixed frame [map]. TF error: [Could not find a connection between 'map' and 'robot_0/base_laser_link' because they are not part of the same tree.Tf has two or more unconnected trees.]

I am also attaching the output of rosrun tf view_frames which will clarify the issue here. image description

Please let me know how to join the odom from individual to global tf frame such that all the robots can simultaneously project their scans in Rviz

edit retag flag offensive close merge delete



You should broadcast a couple transforms from map to robot_x/odom as well, so everything can be connected

huanxiner gravatar image huanxiner  ( 2016-10-24 16:39:08 -0600 )edit

I added the following lines in the launch file after the slam_gmapping node command

<param name="odom_frame" value="robot_1/odom"/>
<param name="base_frame" value="robot_1/base_link" />

This connected the tree. I still have not yet resolved the issue of common map

arttp2 gravatar image arttp2  ( 2016-10-24 17:25:25 -0600 )edit

What exactly is your problem after update 2? Anyways other than tweaking the launch file, I would just open up a few terminals and try publishing static transforms and see what works.

rosrun tf static_transform_publisher 0 0 0 0 0 0 map robot_x/odom 100

something like that.

huanxiner gravatar image huanxiner  ( 2016-10-25 13:34:54 -0600 )edit

According to the image in Update 2, the transform from map to odom (robot_x) exists. Is it even feasible to carry out independent SLAM from 2 different robots in the same .world and visualize it in the same Rviz console. This is what I want to do.

arttp2 gravatar image arttp2  ( 2016-10-26 14:18:32 -0600 )edit

Did this ever get resolved? What were the steps were taken?

cwillia109 gravatar image cwillia109  ( 2020-02-14 09:59:17 -0600 )edit