Robotics StackExchange | Archived questions

switch between GPS and AMCL based on location

Background on my robot situation:

I would like to be able to use the NAV Stack relying on AMCL near the house, and then transition to using primarily the GPS when away from the house (the map is empty away from house so AMCL provides no location data there). GPS should be ignored near the house. There is nothing near the pool for laser scanner to see so must rely primarily on GPS around the pool.

Questions:

Have any of you had success with a NAV Stack setup that used different "weighting" on AMCL or GPS based on location within the map? If so, how did you approach?

Asked by billy on 2018-09-10 17:26:44 UTC

Comments

Answers

I don't have experience with this use case. But in an at least similar situation (having to run multiple SLAM algorithms simultaneously, but only using one), we did something I could imagine could help here as well.

I'm assuming you have both, navigation with amcl and navigation with GPS setup and working. I.e. both run perfectly fine seperatly. Also, you need to have the origin of both aligned.

The most important thing is to handle tf then. Best would be if you remap the tf output of the localization nodes to nirvana (something like tf_disabled) or disable it altogether (amcl has the tf_broadcast parameter). Then create a node that subscribes to both pose topics of your localization algorithms (i.e. amcl_pose and equivalent). With those two topics you have the relevant information in your node. Your node then needs to evaluate your conditions (whether if this is a simple "if-in-here-than-this-localization" check or something more fancy like weighted average with adjustable weight or even something like a Kalman-Filter with dynamic covariances) and publish the result on a topic and broadcast the relevant transform to tf.

There are still some issues that need to be resolved:

  • you should avoid larger jumps, as this could badly influence the navigation/path_planning within move_base.
  • If you use a static costmap layer, the origins are again important
  • if you want to do some gps fencing around the pool, this obviously needs to be handleded in path_planning as well.

Asked by mgruhler on 2018-09-11 01:09:59 UTC

Comments

Thanks mgruhler. I have nav with AMCL working. I will follow your advice and get GPS nav working stand alone. Then work through how to get them running side by side. I like the idea of GPS fencing. That should be easy to set up in a simple disable-robot-if-in-the-box way.

Asked by billy on 2018-09-11 11:50:56 UTC