# An Improved Single-Epoch Attitude Determination Method for Low-Cost Single-Frequency GNSS Receivers
## 2 GNSS Attitude Determination
### GNSS Multi-Baseline Model  
The traditional GNSS multi-baseline model is used to ensure that the different observations between each baseline and its stochastic model can be fully applied. Assume that we have m + 1 observation stations and m baselines. The number of common-view satellites for each baseline is \(n_{1}\)\(n_{2}\cdots\)\(n_{m}\), respectively. As for the short baseline, atmospheric-related errors are greatly eliminated. Thus, the GNSS multi-baseline model is expressed as follows:  
\[E(\text{Y})=\text{AZ}+\text{GB},\text{D}(\text{Y})=\text{Q}_{Y},z\in Z^{n_{1}+ n_{2}+\cdots+n_{m}},B\in R^{3m} \tag{8}\]  
where \(N=n_{1}+n_{2}+\cdots+n_{m}\). \(Y\) (\(2N\times 1\)) is the double-differenced observations of the \(m\) baselines, \(Z\) (\(N\times 1\)) is the double-differenced ambiguity vector of the \(m\) baselines, \(B\) (\(3m\times 1\)) is the baseline vector, \(A\) (\(2N\times N\)) is the double-differenced ambiguity coefficient matrix, and \(G(2N\times 3m)\) is the construction matrix. \(\text{Q}_{Y}\) is the variance matrix of all the observations. Note that because of the different common-view satellites for all the baselines, the observation variance matrix cannot be directly obtained by the Kronecker product. Instead, it can be calculated according to the covariance propagation law, by the following:  
\[L_{SD}=D_{SD}L_{UD},\ Q_{SD}=D_{SD}Q_{UD}D_{SD}^{T},\ D_{SD}=\left[\begin{array} []{ccc}D_{b_{1}}&D_{T_{1}}&0\\ D_{b_{2}}&0&D_{T_{2}}\\ \end{array}\right] \tag{9}\]  
where \(L_{UD}\), \(L_{SD}\), and \(L_{DD}\) are un-, single-, and double-differenced observations; \(Q_{UD}\), \(Q_{SD}\), and \(Q_{DD}\) are the correspondent variance-covariance matrix; \(Q_{UD}\) follows the elevation angle weighting approach; \(D_{SD}\) and \(D_{DD}\) are coefficient matrixes from the un- to single-differencing, and single- to double-differencing observations, respectively; and \(D_{b_{1}},D_{b_{2}},D_{T_{1}},D_{T_{1}},D_{b_{T_{2}}}\) are the corresponding coefficients.  
\[E(\text{Y})=\text{AZ}+\text{GRF},\text{D}(\text{Y})=\text{Q}_{Y},z\in Z^{n_{1} +n_{2}+\cdots+n_{m}},B\in R^{3p} \tag{10}\]where F is the matrix of the local baseline coordinates, \(R\) is the direction cosine matrix, which links the two frames by means of a rigid rotation, and the parameter \(p\) is used to indicate the number of columns in \(R\).  
\[C(Z)=\left\|vec(\hat{Z}-\hat{Z})\right\|_{Q_{\hat{Z}\hat{Z}}}^{2}+\left\|vec( \hat{R}(Z)-\overset{\sim}{R}(Z))\right\|_{Q_{\hat{R}(Z);\hat{R}(Z)}}^{2} \tag{11}\]  
\[vec(\overset{\sim}{R}(Z))=\arg\min_{R\in Q^{3\times p}}\left\|vec(\hat{R}(Z)-R )\right\|_{Q_{\hat{R}(Z);\hat{R}(Z)}}^{2} \tag{12}\]  
where \(C(Z)\) is the cost function, \(\hat{Z}\) is the float ambiguity matrix, with covariance \(Q_{\hat{Z}\hat{Z}}\), whereas the second weighs the distance from the conditional float solution \(\hat{R}(Z)\) to the nearest orthonormal matrix \(\overset{\sim}{R}(Z)\) in the metric of \(Q_{\hat{R}(Z)\hat{R}(Z)}\).  
Due to the observation limitations of the MCLAMBDA method, which does not take into account the non-common satellites between the multiple baselines involved in the model, and the computational burden is heavy for the multi-baseline MCLAMBDA searching, the CLAMBDA method is selected in this study, to fix the ambiguity.