deliverable d4.2: navigation models, part 2teresaproject.eu/wp-content/uploads/2015/09/d4_2... ·...

53
TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models, Part 2 Project Acronym: TERESA Project Full Title: Telepresence Reinforcement-Learning Social Agent Grant Agreement no. 611153 Due date: M21: August 2015 Delivery: September 1, 2015 Lead partner: UPO Dissemination level: Public Status: Submitted Version: v2.0

Upload: others

Post on 04-Sep-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153 - FP7/2013-2016

Deliverable D4.2: Navigation Models, Part 2

Project Acronym: TERESAProject Full Title: Telepresence Reinforcement-Learning Social Agent

Grant Agreement no. 611153

Due date: M21: August 2015Delivery: September 1, 2015Lead partner: UPODissemination level: PublicStatus: SubmittedVersion: v2.0

Page 2: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

DOCUMENT INFO

Date and Version Number Author Comments07.01.2015 v0.1 Ignacio Pérez-Hurtado Initial version.12.01.2015 v0.2 Luis Merino Revision and state of the art.23.02.2015 v0.3 Ignacio Pérez-Hurtado Results and conclusions.26.02.2015 v1.0 Luis Merino Revision and version 1.0.03.08.2015 v1.1 Ignacio Pérez-Hurtado Including new algorithms.10.08.2015 v1.2 Ignacio Pérez-Hurtado Including experiments at Les

Arcades.12.08.2015 v1.3 Rafael Ramón-Vigo Including Gaussian Mixture

Models part.17.08.2015 v1.4 Ignacio Pérez-Hurtado Adapting executive summary.21.08.2015 v1.5 Luis Merino Revision and executive sum-

mary.31.08.2015 v2.0 All Version 2.0

Page 3: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

Contents

1 Contributors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 Executive summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

I A spatial modeling framework based on Growing Hidden Markov Models 93 Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

3.1 State of the Art . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103.2 Growing Hidden Markov Models . . . . . . . . . . . . . . . . . . . . . . . 11

3.2.1 Updating the Topological Map . . . . . . . . . . . . . . . . . . . 113.2.2 Updating the Model’s Structure . . . . . . . . . . . . . . . . . . . 123.2.3 Updating the Parameters . . . . . . . . . . . . . . . . . . . . . . 123.2.4 Learning and Predicting Motion with GHMMs . . . . . . . . . . . 13

3.3 HITS algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 A Spatial Modeling Framework for TERESA . . . . . . . . . . . . . . . . . . . . . 16

4.1 Learning Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164.1.1 Updating the topological map . . . . . . . . . . . . . . . . . . . . 174.1.2 Discovering goals by using statistical hypothesis testing . . . . . 204.1.3 Discovering goals by using the HITS algorithm . . . . . . . . . . 224.1.4 Updating the HMM structure . . . . . . . . . . . . . . . . . . . . 244.1.5 Updating the HMM parameters . . . . . . . . . . . . . . . . . . . 244.1.6 Prediction of human motion and trajectory goals . . . . . . . . . 26

5 Developed software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276 Experimental results and validation . . . . . . . . . . . . . . . . . . . . . . . . . . 28

6.1 Experiments with the Edinburgh Informatics Forum Database . . . . . . . 296.2 Comparison of algorithms for discovering goals . . . . . . . . . . . . . . . 316.3 BIWI Walking Pedestrian Dataset . . . . . . . . . . . . . . . . . . . . . . . 336.4 Prediction phase validation . . . . . . . . . . . . . . . . . . . . . . . . . . 336.5 Pablo de Olavide University . . . . . . . . . . . . . . . . . . . . . . . . . . 346.6 Experiments in Les Arcades . . . . . . . . . . . . . . . . . . . . . . . . . 38

II A local human-robot interaction modeling framework based on GaussianMixture Models 41

7 A Local Human-Robot Interaction Modeling Framework for TERESA . . . . . . . 427.1 Probabilistic approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

8 Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478.1 Data Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478.2 Results and Observations . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

9 Conclusions and future work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

2

Page 4: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

List of Figures

1 Overview of the GHMM learning algorithm . . . . . . . . . . . . . . . . . . . . . . 112 Informatics Forum hall in the University of Edinburgh . . . . . . . . . . . . . . . . 293 Topological map and discovered goals for the Informatics Forum hall with HITS

algorithm for goal discovering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304 Topological map and discovered goals for the Informatics Forum hall with hy-

pothesis testing for goal discovering . . . . . . . . . . . . . . . . . . . . . . . . . 305 Running the prediction service for the Informatics Forum Hall . . . . . . . . . . . 326 Coffee machine area scheme at UPO . . . . . . . . . . . . . . . . . . . . . . . . 357 Topological map and discovered goals for the coffee machine area at UPO . . . 368 Topological map (blue) and discovered goals (red) for the coffee machine area

at UPO. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369 Running the prediction service for the coffee machine area at UPO . . . . . . . . 3710 Rest room at the first floor of Les Arcades . . . . . . . . . . . . . . . . . . . . . . 3811 Fixed laser close to the door . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3912 Generated model at Les Arcades . . . . . . . . . . . . . . . . . . . . . . . . . . . 4013 Trajectories performed by the user for a particular scenario. The initial position of

the robot, the paths performed and the position and orientation of the interactiontarget and other persons presented are showed. . . . . . . . . . . . . . . . . . . 43

14 Two different time steps within a trajectory are depicted. The distances to eachperson presented at the scene and the relative angle between them are pointedout. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

15 Left: GMM model estimated in the (dIT , θIT ) space with respect to the inter-action target. Right: samples obtained from the model and transformed to the(x, y) space, compared to the original trajectories. . . . . . . . . . . . . . . . . . 44

16 Top: d and θ variables are depicted in terms of time (left) and one against theanother (right). Middle: the constraints extracted from the data by the GMM pro-cess. We have used k=2 components for the multivariate Gaussian distribution.Bottom, left: conditional probability for the distance and angle given time. Bot-tom, right: conditional probability for the angle given the distance. In the bottomfigures, the mean and variance for each time or distance value are representedin blue. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

17 The trajectories retrieved for the experiment are depicted in this set of figures.The initial position of the robot, the paths performed and the position and orien-tation of the interaction target and other persons presented are showed. . . . . . 47

18 Left: GMM model extracted for the task using the relative distance d and angleθ as features. Right: samples extracted from the model and compared with theoriginal trajectories. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

3

Page 5: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

19 Left: our RRT planner without additional models trying to approach an interac-tion target (on the right, brownish arrow; the goal of the robot is denoted by theorange arrow). The same situation with the learned GMM model. It can be seenhow in the former case the robot follows a shortest path avoiding the person,while in the latter the estimated path is closer to the demonstrated paths. . . . . 49

D4.2: Navigation Models, Part 2 Page 4 of 52

Page 6: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

List of Tables

1 Cross-validation experiments for discovering goals in the Edinburgh dataset . . . 312 Cross-validation: average values . . . . . . . . . . . . . . . . . . . . . . . . . . . 313 Edinburgh dataset experiments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344 BIWI dataset experiments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

5

Page 7: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

List of Algorithms

1 ITM Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 HITS algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 Controlling Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 Procedure updateTracking((id, x, y, t), r, τ) . . . . . . . . . . . . . . . . . . . . . 185 Procedure checkT imeOut(time, timeout) . . . . . . . . . . . . . . . . . . . . . . 196 W-ITM algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 Discovering goals by statistical hypothesis testing . . . . . . . . . . . . . . . . . . 228 WA-HITS Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

6

Page 8: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

1 Contributors

The authors of the deliverable are the members of the UPO team.

D4.2: Navigation Models, Part 2 Page 7 of 52

Page 9: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

2 Executive summary

Deliverable 4.2 is the outcome of the work undertaken in Task 4.1, in which spatial and hu-man motion models are considered for social navigation. Such models are very important to effectively plan social paths in environments inhabited by humans, where robots should be able to predict human motion and consider typical human activity in a dynamic scenario. In particular, we aim to estimate typical points of interest in the environment where the robot will operate, and to be able to perform predictions on the motions of people in the environment. Furthermore, we require to model as well the constraints that are related to certain social navi-gation tasks. The models considered in this deliverable should be learnt online using as inputs the localization and pose estimation of people in the vicinity of the robot (that is, the output of Task 2.2). This is the second iteration of the document, in which new algorithms and new experiments are included.

We have used two well-know probabilistic frameworks: Growing Hidden Markov Models (GH-MMs) and Gaussian Mixture Models (GMMs). Thereby, we provide two different but com-plementary approaches to face the problem described above. For each approach, we haveexpanded and adapted the corresponding framework to the particular characteristics of theTERESA project, including new techniques and developing novel algorithms.

The framework of GHMMs is able to learn motion patterns of people incrementally and, at thesame time, uses its current knowledge to predict motion in an on-line fashion. The input of thelearning algorithm is a set of human trajectories in the environment, and it learns an Instanta-neous Topological Map (ITM) [6] that structures the space in Voronoi regions whose centroidsare part of the hidden states for the subsequent Hidden Markov Model. The parameters ofthe HMM are then learned by using the Baum-Welch algorithm [13] and Bayesian inferenceis applied in order to compute the current and future belief over the set of possible goals andVoronoi regions for a current trajectory in real-time. In this work, we expand the generic GHMMframework including algorithms in order to discover goals of human trajectories in scenarioswhere the humans can go out of the range of the robot sensors and there are occlusions cut-ting the trajectories. Finally, we have tested our variant of the framework by using simulatedand real data, including data from the final scenarios of the TERESA project.

On the other hand, we use the framework of GMMs to model the constraints on the robot con-figurations that arise when the robot is performing a navigation task considering persons, likemoving towards an human to initiate a conversation, with or without the presence of other peo-ple (for instance, preferred angles of approach, or proxemics-based restrictions). The frame-work of GMMs is a generic methodology proposed to encode temporally continuous featuresthrough a probabilistic representation, which allows the autonomous and incremental construc-tion of a probabilistic model of the task. Having such a model renders it possible to bias ourmotion planners so that the computed motions comply with the restrictions learned from thedemonstrations.

