This chapter needs to be used with a car chassis and other sensors to operate. This is just an explanation of the implementation method. In fact, it cannot be run. It needs to be used with the Yahboom RDK-X3 car to achieve this function.
If you need to transplant it to your own motherboard, you need to install other dependency files.
After the program is started, control the car through the handle or keyboard.
The car will use radar scanning data during movement, use the gmapping algorithm to build a map, and save the map after the construction is completed.
The process is visualized in rviz.
For example, using ROS2 box, input following command:
sudo apt install ros-foxy-rtabmap* -y
Input following command:
xxxxxxxxxx
#Start Astra camera
ros2 launch astra_camera astro_pro_plus.launch.xml
#Start car chassis
ros2 launch yahboomcar_bringup rtabmap_bringup_launch.py
#Start mapping
ros2 launch yahboomcar_nav rtabmap_sync_launch.py
#Start rviz to display the map
ros2 launch yahboomcar_nav display_rtabmap_map_launch.py
Note: This mapping algorithm requires a bit of high hardware requirements, and some motherboards may get stuck. It is recommended to configure a virtual machine and run the RTAB-MAP algorithm on the virtual machine.
After completing the mapping, press 【 ctrl+c 】 to exit the mapping node, and the system will automatically save the map.
The default path for saving maps is [~/. ros/rtabmap. db].
Input following command:
xxxxxxxxxx
#Start Astra camera
ros2 launch astra_camera astro_pro_plus.launch.xml
#Start car chassis
ros2 launch yahboomcar_bringup rtabmap_bringup_launch.py
#Start rviz to display the map
ros2 launch yahboomcar_nav display_rtabmap_nav_launch.py
#Start Navigation
ros2 launch yahboomcar_nav navigation_rtabmap_launch.py
Navigation can be divided into single point navigation and multi-point navigation.
Click on the 2D Pose Estimate on rviz, then compare the pose of the car and mark the initial pose of the car on the map.
By comparing the overlap between the radar scanning points and obstacles, the initial pose of the car can be set multiple times until the radar scanning points roughly overlap with the obstacles.
After setting the initial pose, you can click on 【 2D Goal Pose 】 to set a navigation target point, and the car will start single point navigation,
After setting the initial pose, you can click on the [Panels] in the upper left corner of rviz ->select [Navigation 2], and the [Navigation 2] panel will be displayed.
Click on the Waypoint mode in the above image, then click on the Navigation2 Goal on rviz to mark a target point on the map.
Click on Navigation2 Goal again to mark the second target point on the map.
By looping through, multiple target points can be marked at once.
After marking multiple target points, click on 【 Start Navigation 】 to start multi-point navigation.
After completing the multi-point navigation, the car will remain in the position of the last target point.