# 3D Reconstruction of Pedestrian Trajectory with Moving Direction Learning and Optimal Gait Recognition

Authors: Binbin Wang; Tingli Su; Xuebo Jin; Jianlei Kong; Yuting Bai
Journal: Complexity
 (2018)

---

## Abstract

An inertial measurement unit-based pedestrian navigation system that relies on the intelligent learning algorithm is useful for various applications, especially under some severe conditions, such as the tracking of firefighters and miners. Due to the complexity of the indoor environment, signal occlusion problems could lead to the failure of certain positioning methods. In complex environments, such as those involving fire rescue and emergency rescue, the barometric altimeter fails because of the influence of air pressure and temperature. This paper used an optimal gait recognition algorithm to improve the accuracy of gait detection. Then a learning-based moving direction determination method was proposed. With the Kalman filter and a zero-velocity update algorithm, different gaits could be accurately recognized, such as going upstairs, downstairs, and walking flat. According to the recognition results, the position change in the vertical direction could be reasonably corrected. The obtained 3D trajectory involving both horizontal and vertical movements has shown that the accuracy is significantly improved in practical complex environments.


---

## Body

## 1. Introduction

Pedestrian navigation refers to a user achieving real-time navigation and positioning by carrying different sensors, which can transmit the movement information to monitoring personnel; thus, it is extremely significant for those personnel who need to work in an unknown or dangerous environment. As an important branch of navigation, pedestrian navigation has been paid increasing attention in various industries.At present, technologies suitable for pedestrian navigation can be divided into two technologies, satellite-based Global Navigation Satellite System (GNSS) [1] providing global position solution and ground-based positioning using radio signals. The first kind is relatively mature, but the signals are blocked by tall buildings or when users are indoor or inside places like caves or jungles. The second kind based on the wireless frequency signal (such as wireless fidelity [2], radio frequency identification [3], and ultrawideband [4]) requires preinstallation of signal transmitting equipment in the positioning area, which is costly and has a limited application range. It cannot be used in the positioning area and in rooms where there are no signal transmitting/receiving devices. People who have dangerous occupations, such as firefighters or police officers, usually work in such situations and have a high demand for precise locations. This is because the pedestrian navigation system is used in an unknown environment. Compared with other positioning technologies based on self-contained sensors, the inertial measurement unit (IMU) has the advantage of strong independence and mainly adopts sensors, such as accelerometers and gyroscopes, to calculate pedestrian position information [5, 6].Thanks to miniaturization technologies, such as microelectromechanical systems or nanoelectromechanical systems, IMUs have become smaller, low-cost, less power consuming, and can be fixed to a pedestrian foot. The foot-mounted IMU has many indoor applications, such as in antiterrorism efforts and in providing help for fire and other dangerous situations [7]. For example, in the antiterrorism application, the IMU system can provide locations to facilitate smooth conduct of police operations and indoor cooperation; this has great application value.The main algorithm structure of the pedestrian navigation system was proposed by Foxlin [8]; this is a shoe-mounted method using the extended Kalman filter, zero-velocity updates, and a strapdown inertial navigation system (SINS). Over the past few years, some researchers have tried to add other information sources to this main algorithm structure, such as building heading information proposed by Cai et al. [9], prior maps used by Lategahn et al. [10], and visual sensors used by Flores et al. [11], to solve the problem of system error drift. However, the applications of these methods are limited to only some specific situations, and the system accuracy is affected heavily by the selected sensors.For the 3D positioning of indoor floors [12, 13], due to the drift and integral error of the IMU, the positioning results are very unstable, especially in the vertical direction. Furthermore, because of the influence of gravity acceleration, there is a great deviation in the calculation of the height displacement. To solve this problem, some researchers used the IMU to combine building structures, such as Fei et al. who proposed a method using a building heading-aided low-cost inertial navigation [14]. However, firefighters often execute rescue missions where there are no prior maps. Additionally, Jiang et al. used visual tracking assists in IMU calibration to avoid the bias drift during pedestrian navigation [15]; experimental results show that the IMU and visual tracking are complementary to each other. However, visual sensors may be useless when it is dark or when the environment is full of smoke. Furthermore, Zeng et al. used UWB/IMU sensor fusion for indoor pedestrian tracking, which has the advantage of higher accuracy and stronger anti-interference capability due to the features of UWB [16]. Its disadvantage is that the UWB base station must be arranged beforehand. A conventional solution uses the IMU with the barometer height to achieve vertical positioning of the stairs [17], but the barometer is easily affected by temperature flow intensity and other factors in fire and other harsh environments.This paper used an optimal gait recognition algorithm to improve the accuracy of gait detection. Then we combined this with Kalman filter and the zero-velocity update algorithm to accurately recognize gait using our proposed moving direction learning method. According to the results of direction determination, we took different coping methods. Finally, accurate tracking between floors was obtained. The proposed method was evaluated with walking experiments and comparisons with other methods without using our method and only applying SINS and the method using the IMU and barometric pressure fusion to solve 3D pedestrian trajectory. The experimental results show the effectiveness of the proposed method. The error in the horizontal direction was less than 0.08 m per 10 m, and the error in the vertical direction was less than 0.14 m per 10 m. The main contribution of this paper is that the proposed method is independent of various kinds of sensors. It even achieved better performance than the existing multisensor fusion methods [12, 18]. In addition, the optimal gait recognition and the moving direction learning method will also bring much benefit to indoor positioning problems.This paper is organized as follows. Section2 introduces the system structure of the proposed pedestrian navigation system (PNS), including hardware structure and algorithm composition. The optimal gait recognition algorithm, which plays an important role throughout the system, is discussed in Section 3. In Section 4, Kalman filter is applied for online computation of attitude transform matrix, position, and velocity. Then, the moving direction learning method is proposed in Section 5. Section 6 shows the evaluation results of two sets of experiments. In Section 7, we give the main conclusions drawn from this work.


