A Novel GNSS Attitude Determination Method Based on Primary Baseline Switching for A Multi-Antenna Platform

: The global navigation satellite system (GNSS)-based attitude determination system has attracted more and more attention with the advantages of having simpliﬁed algorithms, a low price and errors that do not accumulate over time. However, GNSS signals may have poor quality or lose lock in some epochs with the inﬂuence of signal fading and the multipath e ﬀ ect. When the direct attitude determination method is applied, the primary baseline may not be available (ambiguity is not ﬁxed), leading to the inability of attitude determination. With the gradual popularization of low-cost receivers, making full use of spatial redundancy information of multiple antennas brings new ideas to the GNSS-based attitude determination method. In this paper, an attitude angle conversion algorithm, selecting an arbitrary baseline as the primary baseline, is derived. A multi-antenna attitude determination method based on primary baseline switching is proposed, which is performed on a self-designed embedded software and hardware platform. The proposed method can increase the valid epoch proportion and attitude information. In the land vehicle test, reference results output from a high-accuracy integrated navigation system were used to evaluate the accuracy and reliability. The results indicate that the proposed method is correct and feasible. The valid epoch proportion is increased by 16.2%, which can e ﬀ ectively improve the availability of attitude determination. The RMS of the heading, pitch and roll angles are 0.52 ◦ , 1.25 ◦ and 1.16 ◦ .


Introduction
Precise vehicle attitude determination is one of the key technologies in the field of navigation, guidance and control.Generally, an inertial navigation system (INS) is used to obtain attitude angles directly with the advantage of continuous navigation signals, free from electromagnetic interference and concealment.However, the high-accuracy INS is expensive, and the error will accumulate over time [1].It often relies on external auxiliary information for correction [2,3].In the early stages of the GPS (Global Positioning System) system construction, some people put forward the idea of using GPS for attitude determination.As long as ambiguities can be fixed correctly, the attitude solutions based on high-accuracy carrier phase observations can reach considerable precision [4,5].In recent years, the use of a GPS carrier-phase double differenced (DD) observations to calculate high-precision baseline vectors has developed rapidly, providing a guarantee for using GPS baseline vectors to realize attitude determination.Thanks to the rapid development of the global navigation satellite system (GNSS), multi-frequency and multi-constellation data has been widely applied.Using GNSS data instead of solely GPS data not only increases the redundant observations but also helps to form a good geometry structure, which is helpful to improve the quality of positioning and attitude determination.More and more researchers began to pay attention to GNSS attitude determination, which has the advantages of having a small size, low cost, short initial time, and errors that do not accumulate over time.Compared with INS, it has outstanding advantages in situations with low accuracy requirements and shows potential to be applied in research and industrialization.
At present, attitude determination algorithms include the direct method, optimal estimation method based on Wahba problem, least square method, Kalman filter method, etc.The direct method does not require any prior information and the attitude angles can be directly calculated using baseline components, but it is greatly affected by baselines layout and redundant observations cannot be applied.Aiming at solving multivalued problems in the direct method, Cai et al (2018) proposed a simple method for judging with symbols based on a three-antenna GNSS platform [6].The Wahba problem [7] was proposed by Wahba in 1965 to discuss how to use the baseline vector information to calculate the attitude angles of the carrier.In essence, it is to find the optimal direction cosine matrix (DCM) to minimize the Wahba loss function.Since then, many scholars have proposed optimal estimation methods based on the Wahba problem, including the QUEST (quaternion estimation) method [8] and SVD (singular value decomposition) method [9].However, these methods have the disadvantages of having large amounts of calculation and loss of valid information.Chen et al. (2016) developed an innovative method that fully integrates MEMS (micro-electro-mechanical system)-based inclinometer measurements into single-difference GPS observation equations and obtains the fixed baseline solution via weighted constrained integer least-squares [10].However, the least-square method is generally based on the principle of indirect adjustment, and the initial value of the attitude angle needs to be provided [6].In order to better adapt to the dynamic situation, many scholars have carried out some researches using the filter to solve the attitude determination problem.At present, the multiplicative extended Kalman filter based on quaternion is most widely used.For example, Reference [11] introduced an Euler-like attitude perturbation angle for reducing filter states and simplifying propagation processes in the quaternion-based Kalman filter configuration.Teunissen proposed the CLAMBDA (constrained LAMBDA, Least-squares Ambiguity Decorrelation Adjustment) algorithm [12,13], which takes baseline length as the constraint information so that it can effectively fix the ambiguity and realize attitude determination.Some scholars also put forward some new methods, for instance, Yang et al. (2016) proposed to use the rotation matrix method (RMM) combined with the AFM (ambiguity function method) to solve the GNSS attitude and ambiguity resolution problem [14].The rotation matrix method reduces the computational complexity compared with the analytical resolution method.Cong et al. (2015) proposed a MEMS INS-aided ambiguity resolution method based on a multi antenna platform to improve the GPS attitude determination performance.They improved the quality of the float ambiguity solution, leading to a high success rate [15].In addition, a BDS/INS (BeiDou Navigation Satellite System/Inertial Navigation System) tightly coupled attitude determination algorithm was proposed in [16].However, there is no reference value to verify the experimental results.In Reference [17] a low-cost effective GPS-aided method based on target images is proposed to measure the platform attitude angles.But the real-time and availability of this method are limited.Since the ambiguity correctness validation cannot guarantee the reliability of the attitude solutions, an integrity monitoring method is therefore proposed for the attitude determination in the measurement domain [18].The proposed method can reduce the maximum attitude error by about 2.3 • .As in [19], these two articles pay more attention to the improvement of attitude accuracy by quality control.Raúl de Celis (2018) presented a novel approach for gravity vector estimation in a body reference frame, which is based on UAV (unmanned aerial vehicle) aerodynamics and mass properties [20].Reference [21] introduced the design, implementation and experimental results of a quaternion-based EKF algorithm for attitude and heading determination of multi-rotor UAVs using low-cost MEMS sensors.However, the error of dynamic attitude determination is up to 3 • .Hauschild et al. (2019) adopted the airborne platform developed by Stuttgart University [22].It is shown that the major sources of errors are offsets and variations of the differential antenna phase patterns.In addition, the attitude quaternion or Euler angles can also be taken as the parameter to be solved by GNSS attitude determination, which can be solved together with the integer ambiguity [23,24].However, this kind of method needs the initial value of the attitude.If the accuracy of the initial value is poor, the convergence time will be very long or even impossible to converge.
With the improvement of GNSS satellite constellation and development of dynamic positioning technology, GNSS attitude determination methods based on a multi-antenna platform has attracted more and more attention [25].References [26,27] proposed a low-cost method to estimate vehicle attitude for Satcom-on-the-move (SOTM) using a micro inertial measurement unit based on the two-antenna platform.However, the errors may be more than 0.5 • if the two-antenna GPS cannot provide the yaw angle over a long time and the roll angle is not easy to obtain.
In this article, the direct method is used to realize the multi-antenna GNSS attitude determination and the algorithm principle is deduced and summarized.The software and hardware platforms were designed by our research group.However, the GNSS signals may have poor quality or lose lock in some epochs.When using the direct method to calculate attitude angles, the primary baseline may not be available, or the solutions accuracy cannot be guaranteed.Regarding present problems, we deduce the attitude angle conversion algorithm selecting any baseline as the primary baseline and propose a multi-antenna attitude determination method based on primary baseline switching.This method can improve the valid epoch proportion and increase attitude information.In the vehicle test, the observations output from SPAN-FSAS (Synchronized Position Attitude Navigation, the FSAS is a tactical grade inertial measurement unit, manufactured in Germany) were used for integrated navigation solutions, and the results were regarded as a reference for comparison and verification.The practicability and correctness of the proposed method were discussed through the valid epoch proportion, attitude determination results, and error analysis.

