User Tools

Site Tools


Programming Project nr. 2

You may choose freely how you implement a 2-layer subsumption architecture. To give you an example, here is a 2-module, 2-layer subsumption system: A module called “RandomWalk” makes the hexapod walk randomly about, which is subsumed by another module called “TurnTowards” that takes as input the location of an object and the orientation of the hexapod and minimizes the difference by steering the hexapod towards the object.

The new Hexapod has two antennae on its forehead and each time it touches a plant a message is printed on the screen. See if you can make a module that finds a plant and steers the Hexapod towards it.

Hand in

All code and resource files in SVN or MySchool before 23:59 on sunday 11th february!

SVN instructions

Running the new Hexapod

UPDATE 10 feb. 2007

Fixes a bug in Point3´s toXML() function.

Get the new version here.

UPDATE 8 feb. 2007

I just put a new version of the hexapod. You can get it here. A couple of issues were resolved including

  • Better movement of the hexapod
  • Better error messages, in case they come up :)
  • The hexapod now sends a message called “RU.AI06.Information.Location.Body” which gives you the location of the body as a 3-point location and the direction of it as a vector. A data class for this is included called HexapodLocation. You can control the update time of this with the message “RU.AI06.Instruct.Change.UpdateTime.Location” which works exactly the same as “RU.AI06.Instruct.Change.UpdateTime”


Start by downloading downloading and setting up Panda3d (

Then download the file with all the code this file.

Create an environment variable called PYTHONHOME that contains the value: C:\Panda3D-1.3.2\python (or where panda is located on your computer ). Note, you may have to restart your computer for this to work.

There is a bat file called runHexapod.bat that should just work, but you might have to edit it and set the paths correctly. All the code is supplied as well, so you can create your own runner class in Java.

The code is basically split into two, a Java part that controls the Hexapod and a c++ code that controls Panda.

There is a spec file under java/src that you can use.

Keyboard shortcuts

move camera with a-s-d-f and the up and down arrow keys.

Move Hexapod with u-h-j-k

M: Enable control camera with mouse

Messages to and from


  • “RU.AI06.Perception.Sight.Object”
  • “RU.AI06.Perception.Touch.Object”

These message contain, in xml format, the information about a perceived object. The Java class Perception can translate itself to and from the xml format and has three variables:

  • type of perception
  • type of object
  • Location to object RELATIVE to the Hexapod


You can send the same messages as before to make the Hexapod move itself but NOTE!!! the content is now the degrees with which the Hexapod is to rotate its limbs.

Also, you can send the message “RU.AI06.Instruct.Change.UpdateTime” which will change the update time with which the Hexapod sends its perceptions.

Any bugs? Please add bugs that you find here :)

Any questions, email me( )

Later, Vignir

/var/www/ailab/WWW/wiki/data/pages/public/t-622-arti-07-1/program_2.txt · Last modified: 2007/02/11 01:38 by agusthl