\section{Introduction}

Since the advent of smartphones, location aware apps and services are ubiquitous and have become a natural part of our everyday life.
%Whether driving a car, jogging or shopping in the streets, 
GNSS-based applications simplify orientation,
guide the way and even track our fitness achievements. 
%But as soon as we drive into an underground car park or visit a shopping mall, most of them do not work at all.
%That is because satellite signals are too weak to pass through obstacles like ceilings.
However, satellite signals are too weak to pass through obstacles like ceilings and their accuracy is not sufficient for most indoor tasks.
%Moreover, their accuracy is not sufficient for individual parking spaces or office rooms.
Therefore, many different solutions for localising a moving object within buildings have been developed in 
the most recent years \cite{Ebner-15, Yang2015, Khaleghi2013, Fang09, Nurminen2014}.
Especially the hard problem of pedestrian navigation has lately attracted a lot of interest. 

Most modern indoor localisation systems primarily use smartphones to determine the position of a pedestrian.
Especially the phone's inertial measurement unit (IMU) as well as external information like Wi-Fi or Bluetooth
are used to collect the necessary data. 
Additionally, environmental knowledge is often incorporated e.g. by using floormaps. 
This combination of highly different sensor types is also known as sensor fusion.

Here, probabilistic methods like particle- or Kalman filters are often used to approximate a probability density describing the pedestrian's possible whereabouts.
This procedure can be separated into two probabilistic models:
The transition model, which represents the dynamics of the pedestrian and predicts his next accessible locations, and the evaluation model, which estimates the probability for the position corresponding to 
recent sensor measurements.
 %Therefore, the most accurate position is represented by a peak of the probability distribution. 
In our previous work we were able to present such a localisation system based on all the sensors mentioned above, including the phone's barometer \cite{Ebner-15}.

%In pedestrian navigation, the human movement is subject to the characteristics of walking speed and -direction.
%Additionally, environmental restrictions need to be considered as well, for example, walking through walls is impossible.
%Therefore, incorporating environmental knowledge is a necessary and gainful step.
Incorporating environmental knowledge is a necessary and gainful step e.g. walking through walls is impossible.
Like other systems, we are using a graph-based approach to sample only valid movements.
The unique feature of our approach is the way how human movement is modelled. 
This is done by using random walks on a graph, which are based on the heading of the pedestrian. 
Despite very good results, the system presented in \cite{Ebner-15} suffers from two drawbacks, we attempt to solve within this work.

First, the transition model of our previous approach uses discrete floor-changes.
Although the overall system provides viable results, it does not resemble real-world floor changes.
Especially the barometric model is affected due to its continuous pressure measurements.
The discrete model limits the barometer's full potential.
It could further be shown that a correct estimation strongly depends on the quality of $z$-transitions.
To address this problem we extended the graph by adding realistic stairs, allowing a step-wise transition in the $z$-direction.

Second, the heading for modelling the pedestrian's walking behaviour is calculated between two adjacent nodes
and restricts the transition to perform only discrete \SI{45}{\degree} turns. While this is sufficient
for most cases, minor heading changes are often ignored and the posterior distribution (after walking)
is not smoothly spread. The heading-change of our new approach is solely controlled by the smartphone's turn detection.
During the random walk, matching edges are sampled according to their deviation from this change.

To improve the complex problem of localising a person indoors, prior knowledge given by a navigation system can be used.
Such applications are utilized to navigate a user to his desired destination, limiting the unpredictability of human movement to a certain degree. 
So, based on this assumption, the destination is known beforehand and the starting point is the user's currently estimated position. 
Regarding a graph-based transition model, one could suggest to use the shortest route between start and destination as the user's most likely to walk path. 
By incorporating this prior knowledge into the state transition step, a new state can be sampled in a more targeted manner. 
However, for regularly tessellated (grid) graphs, as used in \cite{Ebner-15}, this would lead to unnatural paths e.g.
directly adhering to walls. 
Therefore, we present a novel approach that detects walls using an inverted graph (representing walls and obstacles) and a nearest-neighbour search.
%\commentByFrank{hier kann man, wenn platz fehlt, vlt noch etwas details weglassen (inverted-graph, knn, etc)}

Since areas near walls are less likely to be chosen for walking, a probabilistic weight is assigned to every node of the graph.
This allows a variety of options for integrating additional knowledge about the environment and enables us to address another problem:
Entering or leaving rooms is very unlikely as only a few nodes are representing doors and allow of doing so.
This can be tackled by making such areas more likely.
Therefore, a novel approach for detecting doors using the inverted graph is presented within this work.
%\commentByFrank{auch hier vlt das inverted erstmal noch weg lassen wegen platz}

Finally, it is now possible to calculate more natural and realistic paths using the weighted graph. 
We introduce two different methods which make use of the given destination and thereby provide a targeted movement. 
To the best of our knowledge, this approach is the first one that uses prior navigation knowledge to increase the localisation results.



%Additionally, the human walking behaviour is highly affected by visual distractions, comfort, disorientation and many other factors. 


