In this project you will create a 2D occupancy grid and 3D octomap from a simulated environment using your 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. Most importantly, the quality of the documentation on ROS Wiki (http://wiki.ros.org/rtabmap_ros) is very high. Being able to leverage RTAB-Map with your own robots will lead to a solid foundation for mapping and localization well beyond this Nanodegree program.
For this project we will be using the rtabmap_ros package, which is a ROS wrapper (API) for interacting with RTAB-Map. Keep this in mind when looking at the relative documentation.
The project flow will be as follows:
- You will develop your own package to interface with the
rtabmap_rospackage. - You will build upon your localization project to make the necessary changes to interface the robot with RTAB-Map. An example of this is the addition of an RGB-D camera.
- You will ensure that all files are in the appropriate places, all links are properly connected, naming is properly setup and topics are correctly mapped. Furthermore you will need to generate the appropriate launch files to launch the robot and map its surrounding environment.
- When your robot is launched you will
teleoparound the room to generate a proper map of the environment.
.Project4
├── ball_chaser
│ ├── CMakeLists.txt
│ ├── launch
│ │ └── ball_chaser.launch
│ ├── package.xml
│ ├── src
│ │ ├── drive_bot.cpp
│ │ └── process_image.cpp
│ └── srv
│ └── DriveToTarget.srv
├── my_robot
│ ├── CMakeLists.txt
│ ├── config
│ │ ├── base_local_planner_params.yaml
│ │ ├── costmap_common_params.yaml
│ │ ├── global_costmap_params.yaml
│ │ ├── local_costmap_params.yaml
│ │ └── __MACOSX
│ ├── launch
│ │ ├── amcl.launch
│ │ ├── mapping.launch
│ │ ├── robot_description.launch
│ │ ├── teleop.launch
│ │ └── world.launch
│ ├── maps
│ │ ├── map.pgm
│ │ ├── map.yaml
│ │ └── rtabmap.db
│ ├── meshes
│ │ └── hokuyo.dae
│ ├── package.xml
│ ├── RVIZLaunchConfig.rviz
│ ├── urdf
│ │ ├── my_robot.gazebo
│ │ └── my_robot.xacro
│ └── worlds
│ ├── empty.world
│ ├── minimap.world
│ └── UdacityOffice.world
├── pgm_map_creator
│ ├── CMakeLists.txt
│ ├── launch
│ │ └── request_publisher.launch
│ ├── LICENSE
│ ├── maps
│ │ └── map.pgm
│ ├── msgs
│ │ ├── CMakeLists.txt
│ │ └── collision_map_request.proto
│ ├── package.xml
│ ├── README.md
│ ├── src
│ │ ├── collision_map_creator.cc
│ │ └── request_publisher.cc
│ └── world
│ └── udacity_mtv
├── README.md
└── teleop_twist_keyboard
├── CHANGELOG.rst
├── CMakeLists.txt
├── package.xml
├── README.md
└── teleop_twist_keyboard.py- Open Terminal/CLI by using
Ctrl + Alt + Tshortcut. - Create and initialize a
catkin_ws
mkdir -p /<your_dir>/catkin_ws/src
cd /<your_dir>/catkin_ws/src
catkin_init_workspace- Clone this repo inside
/<your_dir>/catkin_ws/src. Pull all submodules by running
git submodule update --init --recursive- Ensure
ros-kinetic-rtabmap-rospackage is installed. If not, install by running the following:
sudo apt-get install ros-kinetic-rtabmap-ros- Switch to
catkin_ws
cd /<your_dir>/catkin_ws- Build the code and ensure there are no build errors reported
catkin_make- Launch RViz and Gazebo. This may take a while upon initial loading.
source devel/setup.bash
roslaunch my_robot world.launch- Open another Terminal/CLI by using
Ctrl + Alt + Tshortcut. Switch tocatkin_ws
cd /<your_dir>/catkin_ws- Run
teleopnode, which can be done by executingteleop.launch
source devel/setup.bash
roslaunch my_robot teleop.launch- Open another Terminal/CLI by using
Ctrl + Alt + Tshortcut. Switch tocatkin_ws
cd /<your_dir>/catkin_ws- Run
mappingnode, which can be done by executingmapping.launch
source devel/setup.bash
roslaunch my_robot mapping.launch- Navigate your robot in the simulation to create map for the environment! When you are all set, terminate the node and you could find your map db file in the place specified in the mapping.launch file. It will be named rtabmap.db and located in the /my_robot/maps/ folder. Note: if rtabmap.db exists, it will override it when the nodes are launched.
- To open the mapping database, execute the following in a terminal:
rtabmap-databaseViewer /<your_dir>/catkin_ws/src/my_robot/maps/rtabmap.db- Once opened:
- Say yes to using the database parameters
- View -> Constraint View
- View -> Graph View


