The ROS Gmapping package is a wrapper of the open source implementation of SLAM, called OpenSLAM (https://www.openslam.org/gmapping.html). The package contains a node called slam_gmapping, which is the implementation of SLAM and helps to create a 2D occupancy grid map from the laser scan data and the mobile robot pose.
The basic hardware requirement for doing SLAM is a laser scanner which is horizontally mounted on the top of the robot, and the robot odometry data. In this robot, we have already satisfied these requirements. We can generate the 2D map of the environment, using the gmapping package through the following procedure.
Before operating with Gmapping, we need to install it using the following command: