11.RTAB-Map 3D mapping navigation1. Introduction2. Configuration before use3. Map construction4. Navigation4.1. Start the camera4.2. Start rviz to display the map [Start on the virtual machine side]4.3. Display rtabmap_viz [Virtual machine side startup]4.4. Start navigation node4.5. Single-point navigation4.6. Multi-point navigation5. Node analysis5.1. Display calculation graph5.2. Details of rtabmap navigation related nodes5.3. TF transformation
rtabmap official website: http://introlab.github.io/rtabmap/
rtabmap ros-foxy:https://github.com/introlab/rtabmap/tree/foxy-devel
rtabmap is a RGB-D image-based SLAM method that uses a bag-of-words-based global Bayesian loop closure detector to build maps in real-time in large-scale environments.
The features of rtabmap include:
Note: Since the Muto series robots are equipped with multiple radar devices, the factory system has been configured with routines for multiple devices. However, since the product cannot be automatically recognized, the radar model needs to be manually set.
After entering the container: Make the following modifications according to the lidar type:
root@ubuntu:/# cd
root@ubuntu:~# vim .bashrc
After the modification is completed, save and exit vim, and then execute:
xxxxxxxxxx
root@jetson-desktop:~# source .bashrc
------------------------------------
ROS_DOMAIN_ID: 26
my_robot_type: Muto | my_lidar: a1
------------------------------------
root@jetson-desktop:~#
You can see the current modified radar type.
Note: The depth camera needs to be connected directly to the Muto main control, not to the USB-HUB. This can improve the transmission efficiency of the depth camera and improve the mapping and navigation effects. Otherwise, mapping and navigation may become impossible
Note: When building a map, the slower the speed, the better the effect (note that the rotation speed should be slower). If the speed is too fast, the effect will be poor.
First, the port binding operation needs to be done on the host machine [that is, Muto's jetson] [see the port binding tutorial chapter]. The three devices of radar, serial port and camera are mainly used here;
Then check whether the radar and serial port device are in the port binding state: on the host machine [that is, the jetson of the car], refer to the following command to execute the check. The successful binding is as follows:
Check whether the camera is in port binding state
If it shows that the lidar, serial port, and camera devices are not bound, you can plug and unplug the USB cable to check again.
Enter the docker container and execute the following launch file in a terminal:
xxxxxxxxxx
ros2 launch astra_camera astro_pro_plus.launch.xml
xxxxxxxxxx
ros2 launch yahboomcar_nav map_rtabmap_launch.py
xxxxxxxxxx
ros2 launch rf2o_laser_odometry rf2o_laser_odometry.launch.py
xxxxxxxxxx
ros2 launch yahboomcar_nav display_rtabmap_map_launch.py
Or use the remote control [Slowly Move Muto] to start mapping until a complete map is created
xxxxxxxxxx
ros2 run yahboomcar_ctrl yahboom_keyboard
Or
ros2 run teleop_twist_keyboard teleop_twist_keyboard
When the map construction is completed, directly [ctrl+c] exit the map construction node, and the system will automatically save the map. The default saving path of the map [~/.ros/rtabmap.db]
Enter the docker container and execute in a terminal:
xxxxxxxxxx
ros2 launch astra_camera astro_pro_plus.launch.xml
Multi-machine communication is configured in the Ubuntu virtual machine and docker container. It is recommended to start it in the virtual machine in this step: to maintain time synchronization and reduce resource consumption, because if you use vnc, it is very dependent on the network and may cause navigation failure.
[Note that you must first start the node that displays the map, and then start the navigation node in step 3.This is because the navigation2 terminal map topic is only published once. If you start the navigation node first and then start the rviz display, you may not be able to subscribe to the map topic published only once, resulting in the map not being displayed]
xxxxxxxxxx
ros2 launch yahboomcar_nav display_rtabmap_nav_launch.py
rtabmap_viz is the visual interface of RTAB-Map. It is an encapsulation of the RTAB-Map GUI graphics library. It is similar to rviz but has options for RTAB-Map. It can subscribe to different topics, such as odom, rgb/image, depth/image, scan, etc., to display the SLAM process and results, and at the same time load the 3D map into rviz. It is recommended to start this step in a virtual machine.
Note that the map will not be displayed after this step is started. You need to wait for the next navigation node to be started before it will be displayed.
xxxxxxxxxx
ros2 launch yahboomcar_nav rtabmap_viz_launch.py
Navigation can be divided into single-point navigation and multi-point navigation, which will be introduced below.
Enter the docker container and execute in a terminal:
xxxxxxxxxx
ros2 launch yahboomcar_nav rtabmap_bringup_launch.py
xxxxxxxxxx
ros2 launch yahboomcar_nav navigation_rtabmap_launch.py
The display after marking is as follows:
After the initial pose is set, you can click [2D Goal Pose] to set a navigation target point, and Muto will start single-point navigation;
xxxxxxxxxx
rqt_graph
/rgbd_sync
/rtabmap
/rtabmap_viz
/bt_navigator
/controller_server
/global_costmap/global_costmap
/local_costmap/local_costmap
/planner_server
/recoveries_server
/waypoint_follower
xxxxxxxxxx
ros2 run tf2_tools view_frames.py