A Novel Map-Based Dead-Reckoning Algorithm for Indoor Localization

Step counting-based dead-reckoning has been widely accepted as a cheap and effective solution for indoor pedestrian tracking using a hand-held device equipped with motion sensors. To compensate for the accumulating error in a dead-reckoning tracking system, extra techniques are always fused together to form a hybrid system. In this paper, we first propose a map matching (MM) enhanced particle filter (PF) as a robust localization solution, in which MM utilizes the corridor information to calibrate the step direction estimation and PF is applied to filter out impossible locations. To overcome the dependency on manually input corridor information in the MM algorithm, as well as the computational complexity in combining two such algorithms, an improved PF is proposed. By better modelling of the location error, the improved PF calibrates the location estimation, as well as step direction estimation when the map information is available, while keeping the computational complexity the same as the original PF. Experimental results show that in a quite dense map constraint environment with corridors, the proposed methods have similar accuracy, but outperform the original PF in terms of accuracy. When only partial map constraints are applied to simulate a new testbed, the improved PF obtains the most robust and accurate results. Therefore, the improved PF is the recommended DR solution, which is adaptive to various indoor environments. OPEN ACCESS J. Sens. Actuator Netw. 2014, 3 45


Introduction
Location awareness is the basic requirement for developing new exciting location-based services (LBS).Compared to common applications supported by outdoor positioning techniques, like the Global Position System (GPS), it is extremely challenging to provide similar ubiquitous and affordable services in indoor environments.Unlike GPS, providing almost full coverage for the whole Earth's surface, indoor localization provides a solution in a quite smaller scale.The cellular base station-based indoor localization technique [1] provides almost the largest coverage among indoor localization techniques, which sacrifices the accuracy of the solution.To provide a more reliable solution, additional indoor infrastructure deployment is always necessary.Because of the great complexity of the indoor environments, the applied techniques can be quite different.
The most favored indoor technology has been WiFi access points, which is because of their comparable large coverage, and yet, they provide a satisfying solution in certain circumstances [2].If higher accuracy is demanded, researchers have preferred technologies, like ultrasound and Bluetooth [3,4].One of the drawbacks is that they have smaller coverage, and scaling up will incur a high deployment cost.Besides, they are not as common as WiFi in indoor environments.
The infrastructure-based techniques can be categorized into two types, namely training algorithms and non-training algorithms.The training algorithms work based on the assumption that the received signals are different in various locations.The first step is to collect the signal patterns in different ground truths.The signals undergo off-line processing to obtain a reference database.A received real-time signal on the receiver is then compared with those in the database, and the best match location is returned.Non-training techniques always rely on distance estimation.In a dense deployment scenario, a multilateration technique can be applied.Given the same deployment, the training algorithms always return more accurate results compared to the non-training algorithms.However, the training algorithms are vulnerable to environment changes, and the training is labor intensive.
To decrease the cost of deployment, dead-reckoning (DR) techniques relying on inertial measurement unit (IMU) sensors have been proposed [5,6], which have always been applied in GPS systems to improve the robustness of the results.An IMU sensor is able to track its movement by the equipped accelerometers, gyroscopes and magnetometers.The DR method derives the current location by adding the estimated displacement to the previous estimated location.Suppose no external information except the initial location is known; the performance of DR totally relies on the measurement accuracy of the sensors.It is intuitive to find that the DR methods suffer from accumulating errors in the measurements.
Although additional indoor infrastructure is still necessary in order to provide the initial location estimate and performs as the calibration reference, the DR method reduces the demand on the density of the deployment.The DR method provides quite accurate displacement estimation within a short path.The placement of the sensor results in different strategies to calculate the displacement.An intuitive computation method is to double integrate the accelerations in the global coordinate.The fast increasing error is compensated for by a method called zero velocity update (ZUPT) [7][8][9][10].The fact that a foot on the ground has zero speed is quite useful.However, unless it is in a controlled scenario, wearing the sensor on the foot is quite inconvenient.
The recent development of motion sensors in smart phones has made the DR algorithm for general pedestrians possible.Considering the tremendous demand from pedestrians, it is worth providing a localization solution in the scenarios when a smart phone is used.
Step counting is a well-known algorithm to estimate the displacement when the sensors are not placed on the foot.From the readings of acceleration, it is able to tell if a pedestrian has walked a step.The step displacement is estimated after each step, which is then added to the previous location estimate.That is why it is called step counting.A step counting algorithm is constituted by step detection, step length estimation and step direction estimation.
Step length estimation generally returns satisfactory results, and it can be further improved by a simple training process.
Step direction estimation is the most challenging component, as it is sensitive to error in the sensor's orientation estimation.In order to accurately determine the sensor's orientation, the known direction of the Earth's gravity and the magnetic field are required.Let the global coordinate be east-north-up (E-N-U), which coincides with the sensor's x-y-z coordinate, initially.The rotation of the sensor is decomposed as rotations about its axes at the sequence of its z-y-x axis by angle ψ-θ-ϕ, respectively.The direction of the Earth's gravity determines θ and ϕ, which can resolve the vertical and horizontal components of acceleration, given that θ and ϕ, ψ can be resolved from the known magnetic field.The quasi-uniqueness of gravity provides a robust solution for θ and ϕ, which, in turn, facilitates reliable step detection and step length estimation.However, the studies in [11,12] have indicated that there are considerable random disturbances of the magnetic field in an indoor environment, which makes the estimation of ψ unreliable, and hence, the estimation of step direction is affected.Although the orientation can be solved by angular rate integration, the error accumulates if the direction of the magnetic field is not used for calibration.
In this paper, we focus on dealing with the error in direction estimation, which is helped by incorporating the indoor map information.In this paper, we first propose a new step counting algorithm with the map matching (MM) method.It is based on the observation that the pedestrian tends to walk along a quasi-straight line when he is in a corridor.Once this walk pattern is detected and there is a nearby corridor, the estimated location is mapped to the corridor, and the step direction and the sensor's orientation is calibrated by the known corridor's direction.The drawback of the MM algorithm is that the required narrow corridors are not always available in an indoor environment.To compensate for such a drawback, we also propose a hybrid solution.The map matching algorithm is applied as a supplementary algorithm of the particle filter (PF), which is called the MM-enabled PF, to form a more robust solution.In the end, we propose an improved PF, which simulates the uncertainty in the step direction estimation.The particles with the wrong location estimation are more likely to be the ones with the wrong direction estimation, which would be eliminated by map constraints.The improved PF returns a more robust result, with less computational complexity compared to the MM-enabled PF.
The sensor we use is ADIS16405BMLZ [13], containing a three-axis accelerometer, a three-axis gyroscope and a three-axis magnetometer.To simulate the usage of a smart phone, the sensor is put in a trouser pocket, as shown in Figure 1 for data collection during walking, as many people carry their phones in their trouser pockets [14].In order to perform the experimental study, our laboratory was chosen as the indoor tracking testbed.The layout is shown in Figure 2. The size of the testbed is about 22 m by 18 m.The coordinate system and the coordinates for some locations are also indicated.The map contains obstacles, walls and accessible areas.There are three corridors available in total in this map for the MM algorithm.Later, the map will be represented as simple lines and rectangles.The rest of the paper is organized as follows.Section 2 describes the related works regarding step counting-based DR algorithms.In Section 3, the major components for the step counting algorithm are reviewed, which is also the basis of our proposed approach.In Section 4, the particle filtering algorithm and our proposed map matching algorithm are illustrated, as well as the hybrid method.An improved PF is proposed in Section 5 for robust performance without the requirement of corridor information.Experimental studies are given in Section 6 for performance comparison.Finally, we conclude in Section 7.

