1. INTRODUCTION
With the development of smart cities and the corresponding improvements in smartphone technologies and micro-electro-mechanical systems (MEMS), the demand for indoor positioning services has grown rapidly. Smartphones have a variety of built-in sensors and support a wide range of radio frequency signals (Chen and Chen, Reference Chen and Chen2017) and a large user base. Accordingly, smartphone-based indoor positioning technologies have become a major focus of research. The positioning technologies for smartphones mainly include radio frequency, map-matching and inertial navigation technologies. Smartphones support radio frequency signals such as Wi-Fi, Bluetooth and near-field communication. Wi-Fi and low energy Bluetooth are the primary methods used by smartphones for indoor positioning. The indoor map-matching techniques for smartphones include methods based on particle filters, hidden Markov models and geometric similarities. However, neither the practicability nor the accuracy of these methods is yet guaranteed (Guo et al., Reference Guo, Xiong and Zheng2017c). The positioning method for the inertial navigation technology used in smartphones is pedestrian dead reckoning (PDR). The PDR algorithm has strong independence and is one of the main methods of indoor positioning (Harle, Reference Harle2013; Davidson and Piche, Reference Davidson and Piche2017). A mature positioning technology should satisfy the need to provide users with accurate, autonomous and stable location services indoors. Multi-source positioning technology is widely recognised as an effective indoor positioning solution. Because PDR is indispensable in multi-source positioning technology, this study aimed to improve the positioning accuracy of the PDR method.
PDR algorithms are classified into two types: the inertial navigation system PDR algorithm (INS-PDR), which is mainly used for foot-mounted measuring devices, and the step-and-heading system PDR algorithm (SHS-PDR), which can be used for devices mounted anywhere on the body. Because it is uncomfortable for users to wear a dedicated measuring device on the body, such as on the foot, wrist or arm, the smartphone inertial measurement unit (IMU) has great potential for PDR application and development (Kang and Han, Reference Kang and Han2015; Chen and Chen, Reference Chen and Chen2017; Torres-Sospedra et al., Reference Torres-Sospedra, Jiménez, Knauth, Moreira, Beer, Fetzer, Ta, Montoliu, Seco, MendozaSilva, Belmonte, Koukofikis, Nicolau, Costa, Meneses, Ebner, Deinzer, Vaufreydaz, Dao and Castelli2017). In accordance with the habit of using smartphones in daily life, the SHS-PDR algorithm is more suitable for indoor positioning (Kang and Han, Reference Kang and Han2015; Guo et al., Reference Guo, Ji, Liu, Li and Xu2017a; Torres-Sospedra et al., Reference Torres-Sospedra, Jiménez, Knauth, Moreira, Beer, Fetzer, Ta, Montoliu, Seco, MendozaSilva, Belmonte, Koukofikis, Nicolau, Costa, Meneses, Ebner, Deinzer, Vaufreydaz, Dao and Castelli2017).
The SHS-PDR algorithm performs gait detection, step size estimation and heading calculation by analysing and processing the acceleration and gyro data. From the starting position, the real-time position information is gradually calculated for each step, for which the heading estimation is one of the key procedures (Jiménez et al., Reference Jiménez, Seco, Prieto and Guevara2009; Chen, G.L., et al., Reference Chen, Zhang, Wang and Meng2015; Zhang, J.M., et al., Reference Zhang, Su and Li2017). Because smartphones use inexpensive sensors, the signals have considerable noise. Thus, when calculating the heading via integration of the gyroscope data, the accumulation of heading errors increases the offset of the entire track and limits the time for effective positioning of the PDR algorithm to within a minute or less (Chen, L.B., et al., Reference Chen, Li and Pan2015). One challenge to improving the heading estimation in the PDR algorithm is the elimination of the heading error caused by the gyroscope's drift error. Studies that have attempted to eliminate the heading errors have yielded two solutions (Hu et al., Reference Hu, Wang, Wang, Liu, Tan and Li2016; Liu et al., Reference Liu, Pei, Qian, Wang and Liu2017): (1) compensating for the drift of the gyroscope data by adding other sensors to enable data fusion to obtain more accurate heading information and (2) the use of a heuristic heading correction algorithm to correct the calculated heading information according to the walking route and the built environment.
The multi-sensor fusion methods mainly include the six-axis (Zhang, L.Q., et al., Reference Zhang, Xiu, Yang and Yang2017) and nine-axis data fusion algorithms for processing the gyroscope, accelerometer and magnetometer data (Brigante et al., Reference Brigante, Abbate, Basile, Faulisi and Sessa2011; Zheng and Peng, Reference Zheng and Peng2016). Compared with the six-axis algorithm, the nine-axis data fusion algorithm has significantly greater heading accuracy in environments with small magnetic field disturbances. However, the complex and changeable magnetic fields typically encountered in indoor environments cause a heading distortion problem that must be solved (Brigante et al., Reference Brigante, Abbate, Basile, Faulisi and Sessa2011; Zheng and Peng, Reference Zheng and Peng2016).
The foot-IMU-based heading estimation algorithms include heuristic drift reduction (HDR) (Borenstein and Ojeda, Reference Borenstein and Ojeda2009; Zeng et al., Reference Zeng, Liu and Zhang2016), heuristic drift elimination (HDE) (Abdulrahim et al., Reference Abdulrahim, Hide, Moore and Hill2010; Borenstein and Ojeda, Reference Borenstein and Ojeda2010; Lou et al., Reference Lou, Zhou, Ye, Jia and Jin2015; Zhao et al., Reference Zhao, Li and Li2016), improved HDE (iHDE) (Jiménez et al., Reference Jiménez, Seco, Zampella, Prieto and Guevara2011) and advanced HDE (AHDE) (Ju et al., Reference Ju, Min, Chan, Lee and Park2015). Enhanced improved HDE (E-iHDE) is a more popular method for the wrist-IMU-based heading estimation algorithms (Diez et al., Reference Diez, Bahillo, Bataineh, Masegosa and Perallos2016).
If we assume that the true value of the gyroscope is zero in the HDR algorithm when a pedestrian walks in a straight line, the errors in the gyroscope data can be compensated accordingly in the HDR algorithm based on the gyroscope output values (positive or negative). However, the HDR algorithm is only suitable for straight-line routes. The HDE algorithm improves the HDR algorithm by using the building information and can effectively correct simple routes in the dominant direction. In complex routes, however, the HDE algorithm fails to control the correction effectively and leads to inaccurate correction of the heading (Borenstein and Ojeda, Reference Borenstein and Ojeda2010). The iHDE algorithm directly corrects the heading error and regards the deviation between the heading and the dominant direction as the observation, using the extended Kalman filter (EKF) to correct the heading. This algorithm not only performs well on simple indoor routes, the overall heading can also be adequately corrected on short complex routes. However, if the algorithm has insufficient ability to recognise a route, an error correction problem will arise on straight-line paths along the non-dominant direction (Jiménez et al., Reference Jiménez, Seco, Zampella, Prieto and Guevara2011). The AHDE algorithm enhances the path discrimination ability and divides the walking into three types. Specifically, the algorithm is not enabled during nonlinear walking, the heading correction algorithm is improved according to the INS-PDR framework and EKF is set for heading error correction when walking in the dominant direction or a non-dominant direction, which effectively reduces the error correction of the heading correction algorithm (Ju et al., Reference Ju, Min, Chan, Lee and Park2015). To apply the iHDE algorithm to the SHS-PDR system framework, the E-iHDE algorithm uses the Kalman filter (KF) algorithm instead of the EKF algorithm to simplify the correction algorithm, although the error correction problem of the iHDE algorithm has yet to be solved (Diez et al., Reference Diez, Bahillo, Bataineh, Masegosa and Perallos2016).
Based on previous research (Jiménez et al., Reference Jiménez, Seco, Zampella, Prieto and Guevara2011; Ju et al., Reference Ju, Min, Chan, Lee and Park2015; Guo et al., Reference Guo, Ji, Liu, Li and Xu2017a) on the iHDE and E-iHDE algorithms, this study uses a low-cost, low-quality smartphone gyroscope as an experimental object and proposes an optimised iHDE method called O-iHDE. This method improves the path discriminant analysis and the corrected heading is fed back into the PDR heading solution. The quaternion is corrected while the heading is corrected, and the drift error that accumulates in the PDR heading solution is eliminated in time.
2. PROPOSAL AND IMPROVEMENT OF THE HDE ALGORITHM
HDE is the basic method of heuristic heading correction. The iHDE method mainly improves the framework of the HDE application and changes the correction object. The E-iHDE algorithm, which is also based on the iHDE algorithm, realises the application of the wrist-worn IMU by changing the filtering method of the heading error estimation and extends the scope of application of the iHDE algorithm. The basic principles of these algorithms are described below.
2.1. Basic principle of the HDE algorithm
In buildings, most of the corridors are straight and parallel or orthogonal with each other. The direction of a building's walls and corridors is called its ‘dominant’ direction, and most buildings have four or eight dominant directions (Borenstein and Ojeda, Reference Borenstein and Ojeda2009, Reference Borenstein and Ojeda2010). The HDE algorithm first sets the angular interval Δ according to the building's dominant direction. In buildings with four dominant directions, Δ = 90°, and in buildings with eight dominant directions, Δ = 45°. Next, the difference between the walking heading and the neighbouring dominant direction at the previous moment is calculated, and the azimuth relationship between the heading and the dominant direction is determined according to the sign of the difference. Finally, a binary feedback controller and a step-length attenuator are established, and the gyro data are corrected according to the difference sign and step length.
A short-distance walk that does not follow the path's dominant direction does not cause the algorithm to deteriorate. The HDE algorithm can gradually correct the heading if the pedestrian walks far enough in the dominant direction, thereby improving the positioning accuracy. However, if the pedestrian walks in a curve with a large radius, the step attenuator in the HDE algorithm will consider each step to be in a straight line. Eventually, the HDE algorithm will inaccurately correct the heading. Thus, the HDE algorithm obviously corrects simple routes in the dominant direction, but can deteriorate on complex routes.
2.2. Basic principle of the iHDE algorithm
The iHDE method, which improves the principle of the HDE algorithm, uses INS-PDR to correct the heading directly. Jiménez et al. (Reference Jiménez, Seco, Zampella, Prieto and Guevara2011) suggested that the iHDE algorithm should be used in the framework of the IEZ (INS + EKF + ZUPT [Zero velocity UPdaTe]), that is, the framework adds ZUPT to suppress the accumulation of errors based on the characteristics of an IMU fitted to the sole of a shoe. The iHDE algorithm adds the straight-line path and the stride length analysis block. The algorithm is enabled when the walking route is determined to be a straight line and the step length is within the threshold range. The difference between the heading and the neighbouring dominant direction is δφ, the standard deviation of the adaptive heading error is σ δϕ, and δφ and σ δϕ are brought into the EKF. The EKF, which contains 15 element error state vectors, such as the acceleration error and gyroscope error, estimates the pedestrian's position and attitude.
Compared with the HDE algorithm, the iHDE algorithm not only has outstanding effects on simple indoor routes, but it also shows good reliability on certain complex routes. However, the iHDE algorithm attempts to use the adaptive σ δϕ to solve the problem of the miscorrection on the non-dominant linear-walking route (Diez et al., Reference Diez, Bahillo, Bataineh, Masegosa and Perallos2016). The experimental results are not ideal. If the path is identified as a straight walk, when δφ increases, σ δϕ also increases, and thus the heading correction force is either reduced or not corrected. The reason for the larger δφ value may be that the pedestrian is walking along a non-dominant straight line or it may be caused by the gyroscope's drift error accumulation. The iHDE algorithm does not address this issue well, which results in erroneous corrections.
2.3. Basic principle of the E-iHDE algorithm
The E-iHDE algorithm is based on the iHDE algorithm and is applied to a wrist-worn IMU based on the SHS-PDR framework. The judgement conditions of the iHDE algorithm are used and the E-iHDE algorithm brings δφ and the adaptive σ δϕ into the KF. The optimal estimate of the heading error is obtained and the corrected heading is solved (Diez et al., Reference Diez, Bahillo, Bataineh, Masegosa and Perallos2016).
With respect to the characteristics of the SHS-PDR algorithm, the E-iHDE algorithm modifies the filtering method in the iHDE algorithm, which allows successful application of the algorithm with the wrist-worn IMU based on SHS-PDR. However, the E-iHDE algorithm does not solve the legacy problem of the iHDE algorithm.
3. OPTIMISATION OF THE IHDE ALGORITHM
Based on a previous study (Guo et al., Reference Guo, Ji, Liu, Li and Xu2017a), we propose an optimised iHDE (O-iHDE) algorithm to further optimise the iHDE algorithm. The linear path judgement conditions of the iHDE algorithm are used in the SHS-PDR framework, and the O-iHDE algorithm is used to bring δφ and σ δϕ into the KF to correct the heading. The O-iHDE algorithm uses a smartphone gyroscope as its experimental object. The algorithm first improves the conditions for determining the walking route and then adds corrections to the quaternion while correcting the heading. The specific content is discussed in this section.
3.1. Data pre-processing
The gyro constant drift is measured by the mean of the data in the static state over a certain period, which is measured by the variable Tbias. Before each experiment, the smartphone needs to stay still for Tbias seconds. The size of the Tbias value depends on the quality of the gyroscope (Borenstein and Ojeda, Reference Borenstein and Ojeda2010). During the data collection experiment, the experimenter held the smartphone in front of his/her body and walked along the designated route at a normal pace after Tbias seconds. Data were obtained while the experimenter walked, the constant drift was subtracted and data pre-processing was completed.
3.2. Quaternion method to solve the heading angle
The quaternion method is used to update the solution attitude angle. The main process is described below. For the detailed process, please refer to Guo et al. (Reference Guo, Liu, Ji, Li and Wang2017b).
(1) Using the second-order Runge-Kutta method to update the solution quaternion: q(q0,q1, q2,q3).
(1)$$\begin{cases} {K_1 =\Gamma _b (t)q(t)} \\ {Y=q(t)+hK_1 } \\ {K_2 =\Gamma _b ( {t+h} )Y} \\ {q( {t+h} )=q( t )+\dfrac{h}{2}( {K_1 +K_2 })} \end{cases}$$where h is the data sampling interval, q(t) and q(t + h) are the quaternions at t and t + h, respectively, and Γ b = (1/2) M′(ω). In addition,(2)$$M'(\omega)=\left[\begin{matrix} 0 & -\omega_x& -\omega_y& -\omega_z\\ \omega_x& 0&\omega_z& -\omega_y\\ \omega_y& -\omega_z&0& \omega_x\\ \omega_z& \omega_y& -\omega_x &0 \end{matrix}\right]$$where ω represents the gyroscope data and ω x, ω y and ω z are the data from the gyroscope's x, y and z axes, respectively.(2) Solving the heading angle from the updated quaternion:
(3)$$\begin{cases} {\varphi =-\mbox{atan}2\left( {\dfrac{2\left( {q_1 q_2 -q_0 q_3 }\right)}{q_0^2 -q_1^2 +q_2^2 -q_3^2 }} \right)} \\ {\theta =\mbox{asin}\left( {2\left( {q_2 q_3 +q_0 q_1 } \right)} \right)} \\ {\gamma =\mbox{atan}2\left( {\dfrac{2\left( {q_1 q_3 -q_0 q_2 }\right)}{q_0^2 -q_1^2 -q_2^2 +q_3^2 }} \right)} \end{cases}$$where φ is the heading angle, θ is the pitch angle and γ is the roll angle.
3.3. Perfection of the judgement condition of the walking route
3.3.1. Irrationality of the iHDE algorithm
The iHDE algorithm uses the step lengths as the basis for recognising straight lines and curves, which is unreasonable. When a person walks in straight and curved lines, the step sizes differ. When the curvature of the walking curve is small, the size of the step is nearly the same as when walking along a straight line and is related to the individual's height (Abid et al., Reference Abid, Renaudin, Aoustin, Le-Carpentier and Robert2017; Guo et al., Reference Guo, Liu, Ji, Li and Wang2017b). In fact, small steps may also be used in a straight line. Therefore, this algorithm removes the step size judgement condition.
3.3.2. Distinguishing the dominant and non-dominant straight paths
When the pedestrian walks in a straight line, the iHDE algorithm and E-iHDE algorithm control the modified strength according to the adaptive σ δϕ value. However, erroneous correction cannot be avoided when walking along a non-dominant straight line. When walking along the dominant straight line, the δφ value caused by the accumulation of drift errors in the gyroscope becomes large. As a result, the algorithm mistakenly recognises the route as being in the non-dominant direction and thus does not correct the heading. To address this problem, this study specifically classifies the walking routes and adds two new judgement conditions.
(a) Setting the angle threshold. When δφ is lower than the set threshold, it is determined to be along the dominant route and the heading is corrected according to the adaptive σ δϕ; otherwise, it is considered to be a straight line in a non-dominant direction. This avoids erroneous corrections on a straight path in a non-dominant direction.
(b) Additional conditions. When the judgement condition is determined to be a straight line in a non-dominant direction, it is judged by the additional condition of whether the previous heading was corrected; if it was corrected, the larger value of δφ in this step is caused by the accumulation of the gyro drift error. It is assumed that this step follows the dominant straight line and the heading correction is performed.
3.3.3. Realisation of the algorithm for discriminating the walking states
Three discriminant analyses are set for the walking route to classify the walking state accurately. When the pedestrian walks in the dominant direction, the algorithm takes effect, correcting the heading information and avoiding error correction.
(a) Straight-walking judgement (Swj):
(4)$$\mbox{Swj} = \begin{cases} 1 &{\max \left( {\left| {\varphi \left( j \right)-\mbox{mean}\left( {\varphi \left({i-n:i} \right)} \right)} \right|} \right) \lt {Th}_{\varphi}, j \in \{x\vert i-n \le x \le i,x \in N\}} \\ 0 & {\mbox{others}} \\ \end{cases}$$where n denotes that the first n steps of step i are selected to participate in the linear-walking judgement, and Thφ is the angle threshold. When Swj is 1, it is determined to be a straight path; otherwise, it is a curved path. When the walking is recognised as a straight path, the next judgement is made.(b) Dominant direction of the straight-walking judgement.
The difference between the heading and the neighbouring dominant directions is calculated as
(5)$$\delta \varphi \left( i \right)=\varphi \left( i \right)-{\varphi}_{\mbox{dominant}}$$where ϕ dominant is the closest dominant direction to the walking direction. Let Th δϕ be the angle threshold. When |δϕ(i)| < Th δϕ, the path is determined to be in the dominant direction; otherwise, the algorithm proceeds to the next condition.(c) Determine whether the previous step was corrected.
When the previous step is recognised as a non-dominant linear path, the algorithm determines whether the previous step was corrected. If it was corrected, the increase of δφ in this step is caused by the accumulation of errors caused by the drift of the gyro. This step is identified as a straight path along the dominant direction. Otherwise, the step is defined as walking along a non-dominant straight line. As shown in Figure 1, the path is filtered through layers of three discriminant conditions to identify movement in the dominant direction accurately. When the path is identified as a dominant straight line, heading error estimation is performed.
3.4. Heading error estimation and heading correction
3.4.1. Confidence of the error in heading
The standard deviation of the heading error is solved using δφ and the formula is as follows:
where σ HDE is the maximum possible confidence level of the measurement hypothesis, α is the exponential term parameter, the exponential term controls the growth rate of the standard deviation and σ δϕ adaptively controls the correction strength according to the value of δφ.
3.4.2. Heading error estimation
For the heading error estimation, δφ and σ δϕ are brought into the KF. The optimal estimation of the heading error from the previous step is taken as the estimated value X(i|i − 1) of the heading error of this step, σ δϕ being the variance of the observed noise, Z(i) is the observed value of heading error at time i and we let Z(i) = δϕ(i). The best estimate is
where X(i| i) is the optimal estimate of the system at time i and Kt(i) is the Kalman gain.
3.4.3. Correction of the heading
The heading is obtained from the optimal estimate:
where ϕ(i) and φ̂(i) are the heading angles before and after correction, respectively.
3.5. Correction of the quaternion
3.5.1. Misidentification of iHDE and E-iHDE
Because the iHDE and E-iHDE algorithms directly correct the heading calculated by the PDR, they can provide high-precision heading information for position estimation during short walks, but they have no feedback or influence on the PDR heading solution. However, the drift error of the gyro is accumulated in the PDR heading solution. When the heading errors in PDR accumulate to a certain degree, the iHDE and E-iHDE algorithms become invalid (Figure 2). When the pedestrian walks in a straight line for a long time, the heading calculated by the PDR method shifts to another dominant direction, which results in error correction in the iHDE and E-iHDE algorithms. To solve this problem, the O-iHDE algorithm corrects the quaternion based on the corrected heading, conducts the quaternion update at the next moment and thus eliminates the drift error of the gyro in the PDR heading solution over time.
3.5.2. Correction of the quaternion algorithm
The KF method proposed by the E-iHDE algorithm is used to estimate the heading error and the heading is corrected. The corrected heading is then used to correct the quaternion of the step to eliminate the accumulated drift error of the gyro during the PDR heading solution. Equation (9) is used to correct the quaternion of this step (Figure 3) and the corrected quaternion is brought into the quaternion update calculation to obtain the quaternion and heading information for the next moment:
where $\hat{q}_{j,(j=0, 1, 2, 3)}$ is the corrected quaternion, φ̂ is the corrected heading, θ is the pitch angle and γ is the roll angle. The corrected quaternion is brought into Equation (1) and the gyroscope data are used to solve the quaternion at the next moment.
3.6. Frame diagram of the O-iHDE algorithm
Accelerometer data are used for the gait detection and step-length estimation. Since this paper mainly presents the heading correction algorithm, the methods for estimation of step size and the detection of steps are not described in detail here; the reader is referred to Guo et al. (Reference Guo, Liu, Ji, Li and Wang2017b). The step size information is combined with the heading corrected by the O-iHDE algorithm for dead reckoning. That is, the coordinate of the previous position is combined with the heading information and the step size information from the current step to solve the coordinates of the current position. The O-iHDE algorithm frame diagram is depicted as follows (Figure 4).
4. EXPERIMENT AND RESULT ANALYSIS
4.1. Experimental preparation
In the early stage of developing the heuristic heading correction algorithm, the authors designed the related experiments. It has been shown that the improved heading correction algorithm has a better correction effect in the dominant direction. Furthermore, within a short time, a complicated route can also reduce the error correction to a certain extent (Guo et al., Reference Guo, Ji, Liu, Li and Xu2017a).
4.1.1. Design of the experimental route and selection of precision analysis methods
As the research developed, the O-iHDE algorithm gradually improved. Three sets of experiments were designed to verify the O-iHDE algorithm's superiority, stability and effective use of time.
First, a straight round-trip experiment was designed to verify the algorithm's superiority. The experimental site is a 100-metre running track on a playing field. After walking straight along the runway to the endpoint, the experimenter returned to the starting point along the original route.
Second, a complex experimental route with arcs was designed to verify the algorithm's stability. The experimental site comprised a corridor on the third floor of the office building at the College of Geomatics, Shandong University of Science and Technology. The experimenter began by walking along a straight corridor, through a semi-circular arc with a radius of about 2 m and then returned to the starting point via a straight corridor.
Third, a rectangular experiment was designed to challenge the algorithm's effective use of time. The experimental site comprised the return corridor on the third floor of the office building at the College of Geomatics, Shandong University of Science and Technology. After walking along the corridor four times, the experimenter returned to the starting position.
The experimental data of the three groups were processed by SHS-PDR, based on the SHS-PDR system of the E-HDE and O-iHDE algorithms. The results of the three methods were plotted on the same trajectories and heading error graphs, and the study included an intuitive comparison and precision analysis. The following index was used to compare the performance of the various methods.
where D err indicates the positioning error of the pedestrian at the end of the experimental route, TTD indicates the total travelled distance and TTD error is the positioning error of the estimated trajectory:
where AHE is the average heading error of the estimated trajectory, $\hat{\varphi}_{{\rm err}}$ refers to the heading error at each step and Step refers to the total number of steps taken.
When performing the precision analysis, TTD error and AHE are used as the precision indexes to show the algorithm's correction effect on the heading information, the influence of the heading correction algorithm on the positioning accuracy and the effect of the more comprehensive check heading correction algorithm.
4.1.2. Experimental platform
The O-iHDE algorithm was used in the built-in sensors of the low-priced Noblue Note3 smartphone, which include gyroscopes, accelerometers and magnetometers. When choosing the inertial sensor accessories, the handset maker's primary consideration was not positioning. The phone's sensors are also inexpensive, ranging from a few RMB up to 12 RMB in price (Chen and Chen, Reference Chen and Chen2017). Although SHS-PDR is suitable for studying the positioning algorithm based on the smartphone's inertial sensor, the effective positioning time is limited to a few minutes (Harle, Reference Harle2013; Chen, L.B., et al., Reference Chen, Zhang, Wang and Meng2015; Chen and Chen, Reference Chen and Chen2017), which presents a challenge for this algorithm to operate on smartphones with inexpensive built-in phone sensors. The built-in gyroscope used in this study was manufactured by InvenSense Inc. The gyroscope can measure in three dimensions, with measuring range of 34·90656 rad/s, resolution ratio of 0·0010652636 rad/s, rated current of 5·5 mA, power consumption of 5·5 μ A, sample frequency of 15–200 Hz and operating temperature from −20 to 45°C.
4.1.3. Algorithm parameter settings
To determine the thresholds of Th φ and Th δϕ, a straight-line 100 m experiment was designed. Because few straight paths longer than 100 m can be found indoors, the basis for the threshold setting was obtained by analysing several sets of long-distance walking data.
Six volunteers participated in the experiment; experimenters 3 and 4 were women. The experimenters carried the same model of smartphone (Noblue Note3) for experimental data collection. According to the ‘max(|ϕ(j) − mean(ϕ(i − n : i))|) < Th ϕ, j ∈ {x|i − n ≤ x ≤ i, x ∈ N’ in Equation (4), we could calculate the absolute value of the maximum difference between the headings of continuous n step at each set of experiments. The results of the six experiments were shown in Figure 5(a). The maximum value of the six experiments was rounded up as the basis for the value of Th φ, that is, Th ϕ = 6°. Figure 5(b) shows the absolute value of the maximum difference between the heading and the dominant direction in each set of experiments. The maximum value of the six experiments was rounded up as the basis for the value of Th δϕ, that is, Th δϕ = 9°.
Although the size of the threshold varies from person to person and from smartphone to smartphone, it should remain stable within a certain range. This study provides the idea for the threshold setting.
Considering the accuracy of the results and the complexity of the calculation, a set of five steps was used as the unit of calculation (Ju et al., Reference Ju, Min, Chan, Lee and Park2015). Because the Tbias value depends on the quality of the gyroscope (Borenstein and Ojeda, Reference Borenstein and Ojeda2010) and this study examined the built-in sensors in inexpensive smartphones, Tbias was set as 50. The other parameter settings are shown in Table 1.
4.2. Experimental results and precision analysis
4.2.1. Straight-line round-trip experiment
This experiment was designed to verify the superiority of the O-iHDE algorithm. The experiment enacted the hypothetical situation depicted in Figure 2, with a total walking distance of 200 m and a walking time of 2·7 min (excluding the 50 s pre-walking time). Comparison of the trajectories of the three algorithms is shown in Figure 6(a), comparison of the heading errors is shown in Figure 6(b) and the precision analysis results are shown in Table 2.
From Figure 6 and Table 2, the following observations can be made.
(1) During the first 100 m walk, the heading error of the SHS-PDR solution accumulated gradually due to the heading's small deviation, the E-iHDE and O-iHDE algorithms corrected the heading and the corrected heading error showed little difference. After the experimenter turned 180° and returned to the starting point, the heading error became too large and the E-iHDE algorithm discriminated in the wrong direction, leading to a decrease in positioning accuracy. In contrast, the O-iHDE algorithm corrected the quaternions while correcting the heading, so it was still able to make a good correction to the heading.
(2) The O-iHDE algorithm produced a large heading error between steps 110 and 120 (as shown in Figure 6) because the forward n step after the corner was used to judge the algorithm. During the start-up process, the algorithm was not modified, but the heading error was controlled within a lower range when the algorithm started.
(3) The O-iHDE algorithm-adjusted SHS-PDR average heading error was 0·484°. The accuracy of the heading increased by 92·8%, the positioning accuracy was improved and the TTD error was 0·7%. The accuracy increased by 96·3% over the uncorrected SHS-PDR and also improved more than the E-iHDE algorithm (see Figure 6(b) and Table 2).
4.2.2. Complex experiments
A more complex experiment was designed to verify the stability of the O-iHDE algorithm. Instead of a simple rectangular route, the experimental route had six corners and one semi-arc. The total distance was about 310 m and the total travel time was 3·5 min (excluding the 50 s pre-walking time). Comparison of the trajectories of the three algorithms is shown in Figure 7(a), comparison of the heading errors is shown in Figure 7(b) and the precision analysis results are shown in Table 3.
According to Figure 7 and Table 3, the following observations can be made.
(1) The E-iHDE algorithm performed well before the sixth angle rotation correction and maintained less than 10° of heading error. However, after the sixth angle rotation, the gyroscope's heading deviation became too large and the error correction performed by E-iHDE increased the heading error and resulted in a decrease in the positioning precision of the second half of the circle (see Figure 7).
(2) The correction of the quaternion algorithm in the O-iHDE algorithm resulted in less drift error from the gyroscope accumulating during the heading calculation. Combined with the modified algorithm, the heading error of SHS-PDR is 0·076°, the precision of the heading increased by 99·4% and the providing error was 0·4%. Compared with the uncorrected SHS-PDR, the accuracy increased by 95·2%.
4.2.3. Walking four times around a rectangle experiment
This experiment was designed to challenge the effective use of time of the experimental algorithm. The experimenter walked around the rectangular corridor four times (total length, 832 m), which took around 10·1 min (excluding the 50 s pre-walking time). Comparison of the trajectory of the three algorithms is shown in Figure 8(a), comparison of the heading errors is shown in Figure 8(b) and the precision analysis results are shown in Table 4.
According to Figure 8 and Table 4, the following observations can be made.
(1) As the number of turns increased, the heading error of the SHS-PDR solution and the deviation of the track both increased. The E-iHDE algorithm could be corrected normally in the first circle, and the heading error was maintained within a good range. As the experimenter progressed, the deviation of the heading from the second circle to the gyroscope increased, which caused the E-iHDE algorithm to fail, so the leading direction of the error was corrected (see Figure 8(a)).
(2) Combined with the O-iHDE algorithm, the average heading error of SHS-PDR was 0·115, the accuracy of the heading increased by 99·6%, the TTD error was 0·1% and the accuracy improved by 96·3% over the uncorrected SHS-PDR (see Table 4). From the analysis of effective use of time, the accuracy of the O-iHDE algorithm was on the meter level and the effective working time was extended to 10 min, which greatly improved the effective use of time of the SHS-PDR.
5. CONCLUSIONS
In this study, the iHDE algorithm is further optimised under the framework of SHS-PDR. Judgement conditions of the angle threshold are added to determine whether the path is along the dominant straight-line route. The judgement of whether the previous step was amended is added to avoid the problem whereby the correction algorithm stops working because of a large deviation in the heading angle caused by gyroscope drift. To prolong the use time of the positioning algorithm, a method is proposed in which the quaternion is corrected while correcting the heading angle. The experimental results show the validity and accuracy of the proposed method. In future research, the authors plan to continue designing experiments, testing the application environment and stability of the algorithm and further improving the application time of SHS-PDR in low-priced smartphone sensors.
ACKNOWLEDGEMENTS
The research was supported by the National Key Research and Development Program of China (grant no. 2016YFC0803102), Key Research and Development project of Shandong Province (Grant No. 2018GGX106003), the Graduate Science and Technology Innovation of Shandong University of Science and Technology (Grant No. SDKDYC170312) and the Research and Innovation Team Project of Shandong University of Science and Technology (Grant No. 2014TDJH101).