7.ROS2_Gmapping mapping algorithm1 Introduction2. Use2.1. Configuration before use2.2. Specific use3. Node analysis3.1. Display calculation graph3.2. gmapping node details3.3. TF transformation
wiki:http://wiki.ros.org/gmapping/
ros2 gmapping:https://github.com/Project-MANAS/slam_gmapping
Advantages:Gmapping can construct indoor maps in real time. The amount of calculation required to construct small scene maps is small and the accuracy is high.
Disadvantages: As the scene grows, the number of particles required increases because each particle carries a map, so the amount of memory and computation required when building a large map increases. Therefore it is not suitable for building large scene maps. And there is no loop detection, so the map may be misaligned when the loop is closed. Although increasing the number of particles can close the map, it comes at the expense of increased calculations and memory.
Note: Since the Muto series robots are equipped with multiple lidar 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 lidar type.
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 in the host [Muto]. The two devices of lidar and serial port are mainly used here;
Then check whether the lidar and serial device are in port binding state: Run the following command on the host machine [Muto] to check. Successful binding is as follows:
If it shows that the lidar or serial device is 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 yahboomcar_nav map_gmapping_launch.py
xxxxxxxxxx
ros2 launch yahboomcar_nav display_map_launch.py
Or use the remote control [slowly moving car] to start mapping until a complete map is created
xxxxxxxxxx
ros2 run teleop_twist_keyboard teleop_twist_keyboard
xxxxxxxxxx
ros2 launch yahboomcar_nav save_map_launch.py
Save path is as follows:
xxxxxxxxxx
/root/yahboomcar_ros2_ws/yahboomcar_ws/src/yahboomcar_nav/maps/
A pgm picture, a yaml file yahboomcar.yaml
xxxxxxxxxx
image: /root/yahboomcar_ros2_ws/yahboomcar_ws/src/yahboomcar_nav/maps/yahboomcar.pgm
mode: trinary
resolution: 0.05
origin: [-10, -10, 0]
negate: 0
occupied_thresh: 0.65
free_thresh: 0.25
Parameter analysis:
xxxxxxxxxx
rqt_graph
xxxxxxxxxx
ros2 run tf2_tools view_frames.py