Abstract
People with impaired physical and mental ability often find it challenging to negotiate crowded or unfamiliar environments, leading to a vicious cycle of deteriorating mobility and sociability. To address this issue we present a novel motion planning algorithm that is able to intelligently deal with crowded areas, permanent or temporary anomalies in the environment (e.g., road blocks, wet floors) as well as hard and soft constraints (e.g., “keep a toilet within reach of 10 meters during the journey”, “always avoid stairs”). Constraints can be assigned a priority tailored on the user’s needs. The planner has been validated by means of simulations and experiments with elderly people within the context of the DALi European project.
Introduction
With unimpaired ability, pedestrians are able to find their way across complex and crowded areas with few problems. With reduced abilities this apparently simple task easily becomes a challenging one. A person with reduced mobility needs to minimise the travelled distance. A person with cognitive problems should avoid situations that challenge her sense of direction and confuse her perception of the environment. The difficulty in identifying the best path and in making proper reactions to unexpected contingencies gradually reduce the confidence of the impaired person in using public spaces. The afflicted are most often older adults and the problem worsens quickly if no adequate countermeasure is taken [3,37]. They are deprived of essential social relations, with a negative impact on their physical condition (reduced exercise), on their psychological wellbeing (reduced social contact) and even on the quality of their nutrition when they reduce the frequency of their visits to supermarkets [1,35]. The application of assistive robotic technologies can be of significant help to offset this trend.
In this work we therefore consider a dynamic motion planning problem in a complex but known environment containing other moving agents (i.e., pedestrians). The planner’s motion is constrained by the user’s preferences (preferred speed, preferred proximity to others and preferred or disliked areas in the environment) and must accommodate any recent modifications to the environment that are not known a priori (e.g., due to maintenance work). The goal of the planner is to help the user visit a number of points of interest in the most stress-free and efficient manner. Our basic approach is to construct a graph data structure of sufficient granularity to represent efficient direct paths between points of interest. The planner attempts to follow paths defined on the graph, but may deviate to avoid other pedestrians or at the specific request of the user. The complexity of the problem is essentially that of finding the shortest path on a graph.
Figure 1 illustrates the different types of support that a robotic system with cognitive abilities can offer in the navigation of a complex environment.