This document is structured in two parts: the first one is dedicated to the framework of GHMMs,including several improvements over the general framework, as well as experimental resultsand algorithms comparisons by using real and simulated data. The second part is dedicatedto GMMs, presenting the used framework and describing several experimental results. Thedocument ends with a conclusions and future work section.

D4.2: Navigation Models, Part 2 Page 8 of 52

Page 10: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

Part I

A spatial modeling framework basedon Growing Hidden Markov Models

9

Page 11: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

3 Preliminaries

3.1 State of the Art

Robot navigation side by side with people in social environments poses several challenges.Not only obstacle and people avoidance algorithms are required, but also different goals thanclassical path planning are usually pursued. For instance, in [16], the authors discusses pathplanning problems for social robots, which include, for instance, paths that minimize the inter-ference with people (to avoid discomfort), or that maximize the probability to found someone(if we are searching for someone). This requires the capability of predict, up to some extent,human behaviors.

Human behaviors depends typically on spatial variables. People move between rooms or of-fices following similar motion patterns; places of interests, like coffee machines, are relevantwhen considering where people are aiming at, etc. Ad-hoc modeling of these elements is timeconsuming and do not generalize to different environments. Machine learning techniques canbe used to infer these models from data.

[2] is one of the first works to apply learning techniques to estimate typical motion patterns ofpeople in an office and use them for robot path planning. It employs Hidden Markov Models(HMM) to estimate the motion patterns offline from trajectory data. The model is then usedto plan adequate paths for robots, to avoid interference with persons. HMMs are also theframework employed by the Growing Hidden Markov Models framework (GHMMs) [17] and willbe also considered here.

Other approaches extend occupancy grid maps to consider dynamic objects and the occur-rence of events like appearance and disappearance of persons [10, 12]. In [10], a multilayerconcept for Social Navigation is introduced. Each layer has a purpose; one is used to knowthe walkable area map of the environment; another one is used to represent rates of peopleappearing; and the last one represents a place-dependent reliability of the person detector onboard the robot. Authors in [15] present a system of multi probability grids for social mapping.Motion probability grids represent the probable motion of a human moving to a particular tar-get grid cell. Each grid corresponds to a particular discrete time step for each possible targetlocation.

Other models have been also considered. Thus, in [8] motion models grounded on agent-based velocity-space reasoning have been presented, where the resulting model for eachagent is computed using statistical inferencing techniques, like Kalman filters and maximum-likelihood estimation algorithms. This allows a robot to learn individual motion parameters forevery agent in the scene, providing an approach for a collision-free robot navigation amongpedestrian.

In [7], clustering techniques are applied over pedestrian motion data to extract informationabout the use of space and people’s typical global behaviors. This is used by a robot to offerservices to people that are idle in a shopping center. Using the spatial model, the robot isable to predict the most likely behaviors in certain places. In [4], the authors describe a spatialbehavior cognition model to represent the spatial effects in the relations of people and of peopleand the environment. The authors present the concept of ego-graph (PEG) to generate human-like trajectories.

As commented, typical motion patterns and persons intentions are affected by points of interestin the environment, and thus the problem of estimating such points is another application con-sidered in the literature [19]. These points may not have discriminative appearance and shape,

D4.2: Navigation Models, Part 2 Page 10 of 52

Page 12: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

Figure 1: Overview of the GHMM learning algorithm

but they affect the behaviours of people in the scene, for example, they can attract people (suchis the case of vending machines) or repel people to avoid them (e.g. grass lawns).

Due to their versatility, we will consider the Growing Hidden Markov Model as an starting pointfor the developments, and as such it is briefly described in the following:

3.2 Growing Hidden Markov Models

The Growing Hidden Markov Models (GHMMs) framework is an extension to Hidden MarkovModels (HMMs) where the structure of the model reflects the spatial structure of the statespace discretization, and transitions between discrete states are only allowed if the corre-sponding regions are neighbors. We have selected the GHMMs framework as our startingpoint since it includes probabilistic techniques (HMMs) over a dynamically created instanta-neous topological map (ITM), which minimizes the number of possible nodes comparing withother techniques such as grid maps.

The structure learning consists of estimating the best space discretization from data and iden-tifying neighboring regions. The problem is addressed by building a topological map by usingthe instantaneous topological map (ITM) algorithm [6]. For parameter learning, it uses theBaum-Welch technique [13].

The basic elements of a GHMM are:

• The nodes of the ITM.

• The discrete states of a HMM.

• The continuous state of an object.

• The observations provided by sensors.

Structurally GHMMs are identical to regular HMMs except for the fact that the number of statesand the transition structure are not constant, they can change as more input observation se-quences are processed. The other difference lies in the learning algorithm, which is able toincrementally update the model. The general steps of the learning algorithm are depicted inFig. 1 and are detailed in the following subsections.

3.2.1 Updating the Topological Map

The used topological map is a discrete representation of continuous observation space in theform of a graph where nodes represent regions if the space, and edges connect contiguousnodes. Every node i has associated a vector ci, corresponding to the region’s centroid.

The topological map is updated for every available observation Ot using the ITM algorithmwhich has the following properties:

D4.2: Navigation Models, Part 2 Page 11 of 52

Page 13: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

• It minimizes the number of nodes while trying to keep the same average distance be-tween neighbors.

• Has linear time and memory complexity with respect to the number of nodes.

• Edges are a subset of the Delaunay triangulation, meaning that they can exist only be-tween nodes representing adjacent Voronoi regions.

The ITM algorithm is described in Algorithm 1.

Algorithm 1 ITM AlgorithmRequire: Observation Ot. Smoothing factor ε. Insertion threshold τ .1: Matching: Find the nearest node n and the second-nearest node s with respect to a given distance measure.2: Reference vector adaptation: Move the centroid of the nearest node toward the observation by a small fractionε

3: Edge adaptation: (i) Create an edge connecting n and s if it does not already exist. (ii) For each node m inthe neighborhood of n, check if the centroid of s lies inside the Thales sphere through the centroids of n andm. If that is the case, remove the edge connecting n and m. When deleting an edge, check m for emanatingedges; if there are none, remove that node as well.

4: Node adaptation: (i) If the observation Ot lies outside the Thales sphere through the centroids of n and s,and outside a sphere around the centroid of n with a given radius τ , create a new node y with centroid in Ot.Connect nodes y and n. If the centroids of n and s are closer than 0.5 ∗ τ , remove s.

3.2.2 Updating the Model’s Structure

During the topological map update, nodes and edges may be added or deleted. These changesin the topological map are reflected in the GHMM structure as follows:

1. For every new node i in the topological map, add a corresponding discrete state in theGHMM, initializing its prior and self-transition probability to a preset value.

2. For every new edge in the topological map, initialize the corresponding transition proba-bilities to preset values.

3. For every deleted node and edge in the topological map, assign a zero value to thecorresponding state prior and transition probabilities.

4. For every added or modified centroid ci, a related Gaussian distributionG(µi,Σ) is stored,which represents the probability of observation for that centroid (see below). The meanvalue is set as µi = ci. The covariance Σ is considered the same for all the nodes and itis fixed as a parameter of the GHMM learning algorithm.

3.2.3 Updating the Parameters

Parameter learning takes place once per input sequence, after all of the observationsO1:T havebeen processed by the structure learning step described above. The GHMM learning algorithmre-estimates the parameters using an incremental version of the Baum-Welch technique [13]extending it for continuous observation variables and an evolving number of states.

All the observation probabilities’ mean values are assigned during the structure update, andtheir covariance Σ is fixed, as commented in Section 3.2.2. Hence, only the state prior andtransition probabilities need to be re-estimated. The algorithm normalizes the state prior andtransition values assigned in the previous step and applies a single iteration of the incrementalBaum-Welch algorithm.

D4.2: Navigation Models, Part 2 Page 12 of 52

Page 14: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

3.2.4 Learning and Predicting Motion with GHMMs

In [17], it is assumed that pedestrians move in function of their intention to reach a particulargoal. Thus, the state vector contains not only the current position (the current node of the topo-logical map), but also the goal node. Also, it is assumed that, during learning, the observationshave access also to the final goals of the person, and thus the observation vector Ot = [O′t, O

′′t ]

is composed of two variables describing its current O′t state and intended goal O′′t state.

To define the likelihood function for a given observation, it is assumed that the current andintended components of observations are conditionally independent given the current state St:

P (Ot|St) = P (O′t, O′′t |St) = P (O′t|St)P (O′′t |St)

The joint probability distribution over the current and past states and the observations is:

P (St−1, St, O′t, O

′′t ) = P (St−1)P (St|St−1)P (O′t|St)P (O′′t |St)

Where:

P (O′t|[St = i]) = G(O′t;µ′i,Σ′)

P (O′′t |[St = i]) =

