Intelligent Positioning for a Commercial Mobile Platform in Seamless Indoor/Outdoor Scenes based on Multi-sensor Fusion

Many traffic occasions such as tunnels, subway stations and underground parking require accurate and continuous positioning. Navigation and timing services offered by the Global Navigation Satellite System (GNSS) is the most popular outdoor positioning method, but its signals are vulnerable to interference, leading to a degraded performance or even unavailability. The combination of magnetometer and Inertial Measurement Unit (IMU) is one of the commonly used indoor positioning methods. Within the proposed mobile platform for positioning in seamless indoor and outdoor scenes, the data of magnetometer and IMU are used to update the positioning when the GNSS signals are weak. Because the magnetometer is susceptible to environmental interference, an intelligent method for calculating heading angle by magnetometer is proposed, which can dynamically calculate and correct the heading angle of the mobile platform in a working environment. The results show that the proposed method of calculating heading angle by magnetometer achieved better performance with interference existence. Compared with the uncorrected heading angle, the corrected accuracy results could be improved by 60%, and the effect was more obvious when the interference was stronger. The error of overall positioning trajectory and true trajectory was within 2 m.


Introduction
Providing pedestrians and vehicles with continuous positioning is a challenging but important topic [1][2][3]. In infrastructure-free navigation, it is necessary for mobile platform to provide accurate positioning in seamless indoor/outdoor occasions based on all the required sensors [4][5][6].
In recent years, various real-time applications benefit from services provided by localization systems due to the advent of new sensing and communication technologies [7]. The Global Navigation Satellite System (GNSS) provides sufficiently accurate information including time, position and velocity [8]. However, GNSS cannot work when an unobstructed sight line to four or more GNSS satellites is lacking. In environments such as urban canyons and tunnels, it is difficult for GNSS to provide continuous and reliable positioning [9,10]. Since the GNSS enables localization only in outside scene, indoor positioning and navigation applications have to use alternative technologies [11], such as Wi-Fi, Bluetooth, Inertial Measurement Units (IMU) and magnetometer. However, each of the techniques has its own advantages and disadvantages. For example, iBeacon technology, which relies on the Bluetooth Low Energy (BLE) standard to create stationary constellations of low-power beacons, can be used to determine to the distribution characteristics of the magnetic field at the two adjacent moments, an additional formula for solving the heading angle is obtained. Finally, the heading angle can be solved by combining the above formulas. This method effectively realizes the correction and compensation of the magnetometer and improves the accuracy of the navigation system. In addition, the outdoor positioning adopts the method, which uses GNSS and INS data in combination with Kalman filtering. Further, according to the design requirements, it needs to meet the control and calculation capabilities of the entire system. Therefore, the processor unit adopts a dual-core architecture chip, which is combined by DSP kernel and ARM kernel. The Linux operation runs on ARM kernel and is responsible for the control of the entire system and data acquisition. DSP kernel is used for the data fusion navigation algorithm. The method of magnetometer calibration proposed in our paper has an accuracy within 2 m in indoor positioning. Compared with the system in [23], our system cost is also greatly reduced. The novelty of this paper is the method of dynamically solving the heading angle based on magnetometer.
The remainder of this paper is organized as follows. In Section 2, the positioning solution and location update principle are described. The methods of calculating the yaw angle and GNSS filtering are described in Section 3. The experimental measurement and performance test results are shown in Section 4. Finally, the conclusions are given in Section 5.

Positioning Solution
The mobile positioning platforms shown in Figure 1 are divided into outdoor and indoor occasions. GNSS is used in outdoor part, and the trajectory estimation method is adopted in indoor part. Since the noise in the GNSS signal causes the inaccurate positioning, we combine the angular velocity and the acceleration to calculate the increment, and then correct the outdoor positioning value with Kalman filtering. When the carrier enters the room, the last point of the outdoor positioning is used as the initial point to calculate the indoor trajectory. The magnetometer is used to provide the direction of the trajectory estimation. Since the magnetometer is susceptible to the surrounding magnetic field, we introduce a magnetometer anti-interference algorithm to dynamically calculate the heading angle. moments, an additional formula for solving the heading angle is obtained. Finally, the heading angle can be solved by combining the above formulas. This method effectively realizes the correction and compensation of the magnetometer and improves the accuracy of the navigation system. In addition, the outdoor positioning adopts the method, which uses GNSS and INS data in combination with Kalman filtering. Further, according to the design requirements, it needs to meet the control and calculation capabilities of the entire system. Therefore, the processor unit adopts a dual-core architecture chip, which is combined by DSP kernel and ARM kernel. The Linux operation runs on ARM kernel and is responsible for the control of the entire system and data acquisition. DSP kernel is used for the data fusion navigation algorithm. The method of magnetometer calibration proposed in our paper has an accuracy within 2 m in indoor positioning. Compared with the system in [23], our system cost is also greatly reduced. The novelty of this paper is the method of dynamically solving the heading angle based on magnetometer. The remainder of this paper is organized as follows. In Section 2, the positioning solution and location update principle are described. The methods of calculating the yaw angle and GNSS filtering are described in Section 3. The experimental measurement and performance test results are shown in Section 4. Finally, the conclusions are given in Section 5.

