## 2 The Proposed Method
### Mapping  
We use the grid map to represent the environment, which has been first proposed by [PERSON] and [PERSON] [31; 32; 33] in the 1980s, and further extended by [PERSON] [34; 35] later. Their fundamental works established the theoretical framework of the grid map. As shown in Figure 2, it is a 2D occupancy grid map, and the value of the cell in the map represents the possibility of being occupied with the objects/obstacles and ranges from \(-1\) to \(1\). The value \(-1\) means the cell is empty or has available space, and is indicated as white cells in the grid map. The value \(1\) means the cell is an obstacle or has no available space, and is indicated as black. The value \(0\) usually represents an unknown area and is indicated as the gray in the map. The map is intuitive, with easy maintenance and an easy introduction to navigation algorithm. How to choose a suitable grid size is empirically determined, which should balance the map accuracy and computational cost. According to the environment scale of the application, the size of the grid is set to 5 cm in this paper. Figure 1: The data flow diagram of the proposed method. The updating model of the grid map can be expressed as follows:  
\[M_{new}(\mathrm{p_{m}})=M_{old}(\mathrm{p_{m}})+\textit{lomeas} \tag{1}\]  
In Equation (1), \(M_{new}(\mathrm{p_{m}})\)\(\in\)[\(-\)1,1] represents the grid value that has been updated by the point cloud, \(M_{old}(\mathrm{p_{m}})\) represents the previous value that has not been updated, _lomeas_ represents the measured value. There are two cases when a grid map is updated by a point cloud. The first is the laser point falls on the grid, and the grid can be regarded as occupied with _lomeas_ = 0.3. The second is the laser beam can pass through the grid, and the grid can be regarded as free with \(\textit{lomeas}=-0.3\). Based on Equation (1), a modified updating strategy is used to improve the accuracy of scan matching and closed-loop detection for dynamic environments. For the first case, the updating strategy can be expressed in Equation (2), it can restrict the updating of the free grid to eliminate the impact of the arrival of the dynamic target. \[ \begin{cases}M_{new}(\mathrm{p_{m}})=M_{old}(\mathrm{p_{m}})+0.3&-0.9\leq M_{ old}(\mathrm{p_{m}})\leq 1\\ M_{new}(\mathrm{p_{m}})=M_{old}(\mathrm{p_{m}})&-1\leq M_{old}(\mathrm{p_{m}})< -0.9\end{cases}  \tag{2}\]  
For the second case, the updating strategy can be expressed in Equation (3). The updating strategy can accelerate the updating process of the occupied grid to eliminate the effect of the departure of the moving target. \[ \begin{cases}M_{new}(\mathrm{p_{m}})=M_{old}(\mathrm{p_{m}})-0.3&-1\leq M_{ old}(\mathrm{p_{m}})\leq 0.9\\ M_{new}(\mathrm{p_{m}})=-0.95&0.9<M_{old}(\mathrm{p_{m}})\leq 1\end{cases}  \tag{3}\]  
Figure 3 is the simulation comparison between the proposed updating strategy and the existing method. In this figure, the upper three from left to right are the grid maps at time T, T+1, and T+2 using the proposed updating strategy. The bottom row is the results from the existing method. The red point in each figure represents the LiDAR, which goes straight along a corridor. Two dynamic targets enter into the LiDAR scanning range from the unknown area. One target is approaching the LiDAR, and the other one crosses the corridor from left to right. We can find that in the map of the existing method, a trajectory of a moving target is left, although this trajectory will slowly become shallower with the continuous updating, but it will affect the accuracy of scan matching, especially in a low-texture environment. On the contrary, in the map generated by the proposed updating strategy, there is no moving target trajectory left, which eliminates the effects of the dynamic target. Figure 2: 2D grid-based map of occupancy. The grid map is processed with the bicubic interpolation method for derivative computing.