## 2. System Structure

The PNS used in this paper only included one IMU, which was fixed on the left foot, as shown in Figure1. The IMU adopted in our system was the MTi integrated sensor from Holland Xsens company as in Figure 2 [19]. It contains a three-axis accelerometer, three-axis gyroscope, and three-axis magnetometer, which can be connected to a computer by an RS232 interface or USB interface. The sampling rate was set as 100 Hz, and its dynamic range was ±50 m/s2, ±300 deg/s, and 600 mg.Figure 1
The IMU fixed on the shoe.Figure 2
Xsens IMU.The algorithm flow of the PNS was as follows: (1) An improved zero-velocity update algorithm that could more accurately determine when the IMU should be stationary and could be used as a reference in the Kalman filter to correct the predicted position, velocity, and attitude angle of SINS; and (2) a linear gait discrimination method used to judge the walking state of pedestrians and solve the inaccurate positioning problem on floor height estimation, thus realizing accurate indoor trajectory reconstruction. The algorithm architecture is shown in Figure3.Figure 3
The algorithm architecture.


## 3. The Optimal Gait Recognition Algorithm

### 3.1. Zero-Velocity Detection

Zero-velocity detection determines whether the pedestrian foot is on the ground. The detected zero-velocity state could be used as the external measurement information for the system to reduce speed error and improve positioning accuracy. One of two different states, that is, moving and static, was an output of the zero-velocity detection algorithm based on the signal source. Zero-velocity detection [20, 21] plays an important role in the whole system.In this study, a generalized likelihood ratio test algorithm was used, where the equivalent moving variance of acceleration and the moving mean square value of angular velocity are used for zero-velocity detection.The output of IMU was defined as(1)xn=xna,xnw,where xna and xnw∈Ω3 are the specific acceleration and angular velocity measurement vectors, respectively and n represents the index for sampling instants when the sensor data was collected. By the Neyman–Pearson rule, we assumed the value zn=xn,xn+1,…,xn+W−1, where W represents the number of samples. We can get the Tzn model as follows:
(2)Tzn=1W∑k=nn+W−11δa2xka−gx¯kax¯ka2+1δw2x¯ka2,where Tzn is the test statistics as shown by the red curves in Figure 4, g represents the acceleration due to gravity, x¯ka and x¯kw represent the means of the samples, respectively, and δa2 and δw2 represent the noise variances of accelerometers and gyroscopes, respectively.Figure 4
Judgment of zero-velocity detection.In the stage of gait division, detection thresholdTdzn must be preset. In this study, we set Tdzn=0.3×105, as shown by the blue line in Figure 4. By comparing the detection statistic Tzn with the threshold Tdzn, the gait detection results were obtained. Gait detection results were expressed as follows:
(3)Sk=0,Tzn>Tdzn,1,Tzn<Tdzn,where Sk stands for the detection result, corresponding to the black solid lines shown in Figure 5. When Sk equaled to 1, it indicated the static phase; when it equaled to 0, it indicated the moving phase.Figure 5
Gait recognition results based on zero-velocity detection.


