Multiple turtlebot3 navigation base_footprint to map solution
I worked with some colleagues to a university project that was aimed at simulating the navigation of multiple turtlebot3 on a single machine and (afterward) across three different PC. During the development of this project we faced the following problem:
[ WARN] [1413488778.937642524]: Waiting on transform from /base_footprint to /map to become available before running costmap, tf error: canTransform: target_frame map does not exist.. canTransform returned after 203.264 timeout was 0.1
Apparently, on the other ROSanswer questions there was no explicit solution, hence I would like to share what worked for us. The main problem was that the tf_tree was not connecting the odom frame of each robot to the map frame, they were like two separate and uncorrelated branches.
The solution was to remap 3 parameters inside two param files, that were by default set outside the namespace of the two robots. The above mentioned files are in the folder turtlebo3_navigation/param and are:
- localcostmapparams.yaml
- globalcostmapparams.yaml
Inside the first one:
global_fram: odom
robotbaseframe: base_footprint
Inside the second one:
- robotbaseframe: base_footprint
To not change such param files, we decided to create new amcl and move_base launch files (one for each robot) with the following modifications (only the modification are reported):
[In our case the namespaces were tb30 for the first robot, and tb31 for the second robot.]
amcltb30.launch
<param name="odom_frame_id" value="/tb3_0/odom"/>
<param name="base_frame_id" value="/tb3_0/base_footprint"/>
<param name="global_frame_id" value="/map"/>
amcltb31.launch
<param name="odom_frame_id" value="/tb3_1/odom"/>
<param name="base_frame_id" value="/tb3_1/base_footprint"/>
<param name="global_frame_id" value="/map"/>
movebasetb3_0.launch
<param name="global_costmap/robot_base_frame" value="tb3_0/base_footprint"/>
<param name="local_costmap/robot_base_frame" value="tb3_0/base_footprint"/>
<param name="local_costmap/global_frame" value="tb3_0/odom"/>
movebasetb3_1.launch
<param name="global_costmap/robot_base_frame" value="tb3_1/base_footprint"/>
<param name="local_costmap/robot_base_frame" value="tb3_1/base_footprint"/>
<param name="local_costmap/global_frame" value="tb3_1/odom"/>
Definitely, this is not the best solution, but it worked for our purposes. If you have to do a similar project, check our documentation, maybe you can find some hints, since we have explained step by step what we did.
https://github.com/francimala/ROS_multiple_navigation
I'm using ROS melodic and the Turtlebot3 packages.
Asked by francimala on 2019-05-11 12:36:44 UTC
Comments
Is this a question?
Asked by jayess on 2019-05-12 03:24:41 UTC
No, this is the solution that worked for us. If you have a more elegant one, please share it with us.
Asked by francimala on 2019-05-12 03:54:14 UTC
Hey! It would be better if you could post the question and answer separately in their given sections. This would let one know that such a problem has been answered, and people can recreate it.
Asked by parzival on 2019-06-10 02:16:17 UTC