How to run navigation and SLAM gmapping simultaneously

asked 2020-09-04 11:03:00 -0500

aditi741997 gravatar image

updated 2021-04-24 02:34:34 -0500

miura gravatar image

Hello everyone

I have been trying to run gmapping and navigation simultaneously, in simulation on gazebo. I am using the turtlebot3_slam.launch file to launch the gmapping slam, and for navigation, I have removed the amcl and map_Server lines in the turtlebot3_navigation.launch file. I am using default parameters, i.e. Local Costmap has static_map false and Global Costmap has static_map true. I first wanted to ask if Global Costmap should also have static_map = false. When I try to run them together, there are no errors, but the robot does not seem to navigate properly when I give random goals. Specifically, I tried giving goals such as x=0.3,y=0 , x=0,y=0.3 and the robot moves in the same way in both cases.

I think I am missing out on some parameters for navigation which should probably be different from default in tb3, since I am trying to use it with Slam in real time.

Any help would be greatly appreciated! Thanks.

edit retag flag offensive close merge delete

Comments

Iam not sure about this, but the usual setup takes in a already build map and goes from there, not updating the map along the way. This would mean you dont have a map at the beginning and it never updates, thus navigation has no map at all, being lost in space. I have seen other slam packages being used for slam navigation combined with exploration alghorythms, but not gmapping. This way or the other Iam highly confidenct that this would need much more tweeking of the nodes then just the mentioned launchfile alterations. At first I would try with an empty but existing map on the map server and see if this solves the x/y goal problem.

Dragonslayer gravatar image Dragonslayer  ( 2020-09-05 09:15:26 -0500 )edit

Thankyou for the response! I did see that for the global costmap [within navigation], if the static variable is true, it has a static layer plugin, which subscribes to the /map topic, i.e. there is a callback in the global costmap which is receiving the updated maps [being published by slam node], but probably the callback isnt really doing anything? I am referring to the incomingMap function in the static layer within costmap2dros. It would be great if it could be confirmed that navigation is not able to use the updated map...

aditi741997 gravatar image aditi741997  ( 2020-09-05 12:29:41 -0500 )edit

Also, could you point me to any slam + navigation + exploration package? I am planning to try nav2d, but it seems to be using stage for simulation which might not work on ros melodic/kinetic

aditi741997 gravatar image aditi741997  ( 2020-09-05 13:08:43 -0500 )edit

Iam not sure about the map topic. But in usual configuration one gets the map once from the map server, and thats it. I think its highly likely that you would have to enable the update map feature and configure navigation to subscribe and use it instead of just the map server. You only mentioned the "little" changes to the launchfile I expect that not to be enough for this very different usecase. I think to remember that slam packages with integrated odometry were used. rtabmap or cartographer for example. I dont know a package to point you to. But you really only need a exploration algo, should be easy to find.

Dragonslayer gravatar image Dragonslayer  ( 2020-09-06 10:20:10 -0500 )edit