Ask Your Question
0

Help with Localization Algorithm

asked 2018-12-27 11:52:54 -0500

lovelife gravatar image

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!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2019-01-03 07:53:53 -0500

juanlu gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2018-12-27 11:52:54 -0500

Seen: 118 times

Last updated: Jan 03 '19