Positioning Solution
The mobile positioning platforms shown in Figure 1 are divided into outdoor and indoor occasions. GNSS is used in outdoor part, and the trajectory estimation method is adopted in indoor part. Since the noise in the GNSS signal causes the inaccurate positioning, we combine the angular velocity and the acceleration to calculate the increment, and then correct the outdoor positioning value with Kalman filtering. When the carrier enters the room, the last point of the outdoor positioning is used as the initial point to calculate the indoor trajectory. The magnetometer is used to provide the direction of the trajectory estimation. Since the magnetometer is susceptible to the surrounding magnetic field, we introduce a magnetometer anti-interference algorithm to dynamically calculate the heading angle.

Positioning Update
The data of magnetometer and INS are used to update the positioning when the GNSS signals are weak. As shown in Figure 2, to update the coordinates of the next moment, it is necessary to know the coordinate value and of the last moment, the distance of the motion, and the heading angle . The formula is described as follows:

Positioning Update
The data of magnetometer and INS are used to update the positioning when the GNSS signals are weak. As shown in Figure 2, to update the coordinates of the next moment, it is necessary to know the coordinate value N n and E n of the last moment, the distance d of the motion, and the heading angle ψ. The formula is described as follows: Figure 2. Track positioning. Figure 2 is the grid coordinates, which need to establish a unified relationship with the latitude and longitude, as shown in Figure 3. We made the IMU and the magnetometer have the same threeaxis direction. Then, the heading angle in Equation (1) is composed of these three parameters: the initial direction provided by the magnetometer, the gyroscope provides a rotation angle , and the angle difference between magnetic north and true north. This variable takes a value based on different geographic locations. In this article, the value is a negative number. The coordinates of the latitude and longitude are updated, as shown by Equations (2) and (3).   Figure 2 is the grid coordinates, which need to establish a unified relationship with the latitude and longitude, as shown in Figure 3. We made the IMU and the magnetometer have the same three-axis direction. Then, the heading angle ψ in Equation (1) is composed of these three parameters: the initial direction ψ m provided by the magnetometer, the gyroscope provides a rotation angle ψ ω , and the angle difference ψ ∆ between magnetic north and true north. This variable ψ ∆ takes a value based on different geographic locations. In this article, the value is a negative number. The coordinates of the latitude and longitude are updated, as shown by Equations (2) Figure 2. Track positioning. Figure 2 is the grid coordinates, which need to establish a unified relationship with the latitude and longitude, as shown in Figure 3. We made the IMU and the magnetometer have the same threeaxis direction. Then, the heading angle in Equation (1) is composed of these three parameters: the initial direction provided by the magnetometer, the gyroscope provides a rotation angle , and the angle difference between magnetic north and true north. This variable takes a value based on different geographic locations. In this article, the value is a negative number. The coordinates of the latitude and longitude are updated, as shown by Equations (2) where T 0 is set to be the sampling time, Lat(k) is set to be the latitude of carrier at the kT 0 time, and Lng(k) is set to be the longitude of carrier at the kT 0 time. v(k) denotes the speed of the carrier in the moving direction. a(k) is the acceleration of the carrier. A and B indicate the proportion of length in meters to latitude and longitude locally.