Methodology
GNSS attitude determination requires observations of two or more antennas.First, use the DD carrier phase observations to obtain the baseline vector solutions.Second, according to the basic principle of coordinate system transformation, use the direct method to carry out the attitude solutions.

DD Positioning Algorithm Based on Carrier Phase
The function model of GNSS positioning is used to establish the mathematical expression between the observations and parameters to be evaluated [28]: where r and s represent receivers and satellites, X r is the coordinates to be estimated (x r , y r , z r ), X s is the coordinates of GNSS satellite (x s , y s , z s ), O is carrier phase observations, δt r is receiver clock difference, δt s is satellite clock difference, δ ion , δ trop , δ tide , δ rel , δ ref_f represent ionospheric delay, tropospheric delay, tide, relativistic effects and the frequency correction of the relativistic effects, ε is noise, m represents the multipath effect and N is integer ambiguity.As attitude determination mainly adopts carrier phase observations, the specific form is as follows [29][30][31]: Attitude determination is generally based on an ultra-short baseline.When using the DD model [32], most of the errors in the above formula, such as clock difference, ionospheric error, tropospheric delay, and satellite orbit error, can be eliminated.At this time, the DD carrier phase positioning model can be simplified as [33][34][35] ∇∆L ks br = ∇∆ρ ks br + ∇∆ε + ∇∆m − λ∇∆N ks br (3) where r and b are the rover and base station, k and s represent satellites, L is the carrier phase observations and λ is wavelength.∇∆ρ ks br is the DD geometric distance from the satellite to the receiver, ∇∆N ks br is DD ambiguity, ∇∆ε is DD noise and ∇∆m is the DD multipath effect.∇∆ is a DD operator.It means the difference between the single difference carrier-phase observations made by two stations to two satellites.Single difference (SD) is the difference of phase observations of two stations to the same satellite.

Attitude Determination Method
The classical LAMBDA [36,37] method is used to fix the ambiguity of the carrier-phase observations.When the ambiguity is fixed, baseline vectors can be calculated by using three or more carrier-phase DD observations in the same epoch.At present, GNSS attitude determination is generally based on the principle of coordinate system transformation, using baseline vectors under the body frame (b-frame) and navigation frame (n-frame) to calculate attitude angles.The algorithms include the direct method, the optimal estimation method based on the Wahba problem, the least-square method and the Kalman filter method.In this article, the direct method is used, and the coordinate transformation matrix is used to realize the transformation of attitude angles when the primary baseline is switched.
In the direct method, the projection of a baseline vector in the b-frame and n-frame as well as conversion relationship between them is used to reverse the attitude angles in the coordinate transformation matrix.When calculating, only the projection of the baseline vector in the n-frame is needed.The heading and pitch angles can be calculated using one primary baseline, and three attitude angles should be calculated using two baselines, the primary and subsidiary baselines.The primary baseline is set according to the following principles: antenna 1 points to antenna 2 to form the primary baseline, and vector 1-2 points to the positive direction of the Y-axis in the b-frame.As shown in Figure 1, the b-frame can be constructed based on the primary baseline 1-2.The subsidiary baseline 1-3 is not collinear with 1-2 and there is an angle α 0 between 1-3 and the Y-axis in the b-frame.The three attitude angles (heading, pitch and roll) of a car are also shown in Figure 1.

