Robotics StackExchange | Archived questions

Help with Localization Algorithm

Hello, I've been working on creating a simulation of an autonomous robot and I'm very new to ROS. Till now I've used Gmapping algorithm which successfully generates a 2D map now I need Localization algorithm to locate the robot. I tried using AMCL but the problem is I've to provide AMCL with a generated map for it to localize. Can anyone kindly help me what algorithm I can use which will generate map and localize and at the same time. I'm using hokuyo laser sensor on my robot.

Thank you!

Asked by lovelife on 2018-12-27 12:52:54 UTC

Comments

Answers

Hi, so two things here:

"What algorithm I can use which will generate map and localize and at the same time?"

You have already used it, GMapping. GMapping is a Simulatenous Localization And Mapping (SLAM) algorithm which does exactly what you are asking for; creates a map while localizing within it.

"The problem is I've to provide AMCL with a generated map for it to localize"

I feel this is actually the problem you want to solve (heard of the XY problem?). It is not necessary to be mapping all the time and that won't be even a good solution for some situations (p.e. you want the robot to move to an area that is out of reach for the sensors).

A more appropiate solution for your problem would be map_server:

  1. Generate a map using GMapping
  2. Save the map using map_server: rosrun map_server map_saver -f mapname
  3. Stop Gmapping
  4. Load the map using map_server: rosrun map_server map_server mapname.yaml
  5. Load AMCL

After you have mapped for the first time and saved the map you only need to do steps 4. and 5.

Asked by juanlu on 2019-01-03 08:53:53 UTC

Comments