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

TurtleBots 3 Burger: Multi robot SLAM IRL

asked 2022-06-02 10:17:42 -0500

learn2learn gravatar image

updated 2023-06-18 09:50:51 -0500

lucasw gravatar image

Hello,

I have a fleet of 4 TurtleBots and I want to make a multi robot SLAM mapping. I know that it is possible in Gazebo that each robots create a map and a higher program merge the maps but I want to do it with my real robots, do you know how to do that ?

Ps: I used ROS Noetic and already set up namespace for each robots

Thank you for any information!

Edit: I don't even manage to launch a slam program on one robot so I ask for your help too.

To set up my robots, i followed the following tutorial so basically when i launch the following command on my Tb:

ROS_NAMESPACE=tb3_1 roslaunch turtlebot3_bringup turtlebot3_robot.launch multi_robot_name:=tb3_1 set_lidar_frame_id:=tb3_1/base_scan

I get the following tf tree, node graph and topics: image description image description image description

After i launch on my computer:

ROS_NAMESPACE=tb3_1 roslaunch turtlebot3_slam turtlebot3_slam.launch multi_robot_name:=tb3_1

and a tf problem appear, the map tf connect to odom tf and not to tb3_1/odom image description image description image description and a warning message tell me that there is a problem with odom (logic because it should be tb3_1/odom):

[WARN ] [1654781371.592635721]: MessageFilter [target=odom ]: Dropped 100.00% of messages so far.

I tried to do it step by step to find the problem by launching on my computer:

ROS_NAMESPACE=tb3_1 roslaunch turtlebot3_bringup turtlebot3_remote.launch multi_robot_name:=tb3_1

and after:

ROS_NAMESPACE=tb3_1 roslaunch turtlebot3_slam turtlebot3_gmapping.launch set_odom_frame:=tb3_1/odom

and i got a nice tf but still warning message and no data in the map topics: image description image description image description with the warning message:

[WARN ] [1654783298.853778784]: MessageFilter [target=odom ]: Dropped 100.00% of messages so far.

From there i tried a lot of thing like edit the parameters in the config files (create save of the originals and replace modified one by the saved one after test), removing ROS_NAMESPACE or modifying parameters but nothing work

Do you have any idea ?

Ps: I don't why but now i can't launch the slam program even without namespace.

edit retag flag offensive close merge delete

Comments

Comment on your question, could you not post the errors as images, but simply copy them and add them as code? The images are now only readable if opened in a separate tab, which is a bit annoying.

EDIT also, please add the commands you run as code too. It makes it easier to follow.

Joe28965 gravatar image Joe28965  ( 2022-06-09 09:23:10 -0500 )edit
1

Thanks for your comment, I didn't see that the warning image were no readable. I write the warning message and change the command as code

learn2learn gravatar image learn2learn  ( 2022-06-09 10:42:37 -0500 )edit

Thank you for the edit!