Related Work
DR algorithms have been widely applied in indoor localization, as in [5,9,15,16], etc. Considering the in-pocket tracking scenario, the step counting algorithm [17][18][19][20] is the preferred DR algorithm.The step counting algorithm is made up of step detection, step length estimation and step direction estimation.A step is detected by a pair of a peak and a valley of the one-axis accelerations in the global coordinate meeting some requirements.A claimed to be more robust way is to look at the peaks and valleys of the modulus of the three-axis accelerations [21].
Step length is related to the vertical component and the modulus of the horizontal component in the global coordinate.Step direction is determined by the horizontal component of acceleration in the global coordinate if we only consider two-dimensional (2D) movement.
The motion sensor we use comprises a three-axis accelerometer, a three-axis gyroscope and a three-axis magnetometer.If the initial orientation is known, the subsequent orientation is updated by the angular rate returned by the gyroscope.The Earth's magnetic field and gravity can be used to obtain the initial orientation and to compensate for the accumulating errors of orientation from the gyroscope.In an ideal environment with identical magnetic field and gravity, the sensor's orientation could be accurately determined.
It is obvious that the fundamental requirement is to compute the sensor's orientation accurately, so that the acceleration in the sensor coordinate can be accurately resolved to the global coordinate.However, because of severe magnetic interference in an indoor environment, that is not an easy task.Several attempts have been made to eliminate the effect of magnetic disturbance, like the work in [22][23][24].However, the algorithms work under the assumption that the disturbance comes from a single source, and the evaluation is taken in controlled environments.The sources of indoor magnetic disturbance are much more complex than that.
To improve the DR tracking results, map information has been widely used, as the map information is available to landowners.Map filtering is applied to eliminate impossible particles, like walking through a wall or an obstacle, which is quite effective in an indoor environment with lots of walls and obstacles.References [25][26][27] are examples of applying PF-based map filtering in indoor tracking.The uncertainty in location estimation is represented as particles with different locations.While the locations of the particles are updated by the step measurement, particles with an inaccessible path are eliminated and new particles are generated.Improvement has been made in [10] by a so-called backtracking particle filter (BPF).BPF takes advantage of long-range geometrical constraint information that the estimated path is always backtracked, so that the particles proven to be unsuitable are eliminated in previous steps.In this way, the localization results of the previous steps are improved.
The existing algorithms only use map information to distinguish accessible and inaccessible areas.More improvement can be achieved by applying MM.MM has been applied for outdoor environments in road tracking [28,29].In our previous work [30], the tracked path is mapped to a nearby known corridor if certain requirements are met.Through map matching, the sensor's location, orientation, as well as the pedestrian's walking direction can be rectified.The improvement in the sensor's orientation and step direction estimation reduces the error in future tracking.The drawback of a pure map matching algorithm is that it does not make full use of the map constraints, but only the corridors.In this paper, we apply map matching as a supplementary algorithm to the original PF method, which gives more robust results.Another contribution of this paper is the improvement of the original PF.In the literature, the error in step counting localization is simply defined as additive arbitrary Gaussian noise in location estimation, which does not simulate the error well.The error should be decomposed as error in step length estimation and another in step direction estimation, which have different attitudes.By defining a more accurate system model, our particle filter performs better than previous ones given the same map constraint information.