### 3.2. Improved Zero-Velocity Detection Algorithm

When the foot steps on the floor, it is actually static. However, due to the drift of the measurement data of IMU, the data shows that the foot is moving. Therefore, we call this phase the pseudomoving phase, which can be induced by the local uplift fluctuation of the static phase and usually lasts a short time. The test result is shown in Figure5. The improved zero-velocity detection algorithm added a preset time threshold Tl on the basis of the generalized likelihood ratio detection algorithm. The improved zero-velocity detection results were expressed by the following formula:
(4)Sk=0,LTzn>Td>Tl,1,LTzn>Td<Tl,where LTzn>Td represents the duration of the gait phase. The modified gait detection result is shown in Figure 6. Traditional zero-velocity detection results contain a lot of pseudomoving phases, which results in inaccurate location calculations. The improved gait detection algorithm segmented the gait effectively.Figure 6
Gait recognition results based on improved zero-velocity update algorithm.


## 3.1. Zero-Velocity Detection

Zero-velocity detection determines whether the pedestrian foot is on the ground. The detected zero-velocity state could be used as the external measurement information for the system to reduce speed error and improve positioning accuracy. One of two different states, that is, moving and static, was an output of the zero-velocity detection algorithm based on the signal source. Zero-velocity detection [20, 21] plays an important role in the whole system.In this study, a generalized likelihood ratio test algorithm was used, where the equivalent moving variance of acceleration and the moving mean square value of angular velocity are used for zero-velocity detection.The output of IMU was defined as(1)xn=xna,xnw,where xna and xnw∈Ω3 are the specific acceleration and angular velocity measurement vectors, respectively and n represents the index for sampling instants when the sensor data was collected. By the Neyman–Pearson rule, we assumed the value zn=xn,xn+1,…,xn+W−1, where W represents the number of samples. We can get the Tzn model as follows:
(2)Tzn=1W∑k=nn+W−11δa2xka−gx¯kax¯ka2+1δw2x¯ka2,where Tzn is the test statistics as shown by the red curves in Figure 4, g represents the acceleration due to gravity, x¯ka and x¯kw represent the means of the samples, respectively, and δa2 and δw2 represent the noise variances of accelerometers and gyroscopes, respectively.Figure 4
Judgment of zero-velocity detection.In the stage of gait division, detection thresholdTdzn must be preset. In this study, we set Tdzn=0.3×105, as shown by the blue line in Figure 4. By comparing the detection statistic Tzn with the threshold Tdzn, the gait detection results were obtained. Gait detection results were expressed as follows:
(3)Sk=0,Tzn>Tdzn,1,Tzn<Tdzn,where Sk stands for the detection result, corresponding to the black solid lines shown in Figure 5. When Sk equaled to 1, it indicated the static phase; when it equaled to 0, it indicated the moving phase.Figure 5
Gait recognition results based on zero-velocity detection.


## 3.2. Improved Zero-Velocity Detection Algorithm

When the foot steps on the floor, it is actually static. However, due to the drift of the measurement data of IMU, the data shows that the foot is moving. Therefore, we call this phase the pseudomoving phase, which can be induced by the local uplift fluctuation of the static phase and usually lasts a short time. The test result is shown in Figure5. The improved zero-velocity detection algorithm added a preset time threshold Tl on the basis of the generalized likelihood ratio detection algorithm. The improved zero-velocity detection results were expressed by the following formula:
(4)Sk=0,LTzn>Td>Tl,1,LTzn>Td<Tl,where LTzn>Td represents the duration of the gait phase. The modified gait detection result is shown in Figure 6. Traditional zero-velocity detection results contain a lot of pseudomoving phases, which results in inaccurate location calculations. The improved gait detection algorithm segmented the gait effectively.Figure 6
Gait recognition results based on improved zero-velocity update algorithm.


## 4. Position Estimation Based on Kalman Filter

After getting the gait detection result, we needed to estimate and correct the location of pedestrians through the zero-velocity reference combined with the Kalman filter algorithm.


### 4.1. Calculation of Attitude Transform Matrix

