# An Algorithm to Assist the Robust Filter for Tightly Coupled RTK/INS Navigation System
## Appendix A The Derivation of the Observation Matrix  
Let us ignore the lever-arm offset for a moment. We assume there are two satellites, \(S_{i}\) and \(S_{j}\), and the position error is added to the true position as Figure 11 shows:  
The position error can only result in a distance error between the satellites and the user receiver because the reference station is accurately localized. Because the position error is small, the LOS vector from the true position to a satellite is the same as that from the nominal position to the satellite. Furthermore, the change in the distance between the satellite and the receiver can be calculated based on the LOS vector and the change of the receiver's position, as Equation (A1) shows [70]:  
\[r_{S_{i},\text{nominal}}=r_{S_{i},\text{true}}-\mathbf{o}_{S_{i}}\cdot\delta\mathbf{ p}.\] (A1)Accordingly, the nominal DD distance \(\
abla\Delta\vec{r}_{{}_{S_{i}}\cdot S_{j}}\) and the true DD distance \(\
abla\Delta r_{{}_{S_{i}}\cdot S_{j}}\) can be formulated as Equation (A2) shows:  
\[ \begin{split}\
abla\Delta\vec{r}_{{}_{S_{i}}\cdot S_{j}}& =\
abla\Delta r_{{}_{S_{i}}\cdot S_{j}}-\mathbf{o}_{{}_{S_{i}}}\cdot \delta\mathbf{p}+\mathbf{o}_{{}_{S_{j}}}\cdot\delta\mathbf{p}\\ &=\
abla\Delta r_{{}_{S_{i}}\cdot S_{j}}+(\mathbf{o}_{{}_{S_{j}}}-\bm {o}_{{}_{S_{i}}})\cdot\delta\mathbf{p}.\end{split} \] (A2)  
Because we neglect the lever-arm offset, the INS position is the same as the GNSS antenna. Considering Equations (3) and (4), we can calculate a component of the measurement vector as:  
\[ \begin{split}\
abla\Delta\rho_{{}_{S_{i}}\cdot S_{j}}-\
abla \Delta\vec{r}_{{}_{S_{i}}\cdot S_{j}}&=(\mathbf{o}_{{}_{S_{i}}}-\bm {o}_{{}_{S_{j}}})\cdot\delta\mathbf{p}+\
abla\Delta\omega_{\rho},\\ \
abla\Delta\phi_{{}_{S_{i}}\cdot S_{j}}-\
abla\Delta\vec{r}_{{}_ {S_{i}}\cdot S_{j}}&=(\mathbf{o}_{{}_{S_{i}}}-\mathbf{o}_{{}_{S_{j}}}) \cdot\delta\mathbf{p}+\lambda\cdot(\Delta N_{{}_{S_{i}}}-\Delta N_{{}_{S_{j}}})+ \
abla\Delta\omega_{\phi}.\end{split} \] (A3)  
Equation (A3) shows that only the position error and the SD ambiguity in the state vector contribute to the measurement vector when we neglect the lever-arm offset. Considering all the available satellites, we can obtain Equation (A4):  
\[ \begin{split}\begin{bmatrix}\
abla\Delta\phi_{{}_{S_{1}}\cdot S_ {2}}&-\
abla\Delta\vec{r}_{{}_{S_{1}}\cdot S_{2}}\\ \
abla\Delta\phi_{{}_{S_{1}}\cdot S_{3}}&-\
abla\Delta\vec{r}_{{}_{S_{1}} \cdot S_{3}}\\ \vdots\\ \
abla\Delta\phi_{{}_{S_{1}}\cdot S_{m}}-\
abla\Delta\vec{r}_{{}_{S_{1}} \cdot S_{m}}\\ \
abla\Delta\rho_{{}_{S_{1}}\cdot S_{2}}&-\
abla\Delta\vec{r}_{{}_{S_{1}} \cdot S_{2}}\\ \
abla\Delta\rho_{{}_{S_{1}}\cdot S_{3}}&-\
abla\Delta\vec{r}_{{}_{S_{1}} \cdot S_{3}}\\ \vdots\\ \
abla\Delta\rho_{{}_{S_{1}}\cdot S_{m}}-\
abla\Delta\vec{r}_{{}_{S_{1}} \cdot S_{m}}\\ \end{bmatrix}=\begin{bmatrix}\mathbf{DWL}&\lambda\cdot\mathbf{D}\\ \mathbf{DWL}&\mathbf{O}_{(m-1)\times m}\\ \end{bmatrix}\begin{bmatrix}\delta\mathbf{p}\\ \mathbf{\kappa}\\ \end{bmatrix}.\end{split} \] (A4)  
Readers can refer to the documents of PSINS to find the details about the transformation matrix \(L\). The attitude error can generate a position error when the lever-arm offset exists. Figure A1 illustrates the lever-arm offset in the body frame. We use \(I^{\text{b}}\) and \(I^{\text{e}}\) to denote the lever-arm offset in the body frame and ECEF frame, respectively. As the measurement vector is calculated in the ECEF frame, we should calculate the position of the GNSS antenna based on the INS position and \(I^{\text{e}}\). If there is no error, \(I^{\text{e}}\) can be formulated as Equation (A5) shows:  
\[I^{\text{e}}=\mathbf{C}^{\text{e}}_{\text{n}}\mathbf{C}^{\text{n}}_{\text{b}}I^{\text{ b}}.\] (A5)  
In Equation (A5), the attitude error will not influence \(\mathbf{C}^{\text{e}}_{\text{n}}\) as it can be directly calculated using the position. Considering the attitude error \(\mathbf{\phi}\), we can calculate the nominal lever-arm offset in ECEF frame \(\widetilde{I}^{\text{e}}\), as Equation (A6) shows:  
\[