In this project I created a 2D occupancy grid and 3D octomap from a simulated environment using my own robot with the RTAB-Map package.
RTAB-Map (Real-Time Appearance-Based Mapping) is a popular solution for SLAM to develop robots that can map environments in 3D. RTAB-Map has good speed and memory management, and it provides custom developed tools for information analysis.
For this project I will be using the rtabmap_ros
package, which is a ROS wrapper (API) for interacting with RTAB-Map.
- Gazebo >= 7.0
- ROS Kinetic
- ROS navigation package
sudo apt-get install ros-kinetic-navigation
- ROS map_server package
sudo apt-get install ros-kinetic-map-server
- ROS move_base package
sudo apt-get install ros-kinetic-move-base
- ROS amcl package
sudo apt-get install ros-kinetic-amcl
- ROS rtabmap-ros package
sudo apt-get install ros-kinetic-rtabmap-ros
- make >= 4.1(mac, linux), 3.81(Windows)
- Linux: make is installed by default on most Linux distros
- Mac: install Xcode command line tools to get make
- Windows: Click here for installation instructions
- gcc/g++ >= 5.4
- Linux: gcc / g++ is installed by default on most Linux distros
- Mac: same deal as make - install Xcode command line tools
- Windows: recommend using MinGW
- Meet the
Prerequisites/Dependencies
- Open Ubuntu Bash and clone the project repository
- On the command line execute
sudo apt-get update && sudo apt-get upgrade -y
- Build and run your code.
- Clone this repository under the
catkin_ws/src
folder
git clone https://github.com/aaryapatel007/slam_rtab_ros.git
- Open the repository and make
cd /home/workspace/catkin_ws/
catkin_make
- Launch my_robot in Gazebo to load both the world and plugins
roslaunch my_robot world.launch
- Launch teleop_twist_keyboard node, open a new terminal, enter
cd /home/workspace/catkin_ws/
source devel/setup.bash
rosrun teleop_twist_keyboard teleop_twist_keyboard.py
- Launch mapping node, open a new terminal, enter
cd /home/workspace/catkin_ws/
source devel/setup.bash
roslaunch my_robot mapping.launch
-
Testing
Send move command via teleop package to control your robot and observe real-time visualization in the environmentrtabmapviz
.
rtabmap-databaseViewer ~/.ros/rtabmap.db -
View database Once you statisfied with your move, press
Ctrl + c
to exit then view your database with
rtabmap-databaseViewer ~/.ros/rtabmap.db
Remember to rename your ~/.ros/rtabmap.db
before your next attempt since it will be deleted due to the launch file setting in mapping.launch
This repository is licensed under the terms of the MIT license.