{UO′′t , if O′′t is not available,G(O′′t ;µ′′i ,Σ

′′), otherwise

UO′′t is a uniform distribution over the goal domain, µ′i and µ′′i are the mean values of thecurrent and goal components for discrete state i; and Σ′ and Σ′′ are the respective values ofthe covariance matrix for all of the states.

By noting that P (Ot|St) is either a product of Gaussians, or a product of a constant and aGaussian, it is possible to rewrite this probability as a single Gaussian:

P (Ot|[St = i]) =1

ZG(Ot;µi,Σ)

where µi = [µ′i, µ′′i ], and Σ is a block diagonal matrix having the form:

Σ =

[Σ′ 00 Σ′′

]The prediction can be performed using the same algorithms that are used for standard HMMs,without interfering with learning. This is possible because learning takes place immediatelyafter an observed trajectory has finished and, thus, it does not affect prediction in any way.

For every new observation, the current belief is re-estimated by applying the Bayes recursion:

P (St|O1:t) =1

ZP (Ot|St)

∑St−1

P (St|St−1)P (St−1|O1:t−1)

Then, prediction is performed by propagating this estimation H time steps ahead into thefuture:

D4.2: Navigation Models, Part 2 Page 13 of 52

Page 15: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

P (St+H |O1:t) =∑

St+H−1

P (St+H |St+H−1)P (St+H−1|O1:t)

Finally, the probability that an observation is produced in the future is:

P (Ot+H |O1:t) =1

Z

∑St+H

P (St+H |O1:t)P (Ot+H |St+H)

3.3 HITS algorithm

One of the objectives of our algorithm is to automatically discover points of interest in thetopological map. We provide two approaches as described in the next section, one based onstatistical hypothesis testing and another one based on the Hyperlink-Induced Topic Search(HITS) algorithm.

HITS is a network analysis algorithm that was originally conceived for rating Web pages byusing the information of their links [9]. In the HITS algorithm, each node has a Hub score andan Authority score. A node will have a high hub score if it points to many other nodes. On theother hand, a node will have a high authority score is it is pointed by many other nodes.

Authority and hub scores are defined in terms of one another in mutual recursion. An authorityscore is computed as the sum of the scaled hub scores that point to that node. A hub scoreis the sum of the scaled authority values of the pages it points to. It is also possible to weightthe links between nodes [18]. We will try to discover nodes with high authority scores in ourtopological map to infer potential points of interest.

Algorithm 2 presents the pseudocode of the original HITS algorithm:

D4.2: Navigation Models, Part 2 Page 14 of 52

Page 16: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

Algorithm 2 HITS algorithmInput:• Set of pages, G• Number of iterations, K

1: for all page p ∈ G do2: p.auth = 13: p.hub = 14: end for5: for step from 1 to K do6: norm = 07: for all page p ∈ G do8: p.auth = 09: for all page q ∈ incomingNeighbors(p) do

10: p.auth += q.hub11: end for12: norm = norm+ square(p.auth)13: end for14: for all page p ∈ G do15: p.auth = p.auth / norm16: end for17: norm = 018: for all page p in G do19: p.hub = 020: for all page r ∈ outcomingNeighbors(p) do21: p.hub += q.auth22: end for23: norm = norm+ square(p.hub)24: end for25: for all page p ∈ G do26: p.hub = p.hub / norm27: end for28: end for

D4.2: Navigation Models, Part 2 Page 15 of 52

Page 17: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

4 A Spatial Modeling Framework for TERESA

In this section, a new Spatial Modeling Framework is presented to be used with mobile robotsin environments frequented by humans. It is based on GHMMs, but introducing importantchanges in order to work with the sensors on-board of the TERESA robot and manage in-formation of partially observed human trajectories, and extending it to automatically discoverpoints of interest (typical destination goals in the scenario).

The next considerations are considered as starting points:

• We consider an observation as a sequence of absolute positions and instant velocitiesrelated to a human trajectory in the range of the sensors.

• The observation begins when the person enters in the range of the sensors and finisheswhen the person goes out of the range. Moreover, if the same person enters again in therange, a new observation sequence will be considered.

• The system does not know a priori any special information about the environment, suchas the location of doors or points of interest.

With the above considerations, we have designed a Spatial Modeling Framework whose (un-supervised) learning algorithm contains the next features:

• It can be applied on-line in real-time or off-line over recorded data.

• It creates a weighted topological map where points of interest (goals of trajectories) areautomatically discovered by applying analysis over the network.

• It dynamically updates the structure and parameters for a HMM whose states are all thepossible combinations of topological areas and discovered points of interest. Thus, eachstate represents the current area for a person and his trajectory goal.

For each new observation, Bayesian inference can be applied on-line with the aim of determin-ing the probability distribution function for the next possible areas in a time horizon, as well asthe distribution of possible goals for the trajectories being observed.

In the following subsections, we explain in detail the learning and prediction algorithms.

4.1 Learning Algorithm

The Learning Algorithm is formed by a loop (Algorithm 3) that processes the tracking recordsand updates: (i) the topological map (Algorithms 4 and 6), (ii) the list of discovered points ofinterests (Algorithms 8 and 7), (iii) the structure of the HMM (Subsection 4.1.4) and, (iv) theparameters of the HMM (Subsection 4.1.5).

It uses the next input parameters:

• Insertion threshold : Distance in meters to discretize the space into Voronoi regions.

• Tracking rate: Frequency in Hertzs at which an observation is updated.

• Tracking time-out: Time in seconds without receiving any update in order to consider anobservation out of the range of the sensors.

In order to discover goals, we propose two approaches, one is based on statistical hypothesistesting and another one is based on the HITS algorithm, the input parameters are different foreach case.

D4.2: Navigation Models, Part 2 Page 16 of 52

Page 18: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

If using hypothesis testing:

• A P-value threshold to be considered in the hypothesis testing.

• pin is the average relative frequency of people appearing in a node.

• pout is the average relative frequency of people disappearing from a node.

• Ts is the average time in seconds that people stop in a node.

If using the HITS algorithm:

• HITS iterations: Number of iterations to be applied in the algorithm.

A controlling loop is required for receiving the tracking records and forwarding them to thelearning algorithm one by one. The controlling loop also have other responsibilities that aredescribed below.

Thus, the learning algorithm receives each time only one tracking record (id, xt, yt, t), (xt, yt)representing the absolute position in map coordinates in meters of the tracked person withidentifier id at time t in seconds. The algorithm calculates the velocities and keeps the obser-vation until the tracking time-out.

If the time elapsed between two consecutive records is less than the tracking rate, then the lastrecord is discarded. In order to update at a constant tracking rate, the controlling loop shouldrun faster than the tracking rate.

If the Euclidean distance between the position of two consecutive records is greater than theinsertion threshold, then intermediate points are introduced recursively ensuring that the dis-tance between two consecutive points in the observation is always equal or less than thethreshold.

The observation begins to be valid when the distance between its first and last position isgreater than the insertion threshold. We introduce this constraint in order to filter false positivessuch as legs of chairs that can be considered humans by the currently used people detectorsystem based on the lasers on-board the robot. The positions of valid observations are usedto update the topological map. An observation is marked as finished when the difference of thecurrent time and the time-stamp of the last position is greater than the tracking time-out. Theareas considered as points of interest are updated one time per iteration of the controlling loopby analyzing the network formed by the topological map.

The HMM learning algorithm is called periodically in the controlling loop. The HMM learningalgorithm is applied for each finished observation updating the HMM structure and parameters.Finally, the observations are removed from the memory.

Algorithm 3 describes such controlling loop. In Algorithm 5 we present how to mark the finishedobservations and record the nodes where people have been going out of the scene. Algorithm4 presents how to process the tracking records including intermediate points when necessary.

4.1.1 Updating the topological map

The topological map is composed by a network whose nodes are the centroids of Voronoi re-gions and whose edges are Delaunay edges connecting adjacent nodes. Algorithm 6 updatessuch structure.

We have modified the original ITM algorithm in order to keep information related to the numberof persons that cross each edge. We have also added counters to keep information about the

D4.2: Navigation Models, Part 2 Page 17 of 52

Page 19: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

Algorithm 3 Controlling LoopInput:• Controlling loop rate: r1.• Tracking rate: r2.• Insertion threshold: τ .• Tracking timeout: timeout.• HITS iterations: iters• pvalue threshold.• pin• pout• Ts

1: loop2: Receive N tracks3: for i from 1 to N do4: Call updateTracking((id, x, y, t)i, r2, τ). Algorithm 45: end for6: Call checkT imeOut(time, timeout) {time is the current time}. Algorithm 57: Call discoverGoalsByHITS(iters). Algorithm 8 in case of using the HITS algorithm for discovering goals

or Call discoverGoalsByHypothesisTesting(pvalue, pin, pout, Ts) Algorithm 7 in case of using statisticalhypothesis testing for discovering goals.

8: Call updateHMM()9: Sleep 1

r1seconds.

10: end loop

Algorithm 4 Procedure updateTracking((id, x, y, t), r, τ)

Input:• Track: (id, x1, y1, t1).• Tracking rate: r.• Insertion threshold: τ .

1: if id is not being tracked then2: Create a new tracking list Tid = [(x1, y1, 0, 0, t1)]3: else4: Get the last element (x0, y0, vx0 , vy0 , t0) from Tid

5: if (t1 − t0) ≥ 1r

then6: if EuclideanDistance((x0, y0), (x1, y1)) > τ then7: Call updateTracking((id, x0+x1

2, y0+y1

2, t0+t1

2), 2r, τ)

8: Call updateTracking((id, x1, y1, t1), 2r, τ)9: else

10: Add (x1, y1,x1−x0t1−t0

, y1−y0t1−t0

, t1) to Tid

11: if Tid is not initiated then12: if EuclideanDistance((x1, y1), F irstPosition(Tid)) ≥ τ then13: for all (x, y, vx, vy, t) ∈ Tid do14: Call updateTopologicalMap(id, x, y). Algorithm 615: end for16: Mark Tid as initiated17: end if18: else19: Call updateTopologicalMap(id, x1, y1). Algorithm 620: end if21: end if22: end if23: end if

D4.2: Navigation Models, Part 2 Page 18 of 52

Page 20: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

Algorithm 5 Procedure checkT imeOut(time, timeout)Input:• Current time: time• Tracking time-out: timeout

1: for all id being tracked do2: Let (x, y, vx, vy, t) the last element of the tracking list Tid3: if (time− t) ≥ timeout then4: if Tid is initiated then5: Mark Tid as finished6: Let outPeopleWeight(nid) = outPeopleWeight(nid)+1 {nid is the node of the topological map where

person id is located, see Algorithm 6 for more information}7: else8: Remove Tid

9: end if10: end if11: end for

number of persons that appears for the first time in an area and the number of persons that goout of the range of the sensors for each area. Thus, the network is represented by a weighteddirected graph with allowed loop edges that keeps the information about the number of personsthat stay in the same area between time instants instead of going to an adjacent one.

Moreover, a Gaussian Distribution is created and dynamically updated for each node i repre-senting the distribution of observations (O = (x, y)T , the positions provided by the robot track-ers) around the centroid of the area. Such distributions G(µi,Σi) will be used later to calculatethe observation probabilities in the HMM Parameters update phase. They are considered asbivariate Gaussian distributions with probability density function:

P (x, y|i) =1

2π√|Σi|

e−12

(O−µi)T Σ−1i (O−µi)

The Σi matrix is:

Σi =

[σ2x,i ρσx,iσy,i

ρiσx,iσy,i σ2y,i

]with ρi the correlation between x and y.

For each new observed position (x, y), Algorithm 6 determines the corresponding node i in thetopological map and the parameters of its related Gaussian Distribution are updated as follows:

µ′i = µi

µi = (µx,i +x− µx,ini

, µy,i +y − µy,ini

)

ρi = ρi +(x− µx,i)(y − µy,i)− ρi

ni

sx,i = sx,i + (x− µ′x,i)(x− µx,i)

D4.2: Navigation Models, Part 2 Page 19 of 52

Page 21: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

sy,i = sy,i + (y − µ′y,i)(y − µy,i)

σx,i =

√sx,ini − 1

σy,i =

√sy,ini − 1

where ni is the number of observations.

We do not need to use a smoothing factor parameter to adapt the centroids for each newobservation since the centroid is represented by the mean value of the Gaussian Distribution.

Algorithm 6 presents the pseudocode of the described technique.

4.1.2 Discovering goals by using statistical hypothesis testing

We assume that true exits of the scenario should have a higher relative frequency of peoplegoing out of the scenario than rest of the nodes in the ITM, even in the case of nodes wherethe people is apparently going out due to occlusions in the environment or miss-detections inthe tracking system. The same assumption can be taken for the true entries in the scenario.On the other hand, the average stopping time of people in points of interest such a vendormachines should be significantly higher than the rest of the nodes representing walkways.

Thus, one of our approaches to discover goals of trajectories is conducted by using statisticalhypothesis testing, for that, three hypotheses tests (t-tests) are applied considering the pre-vious statements. The main goal of the tests is to differentiate the ITM nodes representingentries/exits, as well as standing points.

ITM nodes with a p-value less than a p-value threshold in one or more of the tests are con-sidered goal points (entry points are also considered as goals, since they may be exit pointsfor other people in the future).The p-values for all the nodes are re-calculated in the main loop.Thus, existent goals could be also removed.

Discovering entry/exit points

For each ITM node i, the mean of the relative frequency of people appearing µin(i) = iinin

is computed, where iin = inPeopleWeight(i) and in is the total number of people who havepassed through the node. The associated standard deviation is computed too:

σin =

√iin(1− µin)2 + (in − iin)µ2

in

in − 1

Then, the next hypothesis test is formulated to check whether the node is an entry point:

• H0: µin is less than or equal to pin

• H1: µin is greater than pin

The value pin is a parameter of the algorithm. The idea is that the relative frequency of peopleappearing at an entry node should be clearly higher than that of a node where people pass by.

D4.2: Navigation Models, Part 2 Page 20 of 52

Page 22: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

Algorithm 6 W-ITM algorithmInput:• Identifier of the tracked person: id• Current position: (x, y)• Insertion threshold: τ

1: if The network is empty then2: Create a node n3: Call updateGaussianDistribution(n, x, y)4: Let prev = nid and nid = n5: else6: if The network contains only one node then7: let n the first node of the network8: if The distance between ncentroid and (x, y) is greater than τ then9: Create a node r

10: Call updateGaussianDistribution(r, x, y)11: Let prev = nid and nid = r12: Create edges (n, r) and (r, n) with weight 0.13: else14: Call updateGaussianDistribution(n, x, y)15: Let prev = nid and nid = n16: end if17: else18: Let n the node whose centroid is nearest to (x, y) and s the second nearest19: if n and s are not connected by edges then20: Create edges (n, s) and (s, n) with weight 0.21: end if22: for all node m in the neighborhood of n do23: if m 6= n and m 6= s and scentroid is inside the Thales’ circle from mcentroid to ncentroid then24: if m and s are not connected by edges then25: Create edges (m, s) and (s,m) with weight 0.26: end if27: Let (n, s)weight = (n, s)weight + (n,m)weight

28: Let (s,m)weight = (s,m)weight + (n,m)weight

29: Let (m, s)weight = (m, s)weight + (m,n)weight

30: Let (s, n)weight = (s, n)weight + (m,n)weight

31: Remove edges (n,m) and (m,n)32: end if33: end for34: if (x, y) is out of the Thales’ circle from ncentroid to scentroid and

the distance from (x, y) to ncentroid is greater than tau then35: Create a node r36: Call updateGaussianDistribution(r, x, y)37: Let prev = nid and nid = r38: Create edges (n, r) and (r, n) with weight 0.39: else40: Call updateGaussianDistribution(n, x, y)41: Let prev = nid and nid = n42: end if43: end if44: end if45: if prev is null then46: Let inPeopleWeight(nid) = inPeopleWeight(nid) + 147: else48: if prev and nid are not connected by edges then49: Create edge (prev, nid) with weight 0.50: if prev 6= nid then51: Create edge (nid, prev) with weight 052: end if53: end if54: Let (prev, nid)weight = (prev, nid)weight + 155: end if

D4.2: Navigation Models, Part 2 Page 21 of 52

Page 23: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

The hypothesis test to determine whether a node is an exit point is analogous to the one usedfor entry points, but using iout = outPeopleWeight(i) instead of iin and pout instead of pin.

Discovering standing points

During the tracking process, each node i stores and updates its average standing time is, i.e,the average time people stop in the area corresponding to that node. Its associated standarddeviation is also calculated. Thus, the next hypothesis test can be formulated to check whethera node i is a standing point:

• H0: is is less than or equal to Ts seconds.

• H1: is is greater than Ts seconds.

The value of Ts seconds is a parameter of the algorithm.

Algorithm 7 Discovering goals by statistical hypothesis testingInput:• p-value threshold.• pin• pout• Ts• A weighted topological map M

1: for all node i ∈M do2: Compute t-test for entry point and generate pvalue13: Compute t-test for exit point and generate pvalue24: Compute t-test for standing point and generate pvalue35: if pvalue1 ≤ threshold or pvalue2 ≤ threshold or pvalue3 ≤ threshold then6: Set i as goal7: else8: Unset i as goal9: end if

10: end for

4.1.3 Discovering goals by using the HITS algorithm

Another approximation to discover points of interest in the topological map is a variant of theHITS algorithm where the initial Hub and Authority scores for node n are defined respectively byoutPeopleWeight(n) and inPeopleWeight(n) (see Algorithms 6 and 5). Moreover, we includethe weight of the links in the iterative calculus of the scores in order to weight the amount ofpeople crossing the links. Note that the network includes loop edges whose weights are relatedto the number of persons that stay in the same area instead of moving to an adjacent one.

After computing the hub and authority scores, the nodes with higher authority scores attractand sum the authority scores of nodes with lower value at distance 1 or 2 in the network. Thesame method is applied for the hub scores. This kind of clustering is applied because all theauthorities or hubs tend to group very close in the same region of the network and we areinterested in differentiate single nodes with a high authority score for each region.

Algorithm 8 presents the pseudocode of the designed algorithm.

D4.2: Navigation Models, Part 2 Page 22 of 52

Page 24: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

Algorithm 8 WA-HITS AlgorithmInput:• A weighted topological map M• Number of iterations, K

1: for all node n ∈M do2: n.hub = max(1, outPeopleWeight(n))3: end for4: for step from 1 to K do5: norm = 06: for all node n ∈M do7: n.auth = inPeopleWeight(n)8: for all node m ∈ incomingNeighbors(n) do9: n.auth += m.hub ∗ edgeWeight(m,n)

10: end for11: norm = norm+ square(n.auth)12: end for13: for all node n ∈M do14: n.auth = n.auth / norm15: end for16: norm = 017: for all node n ∈M do18: n.hub = outPeopleWeight(n)19: for all page m ∈ outcomingNeighbors(n) do20: n.hub += m.auth ∗ edgeWeight(n,m)21: end for22: norm = norm+ square(n.hub)23: end for24: for all node n ∈M do25: n.hub = n.hub / norm26: end for27: end for28: for all node n in M following a desceThe nding order of authority score do29: for all node m at distance 1 or 2 of n do30: if n.auth > m.auth then31: n.auth+ = m.auth32: m.auth = 033: end if34: end for35: end for36: for all node n in M following a descending order of hub score do37: for all node m at distance 1 or 2 of n do38: if n.hub > m.hub then39: n.hub+ = m.hub40: m.hub = 041: end if42: end for43: end for

D4.2: Navigation Models, Part 2 Page 23 of 52

Page 25: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

4.1.4 Updating the HMM structure

The states of the defined HMM in our model are all possible combinations (n, p) where n is anode of the topological map and p is a point of interest (goals) from the set of the nodes in thenetwork with a high authority score.

The transition probability from state S1 = (n, p) to state S2 = (m, q) is zero if there is not anedge connecting n and m in the topological map or if the weight of the edge is zero.

Thus, the number of states in the HMM are N ∗ P where N is the number of nodes in thetopological map and P is the number of discovered points of interest.

And the number of possible transitions in the HMM are E ∗P 2 where E is the number of edgeswith weight greater than zero in the topological map and P is the number of discovered pointsof interest.

The structure of the HMM is updated with the following rules:

• For each new node n in the topological map, create all possible states (n, p) where p iscontained in the list of discovered points of interest. Assign a default initial prior proba-bility to each created state and initiate all the related transition probabilities to a defaultvalue if there exists the corresponding edge in the topological map with weight greaterthan zero.

• For each removed node n in the topological map, remove all the states (n, p) and assigna zero value to all the related prior and transition probabilities.

• For each new point of interest p, create all possible states (n, p) where n is one of thenodes in the topological map. Assign a default initial prior probability to each new stateand initiate all the related transition probabilities with a default initial value if there existsthe corresponding edge in the topological map with weight greater than zero.

• For each removed node p from the list of points of interest, remove all the states (n, p)and assign a zero value to all the related prior and transition probabilities.

• For each new edge (n,m) in the topological map with weight greater than zero, assign adefault initial value to all possible related transition probabilities.

• For each removed edge (n,m) in the topological map, assign a zero value to all therelated transition probabilities.

All the probabilities will be normalized in the next step.

4.1.5 Updating the HMM parameters

For each finished observation sequence from the person tracker, the HMM state prior andtransition probabilities are re-estimated following the incremental Baum-Welch algorithm asdone in the GHMMs framework:

1. Normalize the state prior and transition values.

2. Precompute αi (forward probabilities), βi (backward probabilities) and p0 (joint observa-tion probability) for the observation sequence O1:T following the standard Baum-Welchalgorithm.

3. For every discrete state i, re-estimate the state prior πi = P (St = i):

D4.2: Navigation Models, Part 2 Page 24 of 52

Page 26: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

π′i =α1(i)β1(i)

p0,

πi =(k − 1)πi + π′i

k

where k is the number of observation sequences that have been observed so far.

4. Re-estimate every non-zero transition probability aij = P (St = i|St−1 = j):

a′ij =ΣTt=2αt−1(i)aijP (Ot|St = j)βt(j)

ΣTt=2αt−1(i)βt−1(i)

aij =(k − 1)aij + a′ij

k

The observation probability P (Ot = (x, y, vx, vy)t|St = (n, p)) (needed to calculate the forwardand backward probabilities) is defined as the joint probability of the observation (x, y) condi-tioned on the person being in the Voronoi region n with centroid (nx, ny), and the probabilityof observing the velocities (vx, vy) conditioned to be related to a trajectory with goal on theVoronoi region p with centroid (px, py).

P ((x, y, vx, vy)t|St = (n, p)) = P (x, y|n)P (vx, vy|n, p)

The first probability is given by the Gauss Distribution corresponding to node n in the topologi-cal map:

P ((x, y, vx, vy)t|St = (n, p)) = Gn(x, y;µn,Σn)P ((vx, vy)|n, p)

For the second probability we assume that the velocity vector of the person should point to thegoal of the trajectory. In this sense, a Gaussian bivariate distribution G′p(µ′p,Σ′p) is determinedwith the parameters:

µ′p = (px − nx√

(px − nx)2 + (py − ny)2,

py − ny√(px − nx)2 + (py − ny)2

)

Σ′p =

[σvx

2 00 σvy

2

]where σvx and σvy are estimated depending on the distance to the goal.

Finally,

P ((x, y, vx, vy)t|St = (n, p)) = Gn(x, y;µn,Σn)G′p(vx√v2x + v2

y

,vy√v2x + v2

y

;µ′p,Σ′p)

D4.2: Navigation Models, Part 2 Page 25 of 52

Page 27: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

4.1.6 Prediction of human motion and trajectory goals

For every new observation sequence O1:T the current belief is re-estimated:

P (St|O1:t) =1

ZP (Ot|St)

∑St−1

P (St|St−1)P (St−1|O1:t−1)

Then, we can define the belief about the current Voronoi area where the person is located:

P (nt|O1:t) =1

Z

∑p

P (St = (n, p)|O1:t)

And the belief about the distribution of possible goals of the trajectory:

P (pt|O1:t) =1

Z

∑n

P (St = (n, p)|O1:t)

Then, prediction is performed by propagating the estimationH time steps ahead into the future:

P (St+H |O1:t) =∑

St+H−1

P (St+H |St+H−1)P (St+H−1|O1:t)

and computing again the belief about the current Voronoi area and possible goal of the ob-served trajectory.

D4.2: Navigation Models, Part 2 Page 26 of 52

Page 28: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

5 Developed software

The developed software for this deliverable is composed by a ROS package called spatial_model.In order to know the people pose, a ROS topic called pdt_node/people_pose is used by thepackage. This topic can be published by another package or can be simulated by the nodepeople_simulator as explained below.

The ROS package has the following nodes:

• training_ttest: This node is subscribed to the people pose and executes the learningalgorithms in order to generate the topological map and discover the goals by applyingthe statistical hypothesis testing technique. Additionally, it can generate the HMM duringthe network creation. The parameters of the learning algorithms are passed as inputparameters for the node. Finally, the node creates a file with all the learned structuresand parameters. The file can be used to continue the learning process in next sessionsor as input for the prediction node. The node also publishes several markers in order toshow the structure of the network and the discovered goals in the Rviz GUI.

• training_hits: This node is analogous to the one described above, the only differenceis that this one uses the HITS algorithm in order to discover goals of trajectories.

• prediction_service: This node reads a file generated by the previous node and finalizesthe HMM learning process if it was not concluded. In that case, the file is updated. Afterthat, the node is subscribed to the people pose topic and internally calculates the beliefover the set of ITM nodes and possible goals for each person being tracked. The noderuns a ROS service accepting queries for prediction in a time horizon. Each query mustinclude the pdt_node/people_pose identifier for the subject and the desired time horizon(it could be zero for the current belief). Then, the node calculates the prediction returningthe probabilistic distribution of nodes and goals. The node also publishes the necessarymarkers for showing the structure of the network and the whole set of goals in the RvizGUI, as well as markers for showing the belief over nodes and goals for the people beingtracked.

• demo_upo: This node runs a preliminary demonstration of navigation including the infor-mation provided by the prediction service. The robot waits for a person to enter in thescenario and navigates to his goal with the aim of intercepting him; when the persongoes out of the scenario, the robot comes back to an initial point. This demo is conceivedto run ad-hoc by using the model learned for the coffee area at the building 45 in theUniversity Pablo de Olavide. For more details about this model, see the next section.

As commented, the system accepts as inputs the people detected by the person detectionmodules. In order to test the system in simulation, a people_simulator node has been alsodeveloped. This node reads the information from two public datasets: the Edinburgh Infor-matics Forum Pedestrian Database1[11] and the BIWI Walking Pedestrian Dataset 2[14] andsimulates the trajectories by publishing the people pose topic at a configurable rate. The nodeis able to simulate several trajectories at the same time. In order to process the information ofthe Edinburgh datasets, a C++ parser was developed by using the tools flex and bison.

1http://homepages.inf.ed.ac.uk/rbf/FORUMTRACKING/2http://www.vision.ee.ethz.ch/datasets/index.en.html

D4.2: Navigation Models, Part 2 Page 27 of 52

Page 29: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

6 Experimental results and validation

In order to validate the model, we have run experiments in two simulated environments andtwo real environments:

1. A simulated environment based on real data from the Edinburgh Informatics ForumPedestrian Database.

2. A simulated environment based on real data from the BIWI Walking Pedestrian Dataset.

3. A real environment in the University Pablo de Olavide.

4. A real environment in Les Arcades.

In the first and second cases, we have used public databases with tracked trajectories recordedby zenithal cameras. Our software was able to read the databases and reproduce such trajec-tories within the ROS framework.

In the third and fourth cases, we have used the TERESA robot sensors (the lasers) to recordreal trajectories.

The same methodology was applied in all cases:

• Learning algorithm parameters:

– insertion threshold : 1 meter.

– tracking rate: 1 second.

– tracking timeout : 5 seconds.

– HITS iterations: 100

– p-value threshold : 0.001

– pin: 0.5

– pout: 0.5

– Ts: 1 second.

• Experimental protocol:

1. Record a first ROS bag file for training.

2. Record a second ROS bag file for prediction.

3. Generate the topological map and discover the goals by using the first file.

4. Generate the HMM by using the first file and the output of the previous step.

5. Apply the prediction service by using the second file and the HMM in different timehorizons.

Note that we have generated the HMM after generating the topological map and discoveringthe goals. Although the software is able to update all the structures and parameters online andat the same time, we did such steps for evaluation.

D4.2: Navigation Models, Part 2 Page 28 of 52

Page 30: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

Figure 2: Informatics Forum hall in the University of Edinburgh

6.1 Experiments with the Edinburgh Informatics Forum Database

The Edinburgh Informatics Forum Pedestrian Database is a public dataset of trajectories thatcan be downloaded from [11].

The dataset consists of a set of detected targets of people walking through the InformaticsForum, the main building of the School of Informatics at the University of Edinburgh. The datacovers several months of observation which has resulted in about 1000 observed trajectorieseach working day, resulting in more than 92000 observed trajectories.

There are several entry/exit points for an area of 15,80 x 11,85 meters as seen in Fig. 2. Thecamera is fixed overhead approximately 23 meters above the floor and the capture rate is about9 frames per second.

Our software reads the files from the database and generates up to 20 simultaneous trajec-tories within the ROS framework. For the learning algorithms we have used 2000 trajectoriesgenerating two different models, the first one uses the hypothesis testing method and the sec-ond one uses the HITS algorithm for goals discovering. The generated ITM network is thesame for both models and it is composed by 341 nodes and 962 edges. The model generatedwith hypothesis testing contains 9 goals (Fig. 4). On the other hand, the model generated withthe HITS algorithm includes 13 goals (Fig. 3). In Fig. 2 the true main entry/exit points aremarked with arrows, as can be observed there are 10 true goals.

In Fig. 5, it is shown a sequence of frames running the prediction service for a trajectory ata time horizon of 10 seconds. In the images, the arrow represents the current position of thetracked person; the red dots are marking the position of the possible goals and the size of each

D4.2: Navigation Models, Part 2 Page 29 of 52

Page 31: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

Figure 3: Topological map and discovered goals for the Informatics Forum hall with HITSalgorithm for goal discovering

Figure 4: Topological map and discovered goals for the Informatics Forum hall with hypothesistesting for goal discovering

D4.2: Navigation Models, Part 2 Page 30 of 52

Page 32: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

Table 1: Cross-validation experiments for discovering goals in the Edinburgh dataset

Hypothesis testing method HITS algorithm

discoveredgoals

percentage of trajectoriesin the validation subset

going to a discovered goal

discoveredgoals

percentage of trajectoriesin the validation subset

going to a discovered goalset 1 10 79,79 8 71,05set 2 9 71,32 10 75,78set 3 9 73,57 9 75,51set 4 9 73,63 10 76,48set 5 9 67,20 9 70,01set 6 9 74,71 10 75,81set 7 8 70,79 10 73,10set 8 8 66,88 8 67,63set 9 9 74,63 10 75,98

set 10 9 76,79 10 77,56

Table 2: Cross-validation: average values

Hypothesis testing method HITS algorithmAverage number ofdiscovered goals

8,9 9,4

Average percentage of trajectoriesgoing to discovered goals

72,93 73,89

Average percentage of trajectoriesgoing to discovered goals

by number of discovered goals81,95 78,61

Average learning time 19s 6m54s

dot is directly related with the probability to reach the goal. On the other hand, the position andsize of the green dots are representing the probability distribution of the next areas in thespecified time horizon.

6.2 Comparison of algorithms for discovering goals

In order to compare the algorithms for discovering goals, we have run 10 cross-validationexperiments over the whole Edinburgh dataset composed by 100.000 trajectories. Thus, thedataset has been divided in 10 sets of 90.000 trajectories for learning and 10.000 trajectoriesfor validation by applying a sliding window technique.

For each experiment, we have trained the model by using the learning subset and we havecounted the number of discovered goals. On the other hand, we have counted the number oftrajectories in the validation subset that finish in the Voronoi area of one of the discovered goals.Furthermore, we have measured the average time of computation for the learning process. Theresults for both algorithms are shown in table 1 and table 2.

Both algorithms discover a number of goals very close to the number of true goals in thescenario. We can see that the HITS algorithm learns more goals in average than the hypothesistesting method; but the average percentage of trajectories going to discovered goals is quitesimilar for both techniques, indeed the average percentage of trajectories going to discoveredgoals by number of discovered goals is better for the hypothesis testing method. Therefore, the

D4.2: Navigation Models, Part 2 Page 31 of 52

Page 33: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

(a) (b)

(c) (d)

(e) (f)

Figure 5: Running the prediction service for the Informatics Forum Hall

D4.2: Navigation Models, Part 2 Page 32 of 52

Page 34: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

cross-validation experiments show that the hypothesis testing method is more accurate thanthe HITS algorithm for discovering goals. On the other hand, it is important to mention that theaverage learning time is 21 times less for the hypothesis testing method. For these reasonswe will use the hypothesis testing method for the next experiments in this deliverable.

6.3 BIWI Walking Pedestrian Dataset

This dataset was recorded from the top of the ETH main building (Zurich) at 2.5 frames persecond. As before, the dataset provides people’s positions with unique ids, allowing easytrajectory computation. We used 160 trajectories to train an ITM of 223 nodes, 517 edges and5 discovered goals. The HMM contains 1,115 states and 26,965 non-zero transitions.

6.4 Prediction phase validation

The objective of this section is to provide a quantitative criteria to assess the accuracy of thepredictions based on the models learnt previously. The two first datasets were used for this.They incorporate the final goal of every person, which was used as ground-truth to evaluatepredictions. Nonetheless, this information was not used to build the ITM nor the HMM.

A subset of the trajectories were not used in the training phase and are used here to evaluatethe prediction phase. Particularly, 200 trajectories for Edinburgh and 159 for BIWI. Two arethe main factors we can evaluate with these test datasets: (1) how accurately the methoddiscovers the position of the different goals in the models and (2) the accuracy of the goalprediction during a person trajectory.

Regarding trajectories with ground-truth (actual goals), we want to evaluate how accuratelyour approach predicts the person’s goal based on his/her trajectory. For this purpose, people’strajectories were divided into segments of 25%, 50%, 75% and 100% of their length. Thepredictions of our algorithm were evaluated at these points and compared to the ground-truth.Two metrics were computed to assess this prediction phase:

• Metric 1:∑

g∈G P (g|O1:t)kg

• Metric 2:∑

g∈G P (g|O1:t)dg

where:

• G is the set of possible goals.

• P (g|O1:t) is the probability of goal g to be the goal of the trajectory O1:T based on thebelief at time t.

• kg is 1 if g is the actual goal of the trajectory O1:T , 0 otherwise.

• dg is the Euclidean distance of the centroid of g to the centroid of the goal of O1:T .

Metric 1 evaluates how accurately the approach predicts the correct goal (regarding the ground-truth), providing the probability of sampling the right goal conditioned to all the previous obser-vations. The closer to 1 the result of Metric 1 is, the better. Metric 2 tries to assess the accuracyof the position of the predicted goals, that means, if the predicted goal is close or far from theactual goal. We use the Euclidean distance in meters for Metric 2, and the smaller the value,the better.

Tables 3 and 4 show the outcome of these metrics for our experiments. The tables depictaverage values and standard deviations of each metric after running all the test trajectories. It

D4.2: Navigation Models, Part 2 Page 33 of 52

Page 35: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

can be seen how the prediction is clearly improved with the length of the trajectories for theEdinburgh dataset, while the prediction in the BIWI dataset is very good for all cases. It canalso be seen how the standard deviations of the metrics also decrease with the length of thesegment, as expected.

In addition, a hypothesis test (t-test) was run for Metric 1, contrasting the obtained averagevalues with the uniform distribution; i.e, considering 9 goals for the Edinburgh Dataset and 5goals for the BIWI Dataset, the random guess of the goal for a given trajectory has respectivelya probability of 1/9 or 1/5.

• H0: The average value of Metric 1 is less than or equal to 1/9 in the case of the Edinburghdataset or 1/5 in the case of the BIWI dataset.

• H1: The average value of Metric 1 is greater than 1/9 in the case of the Edinburgh datasetor 1/5 in the case of the BIWI dataset.

The p-values are shown in the last column of Tables 3 and 4. It can be seen how the value isvery small (insignificant) for all the cases.

Metric 1 Metric 2Trajectory mean σ mean σ p-value

25% 0.4774 0.4259 3.4465 3.6886 < 2.2 ∗ 10−16

50% 0.5857 0.4264 2.3300 2.9505 < 2.2 ∗ 10−16

75% 0.8381 0.3223 0.8850 2.2087 < 2.2 ∗ 10−16

100% 0.9937 0.0511 0.0647 0.5335 < 2.2 ∗ 10−16

Table 3: Edinburgh dataset experiments.

Metric 1 Metric 2Trajectory mean σ mean σ p-value

25% 0.8983 0.2351 1.1276 2.8390 < 2.2 ∗ 10−16

50% 0.9247 0.2112 0.7643 2.6173 < 2.2 ∗ 10−16

75% 0.9425 0.1898 0.7641 3.0416 < 2.2 ∗ 10−16

100% 0.9802 0.1095 0.3381 1.8972 < 2.2 ∗ 10−16

Table 4: BIWI dataset experiments.

6.5 Pablo de Olavide University

The coffee machine area in the building 45 of the Pablo de Olavide University (UPO) (Fig. 6)is an area of 4.30 × 11.80 meters with an entry point from two corridors and several points ofinterest: three coffee and snack machines, three toilette doors, a water font and a rest areawith chairs and bar-style tables.

The robot used the two laser-scanners for person detection and tracking, applying the algorithmin [1] and a Kalman Filter for temporal tracking and velocity estimation. More than 200 peopletrajectories were recorded in a dataset and used to train the models3, generating a topologicalmap with 21 nodes, 32 edges and 5 discovered goals (see Fig. 7 and Fig. 8). The algorithmwas able to discover as goals all the points of interest in the scene: (1) entry/exit door; (2)water font, (3) toilets, (4) coffee/snack machines, (5) rest area. The corresponding GHMM was

3The ITM algorithm was run with τ = 1 meter for node insertion and p− value = 10−4 for hypothesis testing.

D4.2: Navigation Models, Part 2 Page 34 of 52

Page 36: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

Figure 6: Coffee machine area scheme at UPO

trained by sampling the people trajectories at Ts = 1 Hz, resulting in 105 states and 1,705transition probabilities.

Fig. 9 shows a sequence of frames running the prediction service for a trajectory at a timehorizon of 3 seconds. In the images, the meaning of the arrow, red and green dots are thesame than in the experiments in the simulated environment of Edinburgh Informatics Forum.For these experiments we have generated a model by using an insertion threshold of 0.5meters.

D4.2: Navigation Models, Part 2 Page 35 of 52

Page 37: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

Figure 7: Topological map and discovered goals for the coffee machine area at UPO

Figure 8: Topological map (blue) and discovered goals (red) for the coffee machine area atUPO.

D4.2: Navigation Models, Part 2 Page 36 of 52

Page 38: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

(a)(b)

(c)(d)

Figure 9: Running the prediction service for the coffee machine area at UPO

D4.2: Navigation Models, Part 2 Page 37 of 52

Page 39: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

Figure 10: Rest room at the first floor of Les Arcades

6.6 Experiments in Les Arcades

The rest room at the first floor of Les Arcades in Troyes (Fig. 10) is one of the final scenariosof the TERESA project.

During three days in March 2015 we have recorded real data of trajectories by locating a fixedlaser close to the main door of the room. We have located during three days in a row a fixedlaser instead of the robot for practical reasons. The detection of persons technique basedon laser where used as in the UPO experiments. We have located the same model of laserthan the lasers on board of the TERESA robot and it is exactly at the same height from thefloor. Thus, the generated model can be used in the next navigation experiments by using theTERESA robot.

The room represents a changeling scenario for tracking persons by using the laser sensor,since the large number of chairs that can product false positives detecting persons. This prob-lem will be avoid in next experiments by incorporating the Kinect sensor to the detection ofpersons.

The position of the groups of tables and chairs is approximately the same for the three days;then, for generating the model, we have manually marked the areas where tables and chairsare located and the we have filtered the tracked human positions in those areas.

3909 trajectories where recorded and the resulting model (Fig. 12) contains 19 ITM nodes,32 ITM edges, 4 goals, 76 HMM states and 1100 non-zero HMM transition probabilities. Thegoals correspond to (1) the main door, (2) the fridge position, (3) entry/exit point and (4) tableswhere people have lunch. The parameters of the training algorithm where the same than the

D4.2: Navigation Models, Part 2 Page 38 of 52

Page 40: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

Figure 11: Fixed laser close to the door

used for the coffee area experiments at UPO.

D4.2: Navigation Models, Part 2 Page 39 of 52

Page 41: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

Figure 12: Generated model at Les Arcades

D4.2: Navigation Models, Part 2 Page 40 of 52

Page 42: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

Part II

A local human-robot interactionmodeling framework based on

Gaussian Mixture Models

41

Page 43: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

7 A Local Human-Robot Interaction Modeling Framework for TERESA

The previous sections have presented global spatial models of typical motions of people, whichcan be used by the global task and path planners to consider human intentions and potentialdestinations when planning next robot actions.

We are also interested in modeling local interactions between the robot and the persons forcertain tasks, like approaching a person, or avoiding a group. These models will be then usedby the local planners of T4.3 depending on the social situation. Here we present methods toobtain, in an unsupervised way, these human-robot interaction models from the data gatheredby the TERESA telepresence robot. While the method is general, we present results in the par-ticular task of approaching a person from experiments performed at the UPO’s premises. In thenext phases of the project, the same methodology will be employed to model additional skillsrequired for the TERESA scenarios, like walking side-by-side with a person or approachinggroups.

7.1 Probabilistic approach

It is complicated to model mathematically the way persons typically perform tasks like ap-proaching an interaction target. However, in TERESA we can leverage the fact that we havea telepresence robot, so we can extract useful information from the users of the robot. Usingexamples of (teleoperated) robot paths and the relevant configurations (features) of the per-formed task (for instance, the location of the interaction target and other persons who mayappear) we intend to extract the relevant relations or constraints that best represent such kindof paths. Our hypothesis is that these paths enclose the social implications that a human takesinto account when he is performing such task, at least at the same situations performed in theexperiments.

As an example, Fig. 13 shows several trajectories performed by the teleoperated robot in thetask of approaching a person with other two persons present. It can be seen how certainconfigurations of the robot are avoided. Then, we would like to extract the relevant informationand integrate them into our planners.

In this work we are interested in modeling in an unsupervised fashion the relationships be-tween the relevant features that arise when the robot is performing a particular navigation task.One approach is to encode these relationships with Gaussian Mixture Models (GMM). Notonly GMMs are a well-suited representation for unsupervised extraction of continuous featuredistributions, but it has also been shown its utility as a model for robot skills representationsin programming by demonstration settings [3]. That work shows that GMMs have some nicecharacteristics to represent a navigation task: 1) to provide a compact and efficient represen-tation of high-dimensional data; 2) to classify existing and detect new skills; 3) to evaluate areproduction attempt; 4) to extract the constraints of the skill; and 5) to reproduce the learnedskill in a different situation by generalizing over multiple observations.

