UMRobot gazebo simulation use cartographer to do mapping.
Cartographer is powerful SLAM algorithm, and easy to use.
Cartographer is to be installed. Follow commands at here. I recommand you to make another workspace like carto_ws only for cartographer, instead of using catkin_ws. Because cartographer use little different method to build package, catkin_make_isolated --install --use-ninja
not catkin_make
.
Now you can do mapping with the cartographer.
# Run umrobot gazebo simulation
$ roslaunch umrobot_description umrobot_gazebo.launch
# Mapping with cartographer
$ roslaunch cartographer_ros umrobot.launch
To save the map, we use map_server package. map_server package is included in the ros navigation package.
# Map is saved in current directory
$ rosrun map_server map_saver -f {file name}
You can find .pgm and .yaml files for map, and the two files should always exist together.