Attitude Determination Method
The classical LAMBDA [36,37] method is used to fix the ambiguity of the carrier-phase observations.When the ambiguity is fixed, baseline vectors can be calculated by using three or more carrier-phase DD observations in the same epoch.At present, GNSS attitude determination is generally based on the principle of coordinate system transformation, using baseline vectors under the body frame (b-frame) and navigation frame (n-frame) to calculate attitude angles.The algorithms include the direct method, the optimal estimation method based on the Wahba problem, the least-square method and the Kalman filter method.In this article, the direct method is used, and the coordinate transformation matrix is used to realize the transformation of attitude angles when the primary baseline is switched.
In the direct method, the projection of a baseline vector in the b-frame and n-frame as well as conversion relationship between them is used to reverse the attitude angles in the coordinate transformation matrix.When calculating, only the projection of the baseline vector in the n-frame is needed.The heading and pitch angles can be calculated using one primary baseline, and three attitude angles should be calculated usingtwo baselines, the primary and subsidiary baselines.The primary baseline is set according to the following principles: antenna 1 points to antenna 2 to form the primary baseline, and vector 1-2 points to the positive direction of the Y-axis in the b-frame.As shown in Figure 1, the b-frame can be constructed based on the primary baseline 1-2.The subsidiary baseline 1-3 is not collinear with 1-2 and there is an angle α0 between 1-3 and the Y-axis in the b-frame.The three attitude angles (heading, pitch and roll) of a car are also shown in Figure 1.By measuring the length L12, L13 and the angle α0 of the baseline, the projection X1 b and X2 b of the baseline vectors in the b-frame can be obtained, and the projection X1 n and X2 n of the baseline vectors in the n-frame can be obtained by GNSS positioning solutions; By measuring the length L 12 , L 13 and the angle α 0 of the baseline, the projection X 1 b and X 2 b of the baseline vectors in the b-frame can be obtained, and the projection X 1 n and X 2 n of the baseline vectors in the n-frame can be obtained by GNSS positioning solutions; According to the formula of coordinate transformation X n = R n b X b , the following equation can be obtained: T , the above formula can be written as Therefore, the heading h and pitch angle p can be obtained: According to X n 2 = e 13 n 13 u 13 T , X b 2 = L 13 sin α 0 L 13 cos α 0 0 T and Equations ( 5), ( 7) and ( 8), the roll angle r can be written as r = −arctan − sin p sin he 13 − sin p cos hn 13 + cos pu 13 cos he 13 − sin hn 13 (9) The advantage of direct method is that the algorithm is simple and the computation is small.Attitude angles can be calculated directly from baseline vectors obtained from GNSS positioning solutions.However, the precision of the direct method is greatly affected by the baseline's layout.When the number of antennas increases, observation information from multiple antennas cannot be fully utilized.

Primary Baseline Switching
When the direct method is used to calculate attitude angles in actual measurement, the primary baseline may be unavailable (due to poor data quality).For example, when the primary baseline 1-2 in Figure 2 is unavailable(for example, signals of antenna 2 loss lock), another baseline can be selected as the temporary primary baseline.Suppose that baseline 1-3 is selected as the temporary primary baseline, the coordinate system established based on baseline 1-2 is recorded as the b0-frame, and the coordinate system established based on baseline 1-3 is recorded as the b1-frame.At this moment, the attitude angles reflect the relative relationship between the b1-frame and the n-frame, which needs to be transformed into the relative relationship between the b0-frame and the n-frame.Baseline 1-4 can be regarded as a subsidiary baseline.Since the topology between antennas remains the same, X0-1-Y0 plane of the b0-frame coincides with the X1-1-Y1 plane of the b1-frame.The two coordinate systems can be transformed by rotating angle α0 around the common Z-axis.This transformation matrix from a b0 to a b-frame can be obtained by the following formula: At the same time, attitude angles calculated from baseline 1-3 can be transformed into a transformation matrix from the b1-frame to the n-frame: The continuous transformation of the coordinate system can be realized by multiplying the transformation matrix.The transformation matrix from the b0-frame to the n-frame can be obtained by multiplying the above two coordinate matrices: The coordinate transformation matrix from the b0-frame to the n-frame reflects the relative relationship between them.Only the attitude angles in the matrix needs to be inversely calculated to get the actual attitude of a carrier: It should be noted that if the selected temporary primary baseline is inconsistent with the starting point of the original primary baseline, the starting point does not need translation first.
The primary baseline switching approach solves the problem of reliance on the primary baseline in the direct method.It can make use of the redundant information brought by the multi-antenna, and also increase the valid epochs involved in attitude determination.In a practical application, the reliability of the attitude determination can be improved by analyzing baseline Since the topology between antennas remains the same, X0-1-Y0 plane of the b0-frame coincides with the X1-1-Y1 plane of the b1-frame.The two coordinate systems can be transformed by rotating angle α 0 around the common Z-axis.This transformation matrix from a b0 to a b-frame can be obtained by the following formula: At the same time, attitude angles calculated from baseline 1-3 can be transformed into a transformation matrix from the b1-frame to the n-frame: The continuous transformation of the coordinate system can be realized by multiplying the transformation matrix.The transformation matrix from the b0-frame to the n-frame can be obtained by multiplying the above two coordinate matrices: The coordinate transformation matrix from the b0-frame to the n-frame reflects the relative relationship between them.Only the attitude angles in the matrix needs to be inversely calculated to get the actual attitude of a carrier: (13) It should be noted that if the selected temporary primary baseline is inconsistent with the starting point of the original primary baseline, the starting point does not need translation first.
The primary baseline switching approach solves the problem of reliance on the primary baseline in the direct method.It can make use of the redundant information brought by the multi-antenna, and also increase the valid epochs involved in attitude determination.In a practical application, the reliability of the attitude determination can be improved by analyzing baseline vectors quality and taking the baseline with the best quality as the primary baseline.To sum up, the methodology flowchart is shown in Figure 3.
vectors quality and taking the baseline with the best quality as the primary baseline.To sum up, the methodology flowchart is shown in figure 3.

