# Enhancing Real-Time Kinematic Relative Positioning for Unmanned Aerial Vehicles
## 4 Proposed Dual Kalman Filter Structure for RTK and Its Rationales
### Conventional Kalman Filter Based RTK Approach  
In Section 3, the preprocessing of GNSS measurements is discussed, such as GNSS measurement selection with the satellite elevation angle and C/N0 of the measurements, the detection of cycle slips, and the time synchronization of GNSS measurements. This section deals with the procedures that remain after the GNSS measurement time synchronization block in Figure 8.  
The state vector for a KF-based RTK denoted as \(\boldsymbol{x}_{ij}\) includes relative position vector, relative velocity vector, and single differenced integer ambiguities. \[\boldsymbol{x}_{ij}= \begin{bmatrix}\boldsymbol{r}_{\text{ij}},\boldsymbol{v}_{ \text{ij}},N_{1,\text{ij}},\cdots,N_{m,\text{ij}}\end{bmatrix} ^{T}. \tag{14}\]  
Here, \(\boldsymbol{r}_{\text{ij}}\), \(\boldsymbol{v}_{\text{ij}}\) are relative position and velocity vector and \((N_{1,\text{ij}},N_{2,\text{ij}},\cdots,N_{m,\text{ij}})\) are single differenced integer ambiguities between receiver \(i\) and receiver \(j\) when \(m\) GNSS carrier phase measurements are available. With a discrete state transition matrix from the \((k-1)\)th epoch to the \(k\)th epoch, denoted as \(\boldsymbol{F}_{k-1}^{k}\), the predicted state vector, and its covariance matrix are computed from the previously updated state vector and its covariance matrix. \[\widehat{\boldsymbol{x}}_{ij,k}^{-}=\boldsymbol{F}_{k-1}^{k} \widehat{\boldsymbol{x}}_{ij,k-1}^{+} \tag{15}\] \[\boldsymbol{P}_{k}^{-}=\boldsymbol{F}_{k-1}^{k}\boldsymbol{P}_{k -1}^{+}\boldsymbol{F}_{k-1}^{k}{}^{T}+\boldsymbol{Q}_{k-1}^{k}\]  
where  
\[\boldsymbol{F}_{k-1}^{k}=\left[ \begin{array}{ccc}\boldsymbol{I}_{3\times 3}& \boldsymbol{I}_{3\times 3}dt&\\ &\boldsymbol{I}_{3\times 3}&\\ &&\boldsymbol{I}_{m\times m}\end{array} \right],\quad\boldsymbol{Q}_{k-1}^{k}= \left[ \begin{array}{ccc}\boldsymbol{Q}_{pos}&\\ &\boldsymbol{Q}_{vel}&\\ &&\boldsymbol{Q}_{int}\end{array} \right]. \tag{16}\]  
Here, \(\widehat{\boldsymbol{x}}_{ij,k}^{-}\) and \(\boldsymbol{P}_{k}^{-}\) are predicted state vector and its covariance matrix at the \(k\)th epoch, and \(\widehat{\boldsymbol{x}}_{ij,k-1}^{+}\) and \(\boldsymbol{P}_{k-1}^{+}\) are updated state vector and its covariance matrix at the \((k-1)\)th epoch. A constant-velocity model is used for the state transition matrix and \(dt\) is the time duration between the \((k-1)\)th epoch and the \(k\)th epoch. \(\boldsymbol{Q}_{k-1}^{k}\) refers to the system noise matrix over the time \(dt\). When new measurements arrive, KF gain, \(\boldsymbol{K}_{k}\), which determines weights to the new measurements are calculated as follows  
Figure 8: Flowchart for a conventional Kalman filter-based RTK. \[ \begin{split} K_{k}=P_{k}^{-}H_{k}^{T}\Big{(}H_{k}P_{k}^{-}H_{k}^{T}+R_{ k}\Big{)}^{-1}\end{split}  \tag{17}\]  
where  
\[ \begin{split}\mathbf{H}_{k}=\left[\begin{array}{cc}-G& \mathbf{0}_{m\times 3}&\mathbf{\Lambda}D_{N}\\ -G&\mathbf{0}_{m\times 3}&\mathbf{0}\end{array}\right]\!,\ \ \ R_{k}=\left[\begin{array}{cc}R_{\
abla\Delta\phi}&\\ &R_{\
abla\Delta\rho}\end{array}\right]\!.\end{split}  \tag{18}\]  
Here, \(H_{k}\) is a linearized measurement model that incorporates the \(G\) matrix in Equation (5), and \(R_{k}\) is a covariance matrix for measurement noise. The initial parameters of the KF were set based on established benchmarks from previous work, particularly referencing [21]. These parameters were subsequently updated through heuristic comparison with results obtained from our experimental data. The matrix \(D_{N}\) converts single differenced integer ambiguities into double differenced integer ambiguities of carrier phase measurements, where \(\mathbf{\Lambda}\) is a diagonal matrix composed of wavelengths of the respective carrier phase measurements. Given that each satellite constellation, such as GPS, GAL, and BDS, has its own pivot satellite, the \(D_{N}\) matrix with all of these constellations is formulated as follows:  
\[