Diagrammatic overview of the motion planning framework. The whole process can be divided into three main elements: the long term planner, which considers the long term objectives, the short term planner, which optimises the long term plan taking into account the short term objectives and constraints, and the guidance, which drives the robot towards the goal.
From a top-down perspective, the first type of assistance is offered before taking on the navigation activity and is the production of a plan that takes into account long term objectives. This is accomplished by the long term planner, which accounts for the topology of the space, the user’s preferences and the possible presence of obstacles or problems along the way, as foreseen by querying environmental sensors. While the user is moving, she could encounter contingent problems that cannot be anticipated (e.g., a small group of people obstructing the path). In this case her robot assistant could react by planning a minimal deviation from the path to preserve her safety and wellbeing. In our terminology, this component is called the short term planner (see Fig. 1). Finally, a robot assistant can guide the user along the planned path. This can be done in different ways depending on the type of robot assistant. If the robot is simply a guiding vehicle, like a tour-guiding vehicle [33], guidance amounts to following the path and to ensuring that the user trails behind. If the robot is a robotic walker, it can guide the user by mechanically turning its wheels and acting on the wheel brakes [15] or by administering visual, audio or haptic signals [31,32]. If the robot is a robotised wheelchair it can be likened to a robotic vehicle driving in crowded spaces [4].
This paper proposes a novel long term planner that targets the first task described above. Consider a person willing to execute a set of activities in a public space. Henceforth, we will use the term assisted person (AP) to define the user. The problem the AP faces is to identify the best way to reach the chosen point of interest. This decision could potentially be taken using any state-of-the-art algorithm for motion planning, able to identify the path with minimum length (or requiring minimum time) given the a priori knowledge of the map. A first problem is that while the position of most fixed objects (e.g., buildings, rooms, and points of interest) is known a priori, the algorithm must account for the possibility of incidental changes, such as temporary obstructions. Standard motion planning algorithms can easily be adapted to consider an up-to-date picture of the state of the environment (e.g., presence of obstructions or over-crowded spaces) as it arrives from environmental sensors. However, a simple modification to a standard planner may be insufficient. First, the detected anomaly could be a temporary one. So, the likelihood of having to deal with the problem during the navigation depends on the time needed to reach the place where the anomaly is located, which in turn depends on the chosen path. What is more, the AP (who is typically an older adult) will likely have specific additional requirements. For instance, the AP could need a frequent access to the toilet, and if the optimum path offers no easy access to the toilet on the way, it might easily generate discomfort. The AP could be hyper-vigilant and overly concerned with her personal security. In this case, she might appreciate always being within reach of a policeman or of other staff member that she perceives as a reassuring presence.
Simply put, what we need is an algorithm for motion planning in public spaces that accounts for 1. the topological and metric information about the space, 2. time-varying environmental information about the space, such as the availability of services (is the shop that the AP wants to visit actually open?), the presence of occlusions and overcrowded areas, etc., 3. preferences of the AP (e.g., the need to be in easy reach of assistance, toilets, etc.).
The presence of these specific requirements makes the planning algorithms offered by common navigators (such as Google Maps) infeasible. What is needed is a different approach that carefully considers the strong psychological aspects involved in the selection of a route. In this paper we report on the solution that we have developed within the context of two research initiatives sponsored by the European Union: Devices for Assisted Living (DALi) and A CyberphysicAl social NeTwOrk using robot friends (ACANTO). These projects are based on a substantial involvement with users, both for requirements collection and for the evaluation of the results. The algorithm proposed here distils this experience and translates it into a suitable formal model by using a modified Dijkstra’s shortest path algorithm [11] where the underlying graph is constructed using quad tree decomposition of the free space [5].
The paper is organised as follows. A review of the current state of the art is presented in Section 2, while a complete description of the requirements of the planner can be found in Section 3. Section 4 goes into the details of the planning algorithm and Section 5 illustrates the functionalities of the software architecture. Sections 6 and 7 report the results of qualitative and quantitative simulations respectively, and Section 8 describes our case study and the related experiments. Finally, in Section 9 we offer our conclusions.
Motion planning in crowded environments is a relevant research problem in robotics which has received constant attention throughout the past two decades [24,25,27]. The approach that we advocate is based on a hierarchical decomposition of the problem between short term and long term planning. Different authors in the literature propose a strategy of this kind [18,28], but the solutions at each of the two levels of the hierarchy differ significantly, depending on the requirements that each author considers. The goal of a long term planner is to find an efficient path in free space from a starting point to some desired destinations, given the topological and metric constraints derived from the map. In the following sections we will comprise the different components that comprise the long term planner with respect to the state of art.
Shortest-path planning
Sampling methods
When the map is not entirely known in advance (e.g., due to uncontrollable changes in the environment), a convenient choice can be the adoption of sampling-based algorithms. In this class the Probabilistic RoadMap (PRM) algorithm by Kavraki et al. [21] and the Rapidly Exploring Random Trees (RRT) [26] have gained an undisputed reputation and visibility in the past few years. The idea of this class of algorithms is to generate feasible points by sampling randomly the neighbourhood of known points and connecting them into a data structure (e.g., a tree for RRT or a graph for PRM). When the destination is finally reached an optimal path can be found by exploring the data structure. The more time that is given to the computation, the more points that can be added and the higher the probability becomes of finding an optimal solution. Such algorithms have recently been revisited by Karaman and Frazzoli [20]. The revised versions,
Potential fields methods
Another family of algorithms is based on the definition of potential fields [8,36] around obstacles and points of interest that can attract or repel the robot. Such approaches are known to be effective for obstacle avoidance, but they are often plagued by local minima (which sometimes delay or deadlock progress). While encoding all the user’s planning requirements, constraints and preferences with a potential function is generally a difficult problem, our approach makes use of the notion of gradients to encode user-defined desirable and undesirable zones. The full details are given in Section 4.3
Graph based methods
The long term planner proposed in this work falls in the class of graph based techniques. In essence, the idea is to decompose the environment into a grid and then generate a graph by associating nodes to elements of the grid and by then connecting with edges the nodes associated to adjacent cells. Minimum time paths on the graph can be found using the well-known Dijkstra algorithm [11] or its extension
Time-dependent paths
An important feature of our algorithm is its ability to deal with temporary anomalies (e.g., obstructions or large groups of people hindering the AP’s motion across some of the areas). In particular, anomalies (i.e., temporary graph obstructions) require the generation of time-dependent paths. The underlying graph exploits a dynamic and time dependent cost function, thus the shortest paths between two edges can vary over time. This problem is known to be challenging and is the focus of independent research [9,10,12,16]. An interesting analysis on the complexity of this problem has been carried out by Foschini et al. [16]. They upper bounded the cost of traversing a graph with polynomial-size piecewise linear cost functions and with other particular classes of linear functions. However, the cost remains high and prohibitive even with small to medium sized graphs. In [9] the authors present an overview of existing techniques together with three efficient speed-up methods. The experiments, nevertheless, show that finding the solutions requires several minutes (sometimes hours) using server-class hardware.
Given these performance limitations, in our particular case we adopt a conservative assumption, described in Section 4.6, that allows us to solve a simplified problem very efficiently. Our requirement analysis reveals that senior users of a navigation tool become very annoyed by a long wait in front of a screen. Therefore, efficiency and quick deliveries of decisions are more important than producing “optimal” decisions (as long as the decisions do not violate any hard constraints and they respect soft constraints to a reasonable extent).
Global constraints and preferences
The global constraints (not to be confused with kinodynamic constraints, not considered here) are used for customising the behaviour of the planner and for introducing the notion of “comfort” for the AP. Constraints are prioritised and some of them can be violated if their compliance prevents the system from finding any path. They embed priority and the possibility for one or more constraints to be ignored if a path cannot be found otherwise (namely, conflicting constraints). This is called “planning with partial satisfaction” and is studied in the literature under the notion of preference-based planning. In [6] the authors focus on computation of relaxed plan-based heuristics that guide the planner towards good solutions satisfying the given preferences expressed in Planning Domain Definition Language (PDDL). PDDL is one of the languages aimed at standardising Artificial Intelligence planning and is used in many international competitions. However, its complexity and completeness are an overkill with respect to the goals of this work.
A growing set of frameworks in the literature [23,34] proposes to express temporal properties with partial satisfaction using linear temporal logic (LTL). In [23] the authors introduce a method for quantifying the satisfaction of LTL formulae, and propose a planning framework that synthesises robot trajectories with the optimal satisfaction value. However, they do not consider constraints where the cost or priority changes over time. Tumova et al. [34] present an automatic generator for control strategies for a robotic vehicle where constraints are expressed with LTL formulae. The novelty is the possibility of violating a constraint, according to its priority, in order to complete the task (e.g., a road lane should not be crossed, but this is allowed during car parking).
The concept of “comfort” has already appeared in the literature with different meanings: 1) comfort of the AP when navigating using a robotic platform [17,29] and 2) comfort of the humans in the area surrounding an autonomous robot [22]. Our notion of comfort belongs to the first class and it is deeply rooted in the requirement analysis and in the validation activities with senior users that we have been conducting in the context of the DALi and of the ACANTO projects. Our findings are that the AP needs to specify zones that she likes or dislikes. As an example, more often than not she would prefer to bypass crowded areas or to always have a toilet or a resting place within easy reach, even if this entails choosing a slightly longer path.
Requirements, preliminaries and overview
The proposed long term planner has been developed bearing in mind a number of requirements. The key point is letting the AP personalise her journey while keeping the planner reactive to changes in the environment. For this reason we have implemented three main features.
The first feature gives the AP the possibility of adding hard (non-violable) and soft (violable) constraints, according to some customisable priority. It is possible to encode rules like “never get closer than 5 meters to any stairs” or “try to keep within 10 meters of a toilet”, or “always be within sight of a clerk or of a policeman”. Should a soft constraint be in conflict with another one, the issue is resolved by violating the one with lower priority. A hard constraint, instead, cannot be violated. If the long term planner encounters an inconsistent state (e.g., not all hard constraints can be satisfied) then the AP is notified and is asked to review the set of constraints.
The second feature reacts to anomalies detected in the environment by the sensing subsystem. An anomaly is a bounded zone in the environment that becomes inaccessible for a limited period of time (e.g., a wet floor or blocked passage). After this period expires, the anomaly is cleared and the zone is accessible again.
The final feature takes into account the crowded spots in the environment. They are represented as heat maps (an example is shown in Fig. 7) where the apparent “heat” represents the level of crowdedness. The planner interprets this level as a penalising factor that slows down the AP. Some users could also have specific constraints related to avoiding crowded areas.
The work flow of the algorithm begins with the AP specifying a list of target locations she wants to visit in the environment. The long term planner constructs a plausible path (a long term plan) according to the constraints in her profile and to the current conditions in the environment (known anomalies and current crowding represented by heat maps). The state of the environment is sampled periodically using remote sensors (e.g., surveillance cameras). If other robots are deployed in the environment, they can use their local sensing system to detect anomalies and share this information through a cloud infrastructure. For instance, if a walker detects a wet floor sign, this information is propagated to the other robots and accounted for in the generation of long term plans. Once the AP accepts the plan and starts moving, the control subsystem takes over, allowing the short term planner to make limited adjustments depending on the contingencies encountered on the ground. In the event that the AP is unable to follow the plan with only such limited modifications (e.g., because of encountering an unforeseen obstacle), the control subsystem has the capability to report the event and can request the construction of a new long term plan.

