A simple demonstration of Simultaneous Localization and Mapping (SLAM) using ROS and Gazebo simulator.
-
Algorithm : Grid-Based FastSLAM (from slam-gmapping)
-
Robot : TurtleBot3 Burger (from turtlebot3)
-
Sensor : 360 Laser Distance Sensor LDS-01
-
Environment : Custom
-
ROS Noetic
-
Rviz 1.14.7
-
Gazebo 11.5
-
ROS Noetic TurtleBot3 :
sudo apt install ros-noetic-turtlebot3-*
-
Setup
catkin
workspace :mkdir -p /home/<username>/workspace/catkin_ws/src cd catkin_ws/src/ catkin_init_workspace cd .. catkin_make
-
Clone the repo packages :
cd /home/<username>/workspace/catkin_ws/src git clone https://github.com/DarkGeekMS/ros-slam-demo.git
-
Build and source the packages :
cd /home/<username>/workspace/catkin_ws catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3 source devel/setup.bash
-
Source TurtleBot3 model to
~/.bashrc
:echo 'export TURTLEBOT3_MODEL=burger' >> ~/.bashrc source ~/.bashrc
-
Run the required packages for the demo :
# Terminal 1 (ROS Master Node) roscore # Terminal 2 (TurtleBot3 Gazebo Simulation) cd /home/<username>/workspace/catkin_ws source devel/setup.bash roslaunch turtlebot3_gazebo turtlebot3_world.launch # Terminal 3 (TurtleBot3 GMapping SLAM) cd /home/<username>/workspace/catkin_ws source devel/setup.bash roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=gmapping # Terminal 3 (TurtleBot3 Teleoperation) cd /home/<username>/workspace/catkin_ws source devel/setup.bash roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch
-
Alternatively, you can run the demo using a single launch file [SLOWER] :
cd /home/<username>/workspace/catkin_ws source devel/setup.bash roslaunch turtlebot3_gazebo turtlebot3_slam_demo.launch
-
Save the output map :
rosrun map_server map_saver -f OutMap
-
turtlebot3_gazebo : for TurtleBot3 Gazebo simulation.
-
turtlebot3_slam : a wrapper for slam_gmapping package to perform SLAM on TurtleBot3.
-
slam_gmapping : for Grid-Based FastSLAM using ROS openslam_gmapping SLAM library.
-
turtlebot3_teleop : for controlling a robot through external peripheral (used to navigate the robot during SLAM).