Вы находитесь на странице: 1из 8

Articial Millepede

(2011 Fall Written Qualify Paper)


Student: Jingyi Fang, Mentor: Demetri Terzopoulos
Computer Science Department
University of California, Los Angeles
AbstractI built an articial millepede with perception
systems completely from scratch, using OpenGL and C++. The
3D Bio-Mechanical model of Millipede is built with Spring-
Damper system and Rigid-Body dynamics and solved using
implicit Euler method. Under different initial states, the motion
pattern of the millepedes legs will magically converge to a
wavelike pattern, the same with real millipedes. The perception
of the millipede is built with virtual antennas so that it could
avoid obstacles and search for food on its own. This articial
millipede described bellow is the rst of its kind in the world.
CONTENTS
I Introduction 1
II Functional Overview 2
III 3D Bio-Mechanical Model 3
III-A Three Components: Body Node,
Spring-Damper and Rigid Leg . . . . 3
III-B Motion Equations: Newton Mechanics 4
III-C Solve the Equations: Implicit Euler
Method . . . . . . . . . . . . . . . . . 4
IV Antennas: Perception System 5
IV-A Road Detector: See . . . . . . . . . . 5
IV-B Food Detector: Smell . . . . . . . . . 6
V Coding Notes 6
V-A Design of Classes . . . . . . . . . . . 6
V-B Within Each Frame . . . . . . . . . . 6
VI Summary 6
VII Acknowledgements 7
VIII Appendix 7
References 8
I. INTRODUCTION
It has always been a mystery that makes me think over
and over: Why are we here? What is the reason of life? Since
the earliest generations of us, philosophers, religionists,
scientists and almost all of the smartest individuals have
been trying to solve this everlasting problem. Unfortunately,
up to now (September 2011), there is still no perfect answer.
In 1986, Christopher Langton, an American computer
scientist, gave the birth to Articial Life[1]. With this new
emerging eld, computer scientists could build simulated
life forms with a couple of silicon slices and codes, and nd
something so close to real life patterns that one usually nd
it hard to tell the difference. Indeed, just as V. Breitenberg
pointed out in his famous monograph[2], a lot of structures
within animal brains have been proved interpretable as
pieces of computing machinery because of their simplicity
and regularity. It is a good idea to use computer simulations
to study the behaviors of plants, animals and even human
beings.
In [2], Breitenberg has demonstrated quite complex be-
haviors such as avoiding obstacles, attacking enemies, logic
thinking, memory, and evolution through generations of car-
like robots with several simple rules. While he was building
the Alife theories with either real world robots or computer
simulated creatures, I believe that doing articial life re-
search in a virtual environment is much more convenient
and achievable. Therefore, in this article, Ill focus on virtual
creatures created by a computer. The work in this article I
have done is based on C++ and OpenGL. For simplicity, I
have not used any existing physics engines, rather, I built a
bio-mechanical model that obeys Newton Mechanics from
scratch.
In terms of articial life forms, I am more interested in
lower animals, such as sh, snakes and bugs. Comparing to
human beings that have been evolved with extremely high-
level intelligence, studying lower animals is more feasible
due to current hardware level and the limited time of doing
this project.
First, it is necessary to say something about reptiles
here. A long time ago, early reptiles were well placed
to capitalize on the earth environment. They were well
evolved to live on this planet. Due to their simplicity
and observability, the modelings of zero-leg robots (snake),
four-legs robots(salamander), six-legs robots(spider)[3] have
been studied by a lot of scientists and engineers. A very
good example is Dr.Ijspeerts work on salamander[6].
Insects, not so different from reptiles, are also extremely
popular. They are technically much closer to Breitenberg
vehicles than reptiles, therefore more reliable to be inter-
preted as machines due to their very simple brains. For
example, the ant colony simulation has been done by quite
a number of researchers[4]. By following simple rules, each
ant communicates with environment, and nally nds the
best way of carrying food home. The ant colony optimiza-
Fig. 1. A Real Millepede
tion algorithm (ACO) is then developed as a probabilistic
technique for solving computational problems which can be
reduced to nding good paths through graphs.
After investigating several insects (ants, worms, cater-
pillars, bugs, e.t.c.), I found that millepede (Figure 1) is
absolutely an interesting and fascinating topic which has
not been studied in Articial Life eld. With the limited
resource, I have not found any existing paper about the
simulation of millepede motion or its brain. By observing
the motion and behaviors of millepedes on YouTube, I
found that millepedes have very unique wavelike motion
patterns and I want to simulate out this motion pattern.
To achieve this goal, a 3D bio-mechanical model need to
be built and work under the law of Newton Mechanics.
With inspirations from Xiaoyuan Tus articial sh[5] and
Ijspeerts virtual salamander[6], I decided to use mass-
spring-damper to link the body trunks of millepdes and use
rigid body dynamics for the motion of legs. The result works
beyond my expectations as the legs move into wavelike
pattern automatically. I also simulated several of their low-
level behaviors such as food tracing and obstacle avoidance,
which will be presented later in this paper.
II. FUNCTIONAL OVERVIEW
The control and information ow of my millepede model
is shown in Figure 2. It includes a motion system (i.e.,
motion controllers and physical skeleton/muscle structure),
an instinct unit which provides some motion patterns for
the body moving purely from inheritance, a perception
system and most importantly, a brain which can analyze the
information obtained by the perception system and control
the body movement to achieve certain goals such as turning
certain angles to a new direction.
The motion system, as shown in its name, is the key
function of the millepedes body movement. The physical
structure has been well constructed so that the virtual
millepede is capable of moving around and has enough
resemblance with a real one. It should also be pointed out
that, the millipede does not only have a body that looks
quite vivid, its physical model is also very close to a real
millipedes skeleton. Under certain physical constraints, the
millepede could learn by itself how to walk appropriately
and efciently. What amazes me here is that the result of
Fig. 2. The Control and Information Flow of a Millepede
learning and evolving is quite similar to a real centipede.
I think it is convincible that some mechanisms of nature
have been successfully simulated. The exciting results will
be shown in the later sections of this article.
As we all know, a newly born insect could move around
prociently without learning. If we put a baby millepede on
an innite large plain ground, which has nothing else (quite
a boring world!), it is quite possible that it will randomly
move around. I believe that this wandering-around behavior
has nothing to do with thinking. Precisely, a signal that tells
the millepedes motion system to turn to a certain direction
does not necessarily come from the upper level of the brain.
Under this random walking circumstance, I assume these
command signals are from a special unit called instinct.
In order to create higher order behaviors such as obstacle
avoidance and food tracing, I gave the virtual millepede
a perception system. This system has two parts: a road
detector and a food detector. The two kinds of detectors
can be treated as articial eyes and nose. For lower animals
such as millepede, they usually do not have eyes and noses,
instead, they have simpler organs that work perfectly as well,
which are called antennas3. I started the simulation by
building complicated vision system for the millipede, but it
turned out, as a matter of fact, just two antennas and simple
rules would do a perfect job. Whats more, a real antenna can
sense the molecules in the air so as to detect the positions
of food and lovers :). With the help of the antennas, the
millepede is able to interact with the surroundings. In other
words, it obtains the ability of avoiding obstacles, looking
Fig. 3. Antennas Instead of Eyes/Nose
for food, nding mates, escaping from predators, e.t.c.
After receiving signals (or detecting data) from the envi-
ronment, the perception system itself does not know what
to do with these information. It will continuously send
these information signals directly to the brain. The brains
function is to analyze these information and give commands
to the motion system, so as to let the millepede take certain
actions according to what it percepts.
III. 3D BIO-MECHANICAL MODEL
A. Three Components: Body Node, Spring-Damper and
Rigid Leg
Figure 4 shows the 3D bio-mechanical model built for
our articial millepede. The body of the millipede is formed
with three elements: central mass nodes, spring-dampers that
connect the nodes, and rigid legs mounted on the mass node
which have one degree of rotational freedom(restricted to
certain angles). Besides body components, the millipede also
has higher level components to help it better understand
the world (including eye-like visual system and nose-like
olfactory system).
The head can be treated as a special body node, because
it has antennas congured and (most importantly!) it has a
brain. Here, the word brain does not mean writing codes
of brain classes and functions inside the head node when
programming. Since in this section I am dealing with a bio-
mechanical model, I mainly consider the motion system. So
the brain refers to more precisely a movement leader. It
will lead the movement of the entire millepede body, just
acting the same role as a basketball team leader or a pirate
captain!
The most important physical structure in this model is
the component that is between every two connected nodes.
Fig. 4. The Bio-Mechanical Model of a Millepede
Fig. 5. A Spring-Damper System
It is the spring-damper system, and the structure is shown
more clearly in Figure 5. The spring-damper system is
like an elastic string that links the body together, they are
widely used in real engineering for automobiles as well
as virtual engineering for sh[5] and salamanders[6]. In
my simulation, the spring constant (another name is Hooke
constant) remains unchanged, which means that these links
only act passively to the deformations and maintain the body
shape by generating negative feedback of forces to nearby
nodes (on the other hand, if the spring constant changes
and get controlled by the brain, it simulates muscles). The
negative feedback has two orders, the rst order is the
springs negative feedback to the deformation, the second
order is the dampers negative feedback to the deformation
of deformation.
There are two states for legs on each section, and each
section works independently for their own legs, the rst state
I call it leg-lifting-forward state, the second state I call it
leg-pushing-backward state(See Figure 7). In the rst state,
the center of mass is subject only to three forces: the back
and forward spring-dampers force and the gravity. In the
second state, the leg would push the mass center forward
similar to a rigid lever. Here legs are controlled by motors
that rotate at a speed determined by the brain.
Another important constraint introduced here is that the
legs can not collide with each other. This constraint is
important in that it directly leads to the formation of wave
like leg movement6, which is unexpected before simulation.
This pattern of movement is what real millepedes use. In my
Fig. 6. Wavelike Movement. This pattern of movement is what real
millepedes use. In our simulation, any randomly congured initial leg move
pattern will converge to this wavelike pattern after a few seconds. This is
an amazing auto-optimization.
simulation, any randomly congured initial leg move pattern
will converge to this wavelike pattern after a few seconds.
This is an amazing auto-optimization mechanism. However,
after careful analyze, I nd this result reasonable. Imagine
the legs are long and can rotate freely for 20 degree to
each side, however, the legs are so close to each other that
if they do not coordinate with each other in such a wave
pattern, they would collide with each other all the time,
thus increasing the leg lifting frequency. To lift the leg, the
bug has to overcome the gravity, which is unfavorable and
inefcient. So combining these together, the constraint that
legs can not collide with each other would directly lead to
the wave like leg movement.
The turning of the millipede is realized in a very simple
but efcient way. Rather than giving orders to all legs and
asking them to work together, turning is done by the head
section alone. Magically enough, due to the spring-damper
effect, the whole body would turn beautifully as the head
turns. For example, if the millipede desires a turning of 90
degrees to the left, its head section would turn at a xed
angular velocity each time when it is in the leg-lifting-
forward state(it can not turn when its legs are on the ground).
Also, all the legs on the other body sections always need to
align itself to the direction of its front spring-damper link
during the leg-lifting-forward state. This simple updating
rule results in a very well working turning mechanism for
the millipede (please refer to my video demonstrations listed
in Appendix).
B. Motion Equations: Newton Mechanics
Mathematical representations of the Newton dynamics are
shown below in Eq. (1),(2),(3),(4),(5),(6)and(7).