Here, differently from [3], we intend to use these models in our sampling-based planners toconstraint the solutions. One way to do this is to bias the samples towards the regions of theconfiguration space that comply with the model of the task extracted from data. GMMs fit verywell for this approach.

A proper choice of the relevant features f = [f1, f2, . . . , fn]T when encoding a particular naviga-tion task is crucial, as it provides part of the solution to the problem of defining what is importantto imitate. For the work developed here, we have considered as features the distance and the

D4.2: Navigation Models, Part 2 Page 42 of 52

Page 44: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

Figure 13: Trajectories performed by the user for a particular scenario. The initial position ofthe robot, the paths performed and the position and orientation of the interaction target andother persons presented are showed.

Figure 14: Two different time steps within a trajectory are depicted. The distances to eachperson presented at the scene and the relative angle between them are pointed out.

relative angle between the robot and each of the persons presented at the scene. Figure 14shows two different time steps of one of the trajectories of Fig. 13; the features extracted ateach time instant are highlighted. The angle values, θ, are continuous measures from [−π, π),being negative the clockwise ones (respect to the person’s gaze).

From the example trajectories of the features, it is possible to extract a GMM, so that theprobability of a particular combination of feature values is given by:

p(f) =k∑i=1

ωiN (f ;µi,Σi)

