Running Gmapping and Nav Stack at same time

319 views
Skip to first unread message

Camp Peavy

unread,
Oct 3, 2017, 4:26:30 AM10/3/17
to HomeBrew Robotics Club
    On the Neato with Pi/ROS I'm running gmapping and the navigation stack (move_base and amcl) at the same time (base_only on robot). I get some jitter, that is the local costmap and sometimes the robot-model in rvis flicker between two points but the robot seems to navigate okay and when it goes into an unknown environment it starts mapping which is very cool! The map is as good... as good as regular gmapping anyway.
 
Thanks,
Camp

Jeff Sampson

unread,
Oct 3, 2017, 10:28:18 PM10/3/17
to hbrob...@googlegroups.com
If you are running gmapping and navigation at he same time then I believe that you don't want to run AMCL. The gmapping provides localization and the two will fight, which will cause jitter.So give it a try without starting AMCL and see if it still runs. If it runs then see if it acts more stable.

- Jeff Sampson



From: 'Camp Peavy' via HomeBrew Robotics Club <hbrob...@googlegroups.com>
To: HomeBrew Robotics Club <hbrob...@googlegroups.com>
Sent: Tuesday, October 3, 2017 3:26 AM
Subject: [HBRobotics] Running Gmapping and Nav Stack at same time

Camp Peavy

unread,
Oct 4, 2017, 3:17:50 PM10/4/17
to hbrob...@googlegroups.com
... great suggestion, Jeff. That may be why the rviz image keeps flickering back and forth. I'll try it and get back.
 
Thanks,
Camp


From: Jeff Sampson <jsam...@pobox.com>
To: "hbrob...@googlegroups.com" <hbrob...@googlegroups.com>
Sent: Tuesday, October 3, 2017 7:28 PM
Subject: Re: [HBRobotics] Running Gmapping and Nav Stack at same time

--
You received this message because you are subscribed to the Google Groups "HomeBrew Robotics Club" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hbrobotics+...@googlegroups.com.
To post to this group, send email to hbrob...@googlegroups.com.
Visit this group at https://groups.google.com/group/hbrobotics.
For more options, visit https://groups.google.com/d/optout.


Camp Peavy

unread,
Oct 5, 2017, 1:27:29 AM10/5/17
to hbrob...@googlegroups.com
Jeff,
So killing "amcl" stopped the flickering... and the robot mapped and navigated pretty well but I lost the ability to set a pose in rviz (probably an rviz setting). Regardless... great suggestion. Will fiddle more...
 
- Camp


From: 'Camp Peavy' via HomeBrew Robotics Club <hbrob...@googlegroups.com>
To: "hbrob...@googlegroups.com" <hbrob...@googlegroups.com>
Sent: Wednesday, October 4, 2017 12:17 PM

Camp Peavy

unread,
Oct 13, 2017, 5:45:22 PM10/13/17
to hbrob...@googlegroups.com
    So killing "amcl" stopped the flickering in rviz but I don't seem to be able to set a pose. I poked through rviz and didn't see anything that stood out as applicable to setting the pose (unselected topics and so forth). So if you want to start from scratch and expect to continuously explore "unknown space" running "gmapping" and "move_base" is the way to go but if you're going to be navigating a known space for a long time move_base and amcl is preferable as you may need to periodically relocalize with "2D Pose Estimate". Also continously running the mapper is nice if you have to go into unknown territory but if the space is known you're better off working with a static map because it is more stable.
 
Thanks,
Camp


From: 'Camp Peavy' via HomeBrew Robotics Club <hbrob...@googlegroups.com>
To: "hbrob...@googlegroups.com" <hbrob...@googlegroups.com>
Sent: Wednesday, October 4, 2017 12:17 PM

Ralph Gnauck

unread,
Oct 13, 2017, 7:38:48 PM10/13/17
to hbrob...@googlegroups.com
Camp,
I don't think you are going to get very far trying to do incremental mapping using gmapping, it was just not designed  to support that.

Also running AMCL and gmapping together does not work, they conflict (as you have noticed) by both trying to publish the pose and TF of the robot and they will not agree so the robot will jump between the two estimates.

A better solution would be to try using cartographer instead of gmapping, I believe it can do some level of incremental updates to existing maps.
At least it will add on to an existing map - it wont update the already mapped bit just add to it.

You can find info on cartographer here:






Unfortunately cartographer is harder to use and not as well tried - I have not tried doing the incremental stuff yet, probably a task for the group to work on.

I think to use the feature you would call the write_state service (see ROS API documentation above)  to save an existing map (it is not saved in same format as gmapping).

Then when you start it again next time pass the file name via the --map_filename parameter to have it reload the old map and start mapping against it and adding new paths

As I said I have not tried this yet so you mileage will vary.



good luck

Ralph G.




From: 'Camp Peavy' via HomeBrew Robotics Club <hbrob...@googlegroups.com>
To: "hbrob...@googlegroups.com" <hbrob...@googlegroups.com>
Sent: Friday, October 13, 2017 2:45 PM

Ralph Gnauck

unread,
Oct 13, 2017, 8:18:51 PM10/13/17
to hbrob...@googlegroups.com
Ok,
So I don't think my last message actually solves your problem regarding setting a poses while mapping.

I am not sure it is a good idea to try really as it will confuse the SLAM mapping  and anyway currently gmapping (and looks like also cartographer) do not support this.

It works when using rviz and AMCL by sending a 'pose' message on the  '/initialpose' topic.

Using the 2D pose estimate button in rviz, it will publish the 'pose' message, and AMCL will listen to it and adjust its global estimate to match.

gmapping has does not implement listening to this message so will not update its pose.

So long as you are running nav stack and  have the robot correctly located when also running gmapping (and probably cartographer,) and it has not got lost, it should go to a target if you send a 2D nav goal from rviz. It should continue to update the map as it goes.

I think what you are saying is that you have discovered this from you own experiments so this should verify that this is how it should work from my understanding of how these nodes work.

As far as I know this is what we have for basic ROS right now - there is some  research work on going to make it better but I think 'lifetime mapping'  (that is continuously updating a map while you live and navigate by it)  is still a work in progress for ROS.
 
Ralph



From: Ralph Gnauck <ralp...@pacbell.net>
To: "hbrob...@googlegroups.com" <hbrob...@googlegroups.com>
Sent: Friday, October 13, 2017 4:38 PM

Camp Peavy

unread,
Oct 14, 2017, 11:19:24 PM10/14/17
to hbrob...@googlegroups.com
I really appreciate your comments, Ralph. I'll have to try "cartographer". I also want to try "hector_slam". Having some fun.
 
- Camp



Sent: Friday, October 13, 2017 5:18 PM
Reply all
Reply to author
Forward
0 new messages