Calculation of Yaw Angle
The method of dynamically solving the heading angle based on the magnetometer is proposed in this paper, and is mainly divided into the following steps. First, the source of error in magnetometer measurements are analyzed and an error model for the magnetometer is built accordingly. The correspondence between the three-axis output of the magnetometers in the two adjacent moments is compared, and then is combined with the distribution characteristics of the geomagnetic field. A set of formulas containing the information of the heading angle is obtained. Finally, the heading angle can be calculated by solving the formulas.
The errors of magnetometers can be divided into two categories, one is the instrument error existing in the magnetometer itself, and the other is the error caused by the external environment. The first type of error can be considered as not changing with the external environment. It can be obtained by one correction. When the external environment changes, the second type of error will change accordingly, thus it can be set as a variable parameter. Therefore, the general error model of the magnetometer can be composed of the two types of errors as follows: M h is the triaxial output vector of the magnetometer. N is the total error matrix. M b is the local magnetic field vector. m b is the zero offset error vector. E is the error vector caused by the external environment. E 0 is the measurement error vector, which is generally considered to be white Gaussian noise, and can be ignored.
Regardless of the white Gaussian noise, the error model of the magnetometer can be obtained through a series of simplification changes as follows: M b is the triaxial output vector of the corrected magnetometer. N −1 is the inverse matrix of N.
then the above formula is expressed as: In the above formula, the total error matrix N and the zero offset error vector m b do not change with the external environment. m b can be corrected once by the existing compensation method. The error vector E caused by the external magnetic field environment is an unknown variable.
When the magnetometer is in the horizontal position, the vertical direction does not need to be considered; only the data of the X and Y axes are used to calculate the heading angle. However, the magnetometer does not always maintain a horizontal position during the movement, and it would be a slight tilt, which means the magnetic field strength measured on the X-axis by the magnetometer is not a true horizontal X-axis component. Therefore, the attitude matrix is introduced to deal with this problem.
The correspondences of the magnetometer triaxial output at two adjacent moments can be expressed as: C 1 and C 2 are the attitude matrices corresponding to the two moments of the magnetometer, respectively. X 1 and X 2 are the triaxial output vectors of the magnetometers at two moments. The triaxial correspondence described above can be expressed as: is the direction cosine matrix of the platform from coordinate system (b) to the navigation coordinate system (n) at time of k. C n b (k + 1) is the direction cosine matrix at time of k + 1.M b (k) is the triaxial output vector of the corrected magnetometer at time of k.M b (k + 1) is the vector at time of k + 1.
The geographic coordinate system Northeastern (ENU) is selected as the navigation coordinate system (n-system); then, the cosine matrix of the platform from b-system to the n-system is: where ψ is yaw angle. θ is pitch angle. γ is roll angle. θ and γ can be calculated by the follows: A x , A y and A z are the output values of the triaxial accelerometer, respectively. Since each coordinate maintains a Cartesian coordinate system in the equivalent rotation of the b-to-n-system, C n b is a unit orthogonal matrix. Then, It also can be obtained from Equation (6) that Therefore, Sensors 2019, 19, 1696 and NE(K + 1) = n 1 n 2 n 3 T , the following can be obtained: are the triaxial output of the magnetometer at time k, x 2 y 2 z 2 T are the output of the magnetometer at time k + 1, and n 1 n 1 n 1 T represents the interference on three axes. Both γ and θ are known. The unknown variable are ψ n 1 n 2 n 3 According to the idea of the limit, when the sampling time is short enough, the strength of the surrounding magnetic fields at the two adjacent moments is equal. It has the following relationship: Since the value at time k is known, According to Equations (16) and (18) and (sin ψ) 2 + (cos ψ) 2 = 1, ψ can be obtained.

GNSS/INS Integration Based Kalman Filter
To reduce the noise in the GNSS signal, a basic Kalman filter is selected in this paper. We take the measurement result of the GNSS receiver as the observation value, and the measurement data of the IMU as the increment, and the predicted value is obtained by these two values, as shown in Figure 4. The observation result of GNSS at k − 1 time is Z k−1 and U k is the position increment obtained by IMU data at k time. The k time predicted valueX k is obtained by Equations (2) and (3). Then, according tô X k and Z k , the Kalman filter is used to solve the optimal value X k at time k. At the next moment, the k time optimal value X k and the U k + 1 are used to obtain the predicted valueX k + 1 at k + 1 time. Then, with Z k + 1 , the k + 1 time optimal value X k + 1 is obtained by Kalman filter, and so on. The sampling time of the system is set to 0.1 s. In addition, the magnetometer provides the initial direction for data conversion of the INS. according to and , the Kalman filter is used to solve the optimal value at time k. At the next moment, the k time optimal value and the are used to obtain the predicted value at k + 1 time. Then, with , the k + 1 time optimal value is obtained by Kalman filter, and so on. The sampling time of the system is set to 0.1 s. In addition, the magnetometer provides the initial direction for data conversion of the INS. The formulation is described as follows: The formulation is described as follows: where the subscript denotes the kth epoch, and the caret ∧ indicates a Kalman filter estimate. X is the state vector of longitude (Lng) and latitude (Lat) as follows: U is the system input provided by the INS which includes acceleration a and angular velocity ω. The changes in position (∆Lng and ∆Lat) are obtained by the following formulas: Z is the measurement provided by the commercial GNSS receiver as follows: H is the observation matrix and φ is the system propagation matrix. Both H and φ are used as a unity matrix in this integration. P is the state covariance. K is the Kalman gain. The process noise covariance (Q) and the measured noise covariance (R) affect the Kalman gain, which is the weight between the system prediction and the measurement update [24,25]. In general, Q and R are fixed values, resulting in a constant weighting between GNSS and INS. However, the environment between cities is different. Subsequently, constant tuning cannot yield an optimal performance [26]. An adaptive tuning algorithm is needed to describe the noise of the GNSS measurement model. An adaptive Kalman filter based on GNSS/INS integration scheme specifically was proposed for commercial flight control system [26]. This article assigns values to R and Q based on its classification results.