with k Gaussian modes, where each mode of the GMM is characterized by a multi-variateGaussian distribution with mean and covariance matrix:

µi =

f̄ i1f̄ i2...f̄ in

D4.2: Navigation Models, Part 2 Page 43 of 52

Page 45: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

Σi =

Σi

11 Σi12 · · · Σi

1n

Σi21 Σi

22 · · · Σi2n

......

. . ....

Σin1 Σi

n2 · · · Σinn

The GMM parameters are estimated using the Expectation-Maximization algorithm. This methodrequires prior knowledge about the number of components (or Gaussians). One usual crite-rion for model selection is the Bayesian Information Criterion (BIC), which performs a trade-offbetween how well the model fits the data and a penalty factor aiming at minimizing the numberof parameters. The main drawback of BIC is that it requires the estimation of multiple models.For the experiments presented in this work, we have tested empirically the best number ofcomponents that can fit the demonstrated example.

As an example, Fig. 15, left, shows the GMM model extracted from the dataset of Fig. 13by considering as feature space f = [dIT , θIT ]T , with dIT the relative distance and θIT therelative angle with respect to the interaction target (IT). It can be seen how the GMM extractsthe constraints that best achieve the task being performed in terms of the variables used toencode it (distance and angle values).

Figure 15: Left: GMM model estimated in the (dIT , θIT ) space with respect to the interactiontarget. Right: samples obtained from the model and transformed to the (x, y) space, comparedto the original trajectories.