Data in body coordinateb and navigation coordinate n meets the following equation:
(5)xn,yn,znT=Cbnxb,yb,zbT,where the attitude transform matrix Cbn represents the rotation relationship between the two coordinates, xn, yn, and zn represent the geographical coordinates east, north, and up, respectively, while xb, yb, and zb indicate the forward, left, and upward directions in the body coordinate system.Therefore, we could get the accelerationf of the navigation system as follows:
(6)f=Cbn×accXaccYaccZT−00gT,where accX, accY, and accZ represent the acceleration along three axes in the body coordinate system. Besides, f can be expressed as f1f2f3T, which represent the acceleration along the xn-, yn-, and zn-axes, respectively. Based on the acceleration data in the navigation coordinate, we could obtain the pedestrian location and speed information via integration computation. Therefore, the accuracy of Cbn, accX, accY, and accZ were very important for accurate pedestrian trajectory reconstruction. The method of calculating the attitude matrix by quaternion has been discussed by many researchers [22], and thus, we just list them as follows:
(7)q=q0q1q2q3T.Considering the relation between quaternions and gyro measurement data in the body coordinate system, the updated equation of quaternions is as follows, and we suppose the quaternion is set as(8)q̇t=12Mwqt,(9)Mw=0−wx−wy−wzwx0−wzwywywz0−wxwz−wywx0,where wx, wy, and wz represent the x-axis, y-axis, and z-axis angular velocity, respectively. According to (8), the quaternion matrix was obtained through the Picard approximation method:
(10)qt=cosΔθ02I+sinΔθ0/2Δθ0Δθq0,whereq0 is the initial quaternion and Δθ denotes the change in angle, which can be obtained as follows:
(11)Δθ=∫tt+ΔtΩnbbtdt=0−△θx−△θy−△θz△θx0△θz−△θy△θy−△θz0△θx△θz△θy−θx0,Δθ02=Δθx2+Δθy2+Δθz2,where Δθx, Δθy, and Δθz are changes in angles and can be obtained by Δθx=wx×Δt,Δθy=wy×Δt, and Δθz=wz×Δt, respectively. Then the attitude transform matrix Cbkn can be expressed in the form of quaternions, as shown in
(12)Cbkn=2q02+q12−12q1q2−q0q32q1q3+q0q22q1q2+q0q32q02+q22−12q2q3+q0q12q1q3+q0q22q2q3−q0q12q02+q32−1.


### 4.2. Prediction of Pedestrian Position and Velocity

Since the IMU will have a certain drift and error will be accumulated over time, the Kalman filter was applied here to correct the distortion. In a regular walking cycle, the foot-mounted IMU will periodically swing. Using the gait detection results, the Kalman filter could estimate the errors of attitude, velocity, and position effectively.The model of zero-velocity correction for the Kalman filter was constructed as follows [23]:
(13)ẋ=Fx+Gw,where x is the system state vector, which is defined as
(14)x=δsxδsyδszδvxδvyδvzδρδξδψT.In the expression above,δsx, δsy, and δsz represent the position errors of the target, δvx,δvy, and δvz are the velocity errors of the target, δρ, δξ, and δψ are the errors in attitude angles. w is the process noise with covariance Qw.F in (13) is the state transition matrix with 9 rows and 9 columns:
(15)F=03×3I3×303×303×303×3Fm03×303×303×3,andFm is structured as follows:
(16)Fm=0f3−f2−f30f1f2−f10.Formula (13) introduces a continuous state model, and the discretized equation is as follows:
(17)xk+1=Axk+wk,where A=I+FΔt+1/2FΔt2, xk represents the state of time instant tk, and wk represents process noise. The covariance of wk is calculated by Qk as
(18)Qk=Qdt+12FQ+QFTdt2+162FQFT+FFQ+QFTFTdt3.Q is computed by Q=GkQwGkT, where Gk is a matrix with 9 rows and 6 columns:
(19)Gk=00−Cbkn00Cbkn.The observation model is(20)zk=Hxk+τk,where zk is the measurement matrix and τk is the white Gaussian noise. H is the measurement matrix:
(21)H=000100000000010000000001000.Based on the output of IMU and the estimated state variable at timetk−1, the velocity and position were calculated with the acceleration f in the navigation coordinate obtained by (6) as follows:
(22)v~k=vk−1+f×Δt,s~k=sk−1+sk−1×Δt+12f×Δt2,where the v~k matrix is the velocity at time tk and v~k=vx,vy,vz. The s~k matrix is the position vector at time tk and s~k=sx,sy,sz. vk−1 and sk−1 are the estimated velocity and position at time tk−1, respectively. Δt is the sampling time. It is known that v~k and s~k will gradually drift away from the true value due to the error of the measured accelerations accX, accY, and accZ.