Diagrammatic overview of the long term planner. Informed by the heat maps and anomaly detectors, the long term planner constructs a long term plan according to the AP’s constraints. The plan is then transferred to the control subsystem.
The long term planner produces the optimal path according to the diagram depicted in Fig. 2 and described as follows:
The plan of an environment is broken down into a grid of rectangular cells containing free space. A graph is derived from the grid, such that each node is on the border between two cells and each edge defines a path in free space. Nodes corresponding to points of interest that are not already present are added manually. The graph is augmented with relevant semantic information (e.g., associating the names of points of interest to nodes). Each edge is associated with a cost that accounts for the distance to travel and for the occupancy of the area (the more people, the longer the time to travel). Parts of the graph are removed or the weights of edges increased to reflect the AP’s preferences. The optimal path is found using a modified Dijkstra algorithm.
In the next sections the algorithm is presented in its full details.
To describe our long term planner we first define some notation and operations on graphs.
A directed graph
Given graphs
Given
Pairwise graph union is defined by
Long term planner
The long term planner proposes feasible paths that efficiently visit the AP’s specified points of interest, while respecting her preferences and accommodating the prevailing conditions in the environment. To achieve this the long term planner abstracts a complex environment, such as a shopping mall, airport, museum, etc., as a weighted directed graph, comprising a set of nodes linked by edges. The nodes represent places in the environment, while the edges represent direct paths between the places and are weighted by their effective length. The a priori length of an edge is the Euclidean distance between its adjacent nodes. The effective length of an edge is generally longer, modelling its undesirability with respect to crowding and the AP’s preferences. The edges are directed so that the effective length of a path leading to an undesirable area can be greater than the same path traversed in the opposite direction.
Nodes are labelled with their physical location (coordinates on the plan of the environment) and their corresponding semantic position (supermarket, toilet, post office, café, bar, bakery, etc.). Each edge in the graph is labelled (weighted) with the effective distance between its adjacent nodes. Then, using an efficient graph traversal algorithm, i.e., the Dijkstra algorithm [11], we find the shortest paths that link the AP’s points of interest. Moreover, anomalies and crowding are included in the same framework by simply modifying the graph prior to finding the shortest path. In particular, anomalies cause parts of the graph to be (temporarily) removed, while crowding increases the weights of edges in crowded areas (their effective length is increased because crowding slows the AP’s progress). Certain user preferences, such as always being near a toilet, may also be encoded as graph transformations.
Creating graphs from floor plans
To construct a graph that efficiently maps the free space in the environment, we first decompose its floor plan into a ‘quad tree’ [14], comprising quadrants containing free space (free quadrants) and quadrants occupied by fixed objects (occupied quadrants). A graph is constructed by embedding nodes in only the free quadrants and linking them with appropriate edges. The quad trees typically have substantially fewer cells than a uniform grid with the same level of minimum granularity, with the density of cells generally following the density of features [13]. An example is shown in Fig. 5. Note that the side length ratio is common to all quadrants and is inherited from the dimensions of the environment. It is possible to add space to the environment to force quadrants to be square or have any other desired ratio. Doing so may improve efficiency or be advantageous with respect to the placement of nodes.
Given a quad tree decomposition of the free space, the corresponding graph is constructed as follows. For all pairs of adjacent free quadrants, a node is embedded at the mid point of the border of the smaller of the quadrants. By definition, a free quadrant is a convex shape containing only free space. Hence, any node on the border of a free quadrant has a “line of sight” to all other nodes on the borders of the same quadrant. We therefore join such nodes with a complete graph. Since nodes are shared between adjacent quadrants, this is sufficient to link all the free space in the environment.
To guarantee that the robotic platform may occupy any point in free space represented by a node, or travel the line represented by any edge, prior to building the quad tree the fixed objects are enlarged in all directions by a distance greater than the radius of the robotic platform. In this way no point in the effective free space is ever too close to a fixed object and all paths in the graph correspond to plausible paths in the environment.
Creating a long term plan
To represent the a priori knowledge about the environment we define a “graphmap” data structure
To generate a long term plan we also define a “working copy” of the graph map (the working graphmap), modified according to the AP’s constraints, the current crowding and the known anomalies. We denote the working graphmap
Given a working graphmap
Finding the minimum length path that visits a set of unordered points of interest is an instance of the well known hard ‘travelling salesman problem’ [30]. Moreover, given that the overall excursion (including stops at the points of interest) may take considerable time, an overall plan optimised for the current level of crowding may eventually be significantly sub-optimal if the crowds dissipate. Our approach is therefore to optimise each leg of the journey separately, using the most up-to-date information about anomalies and crowding.
In simple terms, long term planning works in the following way. The planner first identifies the node
The inclusion of time-dependent anomalies makes the actual long term planning algorithm slightly more complex. Handling such anomalies is described in Section 4.5.
Global constraints
The AP may specify constraints that affect the long term plan (e.g., always remain within 50 metres of a toilet). We call these “global” constraints to distinguish them from, for example, local constraints that might be implemented by the short term planner (e.g., don’t get too close to other pedestrians). Global constraints may be hard or soft. Hard constraints exclude parts of the environment that the AP does not wish to visit under any circumstances. They are implemented by removing subgraphs from G. The set of hard constraints is denoted
Soft constraints make parts of the environment desirable or undesirable to the long term planner, causing the planned path to deviate towards or away from them, respectively. They are implemented by defining a function
In our implementation, soft constraints are specified using sets of triplets (location, radius, intensity), which respectively define the semantic position, the radius of influence and the intensity of the constraint. In general, a constraint creates a gradient of weights that increase towards undesirable zones and vice versa for desirable zones.
A function
We assume the existence of a set of constraints
Heat maps
Cameras in the environment monitor pedestrian traffic and construct “heat maps” that estimate average occupancy of the free space over useful time periods, such as the last five minutes, the last hour or a long-term average for a particular day and time. The goal is to use this information to predict the crowdedness that the AP will encounter and to plan accordingly. In this work we assume that the current prediction is valid over the time the AP takes to reach the next point of interest. If future experience in real environments suggests this assumption is unreasonable, we will treat crowdedness in the same way we treat anomalies, i.e., as time-dependent.
Each point in the free space is thus assigned a value in the interval
An edge represents a straight line path between the points in free space represented by its adjacent nodes. The average occupancy in the area surrounding the line affects the time taken to travel from one end to the other. The free space that the short term planner will allow the AP to explore can be approximated by an ellipse whose vertices (“ends”) coincide with the ends of the line. The area of the ellipse represents the capacity of the edge, while the heat within the ellipse represents the amount of capacity that is being used by others. To calculate the average occupancy of an edge we integrate the occupancy density over its corresponding ellipse. The size and shape of the ellipse is a function of the edge. For simplicity we define an occupancy function
During the course of a journey the AP may encounter anomalies (semi-permanent obstructions, such as a wet floor, locked exit, dense crowd, etc.) that prevent the short term planner from making progress along the long term plan. An anomaly is represented by a data structure
Anomalies exclude parts of the environment, but their effect is not permanent and is dependent on the chosen path. When a new anomaly
The new trajectory definitely excludes the recently detected anomaly, but may include one or more anomalies in A. Hence, the proposed plan is compared to the subgraphs in the set of active anomalies, to find if there is any intersection. If there is no intersection the proposed plan is valid. If the proposed trajectory intersects the subgraph of an anomaly, the time of reaching the anomaly is compared to its remaining time. If the anomaly will not exist by the time the AP reaches it, it is ignored. If no anomalies exist by the time the AP reaches them, the proposed plan is valid. If, on the other hand, one or more anomalies remain valid by the time the AP reaches them, their subgraphs are removed from the working graphmap and the above procedure is repeated until a valid path is found.
There can be cases where it might be convenient to wait for the expiration of an anomaly rather than taking a detour. For example, an anomaly may expire after one second, while the alternative route forces the AP to extend her journey by several minutes. To account for this we propose to implement an heuristic with a customisable cost threshold based on the AP’s profile. If the cost of the alternative path is higher than the threshold, the AP is recommended to wait. If not, the detour is suggested.
Time-dependent shortest paths
Our long term planner intelligently avoids looping paths by regularly updating heat maps and assigning persistence times to anomalies. In this way the planner never returns to permanent obstacles, but may take advantage of crowding and obstacles that clear. Our current approach with heat maps assumes that crowding averaged over a period of time in the immediate past is a good indicator of average crowding for the same time period in the immediate future. This is reliable for short term predictions, but is less so over the longer term because long term averages may mask large peaks of crowding. With regard to anomalies, our planning algorithm takes a cautious approach, assuming that an active anomaly encountered in one proposed path should not be considered in future plans to the same point of interest.
Algorithm 1 describes the basis of our shortest path algorithm that considers timed anomalies, heat maps and user constraints. The algorithm finds the shortest path between the AP’s current position and the closest point of interest. If points of interest are required to be visited in a specific order, it is assumed that the set Targets contains only those nodes corresponding to the next point of interest to visit.
The algorithm makes use of several functions.