Once the model is available, it can be used within our sampling-based planners to obtainsamples according to the task. Fig. 15, right, shows samples extracted from the model andtransformed into the X-Y knowing the pose of the interaction target.

As commented above, a very important aspect is the selection of features. For instance, it ispossible to consider time, velocities, etc, as features of the model in order to consider dynamiccharacteristics of the task as well. Also, when planning a task certain features could be fixed orbeing considered as inputs (for instance, time instants or distances to the target). The modelallows reasoning about the desired distribution of the rest of features by using conditionalprobabilities. If we denote by fI the set of input features and by fO the set of output features,so that f = [fTI , f

TO ]T , the conditional probability of the values of the output features given the

input values is given by:

p(fO|fI) =p(f)

p(fI)=

p(f)∫p(f)dfO

=

k∑i=1

ωiN (f ;µi,Σi)∑k

i=1 ωi∫N (f ;µi,Σi)dfO

=

k∑i=1

ωiN (f ;µi,Σi)∑k

i=1 ωiN (fI ;µiI ,ΣiI)

D4.2: Navigation Models, Part 2 Page 44 of 52

Page 46: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

After some manipulation:

p(fO|fI) =∑i

πip(fO|fI , i)

where p(fO|fI , i) is the conditional probability for each mode of the GMM:

