Gmapping strange map

asked 2020-02-14 11:53:52 -0600

Luigi.giggi gravatar image

updated 2020-02-16 02:57:37 -0600

jayess gravatar image

Hello everyone,

I'm working on a project with Gmapping by using a Ydlidar X4 lidar mounted on a two wheeled robot with optical encoders. I've a problem with the map obtained via gmapping on rviz. After a bit of exploration of the robot, it looks like the attached picture.

C:\fakepath\Schermata da 2020-02-14 17-30-55.png

The code I'm using is the same as the one I've previously developed for a gazebo-based simulation which was correctly working. It looks like the gmapping algorithm doesn't understand when the robot rotates, in fact as the robot moves on already explored zones, the map becames larger and larger (like if it was a new, unexplored zone). It's like the LaserScan readings behave like a sliding window, without reusing previously explored and constructed map. Of course the real map is much smaller and with less obtacles w.r.t the one created by gmapping.

In your opinion what could cause this behaviour? Is there any kind of parameter that I should have changed by switching to the "real" robot from the simulated one? IMHO I think it's related to the source of odometry. In the physical robot, I'm using two optical wheel encoders like these. They are pretty cheap hardware and they are not able to "understand" forward vs backward rotation. Do you think that if I change the source of odometry with a better one I could solve this problem?

Thanks in advance.

edit retag flag offensive close merge delete


@Luigi.giggi I've upvoted your question so that you have enough karma to upload your image to the question itself instead of linking to an external site

jayess gravatar image jayess  ( 2020-02-14 17:35:19 -0600 )edit

How fast are you rotating? You should be rotating fairly slow otherwise you'll end up with similar results

jayess gravatar image jayess  ( 2020-02-14 17:44:31 -0600 )edit

Hi, I'm rotating with an high value, specifically with angular.z=20. I had to use such a big number because otherwise my motors controller doesn't react to movements' msgs

Luigi.giggi gravatar image Luigi.giggi  ( 2020-02-15 02:15:34 -0600 )edit

Try going as slow as possible and see if that changes anything

jayess gravatar image jayess  ( 2020-02-16 02:58:03 -0600 )edit

just for mapping purposes, set all your speeds to as low as possible.

ashutosh08 gravatar image ashutosh08  ( 2020-02-17 04:36:22 -0600 )edit