## 2 Improved AMCL Algorithm
### Comparison of Performance Metrics of the Improved AMCL Algorithm  
The AMCL and improved AMCL algorithms are tested in simulation experiments, respectively. The simulated AGV is started on ROS with a Gmapping raster map, and the start point and end point are set to use the two algorithms for trajectory tracking planning, respectively. The distance between the cyclic Gmapping maps is 10 m, and the walking of 10 circles is one round, ten rounds. The data of each travel is recorded using a rosbag file and then imported into Matlab for simulation analysis. As shown in Figure 9, the simulation is carried out in the ROS operating system.  
Where the parameters are set to \(c=0\).357, \(\varepsilon=0.2\), \(\tau=0.05\), \(\delta=0.01\). The rest of the parameters were kept unchanged.  
The packet rosbag obtained on ROS was imported into Matlab 2021B, after which the data was extracted to obtain the following plot of fitted and analyzed data.  
The data for each of the simulations are shown in Table 2. Table 2 represents the parameter differences between the two different algorithms in the simulation case.  
Figure 8: Analysis of clustering statistics results: (**a**) sampled particles are divided into regions based on weights; (**b**) clustering to find particles with higher weights; (**c**) Comparison of weighting information for different clustered regions.  
Figure 9: Simulation path planning: (**a**) from the starting point to the target point; (**b**) return from the target point to the starting point.  
As can be seen from the illustration, the trace of the error is consistent with the offset error generated during AGV traveling. Still, it needs to be corrected concerning the actual speed value, a priori estimate, and a posteriori estimate. That is, the following predicted path in the process of traveling has a significant deviation from the real path, and it is easy to produce a situation in which the command route is not the same as the real route.  
The improved algorithm was tested in the simulation by setting the initial yaw angle to 60\({}^{\circ}\). The value change in the optimized algorithm, while ensuring that the rest of the parameters are the same, yields the silky smoothness of the real trajectory graph running over the time of (a) in Figure 10. The improved algorithm is better smoothed compared to the AMCL. (b) The grey lines in the figure serve as the measured data, with a large degree of deviation; the green lines serve as the modelled values, with a smaller degree of deviation; and the final filtered results are much closer to the true values, and the traces of error have converged to a minimum. From the figure, it can be concluded that the fluctuation is small and the performance is relatively smooth. The thin line represents the AMCL algorithm test results, and the thick line represents the improved AMCL algorithm test results. (c) and (d) in Figure 10 illustrate that the improved AMCL algorithm performs smoother for the fluctuation of the errors of the true value of the speed, the a priori estimate and the a posteriori estimate for different directions, the errors are within the permissible range, and the improvement of the algorithm meets the requirements and performs well.