1. Introduction {#sec1-sensors-16-00841}
===============

Given that global navigation satellite system (GNSS) attitudes are unaffected by drifts and do not require any alignment, GNSS are well suited for attitude determination. The attitude could be noted as yaw ($\mathsf{\psi}$), pitch ($\mathsf{\theta}$) and roll ($\mathsf{\phi}$). One baseline vector composed by two antennas comprises two attitude angles like ($\mathsf{\psi}，\mathsf{\theta}$). Thus, we could get three attitude angles from two baselines which cannot be arranged in a parallel frame. The basic measurement used for GNSS attitude determination is the phase difference ($\mathsf{\Delta}\mathsf{\varphi}$) between the signals received by two antennas. However, GNSS attitude determination includes unknown integer ambiguities, which should be solved at first. The baseline length is usually known and it will help in integer ambiguities search. Many approaches have been studied for resolving the GNSS attitude ambiguity resolution problem \[[@B1-sensors-16-00841],[@B2-sensors-16-00841],[@B3-sensors-16-00841]\]. In this study, we use the rotation matrix method (RMM) combined with the AFM method to solve the problem. This method is efficiency used for GNSS ambiguity resolution. When the integer ambiguities are fixed, the attitude angles can be calculated on the basis of the AFM method. Although the AFM is more flexible, it is lack of analysis on the relationship of the geometric model and the noise error. In this study, the influence of the satellite geometry model on the success rate is analyzed. The computation error and the noise error are effectively treated. It is introduced in detail and the performance of this strategy is presented in the sections below. Not only the flexibility of the AFM is inherited, but also the success rate is increased. The results are based on simulated and real-time GNSS data and are applied on single-frequency processing, which is known as one of the challenging case of GNSS attitude determination.

2. Model of GNSS Attitude Determination {#sec2-sensors-16-00841}
=======================================

The carrier-phase equation for GNSS can be written as follows: $$\mathsf{\varphi} = \frac{1}{\mathsf{\lambda}}(\mathsf{\rho} + \mathsf{\delta}\mathsf{\rho} + c\mathsf{\delta}t_{r} - c\mathsf{\delta}t_{s} + \mathsf{\delta}\mathsf{\rho}_{t} - \mathsf{\delta}\mathsf{\rho}_{i}) - N + \mathsf{\varepsilon}$$ where $\mathsf{\varphi}$ is the GNSS receiver carrier-phase observation; $\mathsf{\lambda}$ is the GNSS carrier wavelength; $\mathsf{\rho}$ is the range between the receiver antenna and GNSS satellite; $\mathsf{\delta}\mathsf{\rho}$ is the orbital error along the line of sight from the satellite to station; c is the speed of light; $\mathsf{\delta}t_{r}$ is the receiver clock offset from GNSS time; $\mathsf{\delta}t_{s}$ is the satellite clock offset from GNSS time; $\mathsf{\delta}\mathsf{\rho}_{t}$ is the troposphere delay; $\mathsf{\delta}\mathsf{\rho}_{i}$ is the ionosphere delay; N is the carrier-phase integer ambiguity; and $\mathsf{\varepsilon}$ is an error term that includes the measurement noise, multi-path errors, others.

An attitude determination system based on GNSS often consists of two receivers to receive the GNSS signals from independent antennae. Given that the common clock is used in the system, the satellite clock error can be removed by a single difference (SD) \[[@B4-sensors-16-00841]\]. For a baseline length of a few meters, the orbital and atmosphere errors in Equation (1) are actually the same, so that these errors can be removed by a single difference. However, the receiver clock error $\mathsf{\delta}t_{r}$ still exists. The measurement of the single difference is expressed as: $$\mathsf{\Delta}\mathsf{\varphi} = \frac{1}{\mathsf{\lambda}}(\mathsf{\Delta}\mathsf{\rho} + c\mathsf{\Delta}\mathsf{\delta}t_{r}) - \mathsf{\Delta}N + \mathsf{\Delta}\mathsf{\varepsilon}$$

As shown in [Figure 1](#sensors-16-00841-f001){ref-type="fig"}, the SD model is built in local level frame (LLF).

In [Figure 1](#sensors-16-00841-f001){ref-type="fig"}, $\overset{\rightarrow}{b}$ is the baseline vector formed by the antennae A and B, which contains the attitude parameters. The SD carrier phase measurement equation is expressed as: $$\begin{array}{cl}
{\mathsf{\lambda}(\mathsf{\Delta}\mathsf{\varphi}^{i} + \mathsf{\Delta}N^{i}) + c\mathsf{\Delta}\mathsf{\delta}t_{r}} & {= \overset{\rightarrow}{b^{}} \cdot \overset{\rightarrow}{s^{i}} = \overset{\rightarrow}{|b^{}|}\overset{\rightarrow}{|s^{i}|}\cos\mathsf{\eta}^{i}} \\
 & {= \overset{\rightarrow}{|b^{}|}\lbrack\sin\mathsf{\beta}^{i}\sin\mathsf{\theta} + \cos\mathsf{\beta}^{i}\cos\mathsf{\theta}\cos(\mathsf{\alpha}^{i} - \mathsf{\psi})\rbrack} \\
\end{array}$$ where $\overset{\rightarrow}{b} = {|b|}(\cos\mathsf{\theta}\sin\mathsf{\psi},\cos\mathsf{\theta}\cos\mathsf{\psi},\sin\mathsf{\theta})$ is the baseline vector, $\mathsf{\psi},\ \mathsf{\theta}$ are the yaw and pitch, respectively; $\overset{\rightarrow}{s^{i}} = (\cos\mathsf{\beta}^{i}\sin\mathsf{\alpha}^{i},\ \cos\mathsf{\beta}^{i}\cos\mathsf{\alpha}^{i},\sin\mathsf{\beta}^{i})$ is the satellite I vector; $\mathsf{\alpha}^{i},\ \mathsf{\beta}^{i}$ are the yaw and pitch, respectively; $\mathsf{\eta}^{i}$ is the included angle between the baseline vector and the satellite I vector; and $\mathsf{\Delta}N^{i},\ \mathsf{\Delta}\mathsf{\varphi}^{i}$ are the integral and decimal part of the SD carrier measurement, respectively. After the measurement of the double difference (DD) between satellites I and J, the receiver clock error can be removed. The DD measurement is expressed as: $$\begin{array}{l}
{\mathsf{\lambda}(\nabla\mathsf{\Delta}\mathsf{\varphi}^{ij} + \nabla\mathsf{\Delta}N^{ij}) = \overset{\rightarrow}{b^{}} \cdot (\overset{\rightarrow}{s^{j}} - \overset{\rightarrow}{s^{i}}) = \overset{\rightarrow}{\ |b^{}|}|\overset{\rightarrow}{s^{j}} - \overset{\rightarrow}{s^{i}}|\cos\mathsf{\eta}^{ij}} \\
{\mathsf{\lambda}(\nabla\mathsf{\Delta}\mathsf{\varphi}^{ij} + \nabla\mathsf{\Delta}N^{ij}) = \overset{\rightarrow}{|b^{}|}|\overset{\rightarrow}{s^{j}} - \overset{\rightarrow}{s^{i}}|\lbrack\sin\mathsf{\beta}^{ij}\sin\mathsf{\theta}\  + \ \cos\mathsf{\beta}^{ij}\cos\mathsf{\theta}\cos(\mathsf{\alpha}^{ij} - \ \mathsf{\psi})\rbrack} \\
\end{array}$$ where $\overset{\rightarrow}{b} = {|b|}(\cos\mathsf{\theta}\sin\mathsf{\psi},\ \cos\mathsf{\theta}\cos\mathsf{\psi},\ \sin\mathsf{\theta})$ is the baseline vector, $\mathsf{\psi},\ \mathsf{\theta}$ are the yaw and pitch, respectively; $\overset{\rightarrow}{s^{j}} - \overset{\rightarrow}{s^{i}} = |\overset{\rightarrow}{s^{j}} - \overset{\rightarrow}{s^{i}}|(\cos\mathsf{\beta}^{ij}\sin\mathsf{\alpha}^{ij},\ \cos\mathsf{\beta}^{ij}\cos\mathsf{\alpha}^{ij},\ \sin\mathsf{\beta}^{ij})$ is the difference between the satellite I and J vectors; $\mathsf{\alpha}^{ij},\ \mathsf{\beta}^{ij}$ are the yaw and pitch, respectively; $\mathsf{\eta}^{ij}$ is the included angle between the baseline vector and the satellite ($\overset{\rightarrow}{s^{j}} - \overset{\rightarrow}{s^{i}}$) vector; and $\nabla\mathsf{\Delta}N^{ij},\ \nabla\mathsf{\Delta}\mathsf{\varphi}^{ij}$ are the integral and decimal part of the DD carrier measurement, respectively. As shown in [Figure 2](#sensors-16-00841-f002){ref-type="fig"}, the DD model is built in LLF.

The parameters that are unknown in this function are $\nabla\mathsf{\Delta}N^{ij}$, $\mathsf{\psi}$, and $\mathsf{\theta}$. Assuming that the value of $\nabla\mathsf{\Delta}N^{ij}$ is known in the initial course, we can determine the attitude information using the RMM method. Thus, the first step we should discuss is how to find out the integer ambiguities.

3. Rotation Matrix Method in Resolving Equations {#sec3-sensors-16-00841}
================================================

The important feature in this method is the use of the RMM to resolve the equations problem. This method is aimed at two equations. Equation (3) is a nonlinear equation, including sine and cosine functions. The solution of the equations is given by the analytical resolution method \[[@B5-sensors-16-00841],[@B6-sensors-16-00841]\], but the solution process is very complex and the error angles of different scales in trigonometric functions have not been analyzed. The rotation matrix method (RMM) is very convenient to obtain. It will be discussed from two aspects.

3.1. Basic Model of Space {#sec3dot1-sensors-16-00841}
-------------------------

The basic model of spatial geometry is constructed according to the spatial relationship between the baseline vector and the satellite vector, as shown in [Figure 3](#sensors-16-00841-f003){ref-type="fig"}.

In this figure, $\overset{\rightarrow}{AB}$ is the baseline vector; $\overset{\rightarrow}{AC}$ is the satellite vector; $\mathsf{\beta}$ is the pitch of the satellite vector; $\mathsf{\alpha}$ is the included angle between the yaw of the baseline vector and the yaw of the satellite vector; and $\mathsf{\eta}$ is the included angle between the baseline vector and the satellite vector. The geometric relations ($\cos\mathsf{\eta}\  = \ \cos\mathsf{\alpha}\cos\mathsf{\beta}$) can be proved in the basic model. This model has a regular structure and a clear geometric relationship. The following operations need to be conducted is to incorporate the actual situation of the baseline vector and the satellite vector into the model.

3.2. Generation of Rotation Matrix {#sec3dot2-sensors-16-00841}
----------------------------------

Two DD equations are given below: $$\left\{ \begin{array}{l}
{\mathsf{\lambda}(\nabla\mathsf{\Delta}\mathsf{\varphi}^{ij} + \nabla\mathsf{\Delta}N^{ij}) = |\overset{\rightarrow}{b}||\overset{\rightarrow}{s^{j}} - \overset{\rightarrow}{s^{i}}|\cos\mathsf{\eta}^{ij}} \\
{\mathsf{\lambda}(\nabla\mathsf{\Delta}\mathsf{\varphi}^{ik} + \nabla\mathsf{\Delta}N^{ik}) = |\overset{\rightarrow}{b}||\overset{\rightarrow}{s^{k}} - \overset{\rightarrow}{s^{i}}|\cos\mathsf{\eta}^{ik}} \\
\end{array} \right.$$

The spatial relation of two DD equations is shown in [Figure 4](#sensors-16-00841-f004){ref-type="fig"}.

$$\overset{\rightarrow}{AC} = \overset{\rightarrow}{s^{j}} - \overset{\rightarrow}{s^{i}},\overset{\rightarrow}{AD} = \overset{\rightarrow}{s^{k}} - \overset{\rightarrow}{s^{i}},\overset{\rightarrow}{AB} = \overset{\rightarrow}{b},\angle BAC = \mathsf{\eta}^{ij},\angle BAD = \mathsf{\eta}^{ik}$$

First, the ACD plane determined by the $\overset{\rightarrow}{AC}$ vector and the $\overset{\rightarrow}{AD}$ vector is defined as the level plane of the new coordinate system. Attitude rotation is then conducted. The rotating method is applied from the local level frame (LLF) to the new coordinate system (b): $$O - X_{n}Y_{n}Z_{n}\frac{Aroud~Z_{n}~axis}{rotate~\mathsf{\alpha}}O - X_{1}Y_{1}Z_{1}\frac{Aroud~X_{1}~axis}{rotate~\mathsf{\beta}}O - X_{2}Y_{2}Z_{2}\frac{Aroud~Y_{2}~axis}{rotate~\mathsf{\gamma}}O - X_{b}Y_{b}Z_{b}$$ where $\mathsf{\alpha}$ is the yaw of the $\overset{\rightarrow}{AC} = \overset{\rightarrow}{s^{j}} - \overset{\rightarrow}{s^{i}}$ vector; $\mathsf{\beta}$ is the pitch of the $\overset{\rightarrow}{AC} = \overset{\rightarrow}{s^{j}} - \overset{\rightarrow}{s^{i}}$ vector; $\mathsf{\gamma}$ is the included angle between the ACD plane and the $X_{2}Y_{2}$ plane. In the new coordinate system ($O - X_{b}Y_{b}Z_{b}$), the $\overset{\rightarrow}{AC} = \lbrack 0;\ AC_{y};\ 0\rbrack$ vector and the $\overset{\rightarrow}{AD} = \lbrack AD_{x};\ AD_{y};\ 0\rbrack$ vector are together in the $X_{b}Y_{b}$ plane. The yaw and pitch of the $\overset{\rightarrow}{AC} = \overset{\rightarrow}{s^{j}} - \overset{\rightarrow}{s^{i}}$ vector are $(0,\ 0)$, and those of the $\overset{\rightarrow}{AD} = \overset{\rightarrow}{s^{k}} - \overset{\rightarrow}{s^{i}}$ vector are $(\mathsf{\alpha}_{b}^{ik},\ 0)$, as shown in [Figure 5](#sensors-16-00841-f005){ref-type="fig"}.

In the new coordinate system ($O - X_{b}Y_{b}Z_{b}$), the baseline vector ($\overset{\rightarrow}{AB}$) and the satellite vector ($\overset{\rightarrow}{AC} = \overset{\rightarrow}{s^{j}} - \overset{\rightarrow}{s^{i}}$) constitute the basic model of space geometry, the same as the baseline vector ($\overset{\rightarrow}{AB}$) and the satellite vector ($\overset{\rightarrow}{AD} = \overset{\rightarrow}{s^{k}} - \overset{\rightarrow}{s^{i}}$). At this point, the DD equations are given by: $$\left\{ \begin{array}{l}
{\mathsf{\lambda}(\nabla\mathsf{\Delta}\mathsf{\varphi}^{ij} + \nabla\mathsf{\Delta}N^{ij}) = |\overset{\rightarrow}{b}||\overset{\rightarrow}{s^{j}} - \overset{\rightarrow}{s^{i}}|\cos\mathsf{\theta}_{b}\cos\mathsf{\psi}_{b}} \\
{\mathsf{\lambda}(\nabla\mathsf{\Delta}\mathsf{\varphi}^{ik} + \nabla\mathsf{\Delta}N^{ik}) = |\overset{\rightarrow}{b}||\overset{\rightarrow}{s^{k}} - \overset{\rightarrow}{s^{i}}|\cos\mathsf{\theta}_{b}\cos(\mathsf{\psi}_{b} - \mathsf{\alpha}_{b}^{ik})} \\
\end{array} \right.$$ where $\mathsf{\alpha}_{b}^{ik}$ is the yaw of the $\overset{\rightarrow}{AD} = \overset{\rightarrow}{s^{k}} - \overset{\rightarrow}{s^{i}}$ vector in ($O - X_{b}Y_{b}Z_{b}$); $\mathsf{\psi}_{b},\mathsf{\theta}_{b}$ are the yaw and pitch of the baseline vector in ($O - X_{b}Y_{b}Z_{b}$), respectively. According to Equation (6), the results can be obtained by: $$\left\{ \begin{array}{l}
{x_{b} = \frac{A_{2} - A_{1}\cos\mathsf{\alpha}_{b}^{ik}}{\sin\mathsf{\alpha}_{b}^{ik}}} \\
{y_{b} = A_{1}} \\
{z_{b} = \pm \sqrt{|\overset{\rightarrow}{b}|^{2} - x_{b}^{2} - y_{b}^{2}}} \\
\end{array} \right.,\quad\left\{ \begin{array}{l}
{A_{1} = \frac{\left. \mathsf{\lambda}(\nabla\mathsf{\Delta}\mathsf{\varphi}^{ij} + \nabla\mathsf{\Delta}N^{ij} \right)}{|\overset{\rightarrow}{s^{j}} - \overset{\rightarrow}{s^{i}}|}} \\
{A_{2} = \frac{\left. \mathsf{\lambda}(\nabla\mathsf{\Delta}\mathsf{\varphi}^{ik} + \nabla\mathsf{\Delta}N^{ik} \right)}{|\overset{\rightarrow}{s^{k}} - \overset{\rightarrow}{s^{i}}|}} \\
\end{array} \right.$$

Finally, the baseline vector $(x_{b};\ y_{b};\ z_{b})$ is converted through the rotation matrix from the new coordinate system to the local level frame (LLF). This algorithm reduces the computational complexity compared with the analytical resolution method \[[@B5-sensors-16-00841],[@B6-sensors-16-00841]\]: $$\begin{bmatrix}
x \\
y \\
z \\
\end{bmatrix} = {\lbrack R_{y}(\mathsf{\gamma})R_{x}(\mathsf{\beta})R_{z}(\mathsf{\alpha})\rbrack}^{- 1}\begin{bmatrix}
x_{b} \\
y_{b} \\
z_{b} \\
\end{bmatrix}$$

3.3. Method of Satellite Selection in Resolving Equations {#sec3dot3-sensors-16-00841}
---------------------------------------------------------

According to Equation (7), the noise effect is larger when the $|\overset{\rightarrow}{s^{x}} - \overset{\rightarrow}{s^{i}}|$ value and the $\mathsf{\alpha}_{b}^{ik}$ value are smaller. Thus, the following settings should be applied for satellite selection: $$\left\{ \begin{matrix}
{|\overset{\rightarrow}{s^{x}} - \overset{\rightarrow}{s^{i}}|\  > \ 0.7} \\
{|\mathsf{\alpha}_{b}^{ik} - 90{^\circ}|\  \leq \ 30{^\circ}\ or\ |\mathsf{\alpha}_{b}^{ik} - 270{^\circ}|\  \leq \ 30{^\circ}} \\
\end{matrix} \right.$$

3.4. Integer Ambiguities Determination Method Based on Constraint Conditions {#sec3dot4-sensors-16-00841}
----------------------------------------------------------------------------

Many solutions have been studied to determine integer ambiguities, and all kinds of constraint conditions exist, such as the fixed baseline or micro-electromechanical system (MEMS) that provides a small-angle search region \[[@B7-sensors-16-00841],[@B8-sensors-16-00841]\]. For the DD equation, an integer ambiguity value that we should first determine, as well as its span, is described as follows: $$- \frac{|\overset{\rightarrow}{b}||\overset{\rightarrow}{s^{j}} - \overset{\rightarrow}{s^{i}}|}{\mathsf{\lambda}} \leq \nabla\mathsf{\Delta}N^{ij} \leq \frac{|\overset{\rightarrow}{b}||\overset{\rightarrow}{s^{j}} - \overset{\rightarrow}{s^{i}}|}{\mathsf{\lambda}}$$

Finally, the integer candidates that pass the constraint conditions are incorporated into the equations, and the candidate solution ($\overset{\rightarrow}{b} = (x;\ y;\ z)$) can be calculated. These candidate solutions are evaluated and distinguished by the AFM. The AFM was originally proposed by Counselman and Gourevitch and later implemented by Remondi and Mader \[[@B9-sensors-16-00841]\]. The candidate solutions can more easily be determined using RMM directly than by searching for the maximum in the full 2D space. From n pairs of integer ambiguity candidates, m pairs of preliminary solutions exist: $(x_{1};\ y_{1};\ z_{1}),(x_{2};\ y_{2};\ z_{2}),\cdots,(x_{m};\ y_{m};\ z_{m})$. Only one of these solutions is correct, that is, the one that passes via AFM: $$F(x,\ y,\ z)\  = \ \frac{1}{N - 1}{\sum\limits_{j = 1}^{N - 1}{\cos 2\mathsf{\pi}\left\{ {\nabla\mathsf{\Delta}\mathsf{\varphi}^{ij} - \frac{\overset{\rightarrow}{b} \cdot (\overset{\rightarrow}{s^{j}} - \overset{\rightarrow}{s^{i})}}{\mathsf{\lambda}}} \right\}}}$$ where ($\overset{\rightarrow}{b} = (x;\ y;\ z)$), N is the number of satellites and ($i,\ j$) are the master satellite and the concomitant satellite, respectively. Assuming that m pairs of preliminary solutions $(x_{1};y_{1};z_{1}),(x_{2};y_{2};z_{2}),\cdots,(x_{m};y_{m};z_{m})$ exist in k epoch, the float ambiguity of one group (${\overset{\rightarrow}{b}}_{p} = (x_{p};\ y_{p};\ z_{p})$) can be described as: $$\nabla\mathsf{\Delta}{\hat{N}}_{p}^{ij} = \nabla\mathsf{\Delta}\mathsf{\varphi}_{p}^{ij} - \frac{{\overset{\rightarrow}{b}}_{p} \cdot (\overset{\rightarrow}{s^{j}} - \overset{\rightarrow}{s^{i}})}{\mathsf{\lambda}}$$

Thus, the ambiguity function is: $$F_{k}(x_{p},\ y_{p},\ z_{p})\  = \ \frac{1}{N - 1}{\sum\limits_{j = 1}^{N - 1}{\cos 2\mathsf{\pi}\nabla\mathsf{\Delta}{\hat{N}}_{p}^{ij}}}$$

Considering the measurement noise, a threshold T near 1 is necessary to filter out the incorrect solution \[[@B5-sensors-16-00841]\]. According to the first-order difference of the DD carrier measurement, its fluctuation range is ±0.9 cm ($\approx 0.05\ \mathsf{\lambda}$) as shown in [Figure 6](#sensors-16-00841-f006){ref-type="fig"}. There are ($2*0.05\ \mathsf{\lambda}$) being introduced in Equation (6). If the noise threshold is set to $0.2\ \mathsf{\lambda}$, the *T* value is 0.8: $$F_{k}(x_{p},y_{p},z_{p}) \geq T$$

For N satellites tracked, the integer ambiguity vector is described as: $$\nabla\mathsf{\Delta}N_{p}^{ij}\  = \ {({|{\nabla\mathsf{\Delta}{\hat{N}}_{p}^{i1}}|},\ {|{\nabla\mathsf{\Delta}{\hat{N}}_{p}^{i2}}|},\ \ldots,\ {|{\nabla\mathsf{\Delta}{\hat{N}}_{p}^{i(N - 1)}}|})}^{T}$$ where $| \cdot |$ denotes a rounding calculation \[[@B5-sensors-16-00841]\].

In the initial course, the influence of the former epochs should be reduced. The solution is given by: $$\left\{ \begin{array}{l}
{W_{k}(\nabla\mathsf{\Delta}N_{p}^{ij})\  = \ \frac{1}{M}W_{k - 1}(\nabla\mathsf{\Delta}N_{p}^{ij})\  + \ \frac{M - 1}{M}F_{k}(\mathsf{\psi}_{p},\ \mathsf{\theta}_{p})} \\
{W_{1}(\nabla\mathsf{\Delta}N_{p}^{ij})\  = \ F_{1}(\mathsf{\psi}_{p},\ \mathsf{\theta}_{p})} \\
\end{array} \right.$$

The M value is the memory decline factor. After a few epochs, two cases always occur: (a) only one candidate satisfies Equation (14) at epoch *k*, or (b) a number of solutions satisfy the threshold. The real value is then selected with the following method. Ideally, for example, the number of satellites is greater than 8, and the geometric relationship is relatively good. The optimal value is obtained when one of the solutions is twice the suboptimal value \[[@B6-sensors-16-00841]\]. The inequality is given by: $$\frac{W_{k}{(\nabla\mathsf{\Delta}N_{p}^{ij})}_{optimal}}{W_{k}{(\nabla\mathsf{\Delta}N_{p}^{ij})}_{suboptimal}}\  > \ 2$$

In practical application, this ratio is slightly less than 2, while the ratio remains stable. If the optimal value is greater than 0.9, and the difference between the optimal value and the suboptimal value is greater than 0.3, the optimal solution is determined after 50 epochs, as shown in [Figure 7](#sensors-16-00841-f007){ref-type="fig"}: $$\left\{ \begin{matrix}
{W_{k}{(\nabla\mathsf{\Delta}N_{p}^{ij})}_{optimal} > \ 0.9} \\
{W_{k}{(\nabla\mathsf{\Delta}N_{p}^{ij})}_{optimal} - \ W_{k}{(\nabla\mathsf{\Delta}N_{p}^{ij})}_{suboptimal} > \ 0.3} \\
\end{matrix},\ k\  > \ 50epochs({duration}) \right.$$

If the computation error and the noise error are not effectively treated, the success rate of the solution will be decreased. Thus, the influence of the satellite geometry model on the error should be analyzed in detail. In contrast to the AFM, the geometric correlation methods, such as the LAMBDA method \[[@B10-sensors-16-00841]\], the C-LAMBDA method \[[@B11-sensors-16-00841],[@B12-sensors-16-00841],[@B13-sensors-16-00841],[@B14-sensors-16-00841]\] and the M-LAMBDA method \[[@B15-sensors-16-00841]\], get better performance in solving the relationship of the geometric model and the noise error. This relationship about the AFM is analyzed in the sections below. The computation error and the noise error are effectively treated. Not only the flexibility of the AFM is inherited, but also the success rate is increased.

4. The Relationship of the Geometric Model and the Noise Error {#sec4-sensors-16-00841}
==============================================================

4.1. The Influence of the Noise Error on the DD Equations {#sec4dot1-sensors-16-00841}
---------------------------------------------------------

For the convenience of analysis, according to Equations (7) and (9), assuming that the satellite parameters of the DD equations are set to $|\overset{\rightarrow}{s^{j}} - \overset{\rightarrow}{s^{i}}|\  = \ 0.7,\ |\overset{\rightarrow}{s^{k}} - \overset{\rightarrow}{s^{i}}|\  = \ 0.7,\ \mathsf{\alpha}_{b}^{ik}\  = \ 70{^\circ}$. Now noise is added to Equation (7) and the parameters are substituted into Equation (7): $$\left\{ \begin{array}{l}
{x_{b} = \ 1.519\ *\ \mathsf{\lambda}\lbrack(\nabla\mathsf{\Delta}\mathsf{\varphi}^{ik} + \nabla\mathsf{\Delta}N^{ik} + \mathsf{\varepsilon}^{ik}) - 0.342*(\nabla\mathsf{\Delta}\mathsf{\varphi}^{ij} + \nabla\mathsf{\Delta}N^{ij} + \mathsf{\varepsilon}^{ij})\rbrack} \\
\left. y_{b} = \ 1.428\ *\ \mathsf{\lambda}(\nabla\mathsf{\Delta}\mathsf{\varphi}^{ij} + \nabla\mathsf{\Delta}N^{ij} + \mathsf{\varepsilon}^{ij} \right) \\
{z_{b} = \  \pm \sqrt{|\overset{\rightarrow}{b}|^{2} - \ x_{b}^{2} - \ y_{b}^{2}}} \\
\end{array} \right.$$

Assuming that the vector ($X_{b},\ Y_{b},\ Z_{b}$) is the real value of the vector ($\overset{\rightarrow}{b}\  = \ (x_{b};\ y_{b};\ z_{b})$), Equation (19) can be expressed as: $$\left\{ \begin{array}{l}
{x_{b} = \ X_{b} + \ 1.519\mathsf{\lambda}{(\mathsf{\varepsilon}^{ik} - 0.342\mathsf{\varepsilon}^{ij})}_{}} \\
{y_{b} = \ Y_{b} + \ 1.428\mathsf{\lambda}\mathsf{\varepsilon}^{ij}} \\
{z_{b} = \  \pm \sqrt{|\overset{\rightarrow}{b}|^{2} - \ x_{b}^{2} - \ y_{b}^{2}}} \\
\end{array} \right.$$

According to Equation (4), although the DD model eliminates the receiver clock error and the satellite clock error, the cost of the DD measurement noise root mean square error is $\sqrt{2}$ times than the SD measurement, which is generally about 1 cm (*i.e.*, roughly 0.05 GPS L1wavelength). Thus, according to Equation (20), the noise root mean square error ($rmse(\overset{\rightarrow}{b})$) of the baseline vector ($\overset{\rightarrow}{b}\  = \ (x_{b};\ y_{b};\ z_{b})$) is expressed as: $$\left\{ \begin{array}{l}
{rmse(x_{b})\  = \ 0.102\ \mathsf{\lambda}} \\
{rmse(y_{b})\  = \ 0.071\ \mathsf{\lambda}} \\
{rmse(z_{b})\  \approx \ 0.173\ \mathsf{\lambda}} \\
\end{array} \right.$$

Now, according to Equation (21), the noise error of the ambiguity function ($F(x,\ y,\ z)$) is analyzed: $$F(x,\ y,\ z)\  = \ \frac{1}{N - 1}{\sum\limits_{j = 1}^{N - 1}{\cos 2\mathsf{\pi}\left\{ {\nabla\mathsf{\Delta}\mathsf{\varphi}^{ij} - \ \frac{\overset{\rightarrow}{b} \cdot (\overset{\rightarrow}{s^{m}} - \overset{\rightarrow}{s^{i})}}{\mathsf{\lambda}}} \right\}}}$$

For the convenience of analysis, the satellite vector ($\overset{\rightarrow}{s^{m}} - \overset{\rightarrow}{s^{i}}$) of the other DD equation is converted through the rotation matrix from the local level frame (LLF) to the new coordinate system ($O - X_{b}Y_{b}Z_{b}$): $$\left\lbrack \begin{array}{l}
{\overset{\rightarrow}{(s^{m}} - \overset{\rightarrow}{s^{i})_{b(x)}}} \\
{\overset{\rightarrow}{(s^{m}} - \overset{\rightarrow}{s^{i})_{b(y)}}} \\
{\overset{\rightarrow}{(s^{m}} - \overset{\rightarrow}{s^{i})_{b(z)}}} \\
\end{array} \right\rbrack = \lbrack R_{y}(\mathsf{\gamma})R_{x}(\mathsf{\beta})R_{z}(\mathsf{\alpha})\rbrack\left\lbrack \begin{array}{l}
{\overset{\rightarrow}{(s^{m}} - \overset{\rightarrow}{s^{i})_{LLF(x)}}} \\
{\overset{\rightarrow}{(s^{m}} - \overset{\rightarrow}{s^{i})_{LLF(y)}}} \\
{\overset{\rightarrow}{(s^{m}} - \overset{\rightarrow}{s^{i})_{LLF(z)}}} \\
\end{array} \right\rbrack$$

Then, Equation (23) is substituted into Equation (12) and the result is expressed as: $$\begin{array}{l}
{\nabla\mathsf{\Delta}{\hat{N}}^{im} = \ \nabla\mathsf{\Delta}\mathsf{\varphi}^{im} + \ \mathsf{\varepsilon}^{im} - \ \frac{{(\overset{\rightarrow}{s^{m}} - \overset{\rightarrow}{s^{i}})}_{b} \cdot \left. {(x}_{b}{,y}_{b}{,z}_{b} \right)^{T}}{\mathsf{\lambda}}} \\
{\nabla\mathsf{\Delta}{\hat{N}}^{im} = \ \nabla\mathsf{\Delta}\mathsf{\varphi}^{im} + \ \mathsf{\varepsilon}^{im} - \ \frac{{(\overset{\rightarrow}{s^{m}} - \overset{\rightarrow}{s^{i}})}_{b(x)} \cdot x_{b} + \ {(\overset{\rightarrow}{s^{m}} - \overset{\rightarrow}{s^{i}})}_{b(y)} \cdot y_{b} + \ {(\overset{\rightarrow}{s^{m}} - \overset{\rightarrow}{s^{i}})}_{b(z)} \cdot z_{b}}{\mathsf{\lambda}}} \\
\end{array}$$ where $\mathsf{\varepsilon}^{im}$ is the noise error of the DD equation (the satellite vector: $\overset{\rightarrow}{s^{m}} - \overset{\rightarrow}{s^{i}}$); $\nabla\mathsf{\Delta}{\hat{N}}^{im}$ is the float ambiguity. The Equation (21) is substituted into Equation (24), the noise root mean square error ($rmse(\nabla\mathsf{\Delta}{\hat{N}}^{im})$) of the float ambiguity is expressed as: $$\begin{array}{l}
{rmse(\nabla\mathsf{\Delta}{\hat{N}}^{im})\  = {rmse}(\mathsf{\varepsilon}^{im}) + \ \frac{{(\overset{\rightarrow}{s^{m}} - \overset{\rightarrow}{s^{i}})}_{b} \cdot rmse{(x_{b},y_{b},z_{b})}^{T}}{\mathsf{\lambda}}} \\
{rmse(\nabla\mathsf{\Delta}{\hat{N}}^{im})\  \approx \ 0.05\  + \ {(\overset{\rightarrow}{s^{m}} - \overset{\rightarrow}{s^{i}})}_{b(x)} \cdot 0.102\  + \ {(\overset{\rightarrow}{s^{m}} - \overset{\rightarrow}{s^{i}})}_{b(y)} \cdot 0.071\  + \ {(\overset{\rightarrow}{s^{m}} - \overset{\rightarrow}{s^{i}})}_{b(z)} \cdot 0.173} \\
\end{array}$$

4.2. Ambiguity Decorrelation Adjustment of the Geometric Relationship {#sec4dot2-sensors-16-00841}
---------------------------------------------------------------------

According to the previous analysis, if the basic equations (Equation (6)) of the DD model are determined, the satellite parameters ($\overset{\rightarrow}{s^{j}} - \overset{\rightarrow}{s^{i}},\overset{\rightarrow}{s^{k}} - \overset{\rightarrow}{s^{i}},\ \mathsf{\alpha}_{b}^{ik}$) are also determined. The method for satellite selection is based on Equation (9). According to Equation (25), the value ($rmse(\nabla\mathsf{\Delta}{\hat{N}}^{im})$) of the float ambiguity is only related to the other satellite vector ${(\overset{\rightarrow}{s^{m}} - \overset{\rightarrow}{s^{i}})}_{b}$ and the candidate vector ($\overset{\rightarrow}{b}\  = \ (x_{b};\ y_{b};\ z_{b})$). It represents the geometric relationship between the candidate vector and the satellite vector. If the correlation of geometric relationship is smaller, the value ($rmse(\nabla\mathsf{\Delta}{\hat{N}}^{im})$) of the float ambiguity is smaller. Thus, we need to find the suitable satellite vector ($\overset{\rightarrow}{s^{m}} - \overset{\rightarrow}{s^{x}}$), so that the value ($rmse(\nabla\mathsf{\Delta}{\hat{N}}^{im})$) of the float ambiguity is the smallest. This process is equivalent to ambiguity decorrelation adjustment of the LAMBDA method \[[@B10-sensors-16-00841],[@B11-sensors-16-00841],[@B12-sensors-16-00841]\]. If this value ($rmse(\nabla\mathsf{\Delta}{\hat{N}}^{im})$) is smaller, the correlation interference of the noise error is smaller and the robustness of the ambiguity function ($F(x,\ y,\ z)$) is better. In contrast to the LAMBDA method, this method gets better performance in reducing computational complexity.

4.3. Comparison of the Simulation Results {#sec4dot3-sensors-16-00841}
-----------------------------------------

The simulation is performed from two aspects. In the first aspect, the algorithm is processed with ambiguity decorrelation adjustment of the noise error, and the other one is not do it. The simulation results are shown in [Figure 8](#sensors-16-00841-f008){ref-type="fig"} and [Figure 9](#sensors-16-00841-f009){ref-type="fig"}.

The performance of the algorithm in [Figure 9](#sensors-16-00841-f009){ref-type="fig"} is better than the algorithm in [Figure 8](#sensors-16-00841-f008){ref-type="fig"}. The algorithm is effective, and the robustness of the ambiguity function ($F(x,y,z)$) is improved. In the second aspect, the success rate of processing and not-processing is compared, as shown in [Table 1](#sensors-16-00841-t001){ref-type="table"}.

5. Experimental Attitude Determination Results {#sec5-sensors-16-00841}
==============================================

In this section the RMM method is demonstrated using data collected in an experiment. The experiment is conducted on the top of a building. In this experiment, two receivers (COMNAV K500, Shanghai Siyue Technology Co. Ltd, Shanghai, China) are used, and both are connected to the GNSS antennae. The receiver electro-circuit is shown in [Figure 10](#sensors-16-00841-f010){ref-type="fig"}.

The baseline is constrained with 2.0 m and 0.5 m and the pitch angle search region of 20 degrees is provided by MEMS. During the initial step, the integer ambiguity combination is resolved by RMM method and the real value is work out after a few epochs, as is shown in [Figure 11](#sensors-16-00841-f011){ref-type="fig"}, and the real value is a point on the peak obviously.

In this test, the number of locked GPS satellites is about eight, and the geometry of observations for this test is reasonably good. The experiment is performed from two groups in different arrangement. In [Figure 12](#sensors-16-00841-f012){ref-type="fig"}, with 2.0 m baseline, the standard deviation of the yaw and pitch angles are about 0.14° (1σ) and 0.18° (1σ), while with 0.5 m baseline the standard deviation reaches about 0.2° (1σ) and 0.25° (1σ) as shown in [Figure 13](#sensors-16-00841-f013){ref-type="fig"}. However, the calculation is reduced greatly.

The performance is good with high accuracy shown in [Table 2](#sensors-16-00841-t002){ref-type="table"}.

6. Conclusions {#sec6-sensors-16-00841}
==============

This study describes the rotation matrix method and the relationship of the geometric model and the noise error for single-frequency and single-epoch GNSS attitude determination. The rotation matrix method reduces the computational complexity compared with the analytical resolution method \[[@B5-sensors-16-00841],[@B6-sensors-16-00841]\]. In RMM, the calculation is reduced greatly and the error angles of different scales in trigonometric functions are effectively avoided. In contrast to the AFM, the geometric correlation methods \[[@B10-sensors-16-00841],[@B11-sensors-16-00841],[@B12-sensors-16-00841],[@B13-sensors-16-00841],[@B14-sensors-16-00841],[@B15-sensors-16-00841]\] get better performance in solving the relationship of the geometric model and the noise error. Although the AFM is more flexible, there is a lack of analysis on this aspect. In the study, this relationship about the AFM is analyzed in detail. The computation error and the noise error are effectively treated. Not only is the flexibility of the AFM inherited, but the success rate is also increased. According to our simulations and real-time experiments, this method is verified as very reliable and effective. The computational complexity is greatly reduced and the success rate is effectively increased. In future studies, we plan to combine the method with an inertial navigation system (INS) for tight combination.

This work is supported by Shanghai Siyue Technology Co. Ltd, Shanghai, China (Grant No. 2014310031003843). The authors would like to thank the anonymous reviewers for their valuable comments.

Yingdong Yang proposed the improved method, determined the whole research frame, and performed the main research and the experiment, and wrote the original manuscript. Xuchu Mao reviewed the manuscript and provided revisions and critical feedback. Weifeng Tian offered advice for the experiment.

The authors declare no conflict of interest.

![Illustration of the measurement of the SD carrier phase.](sensors-16-00841-g001){#sensors-16-00841-f001}

![Illustration of the measurement of the DD carrier phase.](sensors-16-00841-g002){#sensors-16-00841-f002}

![The basic model of spatial geometry.](sensors-16-00841-g003){#sensors-16-00841-f003}

![The spatial relation of two DD equations.](sensors-16-00841-g004){#sensors-16-00841-f004}

![The spatial relation in the new coordinate system.](sensors-16-00841-g005){#sensors-16-00841-f005}

![The noise error of the DD carrier measurement.](sensors-16-00841-g006){#sensors-16-00841-f006}

![The value ($W_{k}$) of AFM.](sensors-16-00841-g007){#sensors-16-00841-f007}

![Algorithm after not-processing.](sensors-16-00841-g008){#sensors-16-00841-f008}

![Algorithm after processing.](sensors-16-00841-g009){#sensors-16-00841-f009}

![Receiver electric circuit and antennae configuration.](sensors-16-00841-g010){#sensors-16-00841-f010}

![Adaptive function value demonstration.](sensors-16-00841-g011){#sensors-16-00841-f011}

![Experimental data of 1st group.](sensors-16-00841-g012){#sensors-16-00841-f012}

![Experimental data of 2nd group.](sensors-16-00841-g013){#sensors-16-00841-f013}

sensors-16-00841-t001_Table 1

###### 

Single-frequency, single-epoch, GNSS ambiguity success rates based on Equation (17) and Equation (18) for the processing (Y) and not-processing (N) RMM-AFM methods.

  \|b\| = 200 cm   Carrier Phase Precision: 3.0 mm   Pseudorange Precision: 15 cm       
  ---------------- --------------------------------- ------------------------------ --- ------
  5                Y                                 72.1                           N   43.1
  6                Y                                 92.4                           N   67.3
  7                Y                                 95.1                           N   77.4
  8                Y                                 97.3                           N   82.1

sensors-16-00841-t002_Table 2

###### 

Standard errors of attitude determination experiment.

  Test    Epochs   Baseline (m)   Attitude (°)   Std. Errors
  ------- -------- -------------- -------------- -------------
  1       800      2.00           Yaw            0.1483
  Pitch   0.1852                                 
  2       500      2.00           Yaw            0.1503
  Pitch   0.1801                                 
  3       800      0.5            Yaw            0.2121
  Pitch   0.2509                                 
  4       500      0.5            Yaw            0.2221
  Pitch   0.2615                                 
