diff --git a/tex/chapters/experiments.tex b/tex/chapters/experiments.tex index cb18c74..8bf1689 100644 --- a/tex/chapters/experiments.tex +++ b/tex/chapters/experiments.tex @@ -38,9 +38,12 @@ As uncertainties we used $\sigma_\text{wifi} = \sigma_\text{ib} = 8.0$, both growing with each measurement's age. While the pressure change was assumed to be \SI{0.105}{$\frac{\text{\hpa}}{\text{\meter}}$}, all other barometer-parameters - are determined automatically (see \ref{sec:sensBaro}). The step size for the transition was configured to be \SI{70}{\centimeter} - with an allowed derivation of \SI{10}{\percent}. The heading deviation in + are determined automatically (see \ref{sec:sensBaro}). The step size $\mStepSize$ for the transition was configured to be + \SI{70}{\centimeter} with an allowed derivation of \SI{10}{\percent}. The heading deviation in \refeq{eq:transSimple}, \refeq{eq:transShortestPath} and \refeq{eq:transMultiPath} was \SI{25}{\degree}. + Edges departing from the pedestrian's destination are downvoted using $\mUsePath = 0.9$. + \commentByFrank{$\mUsePath$ erklaert} + As we start with a discrete uniform distribution for $\mStateVec_0$ (random position and heading), the first few estimations are omitted from the error calculation to allow the system to somewhat settle its initial state. Even though, the error @@ -71,9 +74,11 @@ \begin{figure} \input{gfx/eval/error_timed_nexus} \caption{Development of the error while walking along Path 4 using the Motorola Nexus 6. - When leaving the suggested route (3), the error of shortest path \refeq{eq:transShortestPath} - and multipath \refeq{eq:transMultiPath} increases. - The same issues arise when facing multimodalities between two staircases just before the destination (9).} + When leaving the suggested route (3), the error of \textbf{shortest} path \refeq{eq:transShortestPath} + and \textbf{multi}path \refeq{eq:transMultiPath} increases. + The same issues arise when facing multimodalities between two staircases just before the destination (9). + \commentByFrank{hilft das bold vlt. schon um die legende zu verstehen?} + } \label{fig:errorTimedNexus} \end{figure} % detailed analysis of path 4 @@ -133,8 +138,9 @@ % overall error-distribution for nexus and galaxy \begin{figure} \input{gfx/eval/error_dist_nexus} - \caption{Error distribution for all walks conducted with the Motorola Nexus 6. Our proposed methods - clearly provide an enhancement for the overall localization process.} + \caption{Error distribution of all walks conducted with the Motorola Nexus 6 for distinct percentile values. + Our proposed methods clearly provide an enhancement for the overall localization process. + \commentByFrank{percentile erwaehnt}} \label{fig:errorDistNexus} \end{figure} %\begin{figure} @@ -143,9 +149,11 @@ %\end{figure} The median error values for all other paths and the other smartphone are listed in table - \ref{tbl:errNexus} and \ref{tbl:errGalaxy}. As can be seen, adding prior knowledge - is able to improve the localisation for all examined situations, even when + \ref{tbl:errNexus} and \ref{tbl:errGalaxy}. Furthermore, fig. \ref{fig:errorDistNexus} + depicts the error development for several percentile values. As can be seen, adding prior + knowledge is able to improve the localisation for all examined situations, even when leaving the suggested path or when facing bad/slow sensor readings. + \commentByFrank{fig. \ref{fig:errorDistNexus} erwaehnt} % error values \begin{table} diff --git a/tex/chapters/grid.tex b/tex/chapters/grid.tex index ebb6a53..360f994 100644 --- a/tex/chapters/grid.tex +++ b/tex/chapters/grid.tex @@ -7,7 +7,8 @@ To sample only transitions that are actually feasible within the environment, we utilize a \SI{20}{\centimeter}-gridded graph - $G = (V,E)$ with vertices $v \in V$ and undirected edges $e \in E$ + $G = (V,E)$ with vertices $v_i \in V$ and undirected edges $e_{i,j} \in E$ + \commentByFrank{notation geaendert. so ok?} 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, depicted in fig. \ref{fig:gridStairs}. @@ -44,31 +45,31 @@ % \begin{align} \gHead &= \mState_{t}^{\mStateHeading} = \mState_{t-1}^{\mStateHeading} + \mObs_t^{\mObsHeading} + \mathcal{N}(0, \sigma_{\gHead}^2) \\ - \gDist &= \mObs_t^{\mObsSteps} \cdot \SI{0.7}{\meter} + \mathcal{N}(0, \sigma_{\gDist}^2) + \gDist &= \mObs_t^{\mObsSteps} \cdot \mStepSize + \mathcal{N}(0, \sigma_{\gDist}^2) . \end{align} - \commentByFrank{fixed. war das falsche makro in (2) und dem satz darunter. das delta musste weg. der state hat ein absolutes heading} + \commentByFrank{fixed. war das falsche makro in (2) und dem satz darunter. das delta musste weg. der state hat ein absolutes heading. step-size als variable} % - During the random walk, each edge has its own probability $p(e)$ - which e.g. depends on the edge's direction $\angle e$ and the + During the random walk, each edge has its own probability $p(\mEdgeAB)$ + which e.g. depends on the edge's direction $\angle \mEdgeAB$ and the pedestrian's current heading $\gHead$. - Furthermore, section \ref{sec:nav} uses $p(e)$ to incorporate prior path knowledge to - favour edges leading towards the pedestrian's desired target $\mTarget$. + Furthermore, section \ref{sec:nav} uses $p(\mEdgeAB)$ to incorporate prior path knowledge to + favour edges leading towards the pedestrian's desired target $\mVertexDest$. \commentByFrank{fixed} - For each single movement on the graph, we calculate $p(e)$ for all edges - connected to a vertex $v$, and, hereafter, randomly draw the to-be-walked edge + For each single movement on the graph, we calculate $p(\mEdgeAB)$ for all edges + connected to a vertex $\mVertexA$, and, hereafter, randomly draw the to-be-walked edge depending on those probabilities. This step is repeated until the sum of the length of all used edges exceeds $d$. The latter depends on the number of - detected steps $\mObs_t^{\mObsSteps}$ and assumes an average - step-size of \SI{0.7}{\meter}. + detected steps $\mObs_t^{\mObsSteps}$ and the pedestrian's step-size $\mStepSize$. + \commentByFrank{step-size als variable} To quantify the improvement prior knowledge is able to provide, - we define a simple reference for $p(e)$ that assigns a probability to each edge + we define a simple reference for $p(\mEdgeAB)$ that assigns a probability to each edge just based on its deviation from the currently estimated heading $\gHead$: % \begin{equation} - p(e) = p(e \mid \gHead) = \mathcal{N} (\angle e \mid \gHead, \sigma_\text{dev}^2). + p(\mEdgeAB) = p(\mEdgeAB \mid \gHead) = \mathcal{N} (\angle \mEdgeAB \mid \gHead, \sigma_\text{dev}^2). \label{eq:transSimple} \end{equation} @@ -88,17 +89,27 @@ \subsection{Wall Avoidance} \label{sec:wallAvoidance} - As discussed in section \ref{sec:relatedWork}, simply applying a shortest-path algorithm such as Dijkstra or - A* using the previously created graph would obviously lead to non-realistic paths sticking to walls and - walking many diagonals. Pedestrians however, will probably keep a small gap between themselves and - nearby walls. To calculate paths that resemble this behaviour, an importance-factor is derived for - each vertex. Those will be used to modify the weight $\fDistance{v}{v'}$ between two vertices - $v,v'$, examined by the shortest-path algorithm. + %As discussed in section \ref{sec:relatedWork}, simply applying a shortest-path algorithm such as Dijkstra or + %A* using the previously created graph would obviously lead to non-realistic paths sticking to walls and + %walking many diagonals. Pedestrians however, will probably keep a small gap between themselves and + %nearby walls. + %To calculate paths that resemble this behaviour, an importance-factor is derived for + %each vertex. Those will be used to modify the weight $\fDistance{v}{v'}$ between two vertices + %$v,v'$, examined by the shortest-path algorithm. + Shortest-path algorithms such as Dijkstra use a scalar weight $\fDistance{v_1}{v_2}$ between two vertices + to determine the path with the lowest overall weight. + As discussed in section \ref{sec:relatedWork}, simply using the distance + $\fDistance{\mVertexA}{\mVertexB} = \| \mVertexA - \mVertexB \|$ as weighting function, would obviously lead to non-realistic paths + sticking to walls and walking many diagonals. Pedestrians however, will probably keep a small gap between + themselves and nearby walls. To calculate paths that resemble this behaviour, an importance-factor is derived for + each vertex. Those will be used to scale the distance between two nodes, just like navigation systems use + the speed-limit as scaling-factor. + \commentByFrank{so besser? der ganze absatz.} To downvote vertices near walls, we need to determine the distance of each vertex from its nearest wall. We therefore derive an inverted version $G' = (V', E')$ of the graph $G$, just describing walls and - obstacles. A nearest-neighbour search \cite{Cover1967} $\fNN{v}{V'}$ within $V'$ provides the vertex - nearest to $v$. + obstacles. A nearest-neighbour search \cite{Cover1967} $\fNN{\mVertexA}{V'}$ within $V'$ provides the vertex + nearest to $\mVertexA$. %\begin{equation} % v' = \fNN{v}{V'} \enskip . %\end{equation} @@ -106,10 +117,11 @@ is derived using a normal distribution with a deviation of \SI{0.5}{\meter}: % \begin{equation} - \fWA{v} = \mathcal{N}( \| v - \fNN{v}{V'} \| \mid 0.0, 0.5^2) + \fWA{\mVertexA} = \mathcal{N}( \| \mVertexA - \fNN{\mVertexA}{V'} \| \mid 0.0, 0.5^2) \enskip . \label{eq:wallAvoidance} \end{equation} + \commentByFrank{fixed. WA war WallAvoidance. hatte statt ll immer $\|$ gelesen und deshalb nicht verstanden} % %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 @@ -154,7 +166,7 @@ \begin{figure} \includegraphics[width=\columnwidth]{door_pca} \caption{Detect doors within the floorplan using $k$-NN to get the centroid $\vec{c}$ and covariance $\mat{\Sigma}$ - of the wall-vertices (black) near $v$. While the left version is fine, the $v$ in the middle is too far + of the wall-vertices (black) near $\mVertexA$. While the left version is fine, the $\mVertexA$ in the middle is too far from $\vec{c}$ and the right one has an invalid eigenvalue-ratio.} \label{fig:doorPCA} \end{figure} @@ -165,12 +177,12 @@ (right) the ratio between $\lambda_1$ and $\lambda_2$ is below the threshold. For smooth gradients around doors, we again use a distribution based on - the distance of a vertex $v$ from its nearest door and a deviation + the distance of a vertex $\mVertexA$ from its nearest door and a deviation of \SI{1.0}{\meter}: % %\commentByFrank{distanzrechnung: formel ok?} \begin{equation} - \fDD{v} = \mathcal{N}( \| \fPos{v} - \vec{c} \| \mid 0.0, 1.0^2 ) + \fDD{\mVertexA} = \mathcal{N}( \| \fPos{\mVertexA} - \vec{c} \| \mid 0.0, 1.0^2 ) \label{eq:doorDetection} \end{equation} % @@ -178,7 +190,7 @@ and \refeq{eq:doorDetection}: % \begin{equation} - \fImp{v} = 1.0 - \fWA{v} + \fDD{v} \enspace . + \fImp{\mVertexA} = 1.0 - \fWA{\mVertexA} + \fDD{\mVertexA} \enspace . \label{eq:finalImp} \end{equation} % @@ -203,22 +215,22 @@ Hereafter, every node in the grid knows the distance and shortest path to the pedestrian's target. To get realistic path suggestions, we use the importance-factors to adjust the edge-weight - $\delta(e_{1,2})$ for the Dijkstra: + $\delta(\mEdgeAB)$ for the Dijkstra: % \begin{equation} \begin{split} - \delta(e_{1,2}) = - \delta(v_1, v_2) = + \delta(\mEdgeAB) = + \delta(\mVertexA, \mVertexB) = \frac - { \| v_1 - v_2 \| } - { \fImp{v_2} } + { \| \mVertexA - \mVertexB \| } + { \fImp{\mVertexB} } \enskip. \end{split} \label{eq:edgeWeight} \end{equation} % - Eq. \eqref{eq:edgeWeight} artificially increases the euclidean distance between $v_1, v_2$ when - $v_2$ approaches a wall and decreases it when encountering a door. + Eq. \eqref{eq:edgeWeight} artificially increases the euclidean distance between $\mVertexA, \mVertexB$ when + $\mVertexB$ approaches a wall and decreases it when encountering a door. % %whereby $\text{stretch}(\cdots)$ is a scaling function (linear or non-linear) used to adjust %the impact of the previously calculated importance-factors. @@ -243,9 +255,11 @@ \newcommand{\pathCentroid}{{\vec{\overline{c}}_{t-1}}} \newcommand{\pathDev}{\sigma_{t-1}} - \newcommand{\pathRef}{\hat{v}} + \newcommand{\pathRef}{v_\text{ref}} - Before every transition, the centroid $\pathCentroid$ of the current + + Before every transition, the centre-position $\pathCentroid = (x,y,z)^T$ of the current + \commentByFrank{reicht das so schon?} sample-set, representing the posterior distribution at time $t-1$, is calculated. % % @@ -255,14 +269,22 @@ This centre serves as the starting point for the shortest-path calculation. As it is not necessarily part of the grid, its nearest-grid-neighbour is determined and used instead. This vertex is located somewhere within the sample-set and already knows the way to the pedestrian's - destination $\mTarget$. + destination $\mVertexDest$. % As new states $\mStateVec_{t}$ should approach the pedestrian's destination we use a reference $\pathRef$ all states try to reach. This references must be both part of the shortest path and located somewhere outside of the sample-set. % - We thus calculate the standard deviation of the distance of all samples from the centre - $\pathCentroid$. After advancing the starting-vertex by three times this deviation + We thus calculate the standard deviation of the distance of all sample-positions + $\fPos{\mStateVec_{t-1}}$ from aforementioned centre $\pathCentroid$. + \commentByFrank{so klarer? platz fuer groese Eq. fehlt und Notation zum ansprechen jedes einzelnen Particles vermeide ich lieber...} + + %\begin{equation} + % d_\text{cen} = \| pos(q_{t-1}) - \pathCentroid \| + % \sigma_\text{cen} = stdDev(distance) + %\end{equation} + + After advancing the starting-vertex by three times this deviation we get the new point $\pathRef$ that is: part of the shortest path, outside of the sample-set and closer (but not too close) to the desired destination. % @@ -273,18 +295,19 @@ % \begin{equation} \begin{split} - p(e) &= - p(v' \mid v) = - \mathcal{N} (\angle e \mid \gHead, \sigma_\text{dev}^2) \cdot \alpha \\ + p(\mEdgeAB) &= + p(\mVertexB \mid \mVertexA) = + \mathcal{N} (\angle \mEdgeAB \mid \gHead, \sigma_\text{dev}^2) \cdot \alpha \\ \alpha &= \begin{cases} - 0.9 & \| v' - \pathRef \| < \| v - \pathRef \| \\ - 0.1 & \text{else} + \mUsePath & \| \mVertexB - \pathRef \| < \| \mVertexA - \pathRef \| \\ + (1-\mUsePath) & \text{else} \end{cases} \end{split} \enskip . \label{eq:transShortestPath} \end{equation} + \commentByFrank{$\mUsePath$ als variable} % @@ -292,20 +315,20 @@ \subsubsection{Multipath} The shortest-path algorithm mentioned in \ref{sec:pathEstimation} already calculated the distance - $\fLength{v}{\dot{v}}$ % = \sum_{i=s}^{e-1} \| v_{i} - v_{i+1} \| $ - for the path from $v$ to the pedestrian's destination $\dot{v}$. + $\fLength{\mVertexA}{\mVertexDest}$ % = \sum_{i=s}^{e-1} \| v_{i} - v_{i+1} \| $ + for the path from $\mVertexA$ to the pedestrian's destination $\mVertexDest$. We thus apply the same assumption as \refeq{eq:transShortestPath} and downvote edges not decreasing the distance to the destination: % \begin{equation} \begin{split} - p(e) &= - p(v' \mid v) = - \mathcal{N} (\angle e \mid \gHead, \sigma_\text{dev}^2) \cdot \alpha \\ + p(\mEdgeAB) &= + p(\mVertexB \mid \mVertexA) = + \mathcal{N} (\angle \mEdgeAB \mid \gHead, \sigma_\text{dev}^2) \cdot \alpha \\ \alpha &= \begin{cases} - 0.9 & \fLength{v'}{\dot{v}} < \fLength{v}{\dot{v}} \\ - 0.1 & \text{else} + \mUsePath & \fLength{\mVertexB}{\mVertexDest} < \fLength{\mVertexA}{\mVertexDest} \\ + (1-\mUsePath) & \text{else} \end{cases} \end{split} \enskip . diff --git a/tex/misc/functions.tex b/tex/misc/functions.tex index a6b591a..9a098c9 100644 --- a/tex/misc/functions.tex +++ b/tex/misc/functions.tex @@ -43,13 +43,21 @@ \newcommand{\mKNN}{\text{knn}} \newcommand{\fPos}[1]{\textbf{pos}(#1)} \newcommand{\fDistance}[2]{\delta(#1, #2)} -\newcommand{\fWA}[1]{\text{wa}(#1)} -\newcommand{\fDD}[1]{\text{dd}(#1)} +\newcommand{\fWA}[1]{\text{wall}(#1)} +\newcommand{\fDD}[1]{\text{door}(#1)} \newcommand{\fImp}[1]{\text{imp}(#1)} \newcommand{\fNN}[2]{\text{nn}(#1, #2)} \newcommand{\fLength}[2]{\text{d}(#1, #2)} -\newcommand{\mTarget}{\dot{v}} +%\newcommand{\mTarget}{\dot{v}} +\newcommand{\mVertexA}{v_i} +\newcommand{\mVertexB}{v_j} +\newcommand{\mEdgeAB}{e_{i,j}} +\newcommand{\mVertexDest}{v_\text{dest}} + +\newcommand{\mUsePath}{\kappa} + +\newcommand{\mStepSize}{s_\text{step}} %\newcommand{\docIBeacon}{iBeacon} @@ -118,12 +126,12 @@ \newcommand{\mMdlDist}{\ensuremath{d}} % distance used within propagation models -\newcommand{\mGraph}{\ensuremath{G}} -\newcommand{\mVertices}{\ensuremath{V}} -\newcommand{\mVertex}{\ensuremath{v}} -\newcommand{\mVertexB}{\ensuremath{w}} -\newcommand{\mEdges}{\ensuremath{E}} -\newcommand{\mEdge}{\ensuremath{e}} +%\newcommand{\mGraph}{\ensuremath{G}} +%\newcommand{\mVertices}{\ensuremath{V}} +%\newcommand{\mVertex}{\ensuremath{v}} +%\newcommand{\mVertexB}{\ensuremath{w}} +%\newcommand{\mEdges}{\ensuremath{E}} +%\newcommand{\mEdge}{\ensuremath{e}}