![]() |
7.4 How to Enter the ContestIf you are willing to challenge the other competitors of the contest, here is the detailed procedure on how to enter the ALife contest. You will need either a Windows or a Linux machine to program your robot controller. 7.4.1 Obtaining the softwareAll the software for running the contest may be obtained free of charge.
7.4.2 Running the softwareLaunch Webots and open the world named alife.wbt. Click on the run to start the simulation. You will see two robots moving around in the world. Each robot is controlled by a Java program named respectively ALife0 and ALife1 located in the Webots controllers directory. You may enter their directory and have a look a the source code of the programs. On Windows, you may need to edit the ALife0.bat and ALife1.bat files to set correct paths to the Webots directory and possibly to the java executable. 7.4.3 Creating your own robot controllerThe simpliest way to create your own robot controller is to start from the existing ALife0 or ALife1 controllers. InstallationIt is safer and cleaner to install a local copy of the material you will need to modify while developing your intelligent controller. Here is how to proceed:
From there, you can modifiy the source code of the controllers in your controllers directory, recompile them and test them with Webots. Modifiying and Compiling your controllerIf you know a little bit of Java, it won't be difficult to understand the source code of the ALife0 and ALife1 controllers, which are stored respectively in the ALife0.java and ALife1.java. You may use any standard Java objects provided with the Java SDK. The documentation for the Controller class is actually the same as for the C programming interface, since all the methods of the Controller class are similar to the C functions of the Controller API described in the Webots Reference Manual, except for one function, robot_live which is useless in Java. Before modifying a controller, it is recommanded to try to compile the copy of the original controllers. To compile the ALife0 controller, just go to the ALife0 directory and type the following on the command line: javac -classpath "C:\Program Files\Webots\lib\Controller.jar;." ALife0.java on Windows. javac -classpath "/usr/local/webots/lib/Controller.jar:." ALife0.java on Linux. If everything goes well, it should produce a new ALife0.class file that will be used by Webots next time you launch it (or reload the alife.wbt world). Now, you can start developing! Edit the ALife0.java, add lines of code, methods, objects. You may also create other files for other objects that will be used by the ALife0 class. Test your controller in Webots to see if it performs well and improve it as long as you think it is necessary. 7.4.4 Submitting your controller to the ALife contestOnce you think you have a good, working controller for your robot, you can submit it to the online contest. In order to proceed, you will have to find a name for your robot. Let's say "MyBot" (but please, choose another name). Copy your ALife0.java to a file named MyBot.java. Edit this new file and replace the line:
by:
Save the modified file and compile it using a similar command line as seen previously. You should get a MyBot.class file that you could not test, but that will behave the same way as ALife0.class. Register to the contest from the main contest web page, providing "MyBot" as the name of the robot. Then, upload all the necessary files in your MyBot directory. This includes the following:
That's it. Once this material uploaded, your robot will automatically enter the competition with an initial score of 10. A contest supervisor program will use you controller to run matches and update your score and position in the hall of fame. You can check regularly the contest web site to see how your robot performs. ![]() ![]() ![]() ^ page top ^ |
E-mail to webmaster | Last updated: | Copyright © 2002 Cyberbotics Ltd. |