Error Analysis
According to formula ( 7), ( 8) and ( 9), as well as the law of error propagation, the root mean square error (RMS) of each attitude angle can be obtained.Taking heading angle as an example, the derivation process of the error will be given.First, assume that the components of baseline are uncorrelated, and the mean square errors of e12, n12 are where e12, n12 represent the coordinate component of baseline 1-2 in the east and north direction.According to formula (7),the partial derivative of function h with respect to variable e and n can be derived as  A gradient vector can be formed as

Error Analysis
According to formula ( 7), ( 8) and ( 9), as well as the law of error propagation, the root mean square error (RMS) of each attitude angle can be obtained.Taking heading angle as an example, the derivation process of the error will be given.First, assume that the components of baseline are uncorrelated, and the mean square errors of e 12 , n 12 are σ e 12 , σ n 12 , then the covariance matrix of e 12 , n 12 is where e 12 , n 12 represent the coordinate component of baseline 1-2 in the east and north direction.
According to formula (7), the partial derivative of function h with respect to variable e and n can be derived as A gradient vector can be formed as −e e 2 +n 2 (17) Following the law of error propagation, the variance and root mean square error of the heading angle can be obtained: Similarly, the root mean square error of pitch and roll angle is where σ 2 According to Equation ( 18), the heading angle error is related to the primary baseline.The longer the baseline is, the smaller the error is.The closer pitch angle is to zero, the smaller the heading angle error is.According to Equation (19), there is a negative correlation between pitch angle accuracy and primary baseline length, involving three baseline components.Roll angle error is related to two baselines and the included angle α 0 between the baselines.When the baseline length is constant and the two baselines are orthogonal, the roll angle error is the smallest.