Step Counting Dead-Reckoning
Before proceeding to describe our proposed method, we briefly describe the original step counting DR technique.A step counting method derives the current location by adding the estimated step displacement to the previous location, which can be expressed by: (1) where x n is the location at the nth step and s n and d n are the length and 2D direction of the nth step, respectively.If s n and d n can be accurately resolved from the sensor's measurement, it is intuitive to conclude that a reliable solution is proposed.
In order to resolve s n and d n , the premise is that the sensor's orientation is accurately determined and a step is correctly detected.In this section, we briefly describe the methods applied in solving each of the components.Further improvement in Section 4 is based on this.

Sensor's Orientation Determination and Step Detection
Given a known magnetic field and measurements from the accelerometer and magnetometer, [31] has proposed a simplified quaternion-based orientation estimation algorithm.In this paper, it is applied to get the sensor's initial orientation.The authors of [32] have proposed a novel quaternion Kalman filtering algorithm for recursive orientation estimation.The angular rate is used to build the system update equation, and both the measured acceleration and magnetic field can be applied to form the measurement update equation.To reduce computational complexity, the proposed system state o = [q u] is reduced to o = q, where q is the attitude quaternion and u is the estimated drift in three directions.
In this paper, q is defined by Equation (2), where e and q 0 are the vector and scalar parts, respectively.The rotation of the sensor is decomposed as rotations about its axes at the sequence of its z-y-x axis.
Because the indoor magnetic field is unstable, only the direction of the Earth's gravity is used to calibrate the orientation estimation.
A step is detected by the pattern of the acceleration.It is concluded from the observation that a step is detected by a successive peak and valley.Although each component of three-axis acceleration can provide step detection results, it is argued in [21] that by analyzing the pattern of the modulus of acceleration, the algorithm provides more robust results.In this paper, we apply this idea.

