## 3 Cartographer Algorithm Improvement
### Experimental Data Analysis  
This study explores the error performance of the original algorithm, the original algorithm fused with inertial sensors, and the improved algorithm fused with inertial sensors in three cases by analyzing and comparing the absolute and relative error data in Tables 1-6. This error performance aims to explore and illustrate the accuracy of constructing real-time maps; simultaneously, the algorithm's requirement for computational resources of computer and robot hardware is another important criterion for judging map construction and localization algorithms. Computational power consumption can illustrate the algorithm's efficiency in constructing real-time maps, measured by observing the CPU occupancy when running the algorithm. By monitoring the CPU occupancy during the execution of the algorithm, it is possible to determine the algorithm's ability to process data promptly and, therefore, its ability to build and update maps under real-time constraints. The selected positions in Tables 1-3 are used as horizontal coordinates, and the absolute errors are used as vertical coordinates to draw Figure 14, a table of absolute errors for the \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Location** & **Actual Value/m** & **Measured Value** & **Absolute Error/m** & **Relative Error/\%** \\ \hline
1 & 20.325 & 20.329 & 0.004 & 0.02 \\
2 & 15.455 & 15.57 & 0.115 & 0.74 \\
3 & 6.615 & 6.657 & 0.042 & 0.63 \\
4 & 2 & 2.004 & 0.004 & 0.20 \\
5 & 5.38 & 5.369 & 0.011 & 0.20 \\
6 & 0.6 & 0.589 & 0.011 & 1.83 \\
7 & 1.99 & 2.01 & 0.02 & 1.01 \\
8 & 1.7 & 1.694 & 0.006 & 0.35 \\ \hline \hline \end{tabular} Note: 1 (The longest side of the map), 2 (Map Sub-Long Edge), 3 (Map broadside), 4 (Obstacles), 5 (U-shaped sofa length), 6 (U-shaped sofa width), 7 (O-shaped sofa width), 8 (Door frame width).  
\end{table} 
Table 6: Optimized algorithm fusion inertial guidance test data in Figure 13.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Location** & **Actual Value/m** & **Measured Value** & **Absolute Error/m** & **Relative Error/\%** \\ \hline
1 & 20.325 & 20.634 & 0.309 & 1.52 \\
2 & 15.455 & 15.637 & 0.182 & 1.18 \\
3 & 6.615 & 6.67 & 0.055 & 0.83 \\
4 & 2 & 2.008 & 0.008 & 0.4 \\
5 & 5.38 & 5.33 & 0.05 & 0.93 \\
6 & 0.6 & 0.583 & 0.017 & 2.83  
0.95% to 0.53%. In measuring and analyzing the length of the obstacle, the absolute error decreased from 0.182 m to 0.122 m, and the relative error also decreased by 1.63%. As summarized in Figures 14 and 15, the error curve of the original algorithm is consistently higher than the error curve of the original algorithm fusing inertial sensors and higher than the error curve of the improved algorithm fusing inertial sensors. Figures 16 and 17 show the changes in absolute and relative errors in the three cases during the map-building of the lobby of the teaching building. As seen in Figure 17, the original algorithm's relative error curve fluctuates the most. In contrast, the curve of the improved algorithm incorporating inertial sensors fluctuates the least, can maintain better accuracy, and is the most stable. The lower relative error indicates that the algorithm can build the map more accurately and with less deviation relative to the accurate map. According to Figures 14 and 15 results, the performance is significantly better than the case without fused sensors by keeping the original algorithm unchanged and combining inertial sensors. When measuring the longest edge of the map, the absolute error is reduced from 0.5 m to 0.41 m, and the relative error is also reduced from 0.95% to 0.78%, which will mitigate the long and straight corridor effect. In addition, according to the results in Figures 16 and 17, the improved algorithm reduces the absolute error of U-shaped couch length from 0.05 m to 0.011 m and the relative error from 0.73% while keeping the fused inertial sensors unchanged, which significantly improves the performance and makes the algorithm more stable.