Experiment
The system platform consists of a processor unit, a GNSS receiver, an IMU and a magnetometer. The processor unit is mainly composed of OMAPL138 processor and its peripherals. It has an ARM plus DSP dual core architecture. ARM kernel of OMAPL138 processor runs Linux operation system responsible for control of the entire system and data acquisition. DSP kernel is responsible for the data calculation. The NV08C-CSM is a fully integrated multi-constellation satellite navigation receiver which can offer high precision and low power consumption. The NV08C-CSM supports National Marine Electronics Association (NMEA) protocol and binary (BINR) protocol. Compared with NMEA protocol which is a unified Radio Technical Commission for Maritime standard in different GNSS navigation devices, BINR protocol can receive more comprehensive satellite navigation raw data such as pseudo-range and signal-to-noise ratio to meet more navigation algorithms. The IMU chip can measure triaxial accelerations and triaxial angular velocity of the platform. The magnetometer chip can also measure triaxial magnetic field strength.
The data received by the processor module not only come from the GNSS receiver NV08C-CSM, but also the IMU and magnetometer. It is shown in Figure 5. During this process, the embedded processor sends BINR request command to the NV08C-CSM. The module receives the satellite signal through the antenna, and sends the BINR response message back to the processor through the Universal Asynchronous Receiver/Transmitter (UART). The IMU sends the data of triaxial acceleration and triaxial angular velocity of the platform to the processor by Inter-Integrated Circuit (I2C). The magnetometer sends the triaxial magnetic field strength to the processor by Serial Peripheral Interface (SPI). The above acquisition process is treated by the ARM, and then the data are sent to the DSP to be decoded, filtered, and fusion. Finally, the processed data are returned to the ARM and sent out through the UART. The TTL level is converted to the RS232 format output through the MAX3232 chip. In view of the design described above, we tested every unit to ensure the circuit was correct after finishing the hardware platform. The hardware platform is shown in Figure 6. Then, the Linux operating system was transplanted on this platform. In view of the design described above, we tested every unit to ensure the circuit was correct after finishing the hardware platform. The hardware platform is shown in Figure 6. Then, the Linux operating system was transplanted on this platform. Receiver Architecture 1 Figure 5. The architecture of the proposed system platform.
In view of the design described above, we tested every unit to ensure the circuit was correct after finishing the hardware platform. The hardware platform is shown in Figure 6. Then, the Linux operating system was transplanted on this platform. After completing the data acquisition, the system needs to transfer the data from the ARM to the DSP. In this study, the SYSTEM LINK (SYSLINK) provided by Texas Instruments was used to achieve ARM and DSP dual-core communication. It provides a way to connect software across multiple cores with each processor running an operating system such as Linux, Quick Unix, etc. Then, it transports the data to the DSP through the SYSLINK. DSP kernel is used for the data filtering and navigation algorithm.
Before testing the performance of the platform, it some preparation and initial calibration were needed. First, the platform was connected to a computer to check whether its data were normal. The serial port settings were as follows: 115,200 bit/s baud rate, 8 data bits, 1 stop bit and no parity. Then, we started to test the performance of the board after the data acquisition program ran. The display data on the terminal are shown in Figure 7. After completing the data acquisition, the system needs to transfer the data from the ARM to the DSP. In this study, the SYSTEM LINK (SYSLINK) provided by Texas Instruments was used to achieve ARM and DSP dual-core communication. It provides a way to connect software across multiple cores with each processor running an operating system such as Linux, Quick Unix, etc. Then, it transports the data to the DSP through the SYSLINK. DSP kernel is used for the data filtering and navigation algorithm.
Before testing the performance of the platform, it some preparation and initial calibration were needed. First, the platform was connected to a computer to check whether its data were normal. The serial port settings were as follows: 115,200 bit/s baud rate, 8 data bits, 1 stop bit and no parity. Then, we started to test the performance of the board after the data acquisition program ran. The display data on the terminal are shown in Figure 7.
Receiver Architecture 1P Figure 5. The architecture of the proposed system platform.
In view of the design described above, we tested every unit to ensure the circuit was correct after finishing the hardware platform. The hardware platform is shown in Figure 6. Then, the Linux operating system was transplanted on this platform. After completing the data acquisition, the system needs to transfer the data from the ARM to the DSP. In this study, the SYSTEM LINK (SYSLINK) provided by Texas Instruments was used to achieve ARM and DSP dual-core communication. It provides a way to connect software across multiple cores with each processor running an operating system such as Linux, Quick Unix, etc. Then, it transports the data to the DSP through the SYSLINK. DSP kernel is used for the data filtering and navigation algorithm.
Before testing the performance of the platform, it some preparation and initial calibration were needed. First, the platform was connected to a computer to check whether its data were normal. The serial port settings were as follows: 115,200 bit/s baud rate, 8 data bits, 1 stop bit and no parity. Then, we started to test the performance of the board after the data acquisition program ran. The display data on the terminal are shown in Figure 7. Usually, the magnetic field sensor has a large zero error in manufacturing. If it is not calibrated, it will bring a large measurement error. The magnetic field calibration is used to remove the zero bias of the magnetic field sensor.
The magnetometer in the platform could measures the magnetic field strength of three axes. The space vector composed of triaxial component is actually the position vector of the Earth's magnetic field relative to the sensor. The direction of the sensor is constantly changing during the platform movement. The data are output in order while the magnetometer reads the three-axis magnetic field. We rotated the sensor around each axis so that a graph consisting of the endpoints of the vectors at each moment should be a sphere, which is centered on the origin. Figure 8a is a view projected on the XY plane. The data on the Y-axis are distributed on both sides of Point 0, which is symmetrical. However, the center Point A on the X-axis deviated from Point 0. Since the data measured by the sensor in both the positive and negative directions of the magnetic field should be the same value but opposite sign, i.e., it should be a circle centered on the origin, this situation showed that the data had zero drift.
We rotated the sensor around each axis so that a graph consisting of the endpoints of the vectors at each moment should be a sphere, which is centered on the origin. Figure 8a is a view projected on the XY plane. The data on the Y-axis are distributed on both sides of Point 0, which is symmetrical. However, the center Point A on the X-axis deviated from Point 0. Since the data measured by the sensor in both the positive and negative directions of the magnetic field should be the same value but opposite sign, i.e. it should be a circle centered on the origin, this situation showed that the data had zero drift. The correction method was to sum the maximum and minimum values of the X-axis, and then half of the sum was the zero offset compensation value of the X-axis data. The corrected image is shown in Figure 8b. It is a circle centered on Point 0. Point A coincides with Point 0 at this moment. Similar processing was done on the data on the Z-axis. In this way, the angle between the heading of the carrier and the magnetic north could be obtained.
As shown in Figure 9, three scenarios were tested, as detailed in Sections 4.1-4.3, respectively. In this study, the true trajectories were obtained by multiple measurements using high-precision aerial mapping vehicles.  The correction method was to sum the maximum and minimum values of the X-axis, and then half of the sum was the zero offset compensation value of the X-axis data. The corrected image is shown in Figure 8b. It is a circle centered on Point 0. Point A coincides with Point 0 at this moment. Similar processing was done on the data on the Z-axis. In this way, the angle between the heading of the carrier and the magnetic north could be obtained.

