1. Introduction
The usage of smartphones for navigation, based on the global navigation satellite system (GNSS), is common in the daily life of people, especially for personal navigation. GNSS is the main technology for outdoor localization. However, heavy attenuation and reflection of the GNSS signals by building structures impede sufficient availability and accuracy in indoor-scenarios [
1]. Indoor localization poses further challenges due to more complex layouts and space constraints [
2], as well as the need for a higher accuracy [
3]. However, Indoor Navigation considering the environment constraints is useful for many different applications, for example, in the context of the Covid-19 pandemic, it can be useful to detect the room a certain person is located in, to ensure that only a maximum number of people are in the room and to track contacts to control the spread of the virus. For an accurate room detection, map information, including room sizes and locations, are necessary.
The inertial sensors of a device can be used to track a user’s position by continuously estimating the displacement from a known location. For instance, pedestrian dead reckoning (PDR) [
4,
5] is not dependent on infrastructure assistance. However, the IMU’s measurements are noisy, resulting in an accumulating positional drift over time. Therefore, it can only provide reliable position estimation for a limited time, making additional support necessary. Several approaches exist, such as a visual support approach using vision features [
6]. Other approaches use point clouds [
7,
8] from cameras, as well as light detection and range (LIDAR) sensors, that can be combined with the odometer information to correct the drift and to provide more accurate localization estimations. These features are not always available since vision sensors can’t be used at all times. However, once map information is available, map matching is among those additional supports that make the correction influences possible at any time on a respective autonomous position estimator [
9]. The information about the environment, such as in the form of floor plans and/or routing graphs, can be combined with the odometry outputs to achieve a more accurate position estimation, without the installation of any additional infrastructure.
Simple point-to-point map matching was among the first computationally efficient and simple approaches. It can be viewed as a simple search problem where location points are matched to the respective floor plans. The disadvantage is its sensitivity to how the path network is digitized [
10]. Therefore, the obtained trajectory can be matched with the help of geometry and topology information with trajectory matching methods. In [
11], the trajectory of a given user is compared to the geometry of the floor plan. Another approach, where the sequence of the users states of motion (standing, walking, turning, etc.) are compared with a map, has been developed in [
12]. The advantage of trajectory matching compared to point-to-point matching is its higher robustness and smaller errors. Its disadvantage, on the other hand, can be its high complexity and possible poor ability for real-time applications [
13].
In recent studies, map-matching algorithms based on probabilistic graphical models fit motion trajectories to a floor plan by using conditional random fields [
14,
15], hidden Markov models [
16,
17,
18,
19], a Kalman Filter [
9,
20], particle filtering (PF) [
21,
22,
23], or dynamic programming [
14] in a real-time and sequential manner. In more detail, the probabilities of each location are updated according to spatial constraints, and the state update can be done according to the last steps. Our literature review confirms the superiority of the conditional random fields methodology over other sequential map-matching methods with respect to accuracy and complexity [
24], but they usually rely on learning data and the map material needs to be prepared in a specific way [
14]. PF can generally perform a robust and real-time map matching by modeling complex sequential motion models, as well as the non-linearity of noises, without any learning of data.
PF belongs to the Monte Carlo Methods, which are groups of state estimation methods used to model highly non-linear problems with very noisy measurements [
25]. PF is able to handle highly non-linear problems, where the uncertainties are represented by several estimation samples (so-called particles) [
26]. The goal in the implementation for map matching is to approximate the probability distribution function (PDF) of a position by a large number of weighted, independent particles [
27]. Backtracking PF further consider the history of the trajectory to further improve position estimates [
28].
For this study, a real-time map-matching approach based on a backtracking particle filter was developed. This work is based on insides acquired through the same authors previous publication in the IPIN conference [
29]. The focus is on map matching using the same available data set, but with a backtracking PF instead of the bootstrap PF. The novelty of the map-matching approach developed in this paper is the possibility to use any kind of odometry information as an input. This enables its use on all kinds of devices, from robots to wearables to smartphones. This poses an advantage to other common approaches, which are only suited for specific-use cases (such as a smartphone, odometer, and wearable sensors). Further, the implemented geospatial analysis tools helped to reduce the complexity of the spatial queries and aided in the development of the modular and flexible structure of the algorithm. This enables one to easily add, modify, and exchange different spatial constraints for the particle validation, including routing-graph-based concepts, and to adjust the algorithm to different use cases. The modular structure provides flexibility for further research, development, and comparison. Additionally, the use of geospatial analysis tools permits the comparatively easy use of map information from files in the GeoJSON format. The structure of the PF algorithm was a good fit to implement the geospatial analysis tools and realise the modular structure of the map-matching algorithm.
Further, a simple correction mechanism based on so-called location fingerprinting was implemented, enabling the initialization of the start position and further corrections of positions, if further environment-dependent measurement patterns are detected. This can also include environmental signals, such as Fifth-Generation of Mobile Telecommunications Technology (5G) signals or GNSS, as introduced in [
29]. In addition to the 5G correction in [
29], here, further environmental information including, but not limited to, transition zones between floors (e.g., elevators or stairs) can be considered in combination with height information from barometer measurements. The overall high-level structure of the developed algorithm is shown in
Figure 1. The polar coordinates (angle of orientation and traveled distance) used for the position estimation can be derived from different methods, such as PDR or odometry learning approaches. In this work, the focus has been on pedestrian navigation, and, for this reason, the polar coordinates are referred to as step headings (direction of movement as angle of orientation) and step lengths (traveled distance per time as the length of each step).
3. Map Matching Based on a Backtracking Particle Filter
This section explains the implementation of the developed backtracking PF with geospatial analysis in the map-matching process. In
Figure 4, a high-level overview of the developed map-matching process is presented.
The algorithm for the map matching is shown in Algorithm 1 as pseudo code. As input, it requires the odometry data, i.e., the step heading, step length, and step height, as well as the map information (
). In line 2, the initial particles at the start position are created before the
for-loop from line 3 on iterates over all steps while performing the map-matching processes. For every step, the current floor is determined and the floor data is selected accordingly (line 4 to 6).
Algorithm 1 Map-matching algorithm with backtracking PF |
Input: Output: result - 1:
maxParticleNumber = 200 - 2:
(Start,maxParticleNumber,σH,σS) - 3:
fori in do - 4:
(Height) - 5:
- 6:
set according to the - 7:
(StepLength,StepHeading,Height,CurrentFloor,CurrentConstraints, CurrentPosition,StepScale) - 8:
(particles,Step,FloorData) - 9:
(PropagatedParticles, FloorData) - 10:
- 11:
append to - 12:
number of - 13:
(NumberOfNewParticles,PropagatedParticles, ) - 14:
return - 15:
return
|
Next, a step-object () is created (line 7), which stores the length, heading, height, current floor, the current position estimate, and the room it is located in, as well as all specific spatial constraints for this step (e.g., rooms where particles are allowed) for the current step. In line 8, the particles’ positions are then propagated based on the step length and step heading and are filtered regarding their plausibility according to the chosen filter concept. If the support through additional particle weights is active, the particles’ weights are determined according to the weighting method afterwards, otherwise all weights are set to one. The weighted mean of the particles’ position then provides the position estimate. Following the estimation of the position, the backtracking algorithm (Algorithm 2) is executed to create new particles and add them to the GeoDataFrame containing the propagated, valid particles. These are then used in the next loop of the backtracking PF algorithm. After the PF is performed on the last backtracking step, all calculated positions, as well as the standard deviation of each position estimate, is returned and saved as a comma separated values (CSV) file.
In this work, the initial particles are normally distributed around the starting position with a standard deviation of the uncertainty of the start position. The start position can be estimated from the location fingerprint, but it can also be set manually if a location fingerprint is not available. The initial heading of the user can be derived from the angle of the line fitted through the first few positions after the user starts to move in a chosen direction.
Algorithm 2 Backtracking Algorithm |
Input: Output: - 1:
(particles,NumberOfNewParticles) - 2:
forp in Samples do - 3:
while do - 4:
(p,Radius) - 5:
if BackTrackingTest() is passed then - 6:
append to - 7:
-
return
|
In the backtracking PF with geospatial analysis, the propagation of the particles is integrated in the filter process, in which the particles are checked for their plausibility by a specific concept. In this work, either the checking for line of sight (cl), checking for containing rooms (cm), or checking for distance to routing graph (cr) concept are used (see
Figure 3), but other approaches could be implemented as well. The new position of each particle,
, is calculated in the propagation step (see
Figure 2) with Equations (
1) and (
2):
where
is the initial heading,
is the estimated heading from the odometry data,
S is the measured step length, and
and
are the noise values for the step length and step heading for each
ith particle, respectively.
For this paper, three filtering methods for the validity of particles have been used, namely the checking by line of sight (cl), checking by rooms (cm), and checking by distance to the routing graph (cr) concept. For the cl (see
Figure 3c), a GeoDataFrame is created containing all the connections between each propagated particle and its previous position. Every particle whose corresponding connection line intersects a wall is deleted, while all other particles are kept in the
GeoDataFrame. Finally, the
GeoDataFrame with the remaining particles is returned. The cm (see
Figure 3a) concept is similar to cl. However, here, the walls are not required as map information, but the rooms, considered as valid for the particles (
), and doors. For each propagated particle, it is checked if it is either within one of the valid rooms or if the
LineString-geometry from its new and its previous position intersects either with any door-
polygon or any
polygon contained in
. If that is the case, it is appended to the valid particles, which are finally returned as a
GeoDataFrame. Rooms, which are entered by particles through doors are added to the list of valid rooms and kept valid as long as particles are inside them. In the cr concept (shown in
Figure 5b), for each propagated particle, the smallest distance to the routing edges is determined. Only if the smallest distance to the routing edges for a particle is smaller than 2 m, is it then appended to the list of valid particles. The valid particles are then, as for the other concepts, returned as a
GeoDataFrame.
The correction concept is implemented in the algorithms of the explained filtering methods. In this work, the location fingerprinting is based on floor changes. After the propagation of the particles, the height change over a defined number of recent steps is observed. If this height change exceeds a specified threshold, all particles that are not located in transition zones (stairs and lifts) connecting the current and the new floor are deleted. The remaining particles are then filtered according to the implemented filtering methods.
The underlying algorithm of the backtracking segment is presented in Algorithm 2. First, a number of particles, according to the difference between the number of valid particles and the maximum number of particles, is randomly chosen from the currently existing particles (line 2). For each sample particle, a new particle at a random position inside a specified radius (line 1) is proposed (line 5). For this proposed particle, a backtracking test (see Algorithm 3) is performed and, if it passes the test, it is appended to the existing particles (line 6 to 8). If the particle doesn’t pass the backtracking test, the procedure is repeated until either the maximum number of particles is reached or until a maximum number of tries (in this case eight tries) has been reached. The limited number of tries will prevent an unnecessary slowing down of the algorithm due to a very high number of tries for each particle. The
GeoDataFrame, to which the accepted particles are added, is finally returned.
Algorithm 3 Backtracking test |
Input: Output: - 1:
for each s in do - 2:
propagate() - 3:
if CheckValidity()←valid then - 4:
with test - 5:
else - 6:
return -
return
|
For each concept used for the checking of particles, the same concept is used for the backtracking test. For each backtracking step
, backwards from the current step
i, the new position
of each particle
p is calculated from the current position of the particle
with Equations (
3) and (
4):
where
is the step length of the previous step and
is the heading of the previous step. Each backtracking step is then checked for its validity (intersections with walls for the cl, containing rooms for the cm, or distance to routing edges for cr). If the whole trajectory passes the backtracking test, the algorithm returns
True, otherwise the algorithm returns
False. When the cl concept is used, it is not checked for intersection at every step, but for all steps simultaneously because the query for intersections is the most time-consuming step and the usage of
GeoDataFrames makes it more efficient to query for intersections of the
LineString-geometry representing the whole trajectory than to query for intersections at each step if multiple steps are considered.
5. Results
In this section, the results of the map-matching algorithm using the cr, cm, and cl method for particle checks are presented and discussed for the two test trajectories. The cumulative distribution function (CDF) of the position estimate error for the different concepts used for the
eight path, with a step correction (manual step scale) of 0.1 m, is shown in
Figure 9. The cm and cr method reached an overall similar accuracy, with the cm method reaching an accuracy of less than 4 m and the cr method reaching a accuracy of just less than 3 m in 90% of the steps.
The cl method performed significantly worse; this is mainly due to the situation that at a step correction of 0.1 m, enough particles are overshooting at one of the turns, ending up in the “gallery” that the positions for the next steps is estimated to be on the wrong side of the wall (see
Figure 10).
At this point, the backtracking functionality can be observed (see
Figure 11). At the end of the “gallery”, with every subsequent step, more particles get deleted because they would cross a wall, resulting in the backtracking algorithm resampling the invalid particles at more plausible positions and by this, changing the trajectory to the correct path.
This was also an exception, where the weighting of the particles corresponding to the distance to the nearest routing edge helped to significantly increase the accuracy to less than 4.5 m in 90% of steps, by correcting the trajectory closer to the next routing edge (see
Figure 12). Since the “gallery” does not contain any routing edges, the trajectory was directed back into the corridor. The effect of the weighting method was negligible for the other methods for the tested trajectories.
Figure 13 shows the CDF of the position estimate error for the
zerotofour path with a step correction of 0.2 m. The accuracy for all methods is between 5 and 6 m in 90% of the steps. The cm method can provide a position error of less than 4 m more often than the two other methods. From the three methods, only the cm method lead the trajectory into the elevator, while only the cr method reached the final room. The cm and the cl method both lead the trajectory into the neighboring room, west of the final room.
For the
eight path without step correction, an accuracy better than 3 m can be achieved with the cm and cl method, while the overall performance of the cr method falls behind the two other methods, as shown in
Figure 14. The use of additional routing support worsens the achievable accuracy of the cr method. For the cm and cl method, the weighting by the distance to the routing graph has only a small influence on the error of position estimate. The cl method performs significantly better (also see
Figure 15), mainly because there is less particle overshoot at the turn at the eastern corner. This way, the trajectory doesn’t deviate into the “gallery”.
Figure 16 shows the different method’s CDF of the positioning error for the
zerotofour path with a step length correction of 0.15 m. All methods, with and without the additional use of the weighting method, achieve a positioning error of less than 7 m in 90% of the steps, while the cm and cl methods achieve a significantly better accuracy for the positioning than the cr method. The additional weighting of particles only has a minor influence on the accuracy of the used methods, slightly improving the cl method and slightly decreasing the accuracy of the cm method. The elevator could be reached by the cl method as well as the cl and cm methods with routing support. It was closely missed by the cm method. The cr method was the only one that reached the destination room, with all the other trajectories ending in the same neighboring room.
In most cases, the cm and the cl method had the best accuracy. The eight path with a step correction of 0.1 m is the exception; here, the cl method reached a significantly worse accuracy, due to the above mentioned situation in which the trajectory gets “trapped” in the gallery for a part of the trajectory.
6. Conclusions
Fitting the odometry outputs with spatial information is a way to correct for the cumulative noises. In this paper, a real-time map-matching method based on a backtracking PF has been developed that can handle different odometry inputs. It provides flexibility to use different kinds of spatial constraints due to the usage of geospatial analysis tools and can be implemented in different use cases. We could successfully develop a PF algorithm that autonomously supports a meter scale position accuracy for indoor navigation. We took the benefits of both odomotery and geospatial anaylsis to develop and evaluate possible algorithms that can provide map-matching services for any kind of moving object. For this, first the underlying concepts and methodology were explained and related work was presented. Next, the concepts as they were further developed and adjusted for this paper have been explained, including the detailed explanation of the implementation of the algorithms of the backtracking PF. Finally, the used test data set was presented and the results of the backtracking PF with geospatial analysis have been investigated and discussed. In addition, a simple correction method has been developed and implemented that can use additional environmental information to further improve the position estimate. In this paper, the height information from a smartphone was used to determine if a user is located on stairs or in elevators in order to develop a simple corrector/optimizer by these transition zones. An extended optimization can be done with other position information, e.g., cellular positioning such as 5G, for a continuous correction. Three methods were developed that determine invalid particles based on different building information, namely the cl, cm, and cr method. The results of the different methods have been tested with the data from two paths through the HCU building and have been compared with regard to the attainable position accuracy, as well as the ability to detect certain rooms.
The cm and cl methods reached better precision than the cr method, with the cm method being a bit more robust. It was possible to develop a PF algorithm that could reach an accuracy of 2 to 7 m most of the time in the two tested trajectories. Of all the tested methods, the cm method for particle checking might be favorable, not only because its performance regarding the position precision and room accuracy, but also because additional information for the accessibility of rooms can be relatively easily implemented. n broken elevator could, for example, easily be declared as an invalid space.
Due to the simple and modular code structure, it is possible to add or exchange methods and functionalities to the developed map-matching algorithm. This would also include the additional use of position estimation, for example from 5G antennas, for the correction method. Since polar coordinates are used for the propagation model, in this case, step length and step heading, the usage is not limited to pedestrian navigation, but the developed approach could also be implemented for other use cases such as the indoor navigation of robots or any other moving object, as long as the traveled distance (which can easily be calculated from the speed) and moving direction is provided. Compared to conditional random fields, a PF does not need learning data, making it more convenient and versatile to use in a variety of real-life scenarios. To improve the accuracy in situations where large hallways provide only few possibilities for map corrections, position information from cellular networks (e.g., 5G) could be used in the implemented correction approach to improve the accuracy (see [
29]).
The accuracy of the developed PF approaches is dependent on the quality of the provided map information, resulting in better performances with better map materials. The quality of the step length estimation could be improved either by scaling the step length every time an absolute position can be attained with high precision and accuracy, either through infrastructure support or when a position is determined with relatively high confidence regarding their correctness; for example, when using an elevator changes the floor. This could be implemented during the implemented correction method. On the other hand, machine-learning algorithms could be used for a more precise step length estimation. Another option would be to use data sets of step length in relation to other biometric information from a huge number of people. However, these are costly and hard to attain. Overall, a novel map-matching algorithm, based on a backtracking PF, has been developed that provides a meter scale accuracy and is applicable in a large variety of use cases and can easily be modified to handle different kinds of spatial information in different scenarios.