Keywords

1 Introduction

In the last decades, both military and civil have seen increasing need for efficient and accurate location-based service. Location-based service, as its name indicates, controls features and provides functions regarding location data of the users. Thus, the basis of location-based service is to provide a location estimate of the user according to the measurements of devices distributed in the environment taken by the user’s device, which requires mapping measurements into exact locations.

In order to provide massive location-based service in large-scale indoor scenario both efficiently and economically, the idea of using a smartphone to run SLAM algorithm while the user carries it and walk around the indoor [1,2,3] space comes out and draws researchers’ immediate attention. But the inaccurate nature of smartphone sensors will lead to an undesirable uncertainty of both the location estimates and landmark estimates.

1.1 Related Work

Previous work has addressed this accuracy issue of smartphone SLAM in different levels. SmartSLAM [3] used path-smoothing model and building orientation model to supervise the heading orientation of the user in order to smooth the noisy path estimate; simultaneously localization and configuring [1] used fixed step length model and EKF to overcome the unreliability of motion measurements. However, fixed step length is still not optimal. Some researches also focused on elimination of Gaussian noise in a RSSI-based localization scenario [4].

This paper presents WalkSLAM, a SLAM solution runs on smartphones. WalkSLAM contributes previous work by adding human walking pattern elements into the SLAM algorithm, both on prior stage and posterior stage. The evaluation on live data shows a noticeable improvement on the path estimation and landmark estimation.

The rest of the paper is organized as follows: In Sect. 2, the problem statement and the model are discussed. In Sect. 3, we introduce a new SLAM algorithm named WalkSLAM. The implantation of WalkSLAM and some refining maneuvers are introduced shortly after. In evaluation section, live data is analyzed and the average errors of both path estimation and landmark estimation are discussed separately with a comparison between WalkSLAM solution and common FastSLAM solution.

2 Problem Definition and Modeling

The original aim of the research is to map an indoor environment using a smartphone without any prior information from the environment. The smartphone is capable of motion sensing and RSSI observing, and in a common SLAM system, the motion sensing ability guarantees the control info of a robot, where location estimation can be extracted, and the RSSI observing achieved by Wi-fi module inside the smartphone can obtain observation of the accessing points working as the landmarks. After this thought, a hidden Markov model [5,6,7] can be applied to our scenario.

Figure 1 represents a hidden Markov model. The poses make the core Markov chain, and in our situation, they are the locations on the path during the navigation; the state transition means a step of the user is taken. Because we do not know the actual coordinate of the locations, they become the hidden states.

Fig. 1.
figure 1

Hidden Markov model in SLAM problems

Now, we can effectively describe our problem as a SLAM problem. The poses are the user’s location, and the current pose will be denoted \( s_{t} \). Poses evolve according to the motion model [7]:

$$ s_{t} \sim p(s_{t} |u_{t} ,s_{t - 1} ) $$
(1)

Among which \( s_{t} \) is the current pose, \( s_{t - 1} \) the previous, and \( u_{t} \) the current control. The control consists of motion measurements from the device, which in our case is the smartphone. After initializing each pose, to map the surroundings, the device senses landmarks using sensors. Sensor observations follow the measurement model:

$$ z_{t} \sim p(z_{t} |s_{t} ,\theta ) $$
(2)

where \( \theta \) is a set consisting of all the landmarks. Now, the SLAM problem can be formulated. SLAM problem is to make a refined estimation of all landmarks \( \theta \) and all poses \( s^{t} = \left\{ {s_{0} ,s_{1} ,s_{2} , \ldots } \right\} \) along the user’s path from the controls and observations, which can be described as \( p(s^{t} ,\theta |z^{t} ,u^{t} ) \). The controls, as stated above, are the motion measurements from motion sensors on the phone, which indicates a step’s heading and orientation. After an initialization of the starting pose, given previous and current control, an estimate of the current state can be calculated. However, the motion sensors are alarmingly inaccurate; thus, in further discussion, we decide to add some prior information into the controls for better performance.

3 WalkSLAM

3.1 Particle Path Sampling