Shortest path considering anomalies, heat and constraints.
In trying to satisfy the conflicting constraints of dynamic motion planning in complex human environments we have considered many alternatives and refinements to our algorithms. There is no off-the-shelf perfect solution, given the inherent uncertainties and variability of the problem. In particular, finding time-dependent shortest paths is known to be hard and is itself the subject of active research [9,10,12,16]. Our present approach is a satisfactory compromise between efficiency and efficacy. We can imagine circumstances under which it might be challenged, but we propose to allow further development to be led by problems encountered in real applications.
To develop our approach we have implemented two tools; a map designer and a simulator. The map designer is written in MATLAB and enables the AP to draw, load and save floor plans, as well as performing quad tree decomposition and graph construction. The user is provided with a GUI to freely draw geometric shapes (Fig. 4) and generate the corresponding graph (Fig. 5) to be used in the simulator.
The simulator is written in MATLAB and Java and allows the user to visually configure global constraints, heat maps, anomalies and all parameters required by the long term planner. To judge performance in a final product, the planning algorithm has been developed in Java and communicates with MATLAB through the integrated Java interface.
The algorithm presented in this work has been designed keeping flexibility in mind. We devised an API that abstracts the low level structures and exposes a simple but efficient interface. It is divided into a number of layers depicted in Fig. 3. The bottom layer is represented by the long term planner itself, which is linked with the top level (the API) via three main blocks.

