roadmap based path planning - a report
TRANSCRIPT
-
7/29/2019 Roadmap Based Path Planning - A Report
1/18
Roadmap Based
Path Planning
Anirudh Singh
-
7/29/2019 Roadmap Based Path Planning - A Report
2/18
1
ABSTRACT
Path planning is an integral part of game development. In fact,
there are a number of virtual world models which depend on
planning for the motion of entities. A lot of algorithms are
available for this purpose like scripting, grid-based search, local
reactive methods but most are difficult to implement in real-time
and require a lot of post-processing to obtain clear roadmaps. This
motivates us to look for innovative ideas to develop roadmaps as
well as answer path queries for single / multiple entities in real-
time. Two of the methods discussed in this report create their
roadmaps based on the Voronoi diagram to generate smooth and
collision-free paths. I also discuss the behavior of a group of
entities moving together. I also discuss another method that
addresses the issue of movement in 3-D and is based on a
modification of the A* algorithm but it requires to two additional
post-processing steps.
-
7/29/2019 Roadmap Based Path Planning - A Report
3/18
2
Contents1. Introduction
3
2. Path Planning: Single Entity3
2.1.Roadmap Generation 4
2.1.1.Creating samples4
2.1.2.Improving the roadmap4
2.2.Answering queries
5
3. Path Planning: Multiple Entities6
3.1.Backbone path and corridor
6
3.2.Movement in corridor 7
3.3.Coherence of group
7
4. Camera Motion8
5. Results 96. Conclusion
9
-
7/29/2019 Roadmap Based Path Planning - A Report
4/18
3
7. References9
-
7/29/2019 Roadmap Based Path Planning - A Report
5/18
4
1. Introduction:
Path planning in a virtual environment is a vital part for the
movement of virtual entities like characters, vehicles or a camera.
The entities not only have to traverse through the ground plane
(2-D) but in many cases having open terrain simulations, have to
plan their motion in 3-D. Also in some cases, the motion of a
group of entities in a virtual world has to be planned, for example
the movement of soldiers in a game. Some methods typically used
for planning the above are scripting, grid-based search, local
reactive methods and flocking.
Scripting involves explicitly defining the paths that must be
followed by the entities. This is a very time-consuming process and
the user is easily able to identify the repletion in the paths
followed by the entities. It also is very complicated when a numberof entities are present.
For real-time applications such as games, it is very important to
decide how the virtual world is to be spatially segregated for
planning effectively. Grid based methods are fast and useful as
long as the environment is small because they work by dividing
the whole world into a grid of cells.
Reactive methods are based on the idea of adapting a pre-
computed path to the obstacles near the path which were not
-
7/29/2019 Roadmap Based Path Planning - A Report
6/18
5
considered previously. This method is fairly simple but often leads
to deadlock situations where the entity cannot decide where to
move, e.g. it can get stuck in a corner of a room.
Thus, for any path planning algorithm must meet the following
requirements:
o The path should have the lowest costo It should be fast robust and accurateo Should be generated automaticallyo Should be applicable to different world maps
2. Path Planning: Single Entity
The following sections discuss the method used for generation of
the roadmap for the entities to traverse. The method which isproposed is a slight variation of the Probabilistic Roadmap (PRM)
method that is based on the Vornoi diagram.
-
7/29/2019 Roadmap Based Path Planning - A Report
7/18
6
2.1. Roadmap Generation
The Voronoi diagram defines a set of points in the world space
that are equidistant from any two closest obstacles. The roadmap
that is to be developed has to satisfy the following criteria:
o It should have a certain minimum amount of clearance fromthe obstacles
o The paths should be smooth and continuouso The paths should be created fast and be short
2.1.1. Creating Samples
Sampling involves the creation of vertices and edges on the
Voronoi diagram to get a graph which will finally be used for
planning. The method involves iteratively picking up a sample c
from the free space and retracting to the Voronoi diagram by
means of the following steps. The closest point cc to c on any
obstacle near it is found (Fig 1 a) and the point from copposite cc
is marked as c. This point is moved away from c till the closest
obstacle to itchanges (Fig 1 b). Now a binary search between c
and c leads to the vertex cv (Fig 1 c) which almost lies on the
Voronoi diagram (with an error of)
-
7/29/2019 Roadmap Based Path Planning - A Report
8/18
7
(a) (b) (c)
Figure 1 Creating Samples
The above steps are followed till the required number of vertices
are located. The vertices are then connected using to form the
edges wherever they do not collide with the obstacles.
2.1.2. Improving the Roadmap
The edges obtained from the previous step do not lie on the
Voronoi diagram but often get too close to the obstacles (Fig 2 a).
Thus these edges have to be retracted back to the Voronoi
diagram till they have a pre-specified amount of clearance form
the obstacles. This is done by first finding the mid-point of the
edge close the obstacle and retracting this point to the Voronoi
diagram using the method described above. The edge is then split
into two different segments of equal parts (Fig 2 b). This is done
repeatedly until the desired clearance is achieved or till the length
of the retracted edges shorter than a pre-defined limit (Fig 2 c).
-
7/29/2019 Roadmap Based Path Planning - A Report
9/18
8
(a) (b) (c)
Figure 2 - Retracting Edges
The roadmap so obtained is still made up of straight lines and
sharp turns. Thus parts of these line segments are replaced by arcs
of a circle to obtain a smooth curve called a circular blend. The
degree of a vertex is given by the number of incoming line
segments at that vertex. For any vertex with a degree of two or
more, the mid-points of every pair of incoming line segments are
found and are connected using arcs of circles (Fig 3 a, b). In some
cases, adding a circular blend decreases the clearance at that
edge. In such cases, the blend is replaced by another circular blend
of smaller radius till the desired clearance is obtained (Fig 3 c).
(a) (b) (c)
Figure 2 Circular Blends
-
7/29/2019 Roadmap Based Path Planning - A Report
10/18
9
2.2. Answering the queries
Once the above steps are completed, the roadmap is ready and it
can be searched in real-time to plan a path in the environment. An
example of a roadmap is shown in figure 4 a. The initial and final
positions are connected with the closest vertices via circular blends
and then the roadmap is searched using Dijkstras algorithm for
the shortest path between these vertices. The final path looks
somewhat like shown in figure 4 b.
-
7/29/2019 Roadmap Based Path Planning - A Report
11/18
10
(a) (b)Figure 4 Roadmap and Final Path
3. Path Planning: Group of Entities
It is often required in virtual environments to plan the motion of a
group of entities for e.g. movement of a group of computer
controlled soldiers in a game. Most current techniques to solve
this problem involve the use of planning for each entity separately
and keeping them together using flocking. But this is often difficult
in complicated environments and the difficulty increases with
-
7/29/2019 Roadmap Based Path Planning - A Report
12/18
11
obstacles. While planning the paths for a group of entities in the
virtual world, the following things should be kept in mind:
o The entities must avoid collisions with obstacles along thepath and amongst themselves
o They should always stay together as a groupThe entities are modeled as discs moving in a plane. Path planning
is done by first finding a backbone path for a single entity and
then defining a corridor around that path. All entities must stay
inside this corridor.
3.1. Backbone Path and corridor
A backbone path is a path in the world where the clearance at
every point on the path is at least equal to the radius of the
enclosing circle of the largest entity. It is preferred to have as
much clearance along the path as possible so as to allow for
coherent movement of the entities. A corridor is defined along the
path as the radius of the largest circle centered at every point
along the path, which does not intersect with any obstacles. The
movement of the entities is restricted to the corridor.
If generated using a non-optimal roadmap, the backbone path
could be very close to the obstacles at some points (Fig 5 a). This
would result in the corridor being very narrow at some points
along the path. But, when an optimal roadmap is used, like the
-
7/29/2019 Roadmap Based Path Planning - A Report
13/18
12
one described in section 3, then sufficient clearance is obtained
along the path (Fig 5 b).
(a) (b)
Figure 5 Backbone path and Corridor
3.2. Movement in the Corridor
Artificial force-fields technique is used to monitor the movement
of the entities in the group. Every entity is assigned an attraction
point on the backbone path which is the maximum advance point
p(Fig 5b) such that the entity is still inside the circle centered at p
with radius equal to the clearance at that point. This keeps the
entities in the corridor and there is repulsion among the entities to
avoid collisions.
3.3. Coherence of Group
-
7/29/2019 Roadmap Based Path Planning - A Report
14/18
13
The groups dispersion should be upper-bounded to keep it
coherent so as not to allow the entities to stray off the backbone
path. The lateral dispersion is already bounded by the corridor
width. The longitudinal dispersion, though, is not bounded. Both
the dispersions can be manipulated to control the behavior of the
group along the path. A high longitudinal dispersion results in a
stretched out group (Fig 6 a). Whereas low longitudinal and high
lateral dispersion will result in the group being huddled together
(Fig 6 b).
-
7/29/2019 Roadmap Based Path Planning - A Report
15/18
14
(a) (b)
Figure 6 Group Coherence
4. Camera Motion
A camera is essential to every virtual environment as it is the
portal through which the user can see the world. Thus there can
be a single or multiple cameras in a virtual world and they are to
be allowed to move and rotate to change the viewing angle and
position. In many situations, a camera moving automatically in the
environment is of great use (e.g. an architectural walk for users
through housing projects to give a feel of the site). The roadmap
construction discussed above is very suitable for this application as
the paths generated are smooth and continuous. There are two
more parameters to be considered. First, the speed of the camera
should adapt to the path for a smooth motion of the camera. Also,
there should be a maximum limit on the acceleration and
deceleration of the camera to avoid abrupt changes in speed. The
-
7/29/2019 Roadmap Based Path Planning - A Report
16/18
15
idea gets clear on looking at figure 7 where (a) shows the path to
be followed by the camera, (b) shows the corresponding maximum
speed limits along the path and figure 7 (c) shows the actual
speed of the camera considering the bounds of acceleration and
deceleration. Thus it figures that the speed of the camera will be
slower around the curves and will increase along straight paths.
(a) (b) (c)
Figure 7 Camera path, speed and acceleration
The second parameter to be kept in mind is the viewing angle of
the camera. The camera should always point in the direction where
it is going to be after some time (say a second) in order give a
better idea of where it heading. The position along the path where
the camera would point to depends on the speed of the camera.
4. Results
-
7/29/2019 Roadmap Based Path Planning - A Report
17/18
16
Computation of the roadmap shown in figure 4 (a) took around 1
second on a P 4, 2.4 GHz machine. That is nominal considering the
fact that the roadmap can be generated once when the virtual
environment is being created / modeled and saved for future use.
Once the roadmap is obtained, answering the path queries hardly
take any time. It was observed that for a roadmap consisting of
1000 vertices and 3000 edges, the path was calculated in less than
10 ms. Even for a group of 50 to 100 entities, the path was
generated without much processor usage (< 1 percent). Moreover
the behavior of the entities could easily be varied by changing thedispersion parameters. Even the application for planning a camera
motion in a virtual environment generates smooth camera motion
along the path to the destination selected by the user. The user is
also allowed to move freely in the virtual environment.
5. Conclusion
In this report, I have looked at two path planning methods one
which talks about generating real-time smooth paths for a single
entity and the other for a group of entities. This approach is very
useful in large environments where grid based search fails. The
method described is a 2-D method, though it can be expanded to
allow the motion of the entities in 3-D.
-
7/29/2019 Roadmap Based Path Planning - A Report
18/18
17
The roadmap can be customized as per the requirements of the
programmer, allowing him to add or delete paths, attach weights
to certain paths to make them more preferable. It is also very easy
to add obstacles to the environment as the roadmap will simply
modify accordingly.
7. References
1 Automatic Construction OF High Quality Roadmaps for PathPlanning, D. Nieuwenhuisen, A. Kamphuis, M. Mooijekind, M.
H.Overmars, Dec 2004
2 Generic Path Planning For Real Time Applications,Christopher Niederberger, Dejan Radovic, Markus Gross
3 A Recursive Approach to roadmap based path planning,David W. Dougall, James K. Archibald
4
Roadmap Path Planning, Brian C. Williams, Oct 20035 Algorithms For Sensor-based Robotics: Roadmap Methods, G.
D. Hager, Nov 2006
6 Automated Planning: Theory and Practice Planning inRobotics, Dana Nau, 2005
7 Route Planning & Physically-based Modeling Using GPUAccelerated Computation, Ming C. Lin, May 2004
8 Robot Motion Planning, Dr. John Xiao