299 lines
14 KiB
TeX
299 lines
14 KiB
TeX
\section{Transition Model}
|
|
\label{sec:trans}
|
|
|
|
To sample only transitions that are actually feasible
|
|
within the environment, we utilize a \SI{20}{\centimeter}-gridded graph
|
|
$G = (V,E)$, $v_{x,y,z} \in V$, $e_{v_{x,y,z}}^{v_{x',y',z'}} \in E$
|
|
derived from the buildings floorplan as described in section \ref{sec:relatedWork}.
|
|
However, we add improved $z$-transitions by also modelling realistic
|
|
stairwells using nodes and edges as can be seen in fig. \ref{fig:gridStairs}.
|
|
|
|
\begin{figure}
|
|
\centering
|
|
\includegraphics[trim=0 0 0 0]{grid/grid}
|
|
\caption{Besides the nodes and edges defined by the distinct floors, we add realistic stairs to interconnect them.}
|
|
\label{fig:gridStairs}
|
|
\end{figure}
|
|
|
|
\newcommand{\spoint}{l}
|
|
Stairs are defined using three points $\vec{\spoint}_1, \vec{\spoint}_2, \vec{\spoint}_3 \in \R^3$ whereby the segment
|
|
$[ \vec{\spoint}_1 \vec{\spoint}_2 ]$ describes the starting-edge, and $[ \vec{\spoint}_2 \vec{\spoint}_3 ]$ the stair's direction.
|
|
The corresponding vertices are determined using intersections of the segments with the bounding-box
|
|
for each vertex.
|
|
|
|
\commentByToni{Der Teil wird mir gar nicht klar irgendwie. Kann mir vor allem den letzten Satz nicht vorstellen.}
|
|
\commentByFrank{mention?: clean z-transitions, remove x/y nodes by adding bounding boxes}
|
|
|
|
To reduce the system's memory footprint, we search for the largest connected region within the graph and
|
|
remove all nodes and edges that are not connected to this region.
|
|
|
|
\newcommand{\gHead}{\theta}
|
|
\newcommand{\gDist}{d}
|
|
Walking the grid is now possible by moving along adjacent nodes into a given walking-direction
|
|
until a desired distance $\gDist$ is reached \cite{Ebner-15}.
|
|
In order to use meaningful headings $\gHead$ and distances $\gDist$
|
|
(matching the pedestrian's real heading and walking speed) for each transition,
|
|
we use the current sensor-readings $\mObsVec_{t}$ for hinted instead of truly random adjustments.
|
|
%
|
|
\begin{align}
|
|
\mStateVec_{t}^{\mStateHeading} = \gHead &= \mStateVec_{t-1}^{\mStateHeading} + \mObsVec_t^{\mObsHeading} + \mathcal{N}(0, \sigma_{\gHead}^2) \\
|
|
\gDist &= \mObsVec_t^{\mObsSteps} \cdot \SI{0.7}{\meter} + \mathcal{N}(0, \sigma_{\gDist}^2)
|
|
\end{align}
|
|
%
|
|
During a walk, each edge has an assigned probability $p(e)$ which depends on a chosen implementation.
|
|
Usually, this probability describes aspects like a comparison of the edge's angle $\angle e$ with the
|
|
current heading $\gHead$. However, it is also possible to incorporate additional prior knowledge to favor
|
|
some vertices/edges.
|
|
|
|
For comparison purpose we define a simple weighting method that assigns a probability to each edge
|
|
based on the deviation from the currently estimated heading $\gHead$:
|
|
|
|
\commentByFrank{das erste $=$ ist komisch. bessere option?}
|
|
\commentByToni{Find ich jetzt nicht tragisch. Eher notwendig fuers Verstaendnis.}
|
|
\begin{equation}
|
|
p(e) = p(e \mid \gHead) = N(\angle e \mid \gHead, \sigma_\text{dev}^2).
|
|
\label{eq:transSimple}
|
|
\end{equation}
|
|
|
|
|
|
|
|
|
|
|
|
\section{Navigation Knowledge}
|
|
|
|
Assuming navigation, the pedestrian wants to reach a well-known destination and represents additional
|
|
prior knowledge. Most probably, the pedestrian will stick to the path presented by
|
|
a navigation system. However, some deviations like chatting to someone or taking another route
|
|
cannot be strictly ruled out. We will therefore describe a system that is able to deal with such variants
|
|
as well as present an algorithm to calculate realistic routes based on the aforementioned grid.
|
|
|
|
\subsection{Wall Avoidance}
|
|
\label{sec:wallAvoidance}
|
|
|
|
As discussed in section \ref{sec:relatedWork}, simply running a shortest-path algorithm as Dijkstra or A* using the previously created graph would obviously lead to non-realistic paths sticking to the walls and walking many diagonals.
|
|
Pedestrian's however, walk either somewhere near (but not close to) a wall or, for larger open spaces, somewhere far from the walls.
|
|
In order to calculate paths the resemble pedestrian walking behavior, an importance factor is derived for each vertex within the graph.
|
|
|
|
To get the distance of each vertex from the nearest wall, an inverted version $G' = (V', E')$ of the graph $G$
|
|
is built. A nearest-neighbor search $\mNN(v_{x,y,z}, G')$ will then provide the nearest wall-vertex
|
|
$v'_{x,y,z} \in V'$ from the inverted graph \cite{Cover1967}. The wall avoidance is calculated as follows:
|
|
%
|
|
\begin{equation}
|
|
d_{v, v'} = d(v_{x,y,z}, v'_{x,y,z}), \enskip 0.0 < d_{v, v'} < 2.2 \\
|
|
\end{equation}
|
|
\begin{equation}
|
|
\begin{array}{ll}
|
|
\text{wa}_{x,y,z} = & - 0.30 \cdot \mathcal{N}(d_{v, v'} \mid 0.0, 0.5^2) \\
|
|
& + 0.15 \cdot \mathcal{N}(d_{v, v'} \mid 0.9, 0.5^2) \\
|
|
& + 0.15 \cdot \mathcal{N}(d_{v, v'} \mid 2.2, 0.5^2)
|
|
\end{array}
|
|
\label{eq:wallAvoidance}
|
|
\end{equation}
|
|
%
|
|
The parameters of the normal distribution and the scaling-factors were chosen empirically.
|
|
While this approach provides good results for most areas, doors are downvoted by
|
|
\refeq{eq:wallAvoidance}, as they have only vertices that are close to walls.
|
|
Door detection thus is the next conducted step.
|
|
|
|
|
|
|
|
|
|
\subsection{Door Detection}
|
|
\label{sec:doorDetection}
|
|
|
|
Doors are usually anchored between two (thin) walls and have a normed width. Examining only a limited region
|
|
around the door, its surrounding walls describe a flat ellipse with the same center as the door itself. It is thus
|
|
possible to detect doors within the floorplan using a PCA.
|
|
|
|
To decide whether a vertex $v_{x,y,z}$ within the (non-inverted) grid $G$ belongs to a door, we use $k$-NN to fetch its
|
|
$k$ nearest neighbors $N'$ within the inverted grid $G'$. For this neighborhood the centroid $\vec{c} \in \R^3$ is calculated.
|
|
If the distance $\| \vec{c} - v_{x,y,z} \|$ between the centroid and the vertex-in-question is above certain threshold,
|
|
the node does not belong to a door.
|
|
\todo{diese distanzformel oder dist(a,b)?}
|
|
\commentByToni{dist gibt es doch net, oder? In der Graphentheorie schreibt man einfach d(v, v) (ist im prinzip shortest path). ansonsten müssten wir dist(..) irgendwo einführen als euklidische distanz oder so, find ich aber irgendwie doof. musst du wissen, was dir beser gefällt}
|
|
%ugly...
|
|
%\begin{equation}
|
|
% \vec{c} = \frac{ \sum_{v_{x,y,z} \in N'} v_{x,y,z} }{k}
|
|
%\end{equation}
|
|
|
|
Assuming the distance was fine, we compare the two eigenvalues $\{\lambda_1, \lambda_2 \mid \lambda_1 > \lambda_2\}$, determined by the PCA.
|
|
If their ratio $\frac{\lambda_1}{\lambda_2}$ is above a certain threshold (flat ellipse)
|
|
the node-in-question belongs to a door or some kind of narrow passage.
|
|
|
|
\begin{figure}
|
|
\includegraphics[width=\columnwidth]{door_pca}
|
|
\caption{Detect doors within the floorplan using $k$-NN and PCA. While the white nodes are walkable, the black ones represent walls. The gray node is the one in question.}
|
|
\label{fig:doorPCA}
|
|
\end{figure}
|
|
|
|
Fig. \ref{fig:doorPCA} depicts all three cases where
|
|
(left) the node is part of a door,
|
|
(middle) the distance between node and k-NN centroid is above the threshold and
|
|
(right) the ration between $e_1$ and $e_2$ is below the threshold.
|
|
\commentByToni{was ist $e_1$ und $e_2$?}
|
|
|
|
Like before, we apply a distribution based on the distance from the nearest door to determine
|
|
an importance-factor for each node:
|
|
%
|
|
\begin{equation}
|
|
\text{dd}_{x,y,z} = 0.8 \cdot \mathcal{N}( \| \vec{c} - v_{x,y,z} \| \mid 0.0, 1.0 )
|
|
\end{equation}
|
|
|
|
|
|
|
|
|
|
\subsection{Path Estimation}
|
|
\label{sec:pathEstimation}
|
|
|
|
Based on aforementioned assumptions, the final importance for each node is given by
|
|
%
|
|
\begin{equation}
|
|
\text{imp}_{x,y,z} = 1.0 + \text{wa}_{x,y,z} + \text{dd}_{x,y,z} \enspace ,
|
|
\end{equation}
|
|
%
|
|
A good visualization of the importance factors can be seen in fig. \ref{fig:importance}.
|
|
|
|
\begin{figure}
|
|
\includegraphics[angle=-90, width=\columnwidth, trim=20 19 17 9, clip]{floorplan_importance}
|
|
\caption{The calculated importance factor for each vertex. While the black elements denote an importance-factor
|
|
of about \SI{0.8}{}, the yellow door-regions denote a high importance of about \SI{1.2}{}.}
|
|
\label{fig:importance}
|
|
\end{figure}
|
|
|
|
To estimate the shortest path to the pedestrian's desired target, we use a modified version
|
|
of Dijkstra's algorithm. Instead of calculating the shortest path from the start to the end,
|
|
we swap start/end and do not terminate the calculation until every single node was evaluated.
|
|
Thus, every node in the grid knows the shortest path to the pedestrian's target.
|
|
|
|
As weighting-function we use
|
|
%
|
|
\begin{equation}
|
|
\begin{split}
|
|
\text{weight}(v_{x,y,z}, v_{x',y',z'}) =
|
|
\frac
|
|
{ \| v_{x,y,z} - v_{x',y',z'} \| }
|
|
{ \text{stretch}(\text{imp}_{x',y',z'}) }
|
|
,
|
|
\end{split}
|
|
\end{equation}
|
|
%
|
|
whereby $\text{stretch}(\cdots)$ is a scaling function (linear or non-linear) used to adjust
|
|
the impact of the previously calculated importance-factors.
|
|
%
|
|
Fig. \ref{fig:multiHeatMap} depicts the difference between the path calculated without (dashed) and
|
|
with importance-factors (solid), where the latter version is clearly more realistic.
|
|
|
|
%\begin{figure}
|
|
% \includegraphics[angle=-90, width=\columnwidth, trim=20 19 17 9, clip]{floorplan_paths}
|
|
% \caption{Comparision of shortest-path calculation without (dotted) and with (solid) importance-factors
|
|
% use for edge-weight-adjustment.}
|
|
% \label{fig:shortestPath}
|
|
%\end{figure}
|
|
|
|
|
|
\subsection{Guidance}
|
|
|
|
Based on the previous calculations, we propose two approaches to incorporate the prior
|
|
knowledge into the transiton model.
|
|
|
|
\subsubsection{Shortest Path}
|
|
|
|
Before every transition, the centroid $\vec{c}$ of the current sample-set $\Upsilon_{t-1}$, representing the posterior distribution at time $t-1$, is calculated:
|
|
%
|
|
\begin{equation}
|
|
\vec{c} = \frac
|
|
%{ \sum_{\mStateVec_{t-1}} (\mState_{t-1}^x, \mState_{t-1}^y, \mState_{t-1}^z)^T }
|
|
{ \sum_{i=1}^N \Upsilon_{t-1}^{x,y,z} }
|
|
{N}
|
|
\end{equation}
|
|
%
|
|
oder
|
|
%
|
|
\begin{equation}
|
|
\vec{c} = \frac
|
|
{ \sum_{i=1}^N \{(\mState_{t-1}^x, \mState_{t-1}^y, \mState_{t-1}^z)^T\}^i }
|
|
{N}
|
|
\end{equation}
|
|
%
|
|
oder: the centroid $\vec{c}$ of the current sample-set's 3D positions $\Upsilon_{t-1}^i = \{(\mState_{t-1}^x, \mState_{t-1}^y, \mState_{t-1}^z)^T\}_{i=0}^N$ is calculated:
|
|
%
|
|
\begin{equation}
|
|
\vec{c} = \frac
|
|
%{ \sum_{\mStateVec_{t-1}} (\mState_{t-1}^x, \mState_{t-1}^y, \mState_{t-1}^z)^T }
|
|
{ \sum_{i=1}^N \Upsilon_{t-1}^{i} }
|
|
{N}
|
|
\end{equation}
|
|
|
|
\newcommand{\pathRef}{v_{\hat{x},\hat{y},\hat{z}}}
|
|
\todo{summe laesst sich so nicht schreiben. ideen?}
|
|
\commentByToni{Das ist gar nicht so einfach... wir haben nie ein Sample Set eingefuehrt. Nicht mal einen Sample. Wir haben immer nur diesen State... Man könnte natuerlich einfach sagen das $\Upsilon_t$ an set of random samples representing the posterior distribution ist oder einfach nur ein set von partikeln. habs mal eingefuegt wie ich denke}
|
|
|
|
This center is used as starting-point for the shortest path. As it is not necessarily part of
|
|
the grid, its nearest-grid-neighbor is determined and used instead.
|
|
The resulting vertex already knows its way to the pedestrian's destination, but is located somewhere
|
|
within the sample-set. We thus calculate the standard deviation for the distance
|
|
of all states from the center. After advancing the starting-vertex by three times the deviation
|
|
we get a new point outside of the sample-set and closer to the desired destination.
|
|
\commentByToni{Worauf liegt der Punkt? Sollte man dazu schreiben. }
|
|
This new reference node $\pathRef$ serves as a comparison base:
|
|
\commentByToni{Allgemein mal zur Schreibweise der Vertices. Irgendwie finde ich dieses $v_{x,y,z}$ nicht so gut. Ich denke jeder sieht das wir 3D haben und deswegen könntem man doch schlicht $v$, $v'$, $\hat{v}$ ... nutzen, oder was denkst du?}
|
|
|
|
\todo{bessere ideen fuer die schreibweise?}
|
|
\begin{equation}
|
|
\begin{split}
|
|
p(v_{x',y',z'} \mid v_{x,y,z})
|
|
= N(\angle [ v_{x,y,z} v_{x',y',z'} ] \mid \gHead, \sigma_\text{dev}^2) \cdot \alpha \\
|
|
\alpha =
|
|
\begin{cases}
|
|
1.0 & \| v_{x',y',z'} - \pathRef \| < \| v_{x,y,z} - \pathRef \| \\
|
|
0.1 & \text{else}
|
|
\end{cases}
|
|
\end{split}
|
|
\label{eq:transShortestPath}
|
|
\end{equation}
|
|
|
|
Eq. \eqref{eq:transShortestPath} combines the simple transition \refeq{eq:transSimple} with
|
|
a second probability, downvoting all nodes that are farther away from the reference $\pathRef$
|
|
than the previous step. Put another way: grid-steps increasing the distance to the reference
|
|
are unlikely but not impossible.
|
|
|
|
|
|
\subsubsection{Multipath}
|
|
|
|
The Dijkstra calculation mentioned in \ref{sec:pathEstimation} already calculated the
|
|
cumulative distance $\text{cdst}_{x,y,z}$ to the pedestrian's target for each vertex.
|
|
\commentByToni{falls wir dist() nutzen sollten wir hier auch cdist machen. }
|
|
We thus apply the same assumption as above and downvote steps not decreasing
|
|
the distance to the destination:
|
|
|
|
\begin{equation}
|
|
\begin{split}
|
|
p(v_{x',y',z'} \mid v_{x,y,z})
|
|
= N(\angle [ v_{x,y,z} v_{x',y',z'} ] \mid \gHead, \sigma_\text{dev}^2) \cdot \alpha \\
|
|
\alpha =
|
|
\begin{cases}
|
|
1.0 & \text{cdst}_{x',y',z'} < \text{cdst}_{x,y,z} \\
|
|
0.1 & \text{else}
|
|
\end{cases}
|
|
\end{split}
|
|
\label{eq:transMultiPath}
|
|
\end{equation}
|
|
|
|
Fig. \ref{fig:multiHeatMap} shows the heat-map of visited vertices after several \SI{125}{\meter}
|
|
walks simulating slight, random heading changes.
|
|
|
|
\begin{figure}
|
|
\includegraphics[angle=-90, width=\columnwidth, trim=20 19 17 9, clip]{floorplan_dijkstra_heatmap}
|
|
\caption{Heat-Map of visited vertices after several walks using \refeq{eq:transMultiPath}.
|
|
Additionally shows the shortest-path calculation without (dashed) and with (solid) importance-factors
|
|
used for edge-weight-adjustment.}
|
|
\label{fig:multiHeatMap}
|
|
\end{figure}
|
|
|
|
|
|
|
|
\commentByFrank{angular-change probability as polar-plot}
|
|
|
|
\commentByFrank{describe the multi-path version}
|
|
|