Structure of the API. The layers are of increasing abstraction, where the public interface is flexible and extensible at runtime by the third-party services. The overall low complexity enables a broad choice of implementations, from a service in the cloud to a standalone smartphone app.
The first block is denoted “Environment and map” and, as the name suggests, allows external services to access and update information about the environment. Such data includes the map of static obstacles and walls, the heat maps and the anomalies. The latter can be grouped into categories, two being available by default: “wet floor” and “destination out of order”. New categories can be added at runtime upon request by the third-party services.
The second block, “Plan”, exposes the planning capabilities. Given the starting position, it is possible to query for the construction of the optimal path directed to one or more goals. The planner automatically considers the current status of the environment and biases the resulting trajectory according to the AP’s preferences. Moreover, alternative sub-optimal paths can be generated upon request, for example when the chosen path is blocked by an unforeseen obstacle detected by the short term planner.

Screenshot of the map designer tool showing an example floor plan. Enables the user to create maps and generate the associated graph, compliant with the long term planner.

Graph and a sample path generated from the map depicted in Fig. 4.
The last block is the “User profile” and encapsulates the interface for accessing the global constraints and other user information, such as her location and the tuning parameters for dealing with anomalies and crowded areas.
This API can be installed and accessed practically anywhere, thanks to the low computational burden highlighted in Section 7.3. For example, it can be packaged in a standalone mobile application to provide an interactive map of a shopping mall, or implemented as a cloud service, as described in the next section.
In our case study, presented in detail in Section 8, we implemented the planner as a service in the cloud. The interface was written in C++, while efficient Java was used for the planning part. The standard Java Native Interface (JNI) provides the link between these elements. We anticipate that a production version will be entirely implemented in Java, to allow it to be deployed on a standard portable device under the Android operating system.
The map of the environment is stored using SpatiaLite,1
The communication with the remote clients takes place through exchange of JSON messages over a TCP link, in a request-reply mechanism, where the planner acts as a server.
The chosen floor plan for the validation is a large room of approximately
In the remainder of this section we will go through each feature separately and, finally, show a more complex simulation combining different features.
Global constraints

