## 3 The Sensor Integration
### Kalman Filter Update
In the measurement model, the link between the GPS baseline and the attitude determination is given by the transformation of the b-frame GPS baseline coordinates \(\Delta\mathbf{x}_{b}^{b}\), which can be determined by calibration measurements, into the e-frame:  
\[\Delta\mathbf{\tilde{x}}_{b}^{e} =\mathbf{C}_{b}^{e}\Delta\mathbf{x}_{b}^{b}+\vartheta_{x_{b}}=( \mathbf{I}+\mathbf{\Psi})\hat{\mathbf{C}}_{b}^{e}\Delta\mathbf{x}_{b}^{b}+ \vartheta_{x_{b}} \tag{33}\] \[=(\mathbf{I}+\mathbf{\Psi})\Delta\mathbf{\hat{x}}_{b}^{e}+ \vartheta_{x_{b}}=\Delta\mathbf{\hat{x}}_{b}^{e}-\left[\Delta\mathbf{\hat{x}}_ {b}^{e}\times\right]\psi+\vartheta_{x_{b}}\]  
where \(\vartheta_{x_{b}}\) is the measurement noise of the GPS attitude baseline. Finally, as long as the ambiguities of the GPS baseline are unresolved, the baseline parameters do not have the quality to correct the yaw error adequately. To be able to also bound the yaw error in these cases, we integrated magnetic field sensors into our system. Magnetic field sensors, when used as a compass, measure two or three components of the Earth's magnetic field in the sensor system. Therefore, they enable the determination of the orientation of the sensor system relative to the Magnetic North Pole. However, the main difficulties with magnetic field sensors are their sensitivities to ferromagnetic material in the vicinity of the sensor. In case this material is part of the sensor platform, disturbances can be compensated by calibration [15]. Nevertheless, the changing currents of the rotors or ferromagnetic material in the environment can still lead to distortions of the magnetic field observations. This is why the attitude accuracy, based on magnetometer measurements, is usually only in the range of a few degrees, which is still good enough to bound the gyro drift. The measurement equation for a magnetic field measurement \(\tilde{\mathbf{h}}^{b}\) is the following [12]:  
\[\tilde{\mathbf{h}}^{b} =\mathbf{C}_{b}^{e,T}\mathbf{h}^{e}+\vartheta_{m}=\hat{\mathbf{C} }_{b}^{e,T}(\mathbf{I}-\mathbf{\Psi})\mathbf{h}^{e}+\vartheta_{m} \tag{34}\] \[=\hat{\mathbf{C}}_{b}^{e,T}\mathbf{h}^{e}-\hat{\mathbf{C}}_{b}^{e,T}\mathbf{\Psi}\mathbf{h}^{e}+\vartheta_{m}=\hat{\mathbf{C}}_{b}^{e,T}\mathbf{ h}^{e}+\hat{\mathbf{C}}_{b}^{e,T}\left[\mathbf{h}^{e}\times\right]\psi+\vartheta_{m}\]  
where \(\mathbf{h}^{e}\) is the known local magnetic field vector, represented in the e-frame, and \(\vartheta_{m}\) is the magnetometer measurement noise. Since erroneous magnetic field observations can lead to significant systematic attitude errors in all three axis, Equation (35) is rearranged, with the result that the magnetic field observations only have an impact on the yaw angle determination:  
\[\tilde{\mathbf{h}}^{b}=\hat{\mathbf{C}}_{b}^{e,T}\mathbf{h}^{e}+\hat{\mathbf{ C}}_{b}^{e,T} \begin{bmatrix}0&0&\hat{h}_{y}^{e}\\ 0&0&-\hat{h}_{x}^{e}\\ 0&0&0\end{bmatrix} \psi+\vartheta_{m} \tag{35}\]  
With the ambiguities fixed, the parameters of the baseline can be determined with a mm-accuracy. For a baseline with a length of 1 m, this leads to attitude accuracies of approximately 0.2-0.5\({}^{\circ}\) for the yaw angle. Since the roll and pitch angle can be determined more reliably regarding the relation to the gravitation vector, the GPS baseline should also only be used to estimate the yaw angle error:  
\[\Delta\mathbf{\tilde{x}}_{b}^{e}=\Delta\hat{\mathbf{x}}_{b}^{e}- \begin{bmatrix} 0&0&\Delta\hat{x}_{b,y}^{e}\\ 0&0&-\Delta\hat{x}_{b,x}^{e}\\ 0&0&0\end{bmatrix} \psi+\vartheta_{xb} \tag{36}\]  
In case the ambiguities of the GPS baseline are unresolved so far, only the GPS positions and the magnetic field observations are used in the Pos/IMU/Mag integration (Figure 1), which serves as the prior information for the GPS baseline ambiguity resolution. If the ambiguities are resolved successfully, the Pos/IMU/Mag/Base solution can be determined, where all available sensory input is integrated.