Gmapping is a laser-based SLAM (Simultaneous Localization and Mapping) algorithm that builds a 2d map.
It uses laser scan data and odometry data from the Turtlebot to feed a highly efficient Rao-Blackwellized particle filer to learn grid maps from laser range data.
The laser scan is generated by taking the point cloud from the 3D sensor and grabbing points from an “eye-level” prespective of the robot. It does not use any RGB data, or any full depth data.
roslaunch turtlebot_bringup minimal.launch
roslaunch turtlebot_navigation gmapping_demo.launch
roslaunch turtlebot_rviz_launchers view_navigation.launch
roslaunch turtlebot_teleop keyboard_teleop.launch
In order to collect data fully, you will need to stop the turtlebot periodically and slowly turn the turtlebot in circles
rosrun map_server map_saver -f ~/gmapping_01
~/gmapping_01.yaml
- a configuration file that specifies where the map image is located, the map resolution, and the start point~/gmapping_01.pgm
- a grayscale binary image file that represents an image of the scanned mapexport TURTLEBOT_MAP_FILE=~/gmapping_01.yaml
roslaunch turtlebot_navigation amcl_demo.launch
roslaunch turtlebot_rviz_launchers view_navigation.launch
roslaunch turtlebot_teleop keyboard_teleop.launch
teleop
terminalsGmapping is great for real-time environment recognition where there are a lot of objects present. The more physical data available around the Turtlebot, the better the map will be.
Gmapping is meant to provide a map for navigation planning without overloading the computer. It may have issues with small objects, or big solid-colored surfaces such as white walls.