This project implements a differential drive robot equipped with SLAM (Simultaneous Localization and Mapping) capabilities using gmapping. The robot creates a 2D map of its environment and saves it locally, which can then be used for localization through AMCL (Adaptive Monte Carlo Localization) and autonomous navigation using move_base.
The differential drive robot in this project performs:
- Mapping: Uses gmapping to generate a 2D map of its environment.
- Localization: Uses the generated map with AMCL for localization.
- Navigation: Plans and follows paths using
move_base
to autonomously navigate the environment.
This project is designed for use in various indoor environments such as warehouses, greenhouses, or industrial settings, where autonomous mapping and navigation are essential.
- Gmapping for SLAM: Creates a real-time map of the environment.
- AMCL Localization: Localizes the robot on a pre-existing map.
- Move Base Navigation: Autonomously navigates to specified goals using path planning.
- Real-time Visualization: Visualizes the robot, map, and path using Rviz.
Ensure the following dependencies are installed:
- ROS Noetic
gmapping
package:sudo apt-get install ros-noetic-slam-gmapping
amcl
package:sudo apt-get install ros-noetic-amcl sudo apt-get install ros-noetic-dwa-local-planner
move_base
package:sudo apt-get install ros-noetic-move-base
teleop-twis-keyboard
package:sudo apt-get install ros-noetic-teleop-twist-keyboard
map-server
package:sudo apt-get install ros-noetic-map-server
-
Clone the repository:
git clone https://github.com/S-Sidharthan/ROS-slam-amcl-autonomous-robot.git
-
Build the project:
cd ROS-slam-amcl-autonomous-robot catkin_make
-
Source the workspace:
source devel/setup.bash
To start mapping the environment, run:
roslaunch robot_gazebo robot_gazebo.launch
roslaunch yourproject gmapping.launch
rosrun teleop_twist_keyboard teleop_twist_keyboard.py
To localize and navigate using the saved map : (Note: change the map path in amcl.launch)
roslaunch diff_wheeled_robot amcl.launch
Figure 1: Environment mapping.
Figure 2: Robot navigating through the mapped environment using move_base.
Watch a demo of the robot in action on YouTube:
Contributions are welcome! Feel free to open issues or submit pull requests for improvements.