### 4.3. Update Based on Kalman Filter

After the Kalman filter predicted the velocity and position, the zero-velocity information was used to correct the velocity. When the foot was stationary, we used the measurement data(23)zk=000T.Then using the Kalman filter, we update the current state as follows:(24)x^k,k=x^k,k−1+Kkzk−Hx^k,k−1,where x^k,k−1 and x^k,k are the estimated states updated by the measurement zk. Kk is the filter gain of the Kalman filter, which can be calculated by
(25)Kk=Pk,k−1HTRk+HPk,k−1HT−1.The error covariance of the state estimation is calculated by(26)Pk,k−1=Ak−1Pk−1,k−1Ak−1T+Qk−1.The error covariance of the update process can be computed by(27)Pk,k=I−KkHkPk,k−1,where k,k−1 refers to the predicted value from the sampling k−1 to k, k,k refers to the k point estimates, and Pk,k−1 is the step prediction covariance.We set the prediction errord as d=x^k,k−x^k,k−1, where d is a 9-dimensional vector and can be described as d=d1d2d3⋯d9T.Then the updated position and velocity are calculated as follows:(28)sk=s~k+λd1−3,vk=v~k+λd4−6,where sk is the position corrected at time tick tk and vk is the velocity corrected at time tick tk. d1−3 is the first, second, and third elements of d; d4−6 is the fourth, fifth, and sixth elements of d; and λ is denoted as the coefficient of deviation. By adjusting the value of λ, the errors of position and velocity could be adjusted. It needs to be pointed out that λ is dependent on the step length, which is related to the height of the pedestrian.In order to correct the rotation matrix, the correction matrixPe was constructed as follows:
(29)Pe=0−d9d8d90−d7−d8d70.With the above matrix, the transform matrix can then be updated via the following equation:(30)Cbkn=I+βPe×Cbk−1n,where β is the coefficient closely related to the step length of people and step length is usually proportional to the height. The average height of adults is 1.5 m to 2 m; therefore, the range of the parameter β is set to be 1.5–2.


## 4.1. Calculation of Attitude Transform Matrix

Data in body coordinateb and navigation coordinate n meets the following equation:
(5)xn,yn,znT=Cbnxb,yb,zbT,where the attitude transform matrix Cbn represents the rotation relationship between the two coordinates, xn, yn, and zn represent the geographical coordinates east, north, and up, respectively, while xb, yb, and zb indicate the forward, left, and upward directions in the body coordinate system.Therefore, we could get the accelerationf of the navigation system as follows:
(6)f=Cbn×accXaccYaccZT−00gT,where accX, accY, and accZ represent the acceleration along three axes in the body coordinate system. Besides, f can be expressed as f1f2f3T, which represent the acceleration along the xn-, yn-, and zn-axes, respectively. Based on the acceleration data in the navigation coordinate, we could obtain the pedestrian location and speed information via integration computation. Therefore, the accuracy of Cbn, accX, accY, and accZ were very important for accurate pedestrian trajectory reconstruction. The method of calculating the attitude matrix by quaternion has been discussed by many researchers [22], and thus, we just list them as follows:
(7)q=q0q1q2q3T.Considering the relation between quaternions and gyro measurement data in the body coordinate system, the updated equation of quaternions is as follows, and we suppose the quaternion is set as(8)q̇t=12Mwqt,(9)Mw=0−wx−wy−wzwx0−wzwywywz0−wxwz−wywx0,where wx, wy, and wz represent the x-axis, y-axis, and z-axis angular velocity, respectively. According to (8), the quaternion matrix was obtained through the Picard approximation method:
(10)qt=cosΔθ02I+sinΔθ0/2Δθ0Δθq0,whereq0 is the initial quaternion and Δθ denotes the change in angle, which can be obtained as follows:
(11)Δθ=∫tt+ΔtΩnbbtdt=0−△θx−△θy−△θz△θx0△θz−△θy△θy−△θz0△θx△θz△θy−θx0,Δθ02=Δθx2+Δθy2+Δθz2,where Δθx, Δθy, and Δθz are changes in angles and can be obtained by Δθx=wx×Δt,Δθy=wy×Δt, and Δθz=wz×Δt, respectively. Then the attitude transform matrix Cbkn can be expressed in the form of quaternions, as shown in
(12)Cbkn=2q02+q12−12q1q2−q0q32q1q3+q0q22q1q2+q0q32q02+q22−12q2q3+q0q12q1q3+q0q22q2q3−q0q12q02+q32−1.