f
t
i
=

f
t
i,pre
+

f
t
i,post
+

G +

f
t
i,leg
; (1)

f
t
i,pre
=

f
t
i1,i,s
+

f
t
i1,i,d
; (2)

f
t
i,post
=

f
t
i+1,i,s
+

f
t
i+1,i,d
; (3)

f
t
i1,i,s
=
s

x
t
i1
x
t
i
x
t
i1
x
t
i

( x
t
i1
x
t
i
L
i1,i
) (4)

f
t
i1,i,d
=
d

x
t
i1
x
t
i
x
t
i1
x
t
i

x
t
i1
x
t
i
x
t1
i1
x
t1
i

dt
(5)
Fig. 7. Two Leg States
v
t+1
i
= v
t
i
+

f
t+1
i

dt
m
; (6)
x
t+1
i
= x
t
i
+v
t+1
i
dt. (7)
Here, in Eq. (1), f
t
i
is the force on ith node at time t. f
t
i,pre
and f
t
i,post
are the pushing or pulling forces by connecting
spring-damper from the previous node and post node. Eq.
(2) and (3) shows that the forces from the link have two
components, one from spring, another from damper. In Eq.
(4)(5), the spring and damper forces is calculated from node
positions x and spring-damper coefcients
s
and
d
. G
is gravity. f
t
i,leg
is the pushing-forward force due to leg
rotation. This force is calculated with rigid body dynamics.
With the equation of forces determined by Eq. (1),(2),(3),(4)
and (5), the position of individual nodes can be updated
through Eq. (6) and (7).
Different schemes can be applied to solve these equations
numerically, I will leave this part to the following subsec-
tion.
C. Solve the Equations: Implicit Euler Method
There are two ways to solve the equations numerically,
one way is called explicit euler method, the other is called
implicit euler method. In the explicit euler method, forces
on each node are calculated at each discrete time step from
current calculated positions, then used to calculate the next
time steps velocities and positions, explicit euler method
is a forward integration method, it is simple to code and
calculate, but fatally unstable when the spring constants
are large. On the other hand, implicit euler method uses
positions from future(which is unknown) to solve for current
forces(a function of to be solved future positions), then
the forces would result in future velocities and positions.
This implicit method is a backward integration method and
results in a system of linear equations to be solved for
the unknowns(future positions). Depends on how large the
matrix is, mathematical tricks can be applied to do the
matrix inversion faster. In my problem, the matrix size
would be NN with N denoting the number of nodes the
millipede has. Since N is relatively small(around the order
of 10)for our simulation, I did matrix inversion directly. The
calculation is fast enough for real time simulation.
_
_
_
_
_
_
_
_
x
t+1
1
x
t+1
2
.
.
.
x
t+1
n
_
_
_
_
_
_
_
_
=
_
_
_
_
_
_
_
_
x
t
1
x
t
2
.
.
.
x
t
n
_
_
_
_
_
_
_
_
+
_
_
_
_
_
_
_
_
v
t
1
v
t
2
.
.
.
v
t
n
_
_
_
_
_
_
_
_
dt+
_
_
_
_
_
_
_
_

