The goal is to develop a planner uses visibility to search for a find an "evader" that moves arbitrarily fast among polygonal obstacles. The input is: i) a polygonal description of the environment; ii) an initial position of a point robot (a.k.a. the "pursuer"). The output is a continuous collision-free path that explores the environment in a way that guarantees that the evader will eventually be seen by the pursuer, regardless of the evader's efforts.
The problem is introduced in the paper A Visibility-Based Pursuit-Evasion Problem by Leonidas J. Guibas, Jean-Claude Latombe, Steven M. LaValle, David Lin and Rajeev Motwani, where a complete solution is given for the case of a single persuer. In the same paper, the problem is proven to be NP-Complete, and other theoretical results are given, such as a logarithmic upper bound in the number of required persuers in a simply connected polygonal enviroment and a lower bound in the case of multi-connected enviroments.
In this project we implemented the complete algorithm for the case of a signle persuer. The algorithm has been divided into three parts, as recommended in the project description.
The first part of the algorithm is to decompose the polygonal enviroment into convex cells. The advantages of this decomposition is that i) a convex cell is globally visible from all the points in its interior and ii) we can take a collision-free path by connecting the centers of adjacent cells. Another advantage is that the set of visible edges does not change as the persuer moves in the interior of each cell. As a consequence, the information state of the persuer (defined below) does not change into these convex cells, and therefore we can search the whole information space by considering only one represntative point for each cell, e.g. its center.
The way that the enviroment has to be decomposed into convex cells in order for the above properties to be satisfied, is to identify the critical places, that is, places where the edge visibility (the set of enviroment polygons that are visible from each point) changes. It turns out, that such places are the extensions of the polygonal enviroment edges (the ones that can be extented in the free space), as well as extended lines defined by par of vertices if the space between these vertices and the space outward along both directions is free.
Algorithmically, we do the cell decomposition using the quad edge structure. Initially the quad edge graph contains information just for the polygonal enviroment. For each edge that has to be extended, we do ray shooting into the cell that contains this edge. As a result the edge that is "hited" by the extended edge has to be splitting, and a new edge has to be inserted in the structure. We continue the same procedure until we hit a wall of the enviroment. The algorithm is quite efficient, since it avoids intersection tests with edges that do not belong in the cell that contains the extended ray. Then, the roadmap can be trivially formed by connecting centers of adjacent cells.
The current version of the implementation assumes that the input polygon is in "general position" (that is, no triple of points are collinear).
The visibilty polygon for each point (x,y) in the enviroment is defined as the set of all points visible to (x,y) form a polygon. A visibility polygon for a given point contains parts of the enviroment edges and gap edges which is an edge that separates the free space in visible and non-visible space. Our task is to find the gap edges for each of the centers of the cells created in the previous stage, because gap edges are important for the generation of the information graph state.
The algorithm we use is a radial sweep line algorithm. That is, for each point for which we want to find the visibility polygon, we generate all the line segments defined by this point and the vertices of the polygonal enviroment. After sorting these segments by their slope, we sweep the whole posible direction space [-pi, pi), stopping at those directions that correspond to slopes of the segments. At each point of the sweeping stage we keep track of the nearest edge towards the current direction. When a change in the nearest edge occur, we have to introduce a gap edge.
As the persuer walks around the enviroment some edges can be marked as clear, that is, an edge that divides the free space in such a way that the evader cannot be present even in the non-visible side of the edge. Clearly this depends not only on the current position of the pursuer, but as well as on the previous cells he/she has traversed. The current position of the persuer in addition with the information about which edges are clear in a specific moment of its walk, define the notion of the information space and the information state graph.
Initially, the persuer is in a position where all its gap edges are not clear (contaminated), and the goal is to find a path in the free space that place the pursuer in a position where all its gap edges are clear. To do that, we have to build the information state graph and to search this graph. The information state graph is built "on the fly" as the pursuer walks on new cells and its information state changes. For the searching of the graph we use Dijksta's algorithm with edge cost that corresponds to Eucledian distance traveled by the pursuer.
Finally, after a solution is found, we optimize the solution by choping the part of the produced path that used to bring the pursuer in a corner of the enviroment and from there to start "cleaning" the space.
Five interactive examples are demostrating our implementation. The first two of the are fairly easy. The third example demostrates how it is possiple same cases the pursuer has to clear the same place (in our case the top of the triangle) for more than one time. The last two are more complicated examples.
In the following table we have recorded the number of cells that the algorithm create in the cell decomposition stage, the number of the information states that hve been explored before the algorithm find a solution, as well as the preprocessing and the searching time.
| Example | Cells | Info States | Prep. Time | Search Time |
| 1 | 34 | 155 | 0.02s | 0.05s |
| 2 | 39 | 207 | 0.05s | 0.07s |
| 3 | 142 | 3129 | 0.19s | 3.53s |
| 4 | 218 | 5116 | 0.31s | 8.09s |
| 5 | 375 | 8108 | 0.81s | 18.87s |
Thanks to the instructor of the course Steve Lavalle and the people of the Stanford Robotics Laboratory that made available the Movie Class code and the Movie Java player.