# Visual-Inertial Navigation System Based on Virtual Inertial Sensors
## 4 Analysis and Experiments of Visual-Inertial Odometry Optimization
### Localization and Mapping Experiments in Degenerated Environments
The road and parking lot that circled the building created a challenging closed-loop path, requiring the system to handle dynamic changes in the environment, such as moving vehicles and pedestrians. The filtering-based mechanism of VINS-Fusion proved to have limitations in this kind of environment, as deviations from the reference path occurred after loop closure. In contrast, our system demonstrated improved robustness and accuracy in handling dynamic changes, including correcting for data distortion caused by large camera shakes through a virtual inertial navigation component. In addition, the significant path errors that can occur when the camera angle changes sharply during turns were also addressed in this experiment. As shown in Figure 9d, the proposed SLAM system was able to correct for these errors, resulting in more accurate and stable trajectory estimation. To evaluate the performance of the SLAM systems in the outdoor environment, the same evo tool was used, and the results are shown in Figure 9e,f and Table 6. Compared to VINS-Fusion, the proposed system demonstrated better performance in terms of reducing the maximum error (Max) by an average of 14.9%, the mean error (Mean) by an average of 3.21%, the median error (Medium) by an average of 4.73%, the root means square error (RMSE) by an average of 7.04%, and the standard deviation error (Std) by an average of 22.5%. These results confirm the effectiveness of the proposed system in handling complex outdoor environments and improving the trajectory estimation accuracy. In Experiment 3, we selected a building as a closed loop, as shown in Figure 10a. The ground truth is shown in Figure 10a,b. During the data collection process, we deliberately increased the camera's motion speed and amplitude to simulate a scenario where VINS-Fusion may struggle to track the camera's motion. We also introduced errors in the initial pose information to evaluate the robustness of the two SLAM systems. When the camera's motion speed and amplitude were too high, it was difficult to track, leading to a decrease in the tracking performance of VINS-Fusion. Additionally, VINS-Fusion has a high demand for initial pose information, and the lack of accurate initial pose information can cause errors to accumulate gradually, leading to significant distortion during initialization. In contrast, the visual-inertial SLAM aided by VIMU can utilize foot sensor data to provide more information, and adjust the weight ratios of each data to achieve better tracking and curve fitting results, while reducing the demand for accurate initial pose information [23], as shown in Figure 10d,e. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Error** & **VINS-VIMU** & **VINS** \\ \hline Max & 2.228963 & 2.619871 \\ \hline Mean & 1.273015 & 1.315248 \\ \hline Median & 1.457812 & 1.530268 \\ \hline RMSE & 1.381425 & 1.486064 \\ \hline std & 0.536441 & 0.691744 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Error comparison between VINS-VIMU and VINS-Fusion based on GPS baseline. Figure 9: (**a,b**) Skewed image of Ground Conditions in Experiment 2. (**c**) Real scene of the outdoor experimental environment; (**d**) comparison of the localization performance between VINS-VIMU and VINS-Fusion, using GPS data collected simultaneously as the actual route benchmark; (**e**) localization performance of VINS-VIMU; (**f**) localization performance of VINS-Fusion. The results of the experiment showed that our visual-inertial SLAM aided by VIMU outperformed the VINS-Fusion system. The VIMU-based SLAM system was able to handle the camera's fast and large motion while maintaining accurate tracking, whereas VINS-Fusion struggled and suffered from a decrease in tracking performance. Moreover, the VIMU-based system showed better performance in initialization, achieving more accurate pose estimation than VINS-Fusion, even when the initial pose information was inaccurate.