Implementation of gmapping ROS package which is based on Grid-based FastSLAM algorithm to map the environment.
Skip this step if you already have a workspace
$ mkdir -p /home/workspace/catkin_ws/src/gmapping_ROS
$ cd catkin_ws/src/gmapping_ROS
$ catkin_init_workspace
$ cd ../..
$ catkin_make
$ apt-get update
$ cd /home/workspace/catkin_ws/src/gmapping_ROS
$ git clone https://github.com/proneetsharma/gmapping_ROS.git
$ rosdep -i install turtlebot_gazebo
$ rosdep -i install turtlebot_teleop
$ cd ..
$ catkin_make
$ source devel/setup.zsh
$ ./launch.sh
Now, see Gazebo and rviz launching.
In the terminal, use teleop operation and drive the robot around. It will create a map of the environment in Rviz!