Robotics StackExchange | Archived questions

Navigation map and laser resolution

Hi,

I recently changed my map resolution from 0.05 to 0.025 by resizing the .pgm image. I also edited the .yaml file and the global and local costmap resolutions. However, when I run amcl_demo.launch, the laser scans from my RPLidar still detects and inflate obstacles with a resolution of 0.05 (from what I see on RVIZ). As a result, the scans do not coincide with the pre-built map and the robot is unable to localize itself. Is there a way to change the resolution so that the laser scans will match the map?

Thanks in advance!

Asked by Rayner on 2017-02-04 10:43:22 UTC

Comments

AMCL doesn't inflate obstacles; maybe you're looking at the obstacle costmap from move_base?

Asked by ahendrix on 2017-02-05 01:11:19 UTC

Sorry, I've edited the question. Hopefully it makes sense now.

Asked by Rayner on 2017-02-05 12:58:08 UTC

AMCL doesn't use the inflated obstacle map either; it just uses the raw map published by the map_server. In fact, if this is just a localization problem you should be able to debug it without running move_base at all.

Asked by ahendrix on 2017-02-05 14:00:48 UTC

Oh I see. Maybe these 2 screenshots can help you understand my problem. The scans do not coincide w map probably due to the diff in resolution

laser scan: https://www.dropbox.com/s/spyktnmui745o79/laser%20scan%202.png?dl=0 laser scan 1: https://www.dropbox.com/s/zdvo36txe60828m/laser%20scan.png?dl=

Asked by Rayner on 2017-02-09 10:37:58 UTC

It looks like your pgm map wasn't scaled to match the new resolution.

Asked by ahendrix on 2017-02-09 14:10:00 UTC

I followed the instructions from http://answers.ros.org/question/204499/how-to-double-the-resolution-of-the-map/ . I doubled the X and Y size of the image to make it 0.025 and also changed the resolution in the .yaml file. Any idea why the layers still do not coincide?

Asked by Rayner on 2017-02-10 10:58:17 UTC

You need to use the scale or stretch tool in your image editor when you resize, so that each pixel in the original image corresponds to 2x2 pixels in the final image.

Asked by ahendrix on 2017-02-10 12:59:21 UTC

By making each pixel 2x2, won't this make the resolution 0.05 again? It is merely just doubling the map size

Asked by Rayner on 2017-02-22 02:49:20 UTC

Basically, yes. Each pixel in the original image corresponds to a 5cm x 5cm part of the world that is either occupied or not occupied. Scaling the image maintains this relationship with the physical world.

Asked by ahendrix on 2017-02-22 02:56:08 UTC

Oh I see. Hopefully doubling the map will increase detail and improve the navigation process. Shall give it a go. Thanks Austin!

Asked by Rayner on 2017-02-23 12:48:19 UTC

Answers