Good map with hector_mapping and with odometry-only - poor map with gmapping
Using an XV11 lidar and calibrated odometry, I am able to build a good quality map using both hector_mapping (using scan results only) and pure odometry (using odometry only). However, I am unable to get a good map using gmapping (which combines scan results and odometry).
Odometry:
My robot has odometry that passes the tests listed in the navigation tuning guide - linear translation is perfect, rotation error seems to be reasonable as well.
Lidar:
Additionally, it is using an XV11 lidar as laser scanner, with the xv_11_laser_driver package.
Bagfile:
I've recorded a short bag file with /odom, /tf and /scan topics, using following command:
rosbag record -O second_data /scan /tf /odom
I then compressed the bagfile (rosbag compress second_data.bag
), and put it available here.
Map results:
If I transform this bag file into a map using hector_mapping, the result looks perfect:
EDIT: Here are links to the hector_mapping generated pgm and yaml files.
Moreover, if I simply display the laserscan results in rviz in the /odom frame, with an infinite decay time, I get a very nice map as well:
Now, when I try to run this through gmapping, the map looks very poor:
EDIT: Here are links to the gmapping generated pgm and yaml files.
Commands:
To generate the gmapping map, I used:
rosparam set use_sim_time true
rosparam set slam_gmapping/delta 0.1 #set resolution to 0.1
rosrun gmapping slam_gmapping scan:=scan
rosbag play second_data.bag --clock
rosrun map_server map_saver
To generate the hector_mapping map, I used:
rosparam set use_sim_time true
roslaunch hector_mapping mapping_default.launch
rosbag play second_data.bag --clock
rosrun map_server map_saver
Launch file is available here.
PDF graph of tf tree is available here.
Question:
How come gmapping gives such poor results, compared to the two other approaches? Any suggestions to improve the gmapping results would be much appreciated.
Thank you,
Kristof
I had a very similar experience with the xv-11 laser. I got the best results from gmapping by driving my robot in a straight line, super slow (around 0.02 m/s I think).
@jseal interesting, thanks! Did you ever try setting the minimumScore parameter? Setting this to a very high value (see below) works very well for me.
I haven't, I'm not sure how I missed that one. I'm going to give it a try. I ended up stitching a couple of maps together with gimp to produce my final map.