Introduction to the Platform
In order to verify the proposed baseline switching method, a GNSS data acquisition and processing platform based on four antennas is designed.The platform is equipped with four M8T series modules of the Ublox Company to realize the acquisition of the GNSS signal and the real-time output of the observations.The Beaglebone Black Board is selected to complete data processing tasks.The Beaglebone Black Board is a low-cost embedded development platform, which uses ARM Cortex-A8 with a main frequency of 1GHz as the processor.It can be used to realize the real-time processing of multiple GNSS observations.The observations of four M8T modules can be directly stored in the built-in memory of the Beaglebone Black Board for subsequent processing and analysis.It can also be delivered to the ARM Cortex-A8 processor in real-time for calculations, and the attitude determination results can be transmitted in real-time via WiFi, radio modem and other communication modes.Figure 4a  The complete test platform for GNSS data acquisition and processing is shown in Figure 5. Four GPS500 antennas are fixed on a smooth and horizontal steel plate, forming a 0.3m × 0.3m rectangle.This type of antenna can capture signals of GPS L1/L2, BDS B1/B2/B3, which can fully meet the needs of this test.Each antenna is connected to an RF (radio frequency) input of an M8T module.Based on the four-antenna hardware platform, the attitude determination method of the multi-antenna GNSS receivers is studied.If antenna 3 is taken as the reference antenna, a maximum of three non-collinear baseline vectors can be constructed in an epoch.If the reference antenna signals lose lock, another reference antenna can be selected to reconstruct the baseline vector, which can make full use of the measurement information provided by this multi-antenna hardware platform.
Because it is very important to obtain the true value of the positioning and attitude in the vehicle test, the high-performance integrated navigation device SPAN-FSAS from Novatel was selected and fixed at the physical center of the four antennas.The integrated navigation algorithm of the SPAN-FSAS is not open source and it is generally considered as a standard tight coupling lose lock, another reference antenna can be selected to reconstruct the baseline vector, which can make full use of the measurement information provided by this multi-antenna hardware platform.
Because it is very important to obtain the true value of the positioning and attitude in the vehicle test, the high-performance integrated navigation device SPAN-FSAS from Novatel was selected and fixed at the physical center of the four antennas.The integrated navigation algorithm of the SPAN-FSAS is not open source and it is generally considered as a standard tight coupling integrated navigation algorithm.In this manuscript, only the output position and attitude solution are selected as the reference truth, and no specific integrated navigation algorithm is involved.The positioning precision (RTK mode) of the SPAN-FSAS can reach about 1-3 cm, and the precision of its pitch, roll and azimuth angles are about 0.015 • , 0.015 • and 0.041 • , respectively.The position and attitude results output from the SPAN-FSAS will be regarded as the true values of the vehicle test to evaluate the precision of our multi-antenna attitude determination results.The complete test platform for GNSS data acquisition and processing is shown in Figure 5. Four GPS500 antennas are fixed on a smooth and horizontal steel plate, forming a 0.3m × 0.3m rectangle.This type of antenna can capture signals of GPS L1/L2, BDS B1/B2/B3, which can fully meet the needs of this test.Each antenna is connected to an RF (radio frequency) input of an M8T module.Based on the four-antenna hardware platform, the attitude determination method of the multi-antenna GNSS receivers is studied.If antenna 3 is taken as the reference antenna, a maximum of three non-collinear baseline vectors can be constructed in an epoch.If the reference antenna signals lose lock, another reference antenna can be selected to reconstruct the baseline vector, which can make full use of the measurement information provided by this multi-antenna hardware platform.
Because it is very important to obtain the true value of the positioning and attitude in the vehicle test, the high-performance integrated navigation device SPAN-FSAS from Novatel was selected and fixed at the physical center of the four antennas.The integrated navigation algorithm of the SPAN-FSAS is not open source and it is generally considered as a standard tight coupling integrated navigation algorithm.In this manuscript, only the output position and attitude solution are selected as the reference truth, and no specific integrated navigation algorithm is involved.The positioning precision (RTK mode) of the SPAN-FSAS can reach about 1-3 cm, and the precision of its pitch, roll and azimuth angles are about 0.015°, 0.015° and 0.041°, respectively.The position and attitude results output fromthe SPAN-FSAS will be regarded as the true values of the vehicle test to evaluate the precision of our multi-antenna attitude determination results.The test platform was installed on the roof of a vehicle, and a section of the BaYi road near the Optics Valley Bridge in Wuhan, China, was selected for the test.The experimental route is shown in Figure 6.The road surface is smooth with small fluctuations.The heading angle decreases first and then increases during the whole process.The average velocity of the car was around 40 km/h.The test platform was installed on the roof of a vehicle, and a section of the BaYi road near the Optics Valley Bridge in Wuhan, China, was selected for the test.The experimental route is shown in Figure 6.The road surface is smooth with small fluctuations.The heading angle decreases first and then increases during the whole process.The average velocity of the car was around 40km/h.

Acquisition of Reference Results
SPAN technology combines two different but complementary technologies: GNSS positioning and inertial navigation technology.It includes an IMU (inertial measurement unit) named IMU-FSAS-EI and a high precision GNSS navigation receiver.This set of equipment in our laboratory is worth 400,000 RMB and its results are used for reference.

Acquisition of Reference Results
SPAN technology combines two different but complementary technologies: GNSS positioning and inertial navigation technology.It includes an IMU (inertial measurement unit) named IMU-FSAS-EI and a high precision GNSS navigation receiver.This set of equipment in our laboratory is worth 400,000 RMB and its results are used for reference.
SPAN-FSAS adopts the local Cartesian coordinates system (ENU), so the coordinate conversion should be carried out during raw data decoding and lever arm setting.The accurate lever arm information is essential for obtaining high-precision solution results.The commercial IE software is used to solve this problem and the calculation of the arm is finished by it.In addition, IGS WUH2 was selected as the base station for GNSS RTK. Figure 7 shows the process of obtaining reference results.Besides, the car is first stationary for 10 min to give SPAN-FSAS sufficient initialization time.It can avoid the unreliability of the reference results during filter converging time.

Acquisition of Reference Results
SPAN technology combines two different but complementary technologies: GNSS positioning and inertial navigation technology.It includes an IMU (inertial measurement unit) named IMU-FSAS-EI and a high precision GNSS navigation receiver.This set of equipment in our laboratory is worth 400,000 RMB and its results are used for reference.
SPAN-FSAS adopts the local Cartesian coordinates system (ENU), so the coordinate conversion should be carried out during raw data decoding and lever arm setting.The accurate lever arm information is essential for obtaining high-precision solution results.The commercial IE software is used to solve this problem and the calculation of the arm is finished by it.In addition, IGS WUH2 was selected as the base station for GNSS RTK. Figure 7 shows the process of obtaining reference results.Besides, the car is first stationary for 10 min to give SPAN-FSAS sufficient initialization time.It can avoid the unreliability of the reference results during filter converging time.

