You are on page 1of 6

Genetic Algorithms for Adaptive Mot ion Planning of

an Autonomous Mobile Robot

Kazuo Sugihara* John Smith

Department of Information and Computer Sciences


University of Hawaii at Manoa, Honolulu, HI 96822
Email: sugiharaahawaii. edu and j ksmithahawaii . edu

Abstract Recently, applications of genetic algorithms ( G A S


for short) [l]t o path planning or trajectory planning
This paper proposes genetic algorithms (GAS) f o r have been recognized [4, 81. GA is a search strategy
path planning and trajectory planning of an au- using a mechanism analogous t o evolution of life in
tonomous mobile robot. Our GA-based approach has nature. I t has widely been recognized that GA works
an advantage of adaptivity such that the GAS work even for complex problems such that traditional al-
even i f an environment is tzme-varying o r unknown. gorithms cannot find a satisfactory solution within a
Therefore, zt zs suitable for both off-line and on-line reasonable amount of time [a].
motion planning. W e first presents a GA f o r path However, the previously proposed GAS have draw-
plann,ing in a 2D terrain. Simulatron results on the backs and could not fully exploit benefits and ability
performance and adaptivity of the GA on randomly of GAS. First, a coding which maps solutions t o sym-
generated terrains are presented. Then, we discuss ex- bolic representations often employs a variable-length
tensions of the C A f o r solving both path planning and string such as a sequence of line segments in path plan-
trajectory planning simultaneously. ning [4]. Since the string length of an optimal solution
is not known, the configuration (e.g., genetic opera-
tors) of a G A must be designed in an a d hoc manner
1 Introduction to guarantee generation of strings of arbitrary length.
Second, the GAS solve either path planning or trajec-
Motzon planning [3]is one of the important tasks in tory planning, but not both.
intelligent control of an autonomous mobile robot. It This paper proposes GAS for motion planning. Our
is often decomposed into path planning and trajectory GA-based approach has an advantage of adaptivity
planning, although they are not independent of each such that the GAS work even if an environment is time-
other. Path planning is to generate a collision-free varying or unknown. Therefore, it is suitable for both
path in an environment with obstacles and optimize off-line and on-line motion planning. We first presents
it with respect to some criterion. An algorithm for a GA for path planning in a 2D terrain with obstacles
path planning is said to be off-line if the environment of two kinds: A solid obstacle and a hazardous obsta-
is a known static terrain and it generates a path in cle which allows a path to intersect it at the expense
advance. It is said t o be on-lzne if it is capable of of some cost. A coding scheme used in the GA repre-
producing a new path in response to environmental sents a path with a binary string of fixed-length. T h e
changes. Trajectory planning is t o schedule the move- performance and adaptivity of the G A are evaluated
ment of a mobile robot along the planned path. by simulation. Then, we discuss extensions of the G A
There have been a number of methods proposed for motion planning for solving both path planning
for motion planning of a mobile robot [3]. However, and trajectory planning simultaneously.
few algorithms have been developed for on-line motion
planning in a time-varying or unknown terrain. In this
paper, we address adaptive motion planning which can 2 Preliminaries
modify the existing path whenever an environmental
change occurs. Assume that path planning is considered in a rect-
*This research was supported in part by NOAA / Sea Grant angular terrain and a path between two locations is
R/ES-4 of U . S.Department of Commerce. approximated with a sequence of adjacent cells in the

138
0-8186-8138-1/97$10.00 0 1997 IEEE
grid corresponding t o the terrain. Suppose that the ents, based on their fitness values. ( 3 ) Recoiiibiiia-
unit of distance is the size of a cell. The length l(i,j ) tion: New individuals (called oflspring) are produced
from cell i to its adjacent cell j is defined as the Eu- from the parents by applying genetic operators such
clid distance from the center pi of one cell t o the ccn- as crossover and mutation. (4) Replacement: Some in-
+
ter pj of another times ( ~ ( p ;t ;, ) w ( p j , t j ) ) / 2 , where dividuals (not necessarily parents in general) are re-
w ( p , t ) denote the weight of the location p a t time t placed by some offspring.
and a mobile robot passes pi and pj a t time t; a i d t j , The population produced a t each transformation is
respectively.’ Note that any way of storing map data called a generation. By giving highly fit individuals
such as p a d t r e e s can be used as long as we can effi- more opportunities t o reproduce, the populaliori be-
ciently retrieve information for a given location (e.g., comes likely to include “good” individuals throughout
whether there exists an obstacle a t the location). generations.
Path Planning Problem
Inpiit: ( t ) m. by n grid, (2) start cell s in the grid,
3 Path Planning
( 3 ) destinat,ion cell d in the grid, and (4) obstacles ( a
collection of cells i n the grid) of two t,ypes solid and
hazardous such that a path cannot intersect solid ob- First, we need to choose a coding which maps a
path from start s to destination d into a binary string.
st>a.clesn.t, all while ha.zardoris obstacles allow a pa.th to
Although we can represent an arbitrary path by us-
intersect them at the expense of a longer path length
ing a binary string of “variable length”, it is much
for each cell in proportion t o the obstacles’ weights
represent,ing various cost factors more desirable to use fixed-length strings. ‘lhus, we
assume that a path from s t o d is either 2-monotone
Output: A path from s to d such that the total length or y-monotone (but not necessarily both). Obviously,
of the weighted path is m i n i m u m , subject t o the con- not all paths are monotone. Hence this assumption
straint that lhe path does n o t intersect u n y solid ob- theoretically implies the possibility of excluding an
stacle optimum path in a terrain with extremely crowded
For simplicity, we assume that m = n and s and d obstacles like a maze. As shown in examples below,
are corner cells located diagonally t o each other. however, monotone paths are reasonably powerful to
In 2D space, a path is said t o be monotone with express complicated paths.
respect t o x-coordinate (2-monotone for short) if no An 2-monotone (or y-monotone) path can be rep-
lines parallel t o y-axis cross the path a t two distinct resented by a column-wise (or row-wise) sequence of
points, i.e., the projection of the path on x-axis is n - 1 pairs of direction and distance such that each
nondecreasing. When there is no confusion, we simply pair corresponds to each column (or each row, respec-
say monotone. tively). Thus, the path can be encoded into a binary
A genetic algorithm ( G A ) [l] for an optimization string whose length is proportiorial t o 71 arid fixed.
problem consists of two major components. First, GA The firsl bit Q iridicates that a path is 2-monotone
maintains a population of indwzduals, where each in- if Q = 0; and it is y-monotone if CY = 1. A block of
dividual corresponds to a candidate solution and the 3+ [lg(n+ 1)1 bits represerits direction arid distarice 011
population is a collection of such potential solutions. each column or row. The ffirst 2 bits of a block denote
In GA, an individual is commonly represented by a the direction, e.g., 00 (vertical), 01 (upper diagonal),
binary string. T h e mapping between solutions and 10 (horizontal), and 11 (lower diagonal) in case o l a =
binary strings is called a coding. The number of indi- 0; and 00 (horizontal), 01 (left diagonal), 10 (vertical),
viduals in a population is called the population size. and 11 (right diagonal) in case of a = 1. The other bits
Second, GA repeatedly transforms the population by of the block denote the distance as a signed integer if
using a mechanism analogous t o biological evolution. the direction is 00; otherwise they are ignored. Thus,
The mechanism includes the following steps: (1) Fit- the amount of space needed to store a population is
ness evaluation; T h e fitness c,orresponding t o an op- p(l+(n-l)(3+[lg(n+-l)1)) = O(pn1ogn)bits, where
timization criterion (i.e., objective function) is calcu- p is the population size.
lated for each individual. (2) Selection: Some individ- To interpret binary strings as paths and evaluate
uals are chosen from the current population as par- their fitness values, we use the following convention
which produces more “valid” paths in generations and
’Since the weight may be time-dependent (e.g., the weight
hence improves the performance of our GA. If a block
strongly depends on the tide and current in a shallow water),
a straightforward application of the Dijkstra’s shortest path al- of a binary string denotes the direction and distance
gorithm does not work in this context. t,hat make hhe corresponding path go beyond the en-

139
k4. I I I I I I I I I I I I I I I
tire grid a t a boundary cell, t h e rest of the path is
regarded as straight line segments along the boundary
from the boundary cell to the destination cell Note
that we leave the binary string as it is, since the unin-
terpreted substring may become valid and useful later
if the substring is inherited t o new generations by ge-
netic operators.
This coding has two advantages. First, as men-
tioned above, binary strings are of the same fixed
lengt8h. If binary strings are of variable length, we N = 1, F i t = 992.586 N = 85,F i t = 996.274
need t o carefully customize genetic operators such as
crossover and mutation. For example, the operators
must be able to generate strings of any length from an
arbitrarily given initial population. Second, straight-
forward applications of genetic operators t o strings al-
ways produce syntactically valid strings. This simpli-
fies a process of recombination and makes the entire
G A efficient. Therefore, with our coding, a simple
GA [l]works well without any special operator.
We have implemented the CA for path planning by N = 520,F i t = 996.446 N = 645, F i t = 999.86
using the GA Toolkit [5] which we developed for design
and prototyping of GAS on WWW.’ For convenience, Figure 1: An example run of the path planning G A .
we changed minimization of a path into maximization
by defining the fitness function as (1 + w m a z ) n 2 - it starts changing a population once an environment
(the length of a weighted path) if the path does not
changes and tries t o adapt for the change. In other
intersect any solid obstacle and otherwise 1, where
words, G A works even if input d a t a is changed on fly.
w,,, is the maximum weight.
Therefore, it is suitable for not only off-line path plan-
Next, we show example runs of the GA, where ning but also on-line path planning.
n = 16, the population size p = 30, crossover rate
Figure 2 shows an example for the adaptivity of the
y = 0.8 that is the ratio of individuals involved in GA. Suppose that the current path is the one (which
the crossover over the entire population, and muta- is optimal) shown in the top left of Figure 2. Note that
tion rate p = 0.01 that is the probability of bit alter- there are several suboptimal paths with fitness values
nation per bit on a string. Note that the start cell very close t o the optimal fitness (at most 0.04% dif-
s is depicted by a circle a t the upper left corner, the ference) and they are quite different from each other.
destination cell d is depicted by X at the lower right Then. a mobile robot detects an unknown hazardous
corner, N denotes the generation number, and F i t de- obstacle on the path (see the top right of Figure 2).
notes a fitness function value. Figure l shows how a Insertion of the new obstacle on the previously opti-
path was evolved during an example run, where black mal path creates a new optimal path which was one
cells denote solid obstacles and three kinds of shaded of the suboptimal paths. In the example run, the G A
cells denote hazardous obstacles with weights (i.e., ex- adapted for this environmental change as shown in the
t r a length) I,2 and 3 in increasing order of their dark- bottom left and right of Figure 2.
ness. Note that there are at least 6 local optima within
0.4% fitness difference. T h e G A examined some of the
local optima, which are completely different from each
other, and eventually found an optimum path.
4 Simulation Results
One of the important advantages of our G A ap- We have conducted simulation study [B] of the pro-
proach is adaptivity. A path may need t o be changed posed G A by using the C A Toolkit [5]. T h e G A was
when a mobile robot detects an unknown obstacle or first tuned by preliminary simulation on the terrain in
inaccuracy of the map information used for generation Figure 1 and two more terrains of similar sizes. T h e
of the path. GA is a dynamic system in the sense that simulation examined all combinations of 3 selection
operators, 3 genetic operators, 1 mutation operator,
2The G A Toolkit is available at the following URL. http://
~~~.ics.ha~aii.edu/-sugihara/research/ga-updates.html and various parameter values for each operator with
It requires a Java-enabled Web browser such as Netscape 3.0. respect t o several performance measures [B] such as

140
Table I : LOPt(lOOO)[%] for combinations of U
, and w.

N = 35, Fit = 991.997 N = 36, Fit = 988.376 Table 2: Performance on randomly generated terrains.
optimal path environmental change

79.4

99.796
20.4
overall 39.0

N = 39, Fit = 988.618 N = 309, Fit = 991.72 ered 5 levels of the terrain complexity in t,erms of the
evolved path new opt,imal path
number of obstacles: 10, 15, 20, 25 and 30 obstacles.
Figure 2: A run on a terrain with 25 obstacles. Each obstacle is generated by choosing its location,
size and weight randomly. The weight ranges between
1 and 4 (we consider 4 as a solid obst,acle) uniformly.
the average fitness value f and lzkelzhood of optzmalzty The size ranges between 1 and 5 uniformly for up to
L,,,(k) which is the estimated probability of finding 20 obstacles. For 25 or 30 obstacles, the size ranges
an optimal solution within k generations. between 1 and 4. This is because a simple estimate
T h e preliminary simulation with 100 runs for each of obstacles’ occupancy rate exceeds 100% (i.e., too
combination suggested the following tuning [6]: A crowded in a t,errain) if the size ranges between 1 and
sequence of roulette tournament selection, 1-point 5, although the actual occupancy rate may be a little

-
crossover and multi-point mutation; population size
p = 30; mutation rate p = 0.04 0.05; crossover rate
y = 0.8; and wzn rate w = 0.95 N 0.8 which is the
less than the estimate due to overlapping of obstacles.
A summary of the performance evaluation is pre-
sented in Table 2, where f o p , is the optimal fitness and
probability that a better individual wins a t each bi- NO,, is the average number of generations to reach an
nary tournament in the roulette tournament selection. optimal solution. It is generally consistent with the in-
With this simulation, we could identify p , p and w as tuition that the higher occupancy rate, the more dif-
primary factors and narrow down the range of each ficult t o solve. Since the standard deviation of the
parameter’s value for fine tuning. number of generations t o reach an optimal path was
For the fine tuning, we observed 1,000 runs on the less than 300, the cut-off gen.eration 1,000 in each run
terrain in Figure 1 for each combination of p and w , seems t o be large enough. The results suggest that
where p = 30, y = 0.8 and the number of genera- even for the most complex terrains with a nearly 90%
tions k = 1000. Simulation results are summarized expected occupancy rate of obstacles, the GA likely
in Table 1. Note that the 95% confidence interval for finds an optimal path with 1 - (1 - 0.204)1° N 90%
1,000 runs is about 0.03. Thus, it is reasonable to ex- probability in 10 runs of 1,000 generations each.
pect L,,t(lOOO) > 0.45. This implies that the GA can Next, we present simulation results on the adaptiv-
find an optimal solution with high probability if it is ity of the GA. T h e adaptivity is defined as how quickly
executed repetitively, e.g., 95% for 5 runs of 1,000 gen- the GA accommodates an environmental change. In
erations and 99.7% for 10 runs of 1,000 generations. this paper, we measure it by the number of genera-
In order t o evaluate the average performance of our tions taken t o find a new optimal path after insertion
GA over various terrains (rather than a few terrains), or deletion of an obstacle. The GA was executed on
we observed simulation of the GA with p = 0.04 and 5 terrains which were chosen, one each of the 5 levels
w = 0.95 on 25 terrains for 100 runs each. T h e 25 ter- of terrain complexity, from the terrains randomly gen-
rains were randomly generated as follows. We consid- erated for the above performance evaluation. We ob-

141
5 Extensions t o Motion Planning

No. ave. s t d of ave. std of T h e GA for path planning can be generalized for
obstacles NI NI NZ N2 motion planning by considering a grid with 3 dimen-
10 3.7 2.61 18.1 12.34 sions. T h e third dimension z is regarded as time in
15 57.6 43.36 88.1 61.94 trajectory planning. For simplicity, we assume that a
20 16.1 16.50 23.8 30.54 mobile robot does not have a particular orientation,
25 356.4 287.84 261.6 234.56 e.g., the robot has a circular shape and can move in
30 4.4 5.43 18.4 19.46 any direction.
overall 87.6 188.29 82.0 144.31
Motion Planning Problem
Input: Obstacles in an n by n by CO grid
served 10 runs on each terrain in the following way. In Output: A path between cells a t (0,0,0) and ( n -
each run, when the GA has found an optimal path on l , n - 1 , T ) for some integer T such t h a t the total
a terrain, a single-cell obstacle with weight 3 is added length of the weighted path in the 3D grid is minimum,
to a terrain so that it obstructs the optimal path in the subject t o the constraints that (a) the path does not
middle. Once the GA finds a new optimal path, the intersect any solid obstacle and (b) the path meets all
GA continues its execution for about 20 generations in the limitations of a robot’s maneuverability
the new environment. Then, the inserted obstacle is
now removed. The simulation run ends when the GA In case of a static terrain, the input can be simpli-
rediscovers the optimal path of the previous terrain. fied t o an n by n grid as in the path planning problem
Simulation results in total 50 runs are summarized defined in Section 2.
in Table 3 , where N I is the number of generations A path in the 3D grid is said t o be xy-monotone if
taken t o find a new optimal path, Na is the number no lines parallel t o z-axis cross the path a t two distinct
of generations taken to rediscover the previously opti- points. Similarly, zz-monotone and yz-monotone are
mal path after deletion of a new obstacle, and “ s t d ” defined. A projection of a path on x-y plane is called
stands for standard deviation. Note t h a t the number xy-projection of the path. Similarly, xz-projection and
N I of generations to find an optimal path in a new yz-projection are defined. Note that zz-projection and
environment is likely much smaller than the number yz-projection are always z-monotone in the motion
of generations t o find it from scratch (see Table 2). planning problem, since the z-coordinate corresponds
t o time.
In addition, we observed t h a t an alternative path
In order t o solve the motion planning problem, we
(not necessarily optimal though) was produced in the
consider 3 possible coding schemes. T h e first cod-
next generation after an environmental change. This
ing scheme assumes that (1) a path is zy-monotone
may be because the GA maintains the diversity of a
and (2) zy-projection of the path is x-monotone and
population t o some extent. Even if a n optimal path
y-monotone. Then, a path in the 3D grid can be rep-
becomes infeasible, another path in the population can
resented by a pair of paths in a 2D grid. One is zz-
be picked up. In many cases, a new optimal path to be
projection and another is yz-projection. Note that
found shares similar features with some paths in the
these assumptions also imply that zz-projection is x-
current population and hence it is quickly produced
monotone and yz-projection is y-monotone.
by the GA. Of course, this is not always the case. If
T h e motion planning problem is now viewed as find-
an environmental change drastically changes an opti-
ing a pair of two 2D paths which minimizes the ob-
mal path and the current population does not cover
jective function. Thus, the coding for the 2D path
features of a new optimal path, finding a new path is
planning problem can be generalized as follows. Let
basically same as finding it from scratch.
u1 be an 2-monotone representation c o n s t r u c t e d f r o m
Finally, we briefly mention about running time of xs-projection by using the coding, except t h a t the first
the GA. So far, we have evaluated the computational bit is no longer needed, directions for decreasing time z
time in terms of the number of generations, since it is are not allowed, and the distance value is always non-
independent of computational environments and con- negative. Similarly, 02 is an y-monotone representa-
venient t o compare different GAS for the same prob-
lem. T h e simulation that we have presented in this 3The limitations m a y include the maximum velocity and the
paper was conducted with a Java applet running on maximum acceleration. If we take into account geometric fea-
tures of a mobile robot and rotation of the robot, additional
Netscape 3.0. T h e applet of the GA runs at the speed constraints on the maneuverability such as the minimum turn-
about 0.1 second per generation on a PC (166MHz). ing radius should be considered.

142
tion constructed from yz-projection. By interleaving 6 Conclusion
the two strings ~1 and uz bit by bit, we obtain U that is
a binary representation of a path in the 3D grid. T h e This paper proposed genetic algorithms (GAS) for
reason for interleaving is that crossover can transform path planning and trajectory planning of an a w
both zz-projection and yz-projection simultaneously. tonomous mobile robot. We first presented a GA
This generalization preserves the advantage of the for 2D path planning and evaluated its performance
by simulation. Our coding represents a path with
coding for 2D path planning, i.e., fixed-length coding.
a binary string of fixed-length. This is a key t o the
The only difference from the coding for 2D path plan-
good performance. Simulation results were also pre-
ning is that we have to resolve potential inconsistency
sented to show how adaptive the G A is. Then, we
between u1 and u2. It is possible that the total time
tl in ~ r 1is less than the total time tz in uz (or vice discussed extensions of the path planning CA t o GAS
which solve both path planning and trajectory plan-
versa). In such a case, we use the following conven-
ning simultaneously. Since the GAS are adaptive so
tion to interpret the interleaved string U . After time
that they work even if an environment is time-varying
t l , a path stays on the same x-coordinate value.
or unknown, the GAS are suitable for both off-line and
T h e second coding scheme assumes only the first on-line motion planning.
assumption (1) and removes (2). Then, a path can be
represented by a triple of xy-projection, zz-projection
and yz-projection. Each projection is mapped t o a bi- References
nary string by using the coding for 2D path planning.
Note that the binary string representing zz-projection David Beasley, Dav-id R. Bull and Ralph R. Mar-
or yz-projection is of variable length, depending on tin, “ A n overview of genetic algorithms,” Univer-
tfhe last z value on the projection. Then, the three sity Computing, Vol. 15, No. 2 and 4, pp.58-69
strings are interleaved bit by bit after shorter paths and 170-181, 1993.
are padded with dummy bits. Note that inconsis-
tency must be resolved among three projections. In David E. Goldberg, “Genetic and evolutionary al-
addition, the length of a binary string in this cod- gorithms come of age,” Commun. ACM, Vol. 37,
ing scheme is variable, since the duration tinie t o be No. 3 , pp.113-119, March 1994.
achieved in trajectory planning is unknown. Once we Young K. Hwang and Narendra Ahuja, “Gross
have to manipulate strings of variable length in a G A , motion planning - A survey,” A C M Compt. Sur-
a simple GA does not work and we need t o carefully veys, Vol. 24, No. 3 , pp.219-291, Sept. 1992.
customize genetic operators for the coding scheme.
T h e design of a GA with a variable-length coding is Hoi-Shan Lin, Jiang Xiao and
usually ad hoc and complicated. Zbigniew Nfichalewicz, “Evolutionary algorithm
The third coding scheme removes both the above for path planning in mobile robot environment ,”
assumptions (1) and (21, but assumes that the size of Proc. 1st IEEE Conf. on Evolutionary Computa-
a cell in z-coordinate is chosen to be snialler than or lion, Vol. I , Orland, FL, 1994, pp.211-216.
equal t o the time S = d / ( 2 V ) , where V is the maxi- John Smith and Kazuo Sugihara, “GA Toolkit
m u m velocity and d is the size of a cell in x-coordinate on the Web,” Proc. 1st Online Workshop on Soft
or y-coordinate. There is no restriction on the shape Computing, Aug. 1996, pp. 93-98.
of a path. Then, a path cannot cross two or more cells
on the same z-coordinate value and hence has only 9 Kazuo Sugihara, “Measures for performance eval-
directions. Thus, a path can be represented by a se- uation of genetic algorithms,” Proc. 3rd Joint
quence of directions. Although this coding scheme is Conf e re n ce o n Inform at ion Sciences (JCIS ’97),
very simple, yet powerful enough to express arbitrary Vol. I, March 1997, pp.172-175.
paths in the 3D grid, it is a variable-length coding. Kazuo Sugihara and Junku Yuh, “GA-based mo-
Therefore, the first coding scheme should be chosen tion planning for underwater robotic vehicles,”
if the assumptions (1) and ( 2 ) are accept,able. UIJST-IO, Durham, NH, Sept. 1997, to appear.
It is also possible to extend the GA further to mo- H. Y. Xu and G. Vukovich, “Fuzzy evolutionary
tion planning in 3D space. We are currently investi- algorithms and automatic robot trajectory gen-
gating a coding suitable for 3D path planning arid de- eration,” Proc. 1st IEEE Conf. on Evolutionary
signing a GA for motion planning of an autonomous Computation, Orland, FL, 1994, pp.595-600.
underwater vehicle [ 7 ] .

143

You might also like