Navigation map and laser resolution

asked 2017-02-04 09:43:22 -0600

Rayner gravatar image

updated 2017-02-05 11:57:04 -0600

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!

edit retag flag offensive close merge delete

Comments

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

ahendrix gravatar imageahendrix ( 2017-02-05 00:11:19 -0600 )edit

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

Rayner gravatar imageRayner ( 2017-02-05 11:58:08 -0600 )edit

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.

ahendrix gravatar imageahendrix ( 2017-02-05 13:00:48 -0600 )edit

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/spyktnmui74... laser scan 1: https://www.dropbox.com/s/zdvo36txe60...

Rayner gravatar imageRayner ( 2017-02-09 09:37:58 -0600 )edit

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

ahendrix gravatar imageahendrix ( 2017-02-09 13:10:00 -0600 )edit

I followed the instructions from http://answers.ros.org/question/20449... . 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?

Rayner gravatar imageRayner ( 2017-02-10 09:58:17 -0600 )edit

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.

ahendrix gravatar imageahendrix ( 2017-02-10 11:59:21 -0600 )edit

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

Rayner gravatar imageRayner ( 2017-02-22 01:49:20 -0600 )edit