Joe28965 gravatar image Joe28965  ( 2022-06-09 11:51:07 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2022-06-09 09:24:19 -0500

Joe28965 gravatar image

Could you check the time of your turtlebot for me? I'm wondering if there is a time difference, which is causing the problem. Also, you should definitely run the command that gets you the full TF.

edit flag offensive delete link more

Comments

you're right, the Tb time was not the good one. Now the slam program without namespace and multiple_robot works again! How ever when i tried with namespace (like tb3_1) it still doesn't work

learn2learn gravatar image learn2learn  ( 2022-06-09 11:35:17 -0500 )edit

Do you get a new error?

Joe28965 gravatar image Joe28965  ( 2022-06-09 11:49:16 -0500 )edit

I get the following message from the remote program:

[ WARN] [1654851032.923551807]: MessageFilter [target=tb3_1/odom ]: Dropped 100.00% of messages so far. Please turn the [ros.gmapping.message_filter] rosconsole logger to DEBUG for more information.

What i find weird is in TF tree, the fact that the tf 'under' tb3_1/base_footprint seems to be establish but there is no communication (Average rate:10000.0 and Buffer lenght:0)

learn2learn gravatar image learn2learn  ( 2022-06-10 03:53:09 -0500 )edit

Could you actually check that your imu and laserscan also use tb_1/imu_link and tb_1/base_scan respectively?

RViz should also open if you run gmapping. You should be able to see the lidar data (if you set global frame to base_link)

Joe28965 gravatar image Joe28965  ( 2022-06-13 01:18:26 -0500 )edit

There is no problem with the IMU, it uses the frame tb3_1/imu_link but, the laserscan still use base_scan and not tb3_1/base_scan. I already spotted this problem but when I start turtlebot3_robot, i specify the parameter: set_lidar_frame_id:=tb3_1/base_scan

learn2learn gravatar image learn2learn  ( 2022-06-13 06:48:33 -0500 )edit

Yes, then I think that's your issue. It's basically not able to place your sensor data in your TF. However, instead of saying that it starts to complain about odom. Could you check that you get the same error when you run roslaunch turtlebot3_bringup turtlebot3_lidar.launch set_frame_id:=tb3_1/base_scan (on your turtlebot).

Joe28965 gravatar image Joe28965  ( 2022-06-13 07:18:13 -0500 )edit

I tried and the laserscan still depends of the base_scan frame and not of tb3_1/base_scan frame, i will check in the config file to understand why it doesn't take into account my arguments

learn2learn gravatar image learn2learn  ( 2022-06-13 08:07:36 -0500 )edit

If you have the new lidar (in comparison to the old lidar), it doesn't seem to have the ability to set the frame_id. At least as far as I can see (in this line).

However, they have been using this new one since 2022. Unless you have a brand new one, you're probably good.

Joe28965 gravatar image Joe28965  ( 2022-06-13 09:06:19 -0500 )edit
0

answered 2022-06-14 03:45:12 -0500

learn2learn gravatar image

Okay so thanks to Joe, i found a solution to launch the slam program with multiple turtlebots:

1) Check that the TB clock is sync with your computer one, if not use the command:

ssh [user_name]@[tb3_ip_adress] sudo date -s $(date -Ins)

2) On the turtlebot, go to ~/catkin_ws/src/ld08-driver/src and open the file ld08_driver.cpp. Find the line with scan.header.frame.id = "base_scan" and change it to scan.header.frame.id = "tb3_1/base_scan". Do a catkin_make after

3) On your computer go to to your ROS repository (in my case /opt/ros/noetic) and open share/turtlebot3_slam/launch/turtlebot3_slam.launch.

Under: <arg name="multi_robot_name" default=""/>

Add:

<arg name="get_base_frame" default="base_footprint"/>

<arg name="get_odom_frame" default="odom"/>

<arg name="get_map_frame" default="map"/>

Under: <arg name="configuration_basename" value="$(arg configuration_basename)"/> (in the include SLAM )

Add:

<arg name="set_base_frame" value="$(arg get_base_frame)"/>

<arg name="set_odom_frame" value="$(arg get_odom_frame)"/>

<arg name="set_map_frame" value="$(arg get_map_frame)"/>

After, you just need to do:

1) (on your computer) Launch roscore

2) (On each Turtlebot) Launch ROS_NAMESPACE=tb3_1 roslaunch turtlebot3_bringup turtlebot3_robot.launch multi_robot_name:=tb3_1 set_lidar_frame_id:=tb3_1/base_scan (change tb3_1 with your Tb name)

3) (on your computer) Launch ROS_NAMESPACE=tb3_1 roslaunch turtlebot3_slam turtlebot3_slam.launch get_base_frame:=tb3_1/base_footprint get_odom_frame:=tb3_1/odom multi_robot_name:=tb3_1 (change tb3_1 with the Tb name you want to control)

It should launch Rviz and display the mapping. There will be an error with the Robot Model, just go to Robot Model>TF prefix and add tb3_1. With this, i managed to do simultaneously a mapping with my Tb #1 and my Tb #2 without any trouble (as for the Tb #1 don't forget to modified the TF prefix in the robot model in Rviz for the Tb#2 !

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2022-06-02 10:17:42 -0500

Seen: 387 times

Last updated: Jun 14 '22