## 2 Materials and Methods
### Adaptive GNSS-RTK/LIO Fusion
\(\mathbf{C}_{\mathcal{B},k}\) is the covariance matrix for the IMU factor and is iteratively derived during the pre-integration according to the covariance propagation rule used when a linear transformation is performed on a random variable [44]. \(\mathbf{C}_{\mathcal{G},j}\) is the covariance matrix for the adaptively added GNSS-RTK factor and is assumed to be constant due to no further information quantitatively indicating the quality of the solution is taken into account such as the Ambiguity Dilution of Precision (ADOP) and the Position Dilution of Precision(PDOP) [55], among which the ADOP is based on the determinant of the covariance matrix of the least-squares ambiguities and defined as follows [56]:  
\[\text{ADOP}=\sqrt{det(\mathbf{Q}_{a})^{\frac{1}{n}}}(cycle) \tag{13}\]  
where \(\mathbf{Q}_{\bar{a}}\) is the covariance matrix of the ambiguities and \(n\) is its order. The estimated states could be derived as:  
\[\mathbf{X}=\min_{\mathbf{X}}\frac{1}{2}\mathbf{f}(\mathbf{X}). \tag{14}\]  
Levenberg-Marquardt (L-M) algorithm [57] implemented in Ceres Solver [58] is utilized to solve the non-linear optimization problem during which the residuals are minimized. The states in a window are updated iteratively until convergence. As for the \(i\)-th iteration, the update procedure is as follows:  
\[\left(\mathbf{J}^{T}\mathbf{J}+\lambda\mathbf{I}\right)\Delta\mathbf{X}_{i}=- \mathbf{J}^{T}\mathbf{r}, \tag{15}\]  
\[\mathbf{X}_{i+1}=\mathbf{X}_{i}\otimes\Delta\mathbf{X}_{i}, \tag{16}\]  
in which, \(\lambda\) is the damping factor of the L-M algorithm automatically set according to the reduction of the residuals to control the step of the states. \"\(\otimes\)\" denotes that for each state \(\mathbf{x}_{k,i+1}=\mathbf{x}_{k,i}\Delta\mathbf{x}_{k,j}\). \(\mathbf{r}\) represents the residual of each factor shaping to a column vector as follows:  
\[\mathbf{r}=\left[\mathbf{r}_{C,1}^{T},\cdots,\mathbf{r}_{C,w-1}^{T},\mathbf{ r}_{B,1}^{T},\cdots,\mathbf{r}_{B,w-1}^{T},\mathbf{r}_{G,j_{1}}^{T},\cdots, \mathbf{r}_{G,j_{n}}^{T}\right]^{T} \tag{17}\]  
For brevity, the \(\mathbf{r}_{C,(\cdot)}\), \(\mathbf{r}_{B,(\cdot)}\), and \(\mathbf{r}_{G,j_{n}}\) with \(j_{n}\in[0,w)\) denotes the residual of the LiDAR factor, the IMU factor, and the adaptively added GNSS-RTK factor respectively. \(\mathbf{J}\) is the jacobian matrix of \(\mathbf{r}\) referring to \(\mathbf{X}\) expressed as follows:  
\[\mathbf{J}=\frac{\partial\mathbf{r}}{\partial\mathbf{X}}=\left[\frac{\partial \mathbf{r}}{\partial\mathbf{x}_{0}},\ \frac{\partial\mathbf{r}}{\partial\mathbf{x}_{1}},\ \cdots,\frac{\partial\mathbf{r}}{\partial\mathbf{x}_{w-1}}\right]=\left[ \begin{array}{cccc}\frac{\partial\mathbf{r}_{C,1}}{\partial\mathbf{x}_{0}} &\frac{\partial\mathbf{r}_{C,1}}{\partial\mathbf{x}_{1}}&\cdots&\frac{ \partial\mathbf{r}_{C,1}}{\partial\mathbf{x}_{w-1}}\\ \vdots&\vdots&\cdots&\vdots\\ \frac{\partial\mathbf{r}_{C,w-1}}{\partial\mathbf{x}_{0}}&\frac{\partial \mathbf{r}_{C,w-1}}{\partial\mathbf{x}_{1}}&\cdots&\frac{\partial\mathbf{r}_ {C,w-1}}{\partial\mathbf{x}_{w-1}}\\ \vdots&\vdots&\cdots&\vdots\\ \frac{\partial\mathbf{r}_{G,j_{1}}}{\partial\mathbf{x}_{0}}&\frac{\partial \mathbf{r}_{G,j_{1}}}{\partial\mathbf{x}_{1}}&\cdots&\frac{\partial\mathbf{r}_ {G,j_{n}}}{\partial\mathbf{x}_{w-1}}\\ \vdots&\vdots&\cdots&\vdots\\ \frac{\partial\mathbf{r}_{G,j_{1}}}{\partial\mathbf{x}_{0}}&\frac{\partial \mathbf{r}_{G,j_{1}}}{\partial\mathbf{x}_{1}}&\cdots&\frac{\partial\mathbf{r}_ {G,j_{n}}}{\partial\mathbf{x}_{w-1}}\\ \vdots&\vdots&\cdots&\vdots\\ \frac{\partial\mathbf{r}_{G,j_{1}}}{\partial\mathbf{x}_{0}}&\frac{\partial \mathbf{r}_{G,j_{1}}}{\partial\mathbf{x}_{1}}&\cdots&\frac{\partial\mathbf{r} _{G,j_{n}}}{\partial\mathbf{x}_{w-1}}\\ \end{array} \right], \tag{18}\]  
Fortunately, the residual of each factor is only related to one or two states rather than most of the states as shown in Figure 3[59]. In other words, the matrix \(\mathbf{J}\) and \(\mathbf{J}^{T}\mathbf{J}\) are both sparse. Therefore, computational efficiency is guaranteed.