p(fO|fI , i) = N (fO;µiO|I(fI),ΣiO|I)

where:

µiO|I(fI) = µiO − ΣiOI(Σ

iI)−1(fI − µiI)

ΣiO|I = Σi

O − ΣiOI(Σ

iI)−1Σi

OIT

and where µiO and ΣiO denote the mean vector and covariance matrix sub-blocks correspond-

ing to the output features (or input features for the subscript I), and ΣiOI corresponds to the

block of the covariance matrix for the correlation between input and output.

πi is given by:

πi =ωiN (fI ;µ

iI ,Σ

iI)∑k

j=1 ωjN (fI ;µjI ,Σ

jI)

Figure 16 shows a set of trajectory examples of the robot with respect to an interaction target.The relative distance d and angle θ with respect to the person, as well as the time, are usedas features of the trajectory, and a GMM model is extracted. The figure shows also the con-ditional probabilities of d and θ when fixed time intervals are considered (which can be usedfor considering the dynamics when planning) and the conditional probability of the angle θ forseveral distances.

D4.2: Navigation Models, Part 2 Page 45 of 52

Page 47: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

200 400 600 800 1000 1200

1

2

3

4

t

dis

t [m

]

200 400 600 800 1000 1200−0.2

0

0.2

t

the

ta [

rad

]

1 1.5 2 2.5 3 3.5 4 4.5

−0.2

−0.1

0

0.1

0.2

0.3

dist [m]

the

ta [

rad

]

200 400 600 800 1000 1200

1

2

3

4

t

dis

t [m

]

200 400 600 800 1000 1200−0.2

0

0.2

t

the

ta [

rad

]

1 1.5 2 2.5 3 3.5 4 4.5

−0.2

−0.1

0

0.1

0.2

0.3

dist [m]

the

ta [

rad

]

200 400 600 800 1000 1200

1

2

3

4

t

dis

t [m

]

200 400 600 800 1000 1200−0.2

0

0.2

t

the

ta [

rad

]

1 1.5 2 2.5 3 3.5 4 4.5

−0.2

−0.1

0

0.1

0.2

0.3

dist [m]

the

ta [

rad

]

Figure 16: Top: d and θ variables are depicted in terms of time (left) and one against theanother (right). Middle: the constraints extracted from the data by the GMM process. Wehave used k=2 components for the multivariate Gaussian distribution. Bottom, left: conditionalprobability for the distance and angle given time. Bottom, right: conditional probability forthe angle given the distance. In the bottom figures, the mean and variance for each time ordistance value are represented in blue.

D4.2: Navigation Models, Part 2 Page 46 of 52

Page 48: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

a) b)

Figure 17: The trajectories retrieved for the experiment are depicted in this set of figures.The initial position of the robot, the paths performed and the position and orientation of theinteraction target and other persons presented are showed.

8 Experiments

In order to illustrate the use of the models, we have performed a set of experiments at UPO’slaboratory. In these experiments, we have carried out several demonstrations of a specifictask: the telepresence robot navigating and approaching an interaction target. This task isperformed in a clear room and different configurations of the interaction target were consideredfor the demonstrations.

The robot was teleoperated by a person used to pilot it (an expert) and he was told to navigateand approach to the interaction target. If a trajectory was considered disturbing or nor sociallycompliant for some of the persons being present in the experiment, it was removed from thedataset. For now on, we will use indistinctly the robot or the pilot to refer to the teleoperatedrobot.

8.1 Data Collection

As said before, the experiments took place inside a clear room, free of obstacles betweenthe interaction target and the robot. Each demonstration consisted on approaching a standingperson (the interaction target) from a distance of 4.5 meters (well outside the zone of socialinteraction between humans defined by Hall [5]).

