## 2 Methods
### Attitude Update Algorithm for Strapdown Inertial Navigation  
The coordinate systems commonly used in strapdown inertial navigation system include the following: inertial coordinate system (_i_ frame), earth coordinate system (_e_ frame), geographic coordinate system (_g_ frame), navigation coordinate system (_n_ frame), and carrier coordinate system (_b_ frame), etc. In this paper, the East-North-Up (ENU) geographical coordinate system is chosen as the navigation coordinate system, and the right front up is the carrier coordinate system. That is, the origin is the center of gravity of the carrier, the \(x_{b}\) axis is to the right along the horizontal axis of the carrier, the \(y_{b}\) axis is to the front along the vertical axis of the carrier, and the \(z_{b}\) axis is to the top along the vertical axis of the carrier. Most of the algorithms for inertial navigation fusing multiple sensors are aimed at longitudinal positioning of the vehicle and these algorithms are well established [20; 21; 22; 23]. The focus of this paper is on the lateral positioning of the vehicle. The vehicle lateral positioning algorithm proposed in this paper is based on the difference of heading angles in adjacent time, so a high accuracy heading angle solution is necessary. In this paper, quaternion method [24] is used to update the attitude of strapdown inertial navigation system. We all know that in a two-dimensional plane coordinate system, the rotation information of an object can be described by the formula \(u=cos\theta\ +\ i\ sin\theta\), however, this formula does not apply when it is necessary to represent the rotation information of a three-dimensional space. So when we need to represent the rotation information of a three-dimensional space, we need to use the formula \(Q=cos\theta+(i+j+k)\ sin\theta\) (where \(i,j\), \(k\) are the unit vectors of \(x,y\), \(z\) axis respectively). We write \(Q=cos\theta+(i+j+k)\ sin\theta\) as \(Q=q_{0}+q_{1}i+q_{2}j+q_{3}k\) to obtain our common quaternion form. Thus, we obtain the following definition of quaternion:  
\[Q(q_{0},q_{1},q_{2},q_{3})=q_{0}+q_{1}i+q_{2}j+q_{3}k \tag{1}\]  
In the above equation, \(q_{0},q_{1},q_{2},q_{3}\) are real numbers and \(i\), \(j\), \(k\) are both mutually orthogonal unit vectors and imaginary units \(\sqrt{-1}\). The relation between quaternion and attitude matrix is as follows:  
\[C_{b}^{R}= \begin{bmatrix}1-2(q_{2}^{2}+q_{3}^{2})&2(q_{1}q_{2}-q_{0}q_{3})&2( q_{1}q_{3}+q_{0}q_{2})\\ 2(q_{1}q_{2}+q_{0}q_{3})&1-2(q_{1}^{2}+q_{3}^{2})&2(q_{2}q_{3}-q_{0}q_{1})\\ 2(q_{1}q_{3}-q_{0}q_{2})&2(q_{2}q_{3}+q_{0}q_{1})&1-2(q_{1}^{2}+q_{2}^{2}) \end{bmatrix}  \tag{2}\]  
Since the quaternion describing the rotation of a rigid body is a normalized quaternion, the normalized quaternion has the following characteristics:  
\[\|Q\|=q_{0}^{2}+q_{1}^{2}+q_{2}^{2}+q_{3}^{2}=1 \tag{3}\]  
Therefore, the relationship between quaternion and attitude matrix can be further transformed into the following:  
\[C_{b}^{R}= \begin{bmatrix}q_{0}^{2}+q_{1}^{2}-q_{2}^{2}-q_{3}^{2}&2(q_{1}q_{2} -q_{0}q_{3})&2(q_{1}q_{3}+q_{0}q_{2})\\ 2(q_{1}q_{2}+q_{0}q_{3})&q_{0}^{2}-q_{1}^{2}+q_{2}^{2}-q_{3}^{2}&2(q_{2}q_{3}- q_{0}q_{1})\\ 2(q_{1}q_{3}-q_{0}q_{2})&2(q_{2}q_{3}+q_{0}q_{1})&q_{0}^{2}-q_{1}^{2}-q_{2}^{2} +q_{3}^{2}\end{bmatrix}  \tag{4}\]  
Quaternion differential equation of attitude update as follows:  
\[\dot{q}_{b}^{n}=\frac{1}{2}q_{b}^{n}\omega_{nb\,q}^{b} \tag{5}\]In the following formula:  
\[\omega_{nb}^{b}=\omega_{ib}^{b}-\omega_{in}^{b}=\omega_{ib}^{b}-C_{n}^{b}\omega_{ in}^{n}=\omega_{ib}^{b}-(C_{b}^{n})^{T}\omega_{in}^{n}\]  
\[\omega_{in}^{n}=\omega_{ie}^{n}+\omega_{en}^{n}\]  
\[\omega_{ie}^{n}= \begin{bmatrix}0&\omega_{ie}\cos L&\omega_{ie}\sin L\end{bmatrix} ^ {T}\]  
\[\omega_{en}^{n}= \begin{bmatrix}-\frac{v_{N}^{n}}{R_{M}+R}&\frac{v_{E}^{n}}{R_{ N}+R}&\frac{v_{E}^{n}}{R_{N}+R}\tan L\end{bmatrix} ^{T}\]  
We will explain some parameters in the above formula. \(q_{b}^{n}\) is the quaternion describing the attitude of the carrier.