The Correctness of the Primary Baseline Switching Method
In order to verify the correctness of the proposed method, baselines with different angles from the Y-axis of the b-frame were selected as the primary baseline for testing.Then, "alpha" was used to indicate the angle from the previous b-frame (i.e., b0-frame) to the new b-frame (i.e., b1-frame), and counterclockwise was positive.
The baseline vector was transformed from the absolute position of the antennas, and the two baselines with an angle difference of 180 • were obtained from the same two antennas.For instance, the 0 • baseline is 4-1 while the 180 • baseline is 1-4.In theory, the difference between the results of the 180 • and 0 • baseline is zero.Considering that the primary baseline in attitude determination was baseline 4-1 (or 3-2), the results of the other angles baselines were compared with the 0 • baseline (baseline 4-1) solution.
Figure 8 shows the difference between the results of the −45 • , −90 • baseline and 0 • baseline (baseline 4-1)."δh", "δp" and "δr" represent the difference of heading angle, pitch angle and roll angle.Table 1 shows the calculated errors of each baseline (the difference between the calculated and the reference results).∆h, ∆p and ∆r are the calculated errors of the heading angle, pitch angle and roll angle.
Figure 8 shows the difference between the results of the −45°, −90° baseline and 0° baseline (baseline 4-1)."δh", "δp" and "δr" represent the difference of heading angle, pitch angle and roll angle.Table 1 shows the calculated errors of each baseline (the difference between the calculated and the reference results).△h, △p and △r are the calculated errors of the heading angle, pitch angle and roll angle.According to Figure 8 and Table 1, when the data quality is stable, there is little difference in the results accuracy of baselines with different angles.Among them, the results accuracy of heading angle is the highest.When the data quality is unstable, the accuracy is also significantly different.For example, it can be seen from the above analysis that the data of antenna 1 is not sensitive to the-90° baseline, the distribution interval of the roll angle errors is small and the error variance is only 0.65.According to Figure 8 and Table 1, when the data quality is stable, there is little difference in the results accuracy of baselines with different angles.Among them, the results accuracy of heading angle is the highest.When the data quality is unstable, the accuracy is also significantly different.For example, it can be seen from the above analysis that the data of antenna 1 is not sensitive to the −90 • baseline, the distribution interval of the roll angle errors is small and the error variance is only 0.65.
It can be known from the above analysis that the primary baseline switching method is correct and feasible, and the results of the baselines with different angles can basically remain consistent after conversion.In practical application, this algorithm can reduce the dependence on the primary baseline of the direct method by combining baselines flexibly.The attitude can be determined even if the GNSS signals of an antenna lose lock.

Analysis of the Results Based on Primary Baseline Switching Method
In the experiment, 3-2 was randomly selected as the primary baseline in the beginning.When the data of antenna 2 or 3 was invalid, another baseline was chosen as the primary baseline.The feasibility and correctness of the proposed method will be analyzed in three aspects: valid epoch proportion, results of attitude determination and error analysis.

Valid Epoch Proportion
Table 2 shows the valid epoch proportion and whether the primary baseline is allowed to switch.Epoch is the time point when the attitude is calculated and valid epochs in Table 2 means the corresponding epochs is available (reliable fixed solutions can be obtained).In addition, a valid epoch proportion means the percentage of available epochs in total.According to Table 2, the valid epoch proportion without switching is 72.03%, and the proportion of allowing switching increases to 83.68% (107 epochs, nearly 16.2%).Generally, the baseline switching is performed because the GNSS signal quality is poor or lose lock in some epochs.Without the primary baseline switching, the attitude solutions cannot be carried out.Therefore, the proposed method can improve the valid epoch proportion and increase the effective attitude information.

