Mapping & Navigation using RTAB-Map
Overview
The RTAB-Map package provides an appearance-based positioning and mapping solution independent of time and scale. It’s aimed at solving the problem of online closed-loop detection in large-scale environments. The idea of the solution is to meet some real-time limitations. Closed-loop detection uses only a limited number of positioning points, while being able to access the positioning points of the entire map when needed.
You can find more information on the rtabmap and rtabmap_ros GitHub repositories.
Usage
Mapping
Note
Use Ctrl + C command to end all the processes before running the below commands.
Note
Mapping works best when the LIMO drives slowly through its environment. If it moves around too quickly, mapping quality will be affected.
Start the LIMO. Open a new terminal, and enter the command:
$ roslaunch limo_bringup limo_start.launch pub_odom_tf:=false
Start the camera. Open a new terminal and enter the command:
$ roslaunch astra_camera dabai_u3.launch
Launch RTAB-Map in its mapping mode. Enter the command:
roslaunch limo_bringup limo_rtabmap_orbbec.launch
After launching successfully, RViz will be opened and display something like the image below.
- Use the mobile app to explore and map out the environment.
Saving the Map
After building the map, you can directly terminate the program, and the map will automatically be
saved under the ~/.ros
directory as rtabmap.db
. The ~/.ros
folder is hidden and can be
displayed by the Ctrl + H command when in the file explorer.
Localization
Note
Use Ctrl + C command to end all the processes before running the below commands.
Start the LIMO. Open a new terminal, and enter the command:
$ roslaunch limo_bringup limo_start.launch pub_odom_tf:=false
Start the camera. Open a new terminal and enter the command:
$ roslaunch astra_camera dabai_u3.launch
Launch RTAB-Map’s localization mode. Open a new terminal and enter the command:
$ roslaunch limo_bringup limo_rtabmap_orbbec.launch localization:=true
Launch move_base. Open a new terminal and enter the command:
$ roslaunch limo_bringup limo_navigation_rtabmap.launch
Note
If in Ackermann steering mode, run the command:
$ roslaunch limo_bringup limo_navigation_rtabmap_ackerman.launch
Launch RViz to view the map and navigation tools. Open a new terminal and enter the command:
$ roslaunch limo_bringup rtabmap_rviz.launch
Note
The robot may need to detect more visual features on initialization before it can localize itself. To do this, drive the robot around until it appears to be in the correct location in RViz. See rtabmap_ros issue #220 for details and other potential workarounds.
Use the 2D Nav Goal button to set your navigation goal as shown below.
A green path will be displayed in the map indicating the planned path, and the robot will automatically navigate to the goal.