# A Frame-to-Frame Scan Matching Algorithm for 2D Lidar Based on Attention
###### Abstract
[13] have carried out a number of studies to determine impact factors such as the overlap ratio, angle difference, distance difference, and noise to come up with a global solution to the ICP algorithm. [PERSON] et al. [14] proposed a global point set registration method that decouples the optimization of translation and rotation. Additionally, the global translation parameter was obtained first using a fast branch-and-bound method, and then the optimal rotation parameter was calculated using the global translation parameter. In addition to the ICP algorithm and its variants, there are different methods for frame-to-frame scan matching. [PERSON] et al. [15] proposed the Normal Distribution Transform (NDT) algorithm, which assumes that the environmental structure has local continuity and constructs multiple local Gaussian distributions to represent the overall geometric structure of the environment and achieves registration by minimizing the distance between the lidar point to the normal distribution. The NDT method is widely used in robot mapping and localization tasks [16]. [PERSON] et al. [17] proposed a sonar scan matching method based on NDT that combined two different sonars to reduce the drift errors. [PERSON] et al. [18] proposed a scan matching method based on NDT and particle swarm optimization that could determine the global optimal solution with 70 particles. To overcome the influence of local extrema on the matching results, [PERSON] [19] proposed the Correlative Scan Match (CSM) method, which divides the search area into grids and then enumerates the poses corresponding to each grid to obtain the robot's position. The CSM method avoids the influence of local extreme values through enumeration. [PERSON] et al. [20] proposed an improved CSM method that analyzes environmental degradation with a covariance matrix, which greatly improved the robustness of the algorithm in complex environments. [PERSON] et al. [21] proposed the construction of a local grid map and then generated a continuous likelihood map with Lagrangian interpolation before using the Gauss-Newton method to register the algorithm. [PERSON] et al. [22] proposed a novel end-to-end trainable deep neural network for rigid point set registration: RPSRNet, which used a novel 2D-tree representation for the input point sets and hierarchical deep feature embedding in the neural network. [PERSON] et al. [23] proposed the lidar odometry and mapping (LOAM)method, which utilizes edge features and planar features in the lidar scans. LOAM is very suitable for structured environments. To improve the accuracy, [PERSON] et al. [24] proposed fusing lidar and vision to construct a more accurate odometry. [PERSON] et al. [25] proposed a lightweight and ground-optimized lidar odometry and mapping (Lego-LOAM) algorithm that leverages the presence of a ground plane during its segmentation and optimization steps and that utilizes two-step optimization to solve different components of the transform matrix. All of the methods above use two consecutive frames for scan matching, and the pose is integrated frame by frame, so the matching error also accumulates frame by frame. Although strategies have been adopted to minimize the matching error between frames, the increase in the error frame by frame still limits their matching accuracy. Moreover, these methods use most of the laser points for scan matching, resulting in a low matching efficiency. Although we can integrate data sampling methods [26; 27] to improve the computational efficiency, this would reduce the matching accuracy. To overcome the shortcomings of the above methods, we introduce an attention mechanism and propose a scan matching method to achieve both high accuracy and computational efficiency. This paper introduces an attention mechanism into the frame-to-frame scan matching algorithm. Different from the above methods, the proposed method only accumulates errors when the attention area is switched.