Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

From Programming Robots with ROS: A Practical Introduction to the Robot Operating By Morgan Quigley, Brian Gerkey, William D. Smart:

Instead of using a normally distributed initial pose, you can get amcl to use a uniform set of candidate poses, scattered all over the map. You might do this if you really dont have a good idea of where the robot is. However, this makes it (much) harder for the algorithm to converge on a good pose estimate, so you should only do this if you really dont know where the robot is starting. you can enable this behaivoir by asking a service call to the global_localization service, using an empty request of type std_srvs(Empty).

To call that service from the command line:

$ rosservice call /global_localization "{}"

Then the robot can be positioned by rotating it. Of course, you can move around too, but the method of rotation will allow the particles to converge quickly.

Next, it's best to clear the cost map because they may contain incorrect information due to the initial wrong location.

$ rosservice call /move_base/clear_costmaps "{}"