Experiment Result for GNSS/INS Filtering
As shown in Figure 9, three scenarios were tested, as detailed in Sections 4.1-4.3, respectively. In this study, the true trajectories were obtained by multiple measurements using high-precision aerial mapping vehicles. movement. The data are output in order while the magnetometer reads the three-axis magnetic field. We rotated the sensor around each axis so that a graph consisting of the endpoints of the vectors at each moment should be a sphere, which is centered on the origin. Figure 8a is a view projected on the XY plane. The data on the Y-axis are distributed on both sides of Point 0, which is symmetrical. However, the center Point A on the X-axis deviated from Point 0. Since the data measured by the sensor in both the positive and negative directions of the magnetic field should be the same value but opposite sign, i.e. it should be a circle centered on the origin, this situation showed that the data had zero drift. The correction method was to sum the maximum and minimum values of the X-axis, and then half of the sum was the zero offset compensation value of the X-axis data. The corrected image is shown in Figure 8b. It is a circle centered on Point 0. Point A coincides with Point 0 at this moment. Similar processing was done on the data on the Z-axis. In this way, the angle between the heading of the carrier and the magnetic north could be obtained.
As shown in Figure 9, three scenarios were tested, as detailed in Sections 4.1-4.3, respectively. In this study, the true trajectories were obtained by multiple measurements using high-precision aerial mapping vehicles.

