6、gmapping mapping algorithm

wiki:http://wiki.ros.org/gmapping/

ros2 gmapping:https://github.com/Project-MANAS/slam_gmapping

The operating environment and software and hardware reference configurations are as follows:

 

6.1、Introduction

Advantages: Gmapping can build indoor maps in real time, which requires less computation and high accuracy in building small scene maps.

Cons: The number of particles required increases as the scene grows, as each particle carries a map, hence the memory required to build a large map

The amount of computation increases. Therefore, it is not suitable for building large scene maps. And there is no loopback detection, so it may cause a map when the loopback is closed

Dislocation, although increasing the number of particles can close the map, but at the cost of increased computation and memory.

img

 

 

6.2、use

6.2.1、pre-use configuration

Note: Since ROSMASTER series robots are divided into multiple robots and multiple devices, the factory system has been configured with routines for multiple devices, but because the product cannot be automatically identified, it is necessary to manually set the machine type and radar model.

After entering the container: according to the model of the car, the type of radar and the type of camera, make the following modifications:

image-20230527152840495

After the modification is complete, save and exit vim, and then execute:

You can see the model of the currently modified car, the type of radar and the type of camera

6.2.2、specific use

Note: When building the image, the slower the effect, the better (note if the rotation speed is slower), too fast the effect, the effect will be poor.

First of all, you need to do port binding operations in the host [car] [see the port binding tutorial chapter], where two devices, radar and serial port, are mainly used;

Then check whether the radar and serial device are in the port binding state: on the host [car], refer to the following command to view, and the successful binding is in the following state:

image-20230421151543423

If the radar or serial device is not bound to the display, you can plug and unplug the USB cable to view it again.

Enter the docker container (for steps, see [Docker course chapter ----- 5. Enter the docker container of the robot]), and execute the following launch file in the terminal:

1、Start mapping

2、Start rviz to display the map, this step is recommended to be executed in the virtual machine, and multi-machine communication needs to be configured in the virtual machine

image-20230420160916499

 

3、Start the keyboard control node, this step is recommended to be executed in the virtual machine, and multi-machine communication needs to be configured in the virtual machine.

Or use the remote control [Move the trolley slowly] to start building the map until the complete map is built.

image-20230420160249189

4、Save the map, the path is as follows:

The save path is as follows:

image-20230420161956140

A PGM image, a YAML file yahboomcar.yaml

Parameter parsing:

6.3、node parsing

6.3.1、Display the calculation graph

 

 

 

6.3.2、Details of gmapping nodes

image-20230420162913681

 

6.3.3、TF transformation

image-20230420163140788