## 2 Methodology
### INS and RTK Fusion  
The fusion algorithm integrates RTK and INS measurements using a robust Kalman filter (EKF), where the state vector x includes the position, velocity, orientation, and their respective biases. The innovation here is the inclusion of a real-time weighting scheme that adjusts the contribution of the RTK and INS measurements based on their current estimated accuracy. To integrate the INS dynamic model with the RTK measurement model effectively, this study employs an EKF, which is specifically tailored to handle the non-linearities and uncertainties inherent in combining these two types of data. The robustness of the Kalman filter in this context is achieved through enhancements that include adaptive noise covariance to manage the varying quality of GNSS data in urban environments and the implementation of outlier rejection mechanisms to mitigate the impact of spurious measurements from both GNSS and INS systems. The integration process begins with the establishment of a comprehensive state vector that includes position, velocity, and orientation components derived from both GNSS and INS systems. The state vector is updated using a prediction model based on the INS data and a correction step that incorporates GNSS measurements. The equations for the prediction and update steps are as follows:  
\[\text{Prediction}:\ \hat{x}_{k|k-1}=F_{k}\hat{x}_{k-1|k-1}+B_{k}u_{k}\]  
\[\text{Update}:\ \hat{x}_{k|k}=\hat{x}_{k|k-1}+K_{k}\left(y_{k}-H_{k}\hat{x}_{k|k-1}\right)\]  
where \(\hat{x}_{k|k-1}\) is the a priori state estimate, \(F_{k}\) is the state transition model, \(B_{k}\) is the control input model applied to the control vector \(u_{k}\), K\({}_{k}\) is the Kalman Gain, \(y_{k}\) represents the measurements from the GNSS, and \(H_{k}\) is the measurement matrix. The system continuously recalibrates the noise matrices \(Q\) (process noise) and \(R\) (measurement noise) based on the real-time assessment of the data quality from both systems, enhancing the filter's robustness and reliability. Through these mechanisms, the robust Kalman filter effectively synthesizes data from the GNSS and INS systems, providing a more accurate and reliable estimate of the vehicle's position and orientation than could be achieved by either system alone. In this study, the integration of RTK and INS measurements is enhanced by a real-time weighting scheme designed to dynamically adjust the contribution of each data source based on its current estimated accuracy. This approach is critical for maintaining high accuracy in environments where the reliability of GNSS signals fluctuates, such as urban canyons or densely built-up areas. The measurement accuracy for the RTK position is primarily assessed using metrics such as the SNR and the geometry of visible satellites, while the accuracy of INS data is evaluated based on the observed drift and bias over time. The real-time weighting scheme assigns a weight to each measurement based on the inverse of its variance, ensuring that more accurate measurements have a greater influence on the final position estimate. Mathematically, this can be expressed as follows:  
\[\omega_{RTK}=\frac{1}{\sigma_{RTK}^{2}} \tag{14}\]  
\[\omega_{INS}=\frac{1}{\sigma_{INS}^{2}} \tag{15}\]where \(\omega_{RTK}\) and \(\omega_{INS}\) represent the standard deviations of the RTK and INS measurements, respectively. The final fused position estimate is then computed as a weighted average of the RTK and INS estimates, as follows:  
\[\hat{x}_{fused}=\omega_{RTK}.\hat{x}_{RTK}+\omega_{INS}.\hat{x}_{INS} \tag{16}\]  
This dynamic adjustment process allows the system to respond to real-time changes in measurement quality. For instance, in scenarios where RTK signals degrade due to multipath effects or poor satellite visibility, the system automatically increases the reliance on INS data to maintain positioning accuracy. Conversely, when the RTK data are robust, they contribute more significantly to the final estimate, leveraging its potential for high precision.