Results of Attitude Determination Based on the Proposed Method
Figures 9-11 show the results of the heading, pitch and roll angles.The blue curve represents the calculated value by the proposed method, while the red curve represents the reference value.Green dots represent switching epochs; they are used to indicate the epochs of the corresponding period when primary baseline switching happen.The number of switching epochs (green dots) is also shown in Table 3.It can be observed that the green "dot" is mainly concentrated in three time periods.According to figure 9, 10, 11 and the first period in Table 3, many float solutions were obtained by RTK positioning (the primary baseline is 3-2), because the ambiguities were not fixed.The baseline vectors results could not be used for attitude determination.Through the primary baseline switching, some ambiguities could be fixed.Hence some baseline vectors were available for attitude determination.The attitude information during these epochs can be effectively increased.In this period, GNSS signal quality was poor and a large number of invalid epochs appeared.Only 88 valid epochs (a total of 265 epochs) were present.A total of 84 epochs could participate in attitude determination after primary baseline switching.The reason is the multi-path effect of the surrounding buildings or the signal attenuation brought on by trees in this period, which makes the signals of some antennas lose lock in some epochs.The primary baseline is also switched frequently.This further reflects the advantage of multi-antenna in attitude determination; that is, considering the probability of a signal losing lock, the possibility of valid epochs and available baselines is increased.
In the second period in Table 3, all four antennas could receive stable signals, but the ratio in the results of antenna 2 was very small.In the dynamic test, the ratio of ambiguity fixed resolution is often set to 2. In order to ensure the reliability of the fixed solution, 3 is considered as a ratio According to Figure 9, Figure 10, Figure 11 and the first period in Table 3, many float solutions were obtained by RTK positioning (the primary baseline is 3-2), because the ambiguities were not fixed.The baseline vectors results could not be used for attitude determination.Through the primary baseline switching, some ambiguities could be fixed.Hence some baseline vectors were available for attitude determination.The attitude information during these epochs can be effectively increased.In this period, GNSS signal quality was poor and a large number of invalid epochs appeared.Only 88 valid epochs (a total of 265 epochs) were present.A total of 84 epochs could participate in attitude determination after primary baseline switching.The reason is the multi-path effect of the surrounding buildings or the signal attenuation brought on by trees in this period, which makes the signals of some antennas lose lock in some epochs.The primary baseline is also switched frequently.This further reflects the advantage of multi-antenna in attitude determination; that is, considering the probability of a signal losing lock, the possibility of valid epochs and available baselines is increased.
In the second period in Table 3, all four antennas could receive stable signals, but the ratio in the results of antenna 2 was very small.In the dynamic test, the ratio of ambiguity fixed resolution is often set to 2. In order to ensure the reliability of the fixed solution, 3 is considered as a ratio threshold in the proposed method.If the ratio of corresponding epochs is lower than 3, the primary baseline will also be switched because the ratio can indicate the positioning quality to a certain extent.Therefore, the corresponding epochs will also be regarded as an invalid epoch even if the ambiguity can be fixed.The third period was similar to the second period.Antenna 3 was eliminated because the ratio was too small, hence the primary baseline was switched.In the latter two periods, the antenna did not lose lock, but the quality of the fixed solution was poor; therefore, there was no abnormal fluctuation when the primary baseline was switched.The RMS of the attitude determination of whether primary baseline switching was applied is shown in Table 4.According to Table 4, the attitude determination results are poor in the first period when the proposed method is not used, and the results are not reliable.After primary baseline switching, not only the reliable attitude information is increased, but also the attitude determination precision is higher.As mentioned above, the GNSS data quality is relatively poor in the second and third periods.After primary baseline switching, the attitude determination precision is also improved.
Figure 12 shows the ambiguity resolution and positioning results of four antennas corresponding to the switching epochs.According to Table 4, the attitude determination results are poor in the first period when the proposed method is not used, and the results are not reliable.After primary baseline switching, notonly the reliable attitude information is increased, but also the attitude determination precision is higher.As mentioned above, the GNSS data quality is relatively poor in the second and third periods.After primary baseline switching, the attitude determination precision is also improved.
Figure 12 shows the ambiguity resolution and positioning results of four antennas corresponding to the switching epochs.In Figure 12a, only float solutions can be obtained in antenna 3, resulting in the primary baseline being switched from 3-2 to 2-1.According to the known spatial relationship between the four antennas, the precision of ambiguity fixed solution is high in Figure 12a.Through primary baseline switching, the number of valid epochs is increased effectively, and more available attitude information can be applied.The feasibility and practical value of the proposed method can be also verified.In Figure 12b, a fixed solution cannot be obtained in antenna 2. At this moment, the primary baseline is switched from 3-2 to 3-4.

Error Analysis
Figure 13 shows the error curve.The green dot "•" represents the epoch in which the primary baseline was switched.△h, △p and △r are the calculation errors of the heading, pitch and roll In Figure 12a, only float solutions can be obtained in antenna 3, resulting in the primary baseline being switched from 3-2 to 2-1.According to the known spatial relationship between the four antennas, the precision of ambiguity fixed solution is high in Figure 12a.Through primary baseline switching, the number of valid epochs is increased effectively, and more available attitude information can be applied.The feasibility and practical value of the proposed method can be also verified.In Figure 12b, a fixed solution cannot be obtained in antenna 2. At this moment, the primary baseline is switched from 3-2 to 3-4.

Error Analysis
Figure 13 shows the error curve.The green dot "•" represents the epoch in which the primary baseline was switched.∆h, ∆p and ∆r are the calculation errors of the heading, pitch and roll angles.
In Figure 12a, only float solutions can be obtained in antenna 3, resulting in the primary baseline being switched from 3-2 to 2-1.According to the known spatial relationship between the four antennas, the precision of ambiguity fixed solution is high in Figure 12a.Through primary baseline switching, the number of valid epochs is increased effectively, and more available attitude information can be applied.The feasibility and practical value of the proposed method can be also verified.In Figure 12b, a fixed solution cannot be obtained in antenna 2. At this moment, the primary baseline is switched from 3-2 to 3-4.

Error Analysis
Figure 13 shows the error curve.The green dot "•" represents the epoch in which the primary baseline was switched.△h, △p and △r are the calculation errors of the heading, pitch and roll angles.The error peaks occur in epochs when the number of available baselines is 2, including the epochs with primary baseline switching and without switching.On the one hand, the poor quality of GNSS signals leads to poor accuracy.On the other hand, gross error cannot be detected after the calculation, and only relies on data preprocessing to remove some error sources.Once the noise or other errors are not thoroughly eliminated during data preprocessing, the results accuracy will be affected.
On the whole, the heading angle error is small and basically distributed within the range of ±1 • .The pitch angle error is basically distributed within the range of ±3 • , while the roll angle error also fluctuates within the range of ±3 • .Theoretically, the baseline coordinates ratio is used to calculate the heading angle.However, power and rooting operations are used to calculate the pitch angle, amplifying the noise.Heading angle and pitch angle are used in the calculation of roll angle, so the noise will also be high.Therefore, pitch and roll angles are more sensitive to noise, which is shown in Figure 13 and Table 5.Table 5 shows the calculated errors.According to Table 5, the results of the heading angle are stable and the variance is 0.28 deg 2 .However, there are some outliers in pitch and roll angle determination, and the maximum error even reaches about 3.6 • .The error variances are 1.56 and 1.34 deg 2 .Therefore, the accuracy of roll and pitch angles is far less stable than the heading angle, which is the most concerned attitude angle in vehicle navigation.
Through the above analysis, the valid epochs can be increased by primary baseline switching thanks to multi-antenna conditions.This is valuable in practical applications.Sometimes, GNSS signals are weak in urban environments, and the attitude can still be determined by the proposed method.

