1. 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].
Figure 1.
The sensor we used and the setting for data collection.
Figure 1.
The sensor we used and the setting for data collection.
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.
Figure 2.
Experimental testbed with walls and obstacles.
Figure 2.
Experimental testbed with walls and obstacles.
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.
2. 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.
4. 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.
4.1. 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:
where
xn and
z1:n are the state and measurement, respectively, {
,
i = 1,…,
Ns} is a set of supporting particles at time
n with the associated weights {
,
i = 1,…,
Ns}.
Ns 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,
where
and
are the 2D states after
n steps and
n − 1 steps, respectively, and
sn and
dn are step-
n’s length and direction, respectively.
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:
4.2. 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 dc; if the following conditions are met, the user is seen as walking along the corridor.
Condition-1: Suppose six consecutive steps are with directions {dn − j, j = 0, 1,…5}, the variance{dn − j, j = 0, 1,…5} < threshold_1.
Condition-2: Suppose the corridor is represented as line segment,
c; the distances from the locations of the six steps to
c are {
Ln − j,
j = 0, 1,…5}, respectively,
.
Condition-3: The average direction
should meet ||
dot(
davg,
dc)|| <
threshold_3, 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°.
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 Nt steps need to be calibrated, the projection of location xn−Nt to corridor c is xc, n−Nt; then, let xn−Nt = xc, n−Nt.
In 2D space, a counter clockwise rotation of a vector through angle
ψ along the
x-axis is represented using the rotation matrix
, and the rectified directions {
,
j = 0, 1,…
Nt − 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.
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.
Figure 4.
Performance comparison of pure step counting and the one with map matching.
Figure 4.
Performance comparison of pure step counting and the one with map matching.
4.3. 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
xn−Nt and its projection to the corridor (represented as
c) is
xc, n−Nt; then, the particles of step
n−Nt (
) are regenerated with the mean
xc, n−Nt.
The particles for the subsequent steps are updated by Equation (12) using the rectified direction estimation. The weight update rule remains the same.
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 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.
Figure 5.
Performance comparison of particle filter (PF) and PF + MM (map matching).
Figure 5.
Performance comparison of particle filter (PF) and PF + MM (map matching).
5. 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:
where
n and
n represent the noise in length and direction estimation, respectively.
b 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 and
n are set as Gaussian variables with small variance. Suppose, initially, the direction estimation is accurate, so that
1 = 0.
b is updated as follows:
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
dn. 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 and
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 estimation in the direction estimation and retains 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.
Performance comparison of PF and the improved PF.
Figure 6.
Performance comparison of PF and the improved PF.