# Research on Map-SLAM Fusion Localization Algorithm for Unmanned Vehicle
## 3 Fusion of Lane Location Information and SLAM Positioning Algorithm
### Result Processing and Output  
After each observation update, the value with the highest probability \(K_{\max\,x}=\max\limits_{n}\left(P_{X_{k+1}n}^{k+1}\right)\) is output as the current vehicle position relocation result. At the same time, according to the position \(K_{\max\,x}\) and direction angle of \(K_{\max\,\theta}\), calculate the position of the current point and the original lane line point in the map, so as to obtain the updated local positioning result \(d_{lane}\). Take the latest result obtained as the latest value and repeat the above steps to update the position. The above results probabilistically process the position of the vehicle on the map. However, there are still some special problems that cause the system to fail to run, or make the convergence speed too slow:  
a. There are not enough candidate points, or the probability value of the candidate points is too small. When the system moves in a straight line for a long time, because the accumulated error is already large, the selected points are often limited to a certain range, resulting in the inability to update the position. The solution is that when the probability of a candidate point is too small, delete this point and let \(D^{\prime}=2*D,Q=2*Q\) expand the value of the covariance matrix to facilitate the selection of more points next time. b. Lack of significant optimal points. If there is no significant optimal point \(P_{\rm xmax}>0.3\&\&P_{\rm xmax}>\sum\limits_{x\rm mK}P_{x}\), the probability difference of each candidate point is small at this time, and it is easy to fall into the local optimal value and cannot move forward. In places with obvious detours (intersections exceeding 90 degrees), the change of angle information is too obvious. Two candidate points with very different positions are likely to have similar probabilities. Therefore, at this time, it is necessary to randomly select candidate points, so that the predicted candidate points can be dispersed into different possibilities as much as possible, and the convergence speed can be faster. After initialization, it generally only takes 10 iterations to converge, and the accuracy meets the needs of unmanned navigation. c. The local positioning result of the lane line is invalid. When lane line detection fails or false detection occurs, in order to maintain the stability of the system, the SLAM output result is used to calculate the current estimated value, so as to obtain the distance between the current position and the lane line in the map and generate the trajectory of the candidate points. At the same time, in the subsequent probability calculation link, this error is always 0, which does not affect the positioning result. The position update effect can still be achieved through the angle, position and other information. When the detection information is restored, the positioning function continues to be realized. Robustness is improved. Finally, the algorithm obtains the current optimal positioning result. It is worth noting that this method can not only have a relocation effect on the global position, but also increase the positioning accuracy. At the same time, the results obtained for the local positioning of the lane lines can also have an optimization effect. Different from the results obtained directly from the local positioning of the lane lines detection, this paper calculates the local positioning by calculating the distance between the final output point with the maximum probability and the original lane line in the map. As a result, with the continuous information output by SLAM, the robust kernel function can ensure the normal operation of the system in the case of lane line detection failure or detection error. At the same time, the local positioning results are coherent and the accuracy is improved. The algorithm proposed in this paper is essentially a mapping search for two trajectories, but different from the previous trajectory relocation algorithm, this paper applies the prediction model and successfully solves the real-time problem.