Experiment Result for GNSS/INS Filtering
The outdoor experiment was to test the outdoor positioning performance of the mobile platform, as shown in Figure 9a. The track started at START point and ended at END point. The buildings were distributed along two sides of the track. The output positioning of the mobile platform is shown in Figure 10. The black line indicates the true trajectory, the blue line indicates the trajectory of the GNSS receiver output, and the red line indicates the trajectory after filtering. As can be seen in the figure, the blue line has a more obvious oscillation. After filtering, the trajectory oscillated less, which was closer to the real trajectory. In Figure 11, the red line represents the error between the filtered trajectory and the real trajectory, while the green line represents the error between the GNSS observation trajectory and the real trajectory. Compared with the green line, the error was reduced by approximately 60%. The mean and standard deviation (STD) of the positioning errors are summarized in Table 1. The formula for the mean of positioning error is as follows: Mean = error 1 + error 2 + · · · + error n n (29) The formula for STD of positioning error is as follows: The error mean and STD of uncorrected positioning were 1.6025 m and 0.7 m, respectively. The corrected positioning achieved a performance of 0.7 m and 0.22 m in the mean and STD of the error, respectively. The data also reflect an accuracy of about 60%. observation trajectory and the real trajectory. Compared with the green line, the error was reduced by approximately 60%. The mean and standard deviation (STD) of the positioning errors are summarized in Table 1. The formula for the mean of positioning error is as follows: The formula for STD of positioning error is as follows: The error mean and STD of uncorrected positioning were 1.6025 m and 0.7 m, respectively. The corrected positioning achieved a performance of 0.7 m and 0.22 m in the mean and STD of the error, respectively. The data also reflect an accuracy of about 60%.

Experiment Result for Heading Angle Correction of Magnetometer
The indoor experiment for testing the proposed mobile platform was conducted beside a source of magnetic interference, as shown in Figure 9b. The red dot in the figure indicates the location of the interference source. A magnet was used as the interference source. Paths A and B were, respectively, placed next to the interference source. The distance between Path A and the interference source was

GNSS Observation Kalman Filter
Mean of positioning error (m) 1.6025 0.5626 STD of positioning error (m) 0.7 0.22

Experiment Result for Heading Angle Correction of Magnetometer
The indoor experiment for testing the proposed mobile platform was conducted beside a source of magnetic interference, as shown in Figure 9b. The red dot in the figure indicates the location of the interference source. A magnet was used as the interference source. Paths A and B were, respectively, placed next to the interference source. The distance between Path A and the interference source was set to 0.1 m, and the distance set between Path B and the interference source was 0.6 m. This paper proposes a method that calculates and corrects the heading angle dynamically, and the purpose of the experiment was to test the effect of method under different interference intensities. The data of triaxial magnetometer under Paths A and B are shown in Figure 12a,b, respectively. The calculated heading angle is shown in Figure 13. Since both Paths A and B were straight trajectories without angular change, the value of the black line in the figure is unchanged, indicating the real angle.
The blue line indicates the uncorrected angle. Since it was closer to the interference source, the value is severely affected and the wrong part can be is seen in Figure 13a. The red line indicates the angle after correction. In Figure 13a, it does not have the same serious deviation as the blue line, and it restores the true angle more closely. The mean and STD values of the angle errors are summarized in Table 2. The error mean and STD of uncorrected angle were 13.4502 • and 42.9705 • , respectively. The corrected angle achieved a performance of 2.1278 • and 3.7276 • in the mean and STD of the error, respectively. The data also reflect an accuracy of about 60%. The true angle was greatly restored. Figure 13b shows the case of Path B. Since Path B was slightly farther from the source of interference, its value was not as severely affected. The maximum error between the blue line and the black line is about 8 • . After the correction, the error was reduced to three • . The mean and STD of the angle errors are summarized in Table 3. The error mean and STD of uncorrected angle were 2.467 • and 2.9812 • , respectively. The corrected angle achieved a performance of 1.2207 • and 1.2267 • in the mean and STD of the error, respectively. The accuracy was increased by about 50%.
In Figure 13a, the corrected line (red) points towards the truth while the red line in Figure 13b maintains a similar shape to the uncorrected line. The reason can be understood in conjunction with Equations (17) and (18). When the sampling time is short enough, the magnetic field strength at time k is the same as the time k + 1. When a part of the interference is filtered as the parameter n, the direction of the k + 1 moment should be maintained at the previous moment. Therefore, the corrected line (red) points towards the truth in Figure 13b. There are two differences between Figure 13a,b: the intensity of the interference and the disturbed time. As shown in Figure 13a, the interfering time was 62 s to 64 s, indicating that it was moving more quickly. The data are abrupt at 62 s, and the value at 63 s should be kept at 62 s according to the above. Thus, it pointed towards the truth. direction of the k + 1 moment should be maintained at the previous moment. Therefore, the corrected line (red) points towards the truth in Figure 13b. There are two differences between Figure 13a,b: the intensity of the interference and the disturbed time. As shown in Figure 13a, the interfering time was 62 s to 64 s, indicating that it was moving more quickly. The data are abrupt at 62 s, and the value at 63 s should be kept at 62 s according to the above. Thus, it pointed towards the truth.