f
t+1
1

f
t+1
2
.
.
.

f
t+1
n
_
_
_
_
_
_
_
_

1
m
dt
2
(8)
The system of equations to be solved are derived from Eq.(6)
and (7), listed in Eq. (8). Denition of f
t+1
i
is derived from
Eq. (1),(2),(3),(4) and (5), listed in Eq. (9). By using f
t+1
i
rather than f
t
i
, the equation set becomes implicit and must
be solved together. In order to simply the problem to a linear
one, in Eq. (9), notice that the none linear part x
t
i1
x
t
i
,
which is the current length of spring-damper, is used to
represent the future spring-damper length x
t+1
i1
x
t+1
i
.
Eventually, Eq (9) can be simplied to Eq. (10), presenting
a linear relationship between forces and node positions.
Putting Eq. (10) back to Eq. (8) would generate a linear
equation set denoted by Eq. (12).

f
t+1
i
=

f
t+1
i,pre
+

f
t+1
i,post
=
s

x
t+1
i1
x
t+1
i
x
t
i1
x
t
i

( x
t
i1
x
t
i
L
i1,i
)
+
d

x
t+1
i1
x
t+1
i
x
t
i1
x
t
i


x
t
i1
x
t
i
x
t1
i1
x
t1
i

dt
+
s