## 4.2. Prediction of Pedestrian Position and Velocity

Since the IMU will have a certain drift and error will be accumulated over time, the Kalman filter was applied here to correct the distortion. In a regular walking cycle, the foot-mounted IMU will periodically swing. Using the gait detection results, the Kalman filter could estimate the errors of attitude, velocity, and position effectively.The model of zero-velocity correction for the Kalman filter was constructed as follows [23]:
(13)ẋ=Fx+Gw,where x is the system state vector, which is defined as
(14)x=δsxδsyδszδvxδvyδvzδρδξδψT.In the expression above,δsx, δsy, and δsz represent the position errors of the target, δvx,δvy, and δvz are the velocity errors of the target, δρ, δξ, and δψ are the errors in attitude angles. w is the process noise with covariance Qw.F in (13) is the state transition matrix with 9 rows and 9 columns:
(15)F=03×3I3×303×303×303×3Fm03×303×303×3,andFm is structured as follows:
(16)Fm=0f3−f2−f30f1f2−f10.Formula (13) introduces a continuous state model, and the discretized equation is as follows:
(17)xk+1=Axk+wk,where A=I+FΔt+1/2FΔt2, xk represents the state of time instant tk, and wk represents process noise. The covariance of wk is calculated by Qk as
(18)Qk=Qdt+12FQ+QFTdt2+162FQFT+FFQ+QFTFTdt3.Q is computed by Q=GkQwGkT, where Gk is a matrix with 9 rows and 6 columns:
(19)Gk=00−Cbkn00Cbkn.The observation model is(20)zk=Hxk+τk,where zk is the measurement matrix and τk is the white Gaussian noise. H is the measurement matrix:
(21)H=000100000000010000000001000.Based on the output of IMU and the estimated state variable at timetk−1, the velocity and position were calculated with the acceleration f in the navigation coordinate obtained by (6) as follows:
(22)v~k=vk−1+f×Δt,s~k=sk−1+sk−1×Δt+12f×Δt2,where the v~k matrix is the velocity at time tk and v~k=vx,vy,vz. The s~k matrix is the position vector at time tk and s~k=sx,sy,sz. vk−1 and sk−1 are the estimated velocity and position at time tk−1, respectively. Δt is the sampling time. It is known that v~k and s~k will gradually drift away from the true value due to the error of the measured accelerations accX, accY, and accZ.


## 4.3. Update Based on Kalman Filter

After the Kalman filter predicted the velocity and position, the zero-velocity information was used to correct the velocity. When the foot was stationary, we used the measurement data(23)zk=000T.Then using the Kalman filter, we update the current state as follows:(24)x^k,k=x^k,k−1+Kkzk−Hx^k,k−1,where x^k,k−1 and x^k,k are the estimated states updated by the measurement zk. Kk is the filter gain of the Kalman filter, which can be calculated by
(25)Kk=Pk,k−1HTRk+HPk,k−1HT−1.The error covariance of the state estimation is calculated by(26)Pk,k−1=Ak−1Pk−1,k−1Ak−1T+Qk−1.The error covariance of the update process can be computed by(27)Pk,k=I−KkHkPk,k−1,where k,k−1 refers to the predicted value from the sampling k−1 to k, k,k refers to the k point estimates, and Pk,k−1 is the step prediction covariance.We set the prediction errord as d=x^k,k−x^k,k−1, where d is a 9-dimensional vector and can be described as d=d1d2d3⋯d9T.Then the updated position and velocity are calculated as follows:(28)sk=s~k+λd1−3,vk=v~k+λd4−6,where sk is the position corrected at time tick tk and vk is the velocity corrected at time tick tk. d1−3 is the first, second, and third elements of d; d4−6 is the fourth, fifth, and sixth elements of d; and λ is denoted as the coefficient of deviation. By adjusting the value of λ, the errors of position and velocity could be adjusted. It needs to be pointed out that λ is dependent on the step length, which is related to the height of the pedestrian.In order to correct the rotation matrix, the correction matrixPe was constructed as follows:
(29)Pe=0−d9d8d90−d7−d8d70.With the above matrix, the transform matrix can then be updated via the following equation:(30)Cbkn=I+βPe×Cbk−1n,where β is the coefficient closely related to the step length of people and step length is usually proportional to the height. The average height of adults is 1.5 m to 2 m; therefore, the range of the parameter β is set to be 1.5–2.