Simulation with constraints. The figure shows two independent simulations that describe how the planner deals with desirable and undesirable zones. The continuous line is the result of the constraint “stay close to the desirable zone” and “stay away from the undesirable zone”, while the dashed line addresses only the latter.
We show how the planner is able to deal with the user preferences when computing the plan. In the first simulation we put an undesirable zone in the middle of the room, overlapping the shortest path. In the second simulation we instead identified a desirable zone (e.g., a restroom) close to the top wall of the map, without interfering with the shortest path. In both simulations the radius of the constraints is set to
We ran these two simulations separately and the results can be seen in Fig. 6. The planner correctly takes the constraints into account by properly bending and extending the original shortest path.
Should the undesirable zone be the only possible access point for reaching the goal, the planner can violate the constraints as long as the intensity is not
We placed one rectangular shaped heat map in the centre of the room, covering the whole space between the two columns and the walls at the top and bottom of the figure. The planner is thus forced to go through the area covered by the heat map to reach the goal. We ran 50 simulations with different heat distributions generated by a sum of bivariate Normal probability density functions (normalised to the range

Simulation with a heat map. The path computed by the planner is represented by the continuous line, which bypasses the crowded region in the middle of the map (i.e., yellow area). The preference is for cold zones (i.e., blue-coloured areas). (Color figure online)

Simulation with anomalies: two independent simulations are shown. The dashed line represents the path generated when the anomaly is set to expire half way to the goal. The continuous line, instead, shows the resulting path when the anomaly does not expire.
To test the handling of time based anomalies we set the average user speed to

Simulation with multiple features. The planner satisfies all the AP requests, but is forced to ignore the constraint for the undesired zone, as it is the only way to reach the goal.
The final validation test considers a combination of multiple features in one simulation. We placed one undesired zone, one desired zone, one anomaly and one heat map as shown in Fig. 9. In particular, the undesired zone completely blocks the passage for reaching the goal. However, as visible in the previous figure, the long term planner is able to ignore the unfeasible constraint. The path then bends towards the desired zone, bypasses the unexpired anomaly and, finally, avoids the crowded region represented by the heat map.
We now present the results of some simulations providing a quantitative analysis of the performance of the long term planner. The aim is to show that the benefits of using the long term planner are evident not only from a qualitative point of view, as shown in Section 6, but also from a well-defined set of performance metrics.
Heat maps
We demonstrate that the long term planner is able to provide better (i.e., quicker) trajectories when it is aware of the crowdedness in the environment.
We first set up a simulation scenario similar to the one in Section 6.2, where the heat map covers the environment as in Fig. 7. We then iteratively increase the heat surface, simulating an expanding crowd, starting from no crowd (
The Euclidean shortest path
The results are shown in Fig. 10. The very slow growth of the effective length of the path considering heat (thick line) is clearly visible. The planner diverts the path to avoid the hot areas until this becomes impossible (i.e., when crowdedness reaches

Relation between level of crowdedness and effective length of the path. When the planner is aware of the heat maps in the environment, the long term planner is able to avoid the heat and the effective distance increases slowly with increasing crowdedness (thick line). Without this information the long term planner just chooses the shortest Euclidean path, whose effective length increases exponentially.
The simulations presented in this section show how the planner interprets the intensity parameter of an undesired or a desired global constraint. The environment and the position of the desired/undesired locations are the same as those considered in Section 6.1 and illustrated in Fig. 6. We identified this particular scenario because it is a worst case situation: the desirable location is at the farthest possible distance from the shortest path and the undesirable location conflicts with the shortest path.
For simplicity and without any loss of generality, in these simulations we define
To measure the characteristics of a constraint for a desirable zone, we set the location as far as possible from the Euclidean shortest path and we fixed the radius to a small value. We then iteratively executed the planner with increasing intensity and computed the minimum direct Euclidean distance of the path from the location (i.e., not considering the graph). The results are reported in Fig. 11. As expected, the minimum Euclidean distance between the path and the desirable zone decreases as intensity increases. The steps in the plot are due to the quantisation of the free space imposed by the underlying graph.

The effect of intensity on the minimum Euclidean distance from a path to a desirable zone on a particular simulation run. As intensity increases the path is attracted towards the desirable location: the Euclidean distance decreases.
A similar procedure was carried out using a constraint for an undesirable zone. We set the location of the constraint midway along the Euclidean shortest path and fixed the radius of the constraint to be the largest possible value (in the simulations the limit is the distance from farthest wall). The intensity of the constraint was then iteratively increased and we computed the minimum direct Euclidean distance of the resulting path from the location. The results are shown in Fig. 12. We observe that as the intensity grows, the planner “pushes” away the constructed path until the minimum Euclidean distance is close to the radius. Again, the steps in the plot are due to quantisation of the free space.

The effect of intensity on the minimum Euclidean distance from a path to an undesirable zone on a particular simulation run. As the intensity increases the path is pushed away from the undesirable location (the Euclidean distance increases) until it approximates the specified radius (
The relations highlighted in these paragraphs are strictly dependent on the considered environment. Different locations, position of obstacles or constraints lead to different relations. An open problem, to be addressed in future work, is how to generalise the relationship between these parameters.
We tested the performance of the long term planner on the BeagleBoard xM,2
Our goal was to verify the feasibility of an online implementation in a realistic scenario and the scalability of the performance with increasing dimensions of the graph. We thus designed a map of a large shopping mall (
Performance of the long term planner on a BeagleBoard xM with different graph dimensions for both setup and query phase. Mean (μ) and standard deviation (σ) are reported for each phase
The results are reported in Table 1. The worst case, as expected, occurs with the largest graph. In this case we measured
Motivated by the same considerations presented in this paper, the DALi project3
The motion planning algorithm is part of the so-called “Cognitive Engine” and follows the diagram depicted in Fig. 1. In this particular case, the long term planner is the algorithm proposed in this work while the short term planner outputs a suggested trajectory and is reactive to the potentially uncooperative response of the AP [7].

Pictures from the DALi project experimental campaign.
In October 2014 we ran an experimental campaign that involved several elderly people at our facilities. The goal was to test the functionalities of the walker as well as of the motion planning algorithm. To this end, we created a simulated shopping mall environment and recruited a cohort of 12 senior users. We asked each participant to choose a destination in the environment (Fig. 13(a)) and then to follow the guidance suggestions of the walker.
At the end of each test we collected results on the participant’s performance and asked her/him to answer some questions about the quality of the guidance suggestion and personal satisfaction.
In addition, we selected a group of caregivers working in protected residences and proposed to each of them a tour through the functionalities of the system, where each of them could define hard and soft constraints and test the system. During each test we randomly triggered anomalies (Figs 13(b) and 13(c)) and heat maps (Fig. 13(d)) to show the reactions of the system to such conditions. At the end of the “road show”, we collected informal opinions and suggestions.
The impression we derived from reading the questionnaires collected from the APs and from talking to the care givers was of a general interest and appreciation toward the system and its functionalities (including the long term planner). Most users were keen on being actively engaged with future development activities. This motivates us in pursuing this line of research in the upcoming years.
Conclusions
In this work we have presented an algorithm for long term motion planning in crowded public spaces. The algorithm applies to robotic platforms assisting the navigation of elderly users in large and complex spaces. Key features of the algorithm are: 1. the ability to encode preferences in the user’s profile about areas that should be avoided during the navigation and others that should be travelled across, 2. the consideration of time-dependent anomalies in making the right choice for a path, 3. the inclusion of crowdedness as a key parameter to take into account when estimating the time to complete a path. Our idea is to use quadtrees to generate a graph structure describing the space and encode user preferences, anomalies and heatmaps in the weight of the edges. We propose a modified version of the Dijkstra algorithm to identify the optimal path accounting for the time dependencies of the graph.
Our algorithm has been implemented as a cloud service that operates alongside a module for reactive (short term) planning and motion control, which are typically hosted on the robotic platform. Thanks to its flexible API and its low computational burden, the algorithm can be easily implemented in different ways, giving to the system integrators plenty of possibilities.
The different functionalities of the system have been validated in two ways. We have tested it through simulation scenarios and prepared a mockup simulating a realistic case study where the system was tested by a group of users and showcased to a group of caregivers.
This case study helped us to identify some borderline scenarios that require further analysis, especially when dealing with combinations of constraints. For example, when the user requires a “timed” constraint (e.g., “keep a toilet within 5 minutes walking distance”), when several constraints for desirable and undesirable zones appear to be placed one after the other, or when two or more constraints for desirable zones are placed at opposite ends of an environment. Simulations have shown that combinations of contrasting requests can be managed efficiently, even though an extensive analysis of this behaviour has not been carried out in the field. Nonetheless, the simplicity and the robustness of the proposed solution is very promising for an efficient handling of such complex situations.
Our future plans include lifting the planning algorithm to a social dimension, with motion plans organised for groups of people supported by a robotic platform, with constraints and anomalies specified in a probabilistic framework.