x
t+1
i+1
x
t+1
i
x
t
i+1
x
t
i

( x
t
i+1
x
t
i
L
i,i+1
)
+
d

x
t+1
i+1
x
t+1
i
x
t
i+1
x
t
i


x
t
i+1
x
t
i
x
t1
i+1
x
t1
i

dt
(9)

f
t+1
i
= a
1
x
t+1
i1
+ a
2
x
t+1
i
+ a
3
x
t+1
i+1
(10)
With:
_

_
a
1
=
s
(1
Li1,i
x
t
i1
x
t
i

) +

d
dt
(1
x
t1
i1
x
t1
i

x
t
i1
x
t
i

)
a
2
= a
1
a
3
a
3
=
s
(1
Li,i+1
x
t
i+1
x
t
i

) +

d
dt
(1
x
t1
i+1
x
t1
i

x
t
i+1
x
t
i

)
(11)
A
t
x
t+1
= b
t
(12)
x
t+1
= A
t
1
b
t
(13)
Solving Eq. (12) would be difcult and requires special
treatment of the matrix when A
t
is very big, however, in
our case, A
t
is at the order of 10, so simply inverse the
matrix and multiply to b
t
would work fast enough to give
real time simulation. Solving the equations frame by frame
and display the millipede can give a vivid moving millipede
on screen in 3D environment. Before applying this implicit
method, explicit method is used and actually gives quite
unstable results. The new implicit method gives more stable
results compared to the explicit one.
IV. ANTENNAS: PERCEPTION SYSTEM
With the Bio-Mechanical Model, the millepede can move
around freely like a drunk toper. However, I want it to
be more intelligent. According to the pyramid of articial
life (from low-level motion to high-level intelligence), my
millipede can go to the perception level.
A creature with perception could usually do some info-
exchange with its living environment. By sensing and ex-
changing information it exhibits some basic behaviors which
is a sign of intelligence.
A. Road Detector: See
A lot of methods of modeling a visual system have been
studied[7]. One of the most popular solutions is ray tracing.
While doing ray tracing, the creatures virtual eyes keep
shooting imaginary ray beams to a range of directions that
belong to its visual scope. If a ray beam detects something
within the scope, it will send back a signal to the corre-
sponding eye. For instance, when a predators rays detect a
prey, they will inform the eye every bit of information they
get. By analyzing these information, the eyes build a data
structure that stores some characteristics of the object seen,
like shape, color, distance to eye, e.t.c. This method can
get more complicated by introducing complicated computer
vision techniques into it.
In my millepede model, I assume the millepede has no
eyes. The mechanism it uses to prevent being stopped by an
obstacle is an antenna system. Figure 4, there are antennas
directing forward on both sides of the head. The mechanism
of the two antennas is very similar with the ray tracing eyes
except the fact that it is much simpler.
Recall Figure 3, most real millepede do not have eyes.
The only thing that prevents the millepede from knocking
Fig. 8. The Food Detector. Antennas sense the smell of food.
into an obstacle is the antenna system. When moving
forward, the virtual millepede uses its antennas to feel
things, like a blind man using a walking stick. Either antenna
detecting an obstacle will trigger a signal to brain. The brain
receives this signal, then let the motion controller to turn to
the other side. The antenna system works very much like
the Breitenberg vehicle, which is simple and useful.
The millepedes antennas are always working. Therefore,
as long as the antennas are long enough, it could turn in
time. However, if we decrease the length of antennas, the
millepede would perhaps knock into an obstacle, because
the amplitude of turning angle is limited. The millepede can
only turn a small angle while still moving forward, i.e., a
pivot turn around body center is not possible for a millepede.
In real world, all millepede antennas are long enough. I
guess those with short antennas had vanished during the
millions of years because they keep on hitting rocks!
B. Food Detector: Smell
As pointed out in the 3D model section, a real antenna
can also sense the molecules in the air so that the millepede
knows where to nd food or lovers to mate, this is similar
to how human noses works (Figure 8).
For detection of food, the antenna has a searching area,
within which it can detect the molecular signal of food in
the air, it will tell the brain how far the food is and in
which direction it lies. In our simulation, the millepede
would simply focus on the closest food, which would
send the strongest molecular signal in the air. After the
antenna transmit information of smell to brain, the brain
will judge the smells from different sources, gure out
the source positions and make a turn to reach the nearest
one. If no obstacles are in front of the millepede, it will
move straightly toward the food. Otherwise, the behavior
of avoiding obstacle has priority over moving toward food.
The millipede makes decision on the y and can change its
decisions when new closer sources are detected.
V. CODING NOTES
A. Design of Classes
The articial millipede is coded using C++, all together
about 4000 lines. OpenGL library is used for drawing
graphics. All the codes can be downloaded from the project
website listed in Appendix I. The millipede class is designed
and has the variables and functions listed in Table.(I). Notice
that for millipede class, three other classes are created and
used, namely: Section, Antenna and Map. The Section class
is designed to compose the body of the millipede, and its
contents are given in Table.(II). The Map class provides
the map for the millipede to live in, and need be signed to
each millipede, it contains the shape of the ground, obstacles
and food sources. The Antenna class provides the millipede
with eyes and noses such that the brain of the millipede has
information to analyze.
There are three modes for the brain, each has different
functions and priorities. The rst mode is called random
walk mode, which has the lowest priority and is determined
by the lower part of the brain (which we call instinct
before). The second mode is called obstacle avoiding mode,
it has higher priority than the random walk mode. When
the millipedes antenna detects an obstacle, the brain would
immediately enter this mode and take actions after analyzing
the signal. The third mode is called the food tracking mode.
It has a higher priority than the random walking mode but
lower priority than the obstacle avoiding mode. When the
millipedes antenna detects a signal of food within its scope,
the brain would enter the food tracking mode and give
orders to the body such it turns toward the food source.
The obstacle avoiding mode has the highest priority and can
always interrupt other modes. New modes can be designed
and given different priorities, such as predator closing mode,
etc.
B. Within Each Frame
During each frame, the program do the following things
sequentially:
If in random walking mode, smell and search for food,
if detected food, enter food preying mode.
If not in obstacle avoiding mode, look around to check
obstacle, if see obstacle, enter obstacle avoiding mode.
Based on which mode the millipede is in and the
input information from antenna, millipede brain tells
the body how to move.
All the rotations are carried out and the matrix is solved
to resolve positions and velocities of all the sections for
current frame.
Display the millipede for current frame.
VI. SUMMARY
In summary, in this article, we conducted a complete
simulation of millepede for the rst time ever. The virtual
millepede has a physics guided motion system, an antenna
perception system and a brain.
TABLE I
DESIGN OF THE MILLIPEDE CLASS
variables for millipede class
variable name type notes
N Section private:int Number of sections
Head private:Section* Head section of millipede
AntennaL private:Antenna The left antenna
AntennaR private;Antenna The right antenna
Objective private:double Current objective turning angle
Process private:double Currently turned angle
BrainMode private:int The millipedes brain mode
MyMap private:Map* The associated map
Scope private:double The food search scope
functions for millipede class
function name return type notes
Centipede(void) no type Constructor
Centipede(void) no type Destructor
Set Head(Section*) public:void Set a section as millipede head
Get Head(void) public:Section* return the heads pointer
Get N(void) public:int return the number of sections
Set N(int) public:void set the number of sections
Brain(double) public:void process information/give orders
Move(double) private:void Core of bio-mechanics
Look(void) private:void Antennas touch feedback
Smell(void) private:void Antennas smell feedback
Set Map(Map*) public:void Set the associated map
Set Scope(double) public:void Set the smell scope
Get Scope(void) public:double return the scope
The Bio-Mechanical structure is simulated with spring-
dampers and rigid-body dynamics. Under the constraints
of a physical environment, the millepede can control the
movement of every body segment. Even assigned random
initial leg rotations, the millepede can automatically adjust
the legs and end up with all legs moving coordinately in a
wavelike pattern, which is actually the walking pattern of a
real millepede.
The perception system is made up with antennas. The
functions of antennas are very basic but essential. It pro-
vides two functionalities: road detection and food detection.
With this perception system, the millepede is able to avoid
obstacles while moving forward, and search for food at the
same time.
VII. ACKNOWLEDGEMENTS
Professor Demetri Terzopoulos is my mentor in the
Computer Science department. He is kind, modest and
knowledgeable. Without his support, I would not be able to
even join CS department, let alone working on this paper.
His course Articial Life opens my eyes and irritated my
interests to code an articial living thing by myself. Despite
being very busy, he respond to lots of my very simple
questions with detailed and careful explanations.
I also would like to sincerely thank my friend, Chenfanfu
Jiang, who is also a student of Demetri, for his help on
introducing Breitenberg vehicle to me.
Although I have never communicated with Xiao-Yuan Tu
[5] directly, her award-winning paper on Articial Fish
TABLE II
DESIGN OF THE SECTION CLASS
variables for Section class
variable name type notes
Index private:int Id number of section
Position[3] private:double Position of section
pPosition[3] private:double Previous Position of section
Color[3] private:double RGB color of the millipede
Dimension[3] private:double Size of the section
Velocity[3] private:double Speed of current section
NextSec private:Section* Pointer to the next section
PreSec private:Section* Pointer to the previous section
Force[3] private:double Calculated force on the section
Rlenght private:double Rest length of spring ahead
LegRotation private:double Current leg rotation
LegRotV private:int Direction of leg rotation
PushV private:double The rate of leg rotation
Direction private:double Direction of the front link
Fspring private:double Spring constant
Fdamper private:double Damper constant
functions for section class
function name return type notes
Section(void) no type Constructor
Section(void) no type Destructor
Set Color(double*) public:void Set a sections color
Set Dimension(double*) public:void* Set a sections size
Set LegRotation(double) public:void Set a sections leg rotation
Set Position(double*) public:void Set a sections position
Set pPosition(double*) public:void Set previous position
Set Index(int) public:void Set the id number
Set Next(Section*) public:void Set the next section
Set Prev(Section*) public:void Set the previous section
Set Velocity(double*) public:void Set the velocity
Set Fsrping(double) public:void Set the spring constant
Set Fdamper(double) public:void Set the damper constant
Set LegRotV(double) public:void Set the initial rotation direction
Set Direction(double) public:void Set the previous link direction
Set PushV(double) public:void Set the leg push rate
Get Position(void) public:double* Return the position
Get pPosition(void) public:double* Return previous position
Get Velocity(void) public:double* Return velocity
Get Color(void) public:double* Return the color of section
Get Dimension(void) public:double* Return the size of section
Get LegRotation(void) public:double Return the leg rotation
Get Direction(void) public:double Return previous link direction
Get Index(void) public:int Return the index number
Get PushV(void) public:double Return the push direction
Rotate All(double) public:void Rotate the leg and section
Get Next(void) public:Section* Return next section pointer
Get Prev(void) public:Section* Return previous section pointer
denitely enlightened me most on this piece of work of
Articial Millipede.
VIII. APPENDIX
1) The website of this project is:
https://sites.google.com/site/uclacs275/
2) Source codes are available at the website.
3) Demo of Locomotion: (Start with random leg cong-
uration, converge to wave very quickly): YouTube
4) Demo of Antenna System: (Tracing food and avoiding
obstacles): YouTube
REFERENCES
[1] http://en.wikipedia.org/wiki/Articial life
[2] Braitenberg, V. Vehicles: Experiments in synthetic psychology. Cam-
bridge, MA: MIT Press. (1984)
[3] Grieco, J.C.; Prieto, M.; Armada, M.; Gonzalez de Santos, P.; , A six-
legged climbing robot for high payloads, Control Applications, 1998.
Proceedings of the 1998 IEEE International Conference on , vol.1, no.,
pp.446-450 vol.1, 1-4 Sep (1998)
[4] Dorigo, M.; Maniezzo, V.; Colorni, A.; , Ant system: optimization
by a colony of cooperating agents, Systems, Man, and Cybernetics,
Part B: Cybernetics, IEEE Transactions on , vol.26, no.1, pp.29-41,
Feb (1996)
[5] Xiaoyuan Tu Articial Animals for Computer Animation: Biome-
chanics, Locomotion, Perception, and Behavior Ph.D Dissertation
, Department of Computer Science, University of Toronto, January
(1996)
[6] Auke Jan Ijspeert, Alessandro Crespi, Dimitri Ryczko, and Jean-Marie
Cabelguen From Swimming to Walking with a Salamander Robot
Driven by a Spinal Cord Model, Science 9 March 2007: 315 (5817),
1416-1420. (2007)
[7] Salomon, R.; Lichtensteiger, L.; , Exploring different coding schemes
for the evolution of an articial insect eye, Combinations of Evolu-
tionary Computation and Neural Networks, 2000 IEEE Symposium on
, vol., no., pp.10-16, (2000)