Gmapping strange map
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.
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.
@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
How fast are you rotating? You should be rotating fairly slow otherwise you'll end up with similar results
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
Try going as slow as possible and see if that changes anything
just for mapping purposes, set all your speeds to as low as possible.