Experiment Result for the Performance of Platform Seamless Positioning
The third experiment for testing the proposed mobile platform was a path passing through both indoor and outdoor environment. As shown in Figure 9c, the lab building and the surrounding area were chosen to test the performance of the positioning system. The entire path covered both outdoor

Experiment Result for the Performance of Platform Seamless Positioning
The third experiment for testing the proposed mobile platform was a path passing through both indoor and outdoor environment. As shown in Figure 9c, the lab building and the surrounding area were chosen to test the performance of the positioning system. The entire path covered both outdoor and indoor environment, and three turns were set. A magnetic field interference source was added at the second turn to test the positioning performance. The outdoor part of the path adopted the method depicted in Section 4.1, which uses GNSS and INS data in combination with Kalman filtering. The indoor part used the method in Section 4.2, and the trajectory estimation was performed based on the heading angle solved by the magnetometer. Figure 14 shows the data read by the triaxial accelerometer during platform motion. The unit of the vertical axis is g, i.e. the gravity acceleration of the Earth. The yellow line indicates the data in the Z-axis direction, which points to the ground, thus the value is about 1× g. Since the platform moved along the Y-axis, the direction had acceleration. It can be seen in the figure that the data on the Y-axis are not 0. There was no force on the X-axis, so its value is 0. Figure 15 shows the data of the triaxial magnetometer during the platform motion.
accelerometer during platform motion. The unit of the vertical axis is g, i.e. the gravity acceleration of the Earth. The yellow line indicates the data in the Z-axis direction, which points to the ground, thus the value is about 1× g. Since the platform moved along the Y-axis, the direction had acceleration. It can be seen in the figure that the data on the Y-axis are not 0. There was no force on the X-axis, so its value is 0. Figure 15 shows the data of the triaxial magnetometer during the platform motion.  The data output of the platform were imported into Google Maps, as shown in Figure 16. The red line in the figure represents the true trajectory, and the blue line represents the positioning of the platform output. In general, the blue line restores the real path approximately. The mean and STD of the positioning errors are summarized in Table 4. The error mean and STD of corrected positioning were 1.73 m and 1.44 m, respectively. The error of overall positioning trajectory and true trajectory was within 2 m. The result verifies the proposed method could meet the civil accuracy requirements in general operations.
In Figure 16, since the magnetometer is disturbed at the second corner, and the uncorrected heading angle is deviated, causing the trajectory to deviate from the original trajectory. Thus, the blue line deviates from the black line after the turning. After error correction, the affected degree of trajectory is greatly reduced. Therefore, the red line surrounds the real trajectory. of the Earth. The yellow line indicates the data in the Z-axis direction, which points to the ground, thus the value is about 1× g. Since the platform moved along the Y-axis, the direction had acceleration. It can be seen in the figure that the data on the Y-axis are not 0. There was no force on the X-axis, so its value is 0. Figure 15 shows the data of the triaxial magnetometer during the platform motion.  The data output of the platform were imported into Google Maps, as shown in Figure 16. The red line in the figure represents the true trajectory, and the blue line represents the positioning of the platform output. In general, the blue line restores the real path approximately. The mean and STD of the positioning errors are summarized in Table 4. The error mean and STD of corrected positioning were 1.73 m and 1.44 m, respectively. The error of overall positioning trajectory and true trajectory was within 2 m. The result verifies the proposed method could meet the civil accuracy requirements in general operations.
In Figure 16, since the magnetometer is disturbed at the second corner, and the uncorrected heading angle is deviated, causing the trajectory to deviate from the original trajectory. Thus, the blue line deviates from the black line after the turning. After error correction, the affected degree of trajectory is greatly reduced. Therefore, the red line surrounds the real trajectory. The data output of the platform were imported into Google Maps, as shown in Figure 16. The red line in the figure represents the true trajectory, and the blue line represents the positioning of the platform output. In general, the blue line restores the real path approximately. The mean and STD of the positioning errors are summarized in Table 4. The error mean and STD of corrected positioning were 1.73 m and 1.44 m, respectively. The error of overall positioning trajectory and true trajectory was within 2 m. The result verifies the proposed method could meet the civil accuracy requirements in general operations.
In Figure 16, since the magnetometer is disturbed at the second corner, and the uncorrected heading angle is deviated, causing the trajectory to deviate from the original trajectory. Thus, the blue line deviates from the black line after the turning. After error correction, the affected degree of trajectory is greatly reduced. Therefore, the red line surrounds the real trajectory.

