# Calibration of Magnetometers with GNSS Receivers and Magnetometer-Aided GNSS Ambiguity Fixing
## 3 Calibration of Magnetic Flux Sensors
### Attitude Determination with Three GNSS Receivers
#### 3.2.3 Integer Ambiguity Fixing Using Prior Information on Baseline Coordinates  
In this section, we exploit the integer property of ambiguities and describe the fixing of float ambiguities to integer ones. A joint fixing of ambiguities from _both_ baselines is performed to exploit the correlation introduced by the use of a common receiver in both baselines. The integer ambiguities, baselines and pseudorange multipaths are determined such that the sum of squared residuals is minimized, i.e.,  
\[\min_{\{N_{12},N_{12}\}\in\mathbb{Z},\ \{\tilde{p}_{12}^{ \mathrm{n}},\tilde{p}_{13}^{\mathrm{n}},\Delta\rho_{\mathrm{MP}_{12}}\Delta \rho_{\mathrm{MP}_{13}}\}\in\mathbb{R}}\left\|\left( \begin{array}{c}\hat{N}_ {12}\\ \hat{N}_{13}\end{array} \right)-\left( \begin{array}{c}N_{12}\\ N_{13}\end{array} \right)\right\|_{\Sigma_{\tilde{N}_{12},\tilde{N}_{13}}^{-1}}^ {2}\] \[+\left\|\left( \begin{array}{c}\tilde{\tilde{p}_{12}^{ \mathrm{n}}}(N_{12})\\ \tilde{\tilde{p}_{13}^{\mathrm{n}}}(N_{13})\\ \Delta\rho_{\mathrm{MP}_{12}}(N_{12})\\ \Delta\rho_{\mathrm{MP}_{13}}(N_{13})\end{array} \right)-\left( \begin{array}[] {c}\tilde{\tilde{p}_{12}^{\mathrm{n}}}\\ \tilde{\bar{p}_{13}^{\mathrm{n}}}\\ \Delta\rho_{\mathrm{MP}_{12}}\end{array} \right)\right\|_{\Sigma_{\tilde{b}_{12 },\tilde{b}_{13}}^{-1}}^{2}. \tag{15}\]  
An analytical optimization is not feasible due to the multi-dimensional integer parameters. Therefore, a sequential tree search is performed as suggested by [PERSON] in [1] and [PERSON] and [PERSON] [9]. The ambiguity residuals \(r_{N_{1r}^{kl}}:=\hat{N}_{1r}^{kl}-N_{1r}^{kl}\) are expressed in terms of conditional ambiguities \(\hat{N}_{1r}^{kl|1,\ldots,(k-1)l}\) using the triangular decomposition of the float ambiguity covariance matrix (see [PERSON] [10]). The lower and upper bound of the search interval of ambiguity \(N_{1r}^{kl}\) are derived by [PERSON] and [PERSON] in [9] as:  
\[N_{1r}^{kl} \geq \hat{N}_{1r}^{kl|1,l\ldots,(k-1)l}-\sigma_{N_{1r}^{kl|1,l\ldots,(k-1)l}}\cdot\sqrt{\chi^{2}-\sum_{j=1}^{k-1}\frac{\left(\hat{N}_{1r}^{jl|1,l \ldots-(j-1)l}-N_{1r}^{jl||1,l\ldots(j-1)l}\right)^{2}}{\sigma_{\hat{N}_{1r}^{ jl|1,l\ldots(j-1)l}}^{2}}} \tag{16}\] \[N_{1r}^{kl} \leq \hat{N}_{1r}^{kl|1,l\ldots,(k-1)l}+\sigma_{N_{1r}^{kl|1,l\ldots(k- 1)l}}\cdot\sqrt{\chi^{2}-\sum_{j=1}^{k-1}\frac{\left(\hat{N}_{1r}^{jl|1,l \ldots(j-1)l}-N_{1r}^{jl||1,l\ldots(j-1)l}\right)^{2}}{\sigma_{\hat{N}_{1r}^{ jl|1,l\ldots(j-1)l}}^{2}}}, \tag{17}\]  
with \(\chi^{2}\) being the search space volume. A prior knowledge on the baselines is typically available in the body-fixed (b-) frame. The local (East-North-Up) navigation (n-) frame is related to the body-fixed frame via the attitude angles (roll \(\varphi\), pitch \(\theta\) and heading \(\psi\)), i.e., the baseline can be re-parameterized as  
\[\vec{b}_{1r}^{\mathrm{n}}=R_{\mathrm{b}}^{\mathrm{n}}(\varphi,\theta,\psi) \vec{b}_{1r}^{\mathrm{b}},\quad\text{with}\quad R_{\mathrm{n}}^{\mathrm{b}}=( R_{\mathrm{b}}^{\mathrm{n}})^{-1}=R_{1}(\varphi)R_{2}(\theta)R_{3}(\psi). \tag{18}\]  
The estimation of all three attitude angles requires at least three receivers spanning two baselines \(\vec{b}_{12}\) and \(\vec{b}_{13}\). Once baseline estimates are available in both frames, the rotation matrix \(R_{\mathrm{b}}^{\mathrm{n}}(\varphi,\theta,\psi)\) can be determined using [PERSON]'s solution [11].