## 5. Moving Direction Learning Method

In order to get the exact vertical height, we presented a linear discriminant function based on the pedestrian gait. First, we judged whether the pedestrian was climbing the stairs or walking on the flat ground; then, if they were climbing the stairs, we judged whether they went up or down the stairs. According to the results of different judgments, we presented a linear discriminant function based on the pedestrian gait, by which the walk pattern of every step, such as up or down the stairs, can be detected. Our specific methods are as below.The step size calculation formula is defined as follows:(31)dxy=xend−xstart2+yend−ystart2,where dxy is the displacement of each step, xend and yend are the surface coordinates of the last point during the moving phase, and xstart and ystart are the first points during the moving phase.According to the actual measurement, when an adult walks, the horizontal displacement of each step is 0.9 m–1.15 m. Meanwhile, when taking a step up or down, the horizontal displacement is 0.3 m–0.38 m; taking two steps up or down, the horizontal displacement is 0.6 m–0.75 m. It can be seen that the two scenes are very different in step size. We set the thresholdds=0.8 m, by comparing horizontal displacements, to distinguish between taking the stairs and walking on a flat plane.If the direction of vertical movement is necessary, some further rules need to be investigated as well. Here, thez-axis displacement was calculated by using SINS. As we all know, the vertical displacement cannot be obtained directly by integrating the z-axis acceleration due to the drift of IMU data. However, through a large number of experiments, we found out that although there will always be a drift, the calculation results can accurately reflect the going up or down the stairs. Therefore, the difference between the upper and lower position dz was computed as follows:
(32)dz=zend−zstart,where zstart and zend are the coordinates in the vertical direction at the start and end points that are the same as those in (31).In summary, the linear gait discrimination function can be obtained as follows:(33)l=upstairsdxy<ds,dz>0,downstairsdxy<ds,dz<0,walkingonaflatplanedxy>ds.If it is judged that a staircase was climbed, the threshold was further set to judge whether one or two steps were climbed at a time; we set another threshold asdsl=0.5 m. If dz>dsl, then the z coordinate of the end point is assigned zstart plus twice the stair height, that is, zend=zstart+2h. If dz<dsl, then the z coordinate of the end point is assigned zstart plus the stair height, that is, zend=zstart+h. If the pedestrian went downstairs, then zend=zstart−2h or zend=zstart−h; this is similar to going upstairs. If it was judged that the pedestrian was walking on a flat plane, then we set zend=zstart.Theh value needed to be calculated at the first step of the stairs. At the beginning of the test, the stair height calculation was accurate. Because the drift was weak, acceleration could be used for position computation in the vertical direction. Besides, with the relationship between zend and zstart, the value h could then be determined. If one step was climbed at a time, then h=dz1=zend1−zstart1; if two steps were climbed at a time, then 2h=dz1=zend1−zstart1. Here, dz1 is the height of the first step of the staircase. The first step height h was used in each subsequent calculation.The verification result of the proposed stair height calculation method is shown in Table1. Three different bench heights were chosen as 0.15 m, 0.16 m, and 0.165 m; each group was verified by 20 sets of experiments; and the average stair height was used as the h value.Table 1
Performance of the stair height calculation method.
Bench height (m)
Calculated average stair heighth (m)
Error (m)
0.15
0.1503
0.0003
0.16
0.1603
0.0003
0.165
0.1646
0.0004


## 6. Case Study