With the control and the observation of our SLAM system defined, we can present our SLAM problem solution in the following steps with implantation details. As shown in Fig. 2, the algorithm begins with the path particle sampling after the input of motion measurements \( u_{t} \) from motion sensors. Due to the nature of human walking pattern, we do not sample the pose \( s_{t} \) directly but rather estimate the transition from \( s_{t - 1} \) to \( s_{t} \) which is denoted \( \overrightarrow {{(s_{t} - s_{t - 1} )}} \).

Fig. 2.
figure 2

SLAM algorithm loop. Notice that the dotted line connecting RSSI observation with weight updating step means the observation takes part in the weight’s calculation

The transition can be described as a combination of the fixed step length and the heading. For the filtering of the heading direction, instead of the path-smoothing method, we present a new filtering model:

$$ \omega_{t} = \left\{ {\begin{array}{*{20}l} {\omega_{t - 1} ,} \hfill & {\left| {\omega_{t - 1} - \omega_{t} } \right| > \varepsilon_{\omega } } \hfill \\ {\omega_{t} ,} \hfill & {\left| {\omega_{t - 1} - \omega_{t} } \right| \le \varepsilon_{\omega } } \hfill \\ \end{array} } \right. $$
(3)

The rationale behind this model is that first the motion sensor is pretty noisy and unreliable according to previous reports [1, 8], and because of that, in some degree we can safely ignore small direction changes without worrying too much about losing the details of heading since Monte Carlo method involved in the sampling phase can guarantee the coverage of most minor direction changes.

After the path sampling, we get a set of path particles, and according to our design, the next step should be landmark estimation, where we initialize and update the landmarks’ locations using the observations. However, since our observation is the 1D RSSI measurements, a single observation is not enough to initialize a landmark’s location. Thankfully this problem can be solved using the range-only localization model presented in [9], and the major requirement of this method is several consecutive poses and relative observations.

The updating of landmarks is guided by the observations, so we need a filter to refine the landmark location, in this situation a 2D coordinate, with 1D RSSI as the observations. An extended Kalman filter can be applied to this situation, using the method mentioned in [1].

3.2 Importance Weight Updating

In robotic SLAM systems, the only indicator of the reliability of a particle is how the observation matches up the landmark estimations, and it is called importance weight factor:

$$ w_{t}^{[m]} = \frac{\text{target distribution}}{\text{proposal distribution}} = \frac{{p\left( {s^{t,[m]} |z^{t} ,u^{t} } \right)}}{{p\left( {s^{t,[m]} |z^{t - 1} ,u^{t} } \right)}} $$
(4)

However, in our WalkSLAM scenario, another factor should be taken into consideration to evaluate the degree of the particle path fitting human walking pattern [10], specifically the walk ratio indicator [11]. For convenience, we call the original importance weight factor observation factor (OF), and the walk ratio indicator walk factor (WF). Then, the new weight becomes:

$$ w_{t}^{[m]} = {\text{OF}} \cdot {\text{WF}} $$
(5)

As the matter of implantation, for the calculation of OF, we can use the conclusion from [7]:

$$ {\text{OF}} = \frac{{p\left( {s^{t,[m]} |z^{t} ,u^{t} } \right)}}{{p\left( {s^{t,[m]} |z^{t - 1} ,u^{t} } \right)}}\mathop \approx \limits^{\text{EKF}} \sum\limits_{k} {p\left( {z_{t} |\theta_{k}^{[m]} ,s_{t}^{[m]} } \right)p\left( {\theta_{k}^{[m]} } \right)} $$
(6)

Since we are always sure about the identity of each RSSI scan result, the equation can be simplified to:

$$ {\text{OF}}^{[m]} = \sum\limits_{k} {p\left( {z_{t} |\theta_{k}^{[m]} ,s_{t}^{[m]} } \right)} $$
(7)

Then, we can calculate OF using the Gaussian function:

$$ {\text{OF}}^{[m]} = \sum\limits_{k} {f\left( {z_{t} |\left\| {\theta_{k}^{[m]} - s_{t}^{[m]} } \right\|,\delta_{\omega } } \right)} $$
(8)

For the calculation of WF, since the proposal distribution is made to be a Gaussian distribution, according to the Bayesian theory we can simplify the equation as:

$$ {\text{WF}}^{[m]} \propto p\left( {d^{t,[m]} |\Delta^{t,[m]} ,\delta_{\text{WR}} } \right) $$
(9)

For implementation purpose, we first calculate the average WR of the path particle,

$$ \overline{\text{WR}} = \frac{1}{n}\sum\limits_{k = 1}^{n} {d_{k} \cdot \Delta_{k} } $$
(10)

Then, through a Gaussian function, we can get the WF of the particle as:

$$ {\text{WF}}^{[m]} = f\left( {\overline{\text{WR}} |R,\delta_{\text{WR}} } \right) $$
(11)

where \( d_{k} \) is the step length and \( \Delta_{k} \) the time that step costs. \( R \) is the average walk ratio of a healthy man, and \( \delta_{\text{WR}} \) the variance of walk ratio.

To sum up, the new weight updating model becomes:

$$ w_{t}^{[m]} = f\left( {\frac{1}{n}\sum\limits_{k = 1}^{n} {d_{k} \cdot \Delta_{k} } |R,\delta_{\text{WR}} } \right)\sum\limits_{k} {p\left( {z_{t} |\theta_{k}^{[m]} ,s_{t}^{[m]} } \right)} $$
(12)

Then, for further use, we normalize the weights:

$$ w_{t}^{[m]} = w_{t}^{[m]} \left( {\sum\limits_{k = 1}^{n} {w_{t}^{k} } } \right)^{ - 1} $$
(13)

3.3 Resampling Particles

After getting the weights of the particle set, we now resample the particle set due to the weight of each particle. To evaluate the effectiveness of a particle set using the weight factor, the effectiveness index is introduced:

$$ N_{\text{eff}}^{t} = \left( {\sum\limits_{k = 1}^{n} {w_{t}^{k} } } \right)^{ - 1} $$
(14)

As shown in Fig. 2, every time the value of \( N_{\text{eff}}^{t} \) gets low enough, the resampling step is triggered; this way we can resample only when we need to, to effectively use all the particles and lower the time consumption.

4 Implementation and Evaluation

In the test, we choose a typical indoor scenario which is a floor of office with a long corridor. The longest part of the corridor is 47.3 m at length, and the overall corridor is 3 m at width. Thirteen access points were accessible along the corridor. A live test in comparison with the ground truth is given in Figs. 3 and 4. Since our goal is to estimate both the path and the landmarks, the localization biases of them are evaluated.

Fig. 3.
figure 3

Replay of a live test

Fig. 4.
figure 4

Ground truth of the same test with a floorplan

Considering the additive nature of the pedometer bias, tests were run on different lengths to indicate the difference made by navigating different lengths and the results are given in Table 1, although due to the variance of step length the tests can only be grouped by a range of distance they cover.

Table 1. Result of three long tests and three short tests

We can still conclude from the results that for a short run of the WalkSLAM, the average localization error falls below 3.0 m, which is good enough for a room-level localization scenario. Another essential factor of the evaluation is the localization error of the landmarks. In the three long runs, 12 access points are all observable; thus, we use them to calculate the error.

To better demonstrate the overall performance when localizing the landmarks, we take each landmark estimation in each run as an individual landmark estimation and use the cumulative distribution function to bring out the result. When compared to a common FastSLAM run with an S1 model applied and one without, as shown in Fig. 5, the improvement in performance of WalkSLAM is quite noticeable.

Fig. 5.
figure 5

Comparison of landmark estimating performance between WalkSLAM and traditional FastSLAM

5 Conclusion

In this research, a simultaneous localization and mapping solution that focuses on running on smartphones was developed. Compared to traditional SLAM solutions, in this new solution, the human walking pattern was considered into the algorithm, with a new sampling model and an advanced weight updating model presented, and the implantation methods given in detail. Six live tests were run in a typical indoor environment. The result indicated that the accuracy could fit a room-level localization scenario and the landmark estimation performance of WalkSLAM is noticeably better than that of a traditional solution.