Discussions
The method of calculating heading angle proposed in this paper is based on magnetometer sensing data. In other methods, the heading angle can be directly obtained based on the current reading of the magnetometer. Different from that, the principle of the propose method is to separate the value n of interference and the true value of the magnetic field strength in the working environment. The value n and the value of heading angle can be obtained using Equation (15). The method achieved better performance when interference existed. It needs to be pointed out that the method is assumes that the magnetic field strength remains unchanged in the continuous two sampling time slots. To achieve that, the sampling time of magnetometer sensors must be set fast enough. For example, if the sampling time of the magnetometer is set to 6 s, the interference in the time slot between 62 s and 64 s in Figure 13a cannot be observed. Correspondingly, the method cannot get the correct solution if the head angle changes during the time. It also can be concluded by Equation (15) that the heading angel cannot be correct if interference exists in time zero.

Conclusions
In this paper, an embedded integrated positioning platform is presented. The platform was designed to acquire the data of GNSS, magnetometer and INS for positioning in seamless indoor/outdoor scenes. In this work, three main points are considered: First, a method to dynamically calculate and correct the heading angle is proposed, which improves the accuracy of positioning by reducing interference. Secondly, to reduce the noise in the GNSS signal, the GNSS/INS combination method by Kalman filtering is used. Finally, ARM+DSP structure is adopted to implement the functionalities of system control and calculation. Experiments were developed along planned paths on multiple occasions. Experimental results show that the method of heading angle correction could improve the accuracy by at least 60%. The error of overall positioning trajectory and true trajectory was within 2 m. In addition, the platform ran the multi-channel acquisition program steadily during the movement. It showed that the system had good performance. Furthermore, some of the platform needs to be improved. When the board is running, some chips will heat, which affects the performance of the system. Therefore, they should be separated by a little distance between in the

Discussions
The method of calculating heading angle proposed in this paper is based on magnetometer sensing data. In other methods, the heading angle can be directly obtained based on the current reading of the magnetometer. Different from that, the principle of the propose method is to separate the value n of interference and the true value of the magnetic field strength in the working environment. The value n and the value of heading angle can be obtained using Equation (15). The method achieved better performance when interference existed. It needs to be pointed out that the method is assumes that the magnetic field strength remains unchanged in the continuous two sampling time slots. To achieve that, the sampling time of magnetometer sensors must be set fast enough. For example, if the sampling time of the magnetometer is set to 6 s, the interference in the time slot between 62 s and 64 s in Figure 13a cannot be observed. Correspondingly, the method cannot get the correct solution if the head angle changes during the time. It also can be concluded by Equation (15) that the heading angel cannot be correct if interference exists in time zero.

Conclusions
In this paper, an embedded integrated positioning platform is presented. The platform was designed to acquire the data of GNSS, magnetometer and INS for positioning in seamless indoor/outdoor scenes. In this work, three main points are considered: First, a method to dynamically calculate and correct the heading angle is proposed, which improves the accuracy of positioning by reducing interference. Secondly, to reduce the noise in the GNSS signal, the GNSS/INS combination method by Kalman filtering is used. Finally, ARM+DSP structure is adopted to implement the functionalities of system control and calculation. Experiments were developed along planned paths on multiple occasions. Experimental results show that the method of heading angle correction could improve the accuracy by at least 60%. The error of overall positioning trajectory and true trajectory was within 2 m. In addition, the platform ran the multi-channel acquisition program steadily during the movement. It showed that the system had good performance. Furthermore, some of the platform needs to be improved. When the board is running, some chips will heat, which affects the performance of the system. Therefore, they should be separated by a little distance between in the future design. Since GNSS receiver can also receive some raw data such as pseudo-range, carrier phase, etc., these data can be used to do some tight GNSS/INS integration in the future.