Step Length Estimation and Step Direction Estimation
Different step length estimation algorithms have been compared in [8,17].We use the equation shown in Equation ( 3): Principal component analysis (PCA)-based step axis estimation is favored because of its robustness.We use an improved PCA-based algorithm to estimate the direction, as described in [33].It is worth noting that the best performance of step direction estimation is restricted by the sensor's orientation estimation.Erroneous orientation estimation eventually results in error in direction estimation, regardless of the applied direction estimation method.We only consider 2D movement.
An example of the performance of the pure step-counting algorithm is given in Figure 3.A pedestrian is asked to walk along the black line when the sensor is carried in the pocket.The path starts from the lower left corner and finally returns to the starting point.The whole path is around 90 m.The connected red dots denote the estimated positions after each step computed by the pure step counting algorithm.It can be found that the step length estimation is quite accurate.The localization error mainly comes from the error in step direction estimation.[ ]

Particle Filter and Map Matching
It is useful to incorporate indoor map information to improve the location results.Previous works have applied indoor map information in map filtering techniques, which eliminates location estimates in impossible areas.However, the accumulating error of the step direction will still eventually lead to large uncertainty in the location estimate.Map matching will relieve this problem.

Particle Filter
The particle filter is normally implemented to apply the map filtering technique.The PF implements a recursive Bayesian filter using the Sequential Monte-Carlo method.It is particularly useful in solving non-linear and non-Gaussian problems.A set of random samples with weights, called particles, are used to represent the posterior probability density of the state, which is given by: (4) where x n and z 1:n are the state and measurement, respectively, { i n x , i = 1,…, N s } is a set of supporting particles at time n with the associated weights { i n ω , i = 1,…, N s }.N s are set to 100 in our algorithm.
The weight update equation is given by Equation ( 5), where is the importance density. ( In the step counting algorithm, the system update and measurement update are executed after each step.During the system update phase, (6) where i n x and 1 i n x − are the 2D states after n steps and n − 1 steps, respectively, and s n and d n are step-n's length and direction, respectively.i n n is a random variable with Gaussian distribution.A rule for pedestrian walking is that a pedestrian cannot walk through walls or obstacles.Particles with this motion are seen as invalid, so the weight is updated according to the following equation: (7)

Map Matching
Step direction estimation error results in large localization errors.To reduce the direction estimation error, we propose a map matching algorithm to calibrate the estimate when the user is walking in a corridor.
A corridor has two possible directions.Suppose one direction of the corridor is d c ; if the following conditions are met, the user is seen as walking along the corridor.Condition-1: Suppose six consecutive steps are with directions {d n − j , j = 0, 1,…5}, the variance{d n − j , j = 0, 1,…5} < threshold_1.where dot(.)means the dot product.
Condition-1 ensures that the pedestrian walks straight, which is the typical pattern when people walk in a corridor.Condition-2 ensures that the track of the pedestrian is close to the corridor.Condition-3 is based on the fact that the error in direction estimation is with a limited angle.These three conditions ensure that the person is walking along a corridor, and even in the worst case that he or she is not, the resulting error is limited by the conditions.After that, the direction with 180° ambiguity is chosen by Equation ( 8), as the error in direction estimation will not exceed 90°.(8) Large errors in direction estimation occur when the pedestrian is making a turn.Therefore, the estimates from the last turn to the current step need to be calibrated (based on at most the previous 20 steps), if the projections of their locations to a corridor (represented as c) are within the corridor ends.Suppose the estimation of the previous N t steps need to be calibrated, the projection of location In 2D space, a counter clockwise rotation of a vector through angle ψ along the x-axis is represented using the rotation matrix cos( ) sin( ) sin( ) cos( ) , and the rectified directions { ' n j d − , j = 0, 1,… N t − 1} are solved using: The locations are then calibrated by Equation (10) using the rectified direction estimate. , The sensor's orientation estimate, q, is also calibrated.The counter clockwise rotation with angle ψ in 2D space is rotating along the z-axis for ψ in 3D space.(11) Unlike PF being executed at every step, the MM algorithm is triggered only when a pedestrian is considered to be walking along a certain corridor.Our simulation shows that to return the tracking results for the same route, MM based on the step counting algorithm takes 1/6 the CPU time compared to the one using the PF (100 particles).
A performance comparison of the pure step counting and the one with MM is shown in Figure 4.There are narrow corridors in the map.At the beginning, MM is not triggered, so both algorithms achieve the same results.After 43 steps, the conditions of MM algorithm are met, and it is triggered.Turning step 34 is found, whose location is then projected to the corridor, as the one stated in red text.The directions from step 34 to 43 are rectified, and the positions are recalculated.Since the sensor's orientation estimation is also rectified, so the direction estimation after step 43 is also improved.

Particle Filter + Map Matching
Although the MM algorithm provides reliable results with less CPU cost, the required narrow corridors may not always exist in an indoor environment.In addition, it does not require full use of the map information.Moreover, the administrator needs to manually state the coordinates and directions of the selected corridors.Therefore, it is better to perform the MM as a supplementary algorithm to other techniques, rather than as a primary technique.
In this paper, we apply an MM-on PF-based step counting algorithm, which is called MM-enabled PF.Suppose the location of a turning step is The particles for the subsequent steps are updated by Equation ( 12) using the rectified direction estimation.The weight update rule remains the same.
, j = 0, 1,…N t − 1 (12) A performance comparison between the original PF and the MM-enabled PF is shown in Figure 5.In the segment v in Figure 5a, there is clear drift for the PF algorithm, because of the error in step direction estimation.A more detailed explanation of the process is shown in Figure 5b, which ' 1 represents the particles at different steps as dots with different colors.The particles for PF are sparsely distributed, so that there are always particles in the actual location.Although erroneous particles are filtered during walking, there is a trend that the particles drift to the right-hand side.For the PF + MM algorithm, the MM is triggered in step 43, and the particles are recalculated from step 34.The particles at step 34 for the PF + MM algorithm before the execution of the MM algorithm are also represented (step 34-P)).Once the MM algorithm is triggered, all the particles of step 34-P are regenerated in the corridor.The particles at the subsequent steps are recalculated using the rectified direction estimation, as shown in Figure 5b.

Improved Particle Filter
In this section, we propose an improved particle filter that models the localization error better than the original one and, thus, returns more accurate results.From the previous discussion, it is known that the step direction estimation always suffers from the error in the sensor's orientation estimation.Because of the uniqueness of the Earth's gravity, reliable vertical and horizontal components of acceleration are decomposed, which turns out to be accurate step length estimation using Equation (3).Therefore, the position update equation for PF can be written as: (13) where n i s,n and n i d,n represent the noise in length and direction estimation, respectively.b i d,n is to compensate the direction estimation drift for particle i in step n, which will be explained later.
To further explain the algorithm, the performance of the pure step counting algorithm shown in Figure 3 needs to be examined.It shows that when a pedestrian walks along a straight line, the pure step counting algorithm provides quite consistent direction estimation, which can be seen as a line.Additionally, there is clear direction drift during the turn.
Because of the robustness of the length estimation and direction estimation during line-mode walk, n i s,n and n i d,n are set as Gaussian variables with small variance.Suppose, initially, the direction estimation is accurate, so that b i d,1 = 0. b i d,n is updated as follows: (14) where N(0,var) is a Gaussian variable with larger variance.The particle weight is updated also using Equation (7).
For the original PF, the estimated direction always equals d n .Although impossible paths can be eliminated by the accessibility constraints, the error in direction estimation accumulates.In the end, the model in Equation ( 6) becomes unsuitable for describing the walk process.The advantage of the improved PF is that it incorporates the uncertainty in direction estimation, which is represented as b i d,n and n i d,n .The choice of its value is further refined by the pattern that large uncertainty occurs during turning.In this way, this model describes the pedestrian walk better than the previous one.Impossible paths, as well as erroneous directions can be eliminated in this algorithm.
A performance comparison between the previous original PF and our improved PF is shown in Figure 6.There is not much difference in performance when the pedestrian is walking along the corridors.However, in segment v, the original PF shows a clear drifted path, as shown in Figure 6a.This drift comes from the error in direction estimation.Our improved PF, on the other hand, fits the true route quite well, as the drift is compensated for in the model.The particles with erroneous drift estimates are eliminated, as they pass the walls or obstacles.Detailed observation in segment v can be found in Figure 6b, where the particles are drawn.The particles are drawn every three steps, so that the particles from different steps would be easy to distinguish.The particles from different steps are represented using different colors.A clear drift trend can be found for the particles from the original PF algorithm compared to our improved one.It does not learn from the previous filtering results.The improved PF, on the other hand, always eliminates the erroneous b i d,n estimation in the direction , ,

Evaluation
Two routes are chosen for the experiment.For each route, 10 trials of data are collected when a pedestrian walks along each route with a motion sensor.Whenever a certain point in the walking path is being passed, the timestamp of the passing is saved.There are 31 pieces of ground truth with timestamps for each route, 1 and 2.

Performance on Full Map Information
Figure 7 shows an example of the tracking results when different algorithms are applied for routes 1 and 2. In both routes, the start and end points are kept the same; the difference is that the direction in route 1 is counter clockwise, while the one in route 2 is clockwise.The indoor map constraints are kept the same as in the previous example.It is shown that the fused PF and MM algorithms do improve the performance of the direct step counting algorithm.If we compare the paths obtained by the original PF and MM schemes, it can be found that the one from MM coincides better with the ground truth, especially in the area right after the MM gets executed.That is because the PF only rectifies the current location; the error in the sensor's orientation estimation and the step direction estimation remains in future calculations.The MM algorithm, in contrast, calibrates the location, as well as the sensor's orientation and step direction.The error in the location update equation (Equation ( 1)) is reduced.Our improved PF overcomes the drawback by modelling the error in direction estimation.
Let the localization error be the distance between ground truth and estimated location.The average tracking errors for the 10 trials for each route are shown in Tables 1 and 2, respectively.The last column shows the average error for the 10 trials.MM returns more accurate results than PF in the 17 trials of the total 20 trials.In the rest of the three trials, the performances are quite close (0.68/0.69, 0.94/1.09and 1.00/1.01).Therefore, MM outperforms PF in the given map environment.A similar conclusion can be made when we compare the accuracy of MM-enabled PF with PF and the accuracy of our improved PF with PF.PF provides the least accuracy among the three, which is only better than pure step counting without map constraints.When we compare the average error from MM, MM-enhanced PF and improved PF, we see quite close location accuracy.It is interesting to find that the MM-enabled PF does not further improve the performance.That is because there are many corridors in our map for MM to take effect, and the paths are along the corridors.MM alone is sufficient to obtain good results.
MM is triggered only when the pedestrian is in the corridor, which wastes the other map constraints' information.MM-enabled PF is quite a natural method to retain the advantages of both algorithms.Our improved PF takes advantage of PF and improves direction estimation at the same time.In the next section, when less corridor information is given, we will see the improvement of such algorithms.

Performance on Incomplete Map Information
Previous evaluation has been carried out in an ideal corridor environment, like our lab.It is necessary to test the performance in another scenario.In this paper, the new scenario is virtually created by giving incomplete map information to the algorithms.From the algorithms' perspective, it makes no difference compared to collecting the data in a physical new environment and using relative map constraints.Figure 8 shows the incomplete map we use to evaluate the performance for the same routes in Section 6.1.Map 1 keeps the map constraints in the top left corner, with one wall of a horizontal corridor.Map 2 keeps the map constraints in the bottom right corner, with the conference room.The average accuracy for each of the trials with respect to the route and map are presented in Tables 3-6.Table 7 shows the average error for map 1 and map 2 and the overall average.We first notice that PF no longer provides better results than the pure step counting algorithm.This is because in the settings with few map constraints, the particles are widely spread out without calibration.The tracking may have been misled to a drifted path if the pedestrian encounters an obstacle in that case.
There is slight enhancement for MM and MM-enhanced PF, compared to step counting.Although from the average value, MM-enhanced PF performs worse than MM (1.31 m to 1.26 m), we find that MM-enhanced PF actually provides more robust results.When MM returns large error in trial 5 in Table 3 (2.17m), trial 7 in Table 4 (2.01 m) and trial 1 in Table 6 (2.32 m), MM-enhanced PF dramatically reduces the error (0.86, 0.83 and 1.80, respectively).The proposed improved PF achieves the most accurate result among all the algorithms with the same computational complexity as the original PF.Considering there is no additional requirement on the manually provided corridor information, improved PF is the most robust solution in various map scenarios.

Conclusion
In this paper, a step counting algorithm with MM-enabled PF, as well as one with improved PF is introduced.Compared to existing works that apply PF to eliminate the particles with impossible locations, our algorithm calibrates not only the location, but also the sensor's orientation and step direction, which reduces the error in the location update computation.To further improve the algorithm by avoiding specified corridor information, an improved PF is proposed, which calibrates the step direction estimation during map filtering.The algorithm has been evaluated experimentally in our laboratory using an in-pocket motion sensor.Experimental results have shown that in a dense map constraint environment with corridors, MM, MM-enabled PF and improved PF outperform the original PF.When partial map constraints are applied, the advantage of using the improved PF is shown, which returns more accurate and robust results.Furthermore, considering that the improved PF does not require the user to specify the corridor information, it is the most adaptive algorithm for various indoor environments.

Figure 1 .
Figure 1.The sensor we used and the setting for data collection.

Figure 2 .
Figure 2. Experimental testbed with walls and obstacles.
a string of a projected acceleration vector in global coordinate in step n and max r v n a − and min r v n a − are the maximum and minimum values of its vertical components, respectively.K is a constant determined by training.

Figure 3 .
Figure 3.An example of localization results by pure step counting.

Condition- 2 :
Suppose the corridor is represented as line segment, c; the distances from the locations of the six steps to c are {L n − j , j = 0, 1,…5}, respectively, (d avg , d c )|| < threshold_3,

Figure 4 .
Figure 4. Performance comparison of pure step counting and the one with map matching.
its projection to the corridor (represented as c)is , t c n Nx − ; then, the particles of step n-N t (
the correct ones.Compared to the MM algorithm, the improved PF rectifies the direction estimation without specifically defining the corridors.Its CPU cost is the same as the original PF, which is less than the MM-enabled PF algorithm.

Figure 6 .
Figure 6.Performance comparison of PF and the improved PF.

Figure 7 .
Figure 7.An example of the tracked results for route 1 and 2 given different algorithms.

Figure 8 .
Figure 8.The incomplete map used.

Table 7 .
Average error for each map and overall.