The study was recorded using a motion capture system (OptiTrack) and the robot and person’sposes were extracted automatically from the data. At points where the automatic tracking failedthe data were filled up by specific interpolation tools in a post processing step.

Figure 17 show the demonstrated trajectories for the task of approaching the person. To il-lustrate the difference, the trajectories approaching the interaction target are separated in twodifferent figures according to the relative angle between person and robot. In Fig. 17.a, theinteraction target had his torso and head facing toward the starting position of the approach,while at Fig. 17.b the interaction target is facing away from the robot. But all trajectories areemployed to derive a single model of approaching a person.

D4.2: Navigation Models, Part 2 Page 47 of 52

Page 49: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

Figure 18: Left: GMM model extracted for the task using the relative distance d and angle θ asfeatures. Right: samples extracted from the model and compared with the original trajectories.

8.2 Results and Observations

Figure 17 shows the example paths for the experiment. As expected, we see differencesdepending on the relative angle between robot an person. In Fig. 17.a), the robot is in thetarget’s view from the start of the approach and does not deviate significantly from the shorteststraight-line path. There is more variation among paths in Fig. 17.b), where the robot does notfollow the shortest path. Rather, the robot tends to take curving paths that bring its approachinto the target’s field of view without coming very close to the target’s back. We also note thatsometimes the robot moves to the target’s left, while others went to the right.

We then select as features the relative distance and angle of the robot with respect to theperson position and heading.

For model initialization, rather than compute the BIC and choose the best score to select themost suitable number of components, we did that empirically, so thus the criterion followedhere consisted of to select the minor number of components for the mixture of Gaussians thatcan achieve satisfactory the encoding of the task.

So, the final procedure to extract the model consists of the following steps:

Encoding:

• Creating the dataset by computing the features or variables:

– Distance between the interaction target and the robot, at each time step of the tra-jectories demonstrated.

– Relative angle between the gaze of the interaction target and the position of therobot, at each time step of the trajectories demonstrated.

• Select a prior number of components for the GMM and training it by EM algorithm toobtain a model.

The results of the pipeline described above are depicted in Fig. 18 for the features considered.

The extracted GMM model can then be used when planning paths to approach a person. Oncethe position of the interaction target is determined by the robot, we proceed as follows:

• Perform a sampling over the model obtained.

D4.2: Navigation Models, Part 2 Page 48 of 52

Page 50: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

Figure 19: Left: our RRT planner without additional models trying to approach an interactiontarget (on the right, brownish arrow; the goal of the robot is denoted by the orange arrow). Thesame situation with the learned GMM model. It can be seen how in the former case the robotfollows a shortest path avoiding the person, while in the latter the estimated path is closer tothe demonstrated paths.

• The distance-angle samples are then converted to x-y samples given the pose of theinteracting target

As a result, we obtain a set of samples in the robot (x, y) space that are used to bias the pathplanner towards those parts of the configuration space. Figure 19 shows an example.

D4.2: Navigation Models, Part 2 Page 49 of 52

Page 51: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

9 Conclusions and future work

This deliverable has presented the models that will be used in the navigation stack of theTERESA robot for task and motion planning.

In the first part, a new Spatial Modeling Framework has been presented in order to be usedwith the sensors on-board of the TERESA robot. These spatial models will be employed bythe high level planners of the stack for proper decision making and global path planning in thepresence of persons.

Since the robot person tracking capabilities will face tracks lost, occlusions, etc, custom algo-rithms have been designed in order to manage partially observed trajectories. Furthermore,the learning process is able to generate a topological map including discovered goals of tra-jectories; then, a HMM is trained in order to provide an inference service that will be used bythe navigation system.

Our learning algorithm needs less parameters than the general framework of GHMMs andthere is no need of any prior knowledge about the environment or about the trajectories, suchas their destination points. We provide and compare two different novel algorithms for detectinggoals. Moreover the learning algorithm is able to adapt a different observation function for eachnode of the network.

We have tested the framework with four datasets: two of them are publicly available datasetbased on the Edinburgh Informatics Forum Pedestrian Dataset and BIWI Walking PedestrianDataset; the two other have been recorded by the sensors of the TERESA robot at UPO andLes Arcades. We have designed some metrics in order to measure the accuracy of the learningprocess and the results shown that the distribution of predicted goals converges with a reducederror.

In the second part, we have presented techniques to model the relationships and constraintsof the most relevant features in navigation tasks that involve interaction with humans, like ap-proaching an interaction target. Differently from the previous models, these models operatemore on a local level, and will be used by the low-level planners and controllers of the stack.

A set of teleoperated paths of a robot, being piloted by a human expert or a pilot, are consid-ered as good execution examples of a given task. These trajectories are then used to extractthe structure of the features that the persons follow when they deal with social situations; forinstance, when navigating while they are approaching to an interaction target.

We have leveraged techniques from Learning by Demonstration frameworks to extract therelevant information from the examples provided by the users of the telepresence robot andmodel them as GMMs. The distributions can then be used in sampling-based planners to biasthem towards human-robot configurations that are compliant with the examples provided.

For the next steps of the project, we will integrate the system with the navigation planners. Akey aspect is generalization. We will investigate further the set of navigation macro-actionsthat can represent the main tasks to be performed by the TERESA robot. The objective will beto estimate and learn the main feature characteristics for these macro-actions, so they can begeneralized for new situations.

Secondly, we will investigate the way that these macro-action models can be combined in orderto obtain higher-level navigation behaviors.

D4.2: Navigation Models, Part 2 Page 50 of 52

Page 52: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

Bibliography

[1] Kai O. Arras, Oscar Martinez Mozos, and Wolfram Burgard. Using boosted features for thedetection of people in 2D range data. In Proceedings of the IEEE International Conferenceon Robotics and Automation (ICRA), pages 3402–3407, Roma, Italy, April 2007.

[2] Maren Bennewitz, Wolfram Burgard, Grzegorz Cielniak, and Sebastian Thrun. Learningmotion patterns of people for compliant robot motion. The International Journal of RoboticResearch, 24(1):31–48, 2005.

[3] S. Calinon. Robot Programming by Demonstration: A Probabilistic Approach. EPFL/CRCPress, 2009. EPFL Press ISBN 978-2-940222-31-5, CRC Press ISBN 978-1-4398-0867-2.

[4] Shu-Yun Chung and Han-Pang Huang. A mobile robot that understands pedestrian spa-tial behaviors. In Intelligent Robots and Systems (IROS), 2010 IEEE/RSJ InternationalConference on, pages 5861–5866. IEEE, 2010.

[5] Hall Edward et al. The hidden dimension. Doubleday, Garden City, 14:103–124, 1966.

[6] J. Jocksuch and H. Ritter. An instantaneous topological map for correlated stimuli. InProceedings of the International Joint Conference on Neural Networks, volume 1, pages529–534, Washington, DC, 1999.

[7] T. Kanda, D.F. Glas, M. Shiomi, and N. Hagita. Abstracting people’s trajectories for socialrobots to proactively approach customers. Robotics, IEEE Transactions on, 25(6):1382–1396, Dec 2009.

[8] S. Kim, S.J. Guy, W. Liu, D. Wilkie, R.W.H. Lau, M.C Lin, and D. Manocha. Brvo: Pre-dicting pedestrian trajectories using velocity-space reasoning. The International Journalof Robotics Research, 34(2):201–217, 2015.

[9] J.M. Kleinberg. Hubs, authorities and communities. ACM Computing Surveys (CSUR),31(4), 1999.

[10] M. Luber, G.D. Tipaldi, and K.O. Arras. Place-dependent people tracking. The Interna-tional Journal of Robotics Research, 30(3):280–293, 2011.

[11] B. Majecka. Statistical models of pedestrian behaviour in the forum. Master’s thesis,School of Informatics, University of Edinburgh, 2009.

[12] D. Meyer-Delius, M. Beinhofer, and W. Burgard. An instantaneous topological map forcorrelated stimuli. In Proceedings of the AAAI Conference on Artificial Inteligence (AAAI),Toronto, Canada, 2012.

[13] R.M. Neal and G.E. Hinton. A view of the em algorithm that justifies incremental, sparse,and other variants. In M.I. Jordan, editor, Learning in Graphical Models. 1998.

51

Page 53: Deliverable D4.2: Navigation Models, Part 2teresaproject.eu/wp-content/uploads/2015/09/D4_2... · 2018. 11. 27. · TERESA - 611153 - FP7/2013-2016 Deliverable D4.2: Navigation Models,

TERESA - 611153

[14] K. Shindler S. Pellegrini and L. Van Gool. You’ll never walk alone: Modeling social behav-ior for multi-target tracking. In Proceedings of the IEEE 12th International Conference onComputer Vision, pages 261–268, September 2009.

[15] Simon Thompson, Takehiro Horiuchi, and Satoshi Kagami. A probabilistic model of humanmotion and navigation intent for mobile robot path planning. In Gourab Sen Gupta andSubhas Chandra Mukhopadhyay, editors, Proceedings of the International Conference onAutomation, Robotics and Applications (ICARA), pages 663–668. IEEE, 2009.

[16] Gian Diego Tipaldi and Kai O. Arras. Planning problems for social robots. In Proc. Inter-national Conference on Automated Planning and Scheduling (ICAPS’11), Freiburg, Ger-many, 2011.

[17] D. Vasquez, T. Fraichard, and C. Laugier. Growing hidden markov models: An incrementaltool for learning and predicting human and vehicle motion. The International Journal ofRobotics Research, 28(11-12):1486–1506, 2009.

[18] Z. Xianchao, H. Yu, C. Zhang, and X. Liu. An improved weighted hits algorithm basedon similarity and popularity. In Second International Mulisymposium on Computer andComputational Sciences, pages 447–480, 2007.

[19] D. Xie, S. Todorovic, and S.C. Zhu. Inferring "dark matter" and "dark energy" from videos.In IEEE International Conference on Computer Vision (ICCV), pages 2224–2231, 2013.

D4.2: Navigation Models, Part 2 Page 52 of 52