Discussion
Theoretically, only one available baseline is needed to realize vehicle directionality.On the basis of the above analysis, the valid epochs used to determine heading angle will be further increased through primary baseline switching.In fact, baseline length, layout and other factors will also affect the attitude determination accuracy.According to GNSS attitude determination theory, a directional precision of 0.6 degrees will be achieved by using a 1-meter long baseline [38].However, the baseline length in our study is only 0.3 m, and the errors in the experiment are basically consistent with relevant theories.Therefore, on the one hand, we plan to apply our platform on the UAV or driverless car due to its small size.Before applying it, analysis and qualification test will also be carried out.On the other hand, if larger antenna spacing is allowed on a platform, higher precision attitude determination results will be obtained.
In addition, the research platform in Figure 4 is also integrated with a MEMS IMU chip, which can provide measurement output of a triaxial accelerometer, triaxial gyroscope and triaxial magnetic compass.It can be used for testing integrated navigation functions.In fact, low-cost MEMS inertial navigation system will be introduced into the following research to further improve the attitude determination precision.The interval of the GNSS receiver module is one second (1Hz) in this research; however, the sampling rate of INS is much higher than 1Hz.It can provide data with a higher sampling rate for auxiliary positioning.Moreover, the proposed method is only applicable to the situation where the ambiguity of one antenna cannot be fixed.If the ambiguities of more antennas cannot be fixed, the attitude information still cannot be provided.At this time, the INS observations can maintain the output of attitude information in a short time, which will be the main work in the next stage.

Conclusions
In this article, the attitude is determined by the direct method based on a self-designed four antenna platform.Referring to the current problems that the GNSS signals of the primary baseline antennas may lose lock, we deduce the attitude angle conversion algorithm, selecting any other baseline as the primary baseline, and propose a multi-antenna attitude determination method based on primary baseline switching.The proposed method can increase the valid epoch proportion and attitude information.In the vehicle experiment, observations of SPAN-FSAS were used to obtain reference solutions.The practicability and correctness of the method are discussed through valid epoch proportion, attitude determination results and error analysis.The experimental results show that the valid epoch proportion increases by 16.2% and the RMS of the heading, pitch and roll angles are 0.52 • , 1.25 • and 1.16 • .The proposed method can provide a reference for attitude determination of multiple GNSS antennas.

Figure 1 .
Figure 1.Baselines layout in the direct method and three attitude angles.

Figure 1 .
Figure 1.Baselines layout in the direct method and three attitude angles.
,b show the schematic and physical diagram of our platform.Remote Sens. 2020, 12,

Figure 4 .
Figure 4.The schematic and physical diagram of the platform.(a)Schematic diagram; (b) Physical diagram.

Figure 4 .
Figure 4.The schematic and physical diagram of the platform.(a) Schematic diagram; (b) Physical diagram.The complete test platform for GNSS data acquisition and processing is shown in Figure5.Four GPS500 antennas are fixed on a smooth and horizontal steel plate, forming a 0.3 m × 0.3 m rectangle.This type of antenna can capture signals of GPS L1/L2, BDS B1/B2/B3, which can fully meet the needs of this test.Each antenna is connected to an RF (radio frequency) input of an M8T module.Based on the four-antenna hardware platform, the attitude determination method of the multi-antenna GNSS receivers is studied.If antenna 3 is taken as the reference antenna, a maximum of three non-collinear baseline vectors can be constructed in an epoch.If the reference antenna signals

Figure 4 .
Figure 4.The schematic and physical diagram of the platform.(a)Schematic diagram; (b) Physical diagram.

Figure 7 .
Figure 7.The acquisition process of reference coordinates and attitude.

Figure 7 .
Figure 7.The acquisition process of reference coordinates and attitude.

Figure 8 .
Figure 8.(a) Difference between the results of the −45° baseline and 0° baseline; (b) Difference between the results of the −90° baseline and 0° baseline.

Figure 8 .
Figure 8.(a) Difference between the results of the −45 • baseline and 0 • baseline; (b) Difference between the results of the −90 • baseline and 0 • baseline.

Figure 9 .
Figure 9.The result of heading angle.

Figure 10 .
Figure 10.The result of pitch angle.

Figure 11 .
Figure 11.The result of roll angle.

Figure 12 .
Figure 12.(a) The example of epochs with float solution of antenna 3 and primary baseline switching; (b) The epoch with float solution of antenna 2

Figure 12 .
Figure 12.(a) The example of epochs with float solution of antenna 3 and primary baseline switching; (b) The epoch with float solution of antenna 2.

Figure 13 .Figure 13 .
Figure 13.(a) Error statistics of heading angle; (b) Error statistics of pitch angle; (c) Error statistics of roll angle Figure 13.(a) Error statistics of heading angle; (b) Error statistics of pitch angle; (c) Error statistics of roll angle.

Table 1 .
Calculation errors under the primary baseline switching condition.

Table 1 .
Calculation errors under the primary baseline switching condition.

Table 2 .
The valid epoch proportion and whether the primary baseline is switched.

Table 3 .
The time periods of primary baseline switching.

Table 4 .
The RMS of attitude determination with primary baseline switching or not/deg.