In this section, two different cases were discussed to illustrate the effectiveness of the developed method. In Case 1, positioning in the 2D plane was considered and a reasonably accurate result was derived. Furthermore, a 3D scenario was implemented in Case 2, where the performance of the linear gait discrimination method was verified.Case 1.
The experiment was conducted in the corridor of Number 3 Teaching Building in Beijing Technology and Business University, as shown in Figure7. After using the optimized zero-velocity detection algorithm and selecting the appropriate parameters, the positioning results of the 2D horizontal plane were shown in Figure 8.
The actual walking distance in the corridor was 39.6 m, while the calculated value was 39.95 m. In this case, the experimental error was 0.35 m. The accuracy of the horizontal experiment results were verified by Case 1.Figure 7
Experimental environment in Case 1.Figure 8
2D plane trajectory optimized by the algorithm.Case 2.
In Case 2, the linear gait discrimination method was used to obtain an accurate 3D indoor trajectory reconstruction. The experiment was carried out in the stairwell in the building, as shown in Figure9.
Pedestrian attitude discrimination experiment. Five people of different height, weight, and sex were selected to carry out this experiment. The heights of the test personnel were 160–185 cm. During the test, the testers walked randomly up/down the stairs and along flat planes. They were asked to keep a real walking posture. The actual pedestrian walking posture and gait discrimination results were compared, and the comparison results are shown in Table 2. It could be clearly seen that the error rate of the algorithm was less than 1.35%. The results showed that the linear gait discrimination method proposed in this paper had a high recognition rate.
In the table above, the error rate was calculated by the formula(34)re=le2L,where re is the error rate, le is the wrong number of steps, and L is the total steps walked, and the number of actual walked steps was equal to the number of test steps.
Validation of height estimation algorithm. The subject started from the sixth floor staircase, climbed to the ninth floor, and then walked a distance in the corridor. The actual floor height was 3.5 m, and with three stories, this resulted to 10.5 m in total. We carried out three experiments: Experiment 1, without using our method and only applying SINS; Experiment 2, using the linear gait discrimination method; and Experiment 3, using the IMU and barometric pressure fusion to solve the 3D pedestrian trajectory. All the starting points were 0, 0, and 0.
The sampling frequency of the barometer was 0.01 s, and the formula for calculating the height of the barometer was as follows:(35)H=44,330∗1−pp00.19026,where H is the current height value of the calculation, p is the barometric value at a specific moment, and p0 is the initial barometric value. Then the IMU and barometer results were calculated by the fusion method [23]. The measured height of the barometer was 10.74 m.
The result of Experiment 1 was shown in Figure10, and the results of Experiments 2 and 3 were given in Figures 11 and 12, respectively. To better show the different performances of these methods, a detailed comparison result was given in Table 3. It could be clearly seen that the error in Experiment 1 was large, up to 3.5 m, and the proposed method also behaved a bit better than the IMU/barometer fusion method with the error of 0.14 m only.
The above three experiments were carried out 30 times in each group, and the errors of Experiment 2 and Experiment 3 were within 0.3 m per 10 m. However, in an environment such as in a fire rescue, the barometer will fail, and therefore, the combination of the barometer and IMU is used to increase the computational complexity. The improved method using only the IMU not only overcame the redundancy of multisensor fusion but also completed the 3D trajectory reconstruction.Figure 9
Experimental environment in Case 2.Table 2
Comparison of gait discriminant results among different pedestrians with actual walking posture.
Person
Case
Up 1 step
Up 2 steps
Down 1 step
Down 2 steps
Flat ground
Error rate (%)
Person 1 (male)
Actual
15
78
21
52
210
1.33
Test
14
80
20
55
207
Person 2 (male)
Actual
9
89
14
45
323
0.625
Test
10
87
15
47
321
Person 3 (female)
Actual
15
58
19
103
403
0.84
Test
14
61
18
105
400
Person 4 (female)
Actual
14
59
17
89
201
1.32
Test
13
57
20
87
203
Person 5 (male)
Actual
8
78
17
105
326
1.12
Test
9
81
15
101
328Figure 10
Using only SINS 3D indoor positioning results.Figure 11
3D positioning results of the proposed linear gait discriminant method.Figure 12
Results of data fusion using the IMU and barometer.Table 3
Comparison of the three groups of experiments.
Experiment
Actual height (m)
Test height (m)
Error (m)
Exp 1
10.5
13.5
3.5
Exp 2
10.5
10.34
0.14
Exp 3
10.5
10.74
0.24


## 7. Conclusions

The foot-mounted IMU-based pedestrian indoor navigation is useful for various indoor applications, such as finding and rescuing firefighters or other emergency first responders. This paper presented an optimal gait recognition algorithm to obtain more accurate gait detection results. Then the Kalman filter was combined with the zero-velocity update algorithm to accurately recognize gait using our proposed moving direction learning method. The proposed method was evaluated with walking experiments, and comparisons of results illustrated the effectiveness of the proposed algorithm. The error in the horizontal direction was less than 0.08 m per 10 m, and the error in the vertical direction was less than 0.14 m per 10 m. In future work, we will study more complicated movement cases, such as jumping and walking backwards, as well as movement via elevators.



---

*Source: 8735846-2018-08-12.xml*