Webots User Guide

previous page go up next page

Foreword

Thanks

1.Installing Webots

2.Upgrading from Webots 2

3.Getting Started with Webots

4.Tutorial: Modelling and simulating your robot

5.Robot and Supervisor Controllers

6.Tutorial: Using the KheperaTM robot

7.ALife Contest

     

5.2 Setting Up a New Controller

In order to develop a new controller, you must first create a controllers directory in your user directory to contain all your robot and supervisor controller directories. Each robot or supervisor controller directory contains all the files necessary to develop and run a controller. In order to tell Webots where your controllers are, you must set up your user directory in the Webots preferences. Webots will first search for a controllers directory in your user directory, and if it doesn't find, it will then look in its own controllers directory. Now, in your newly created controllers directory, you must create a controller subdirectory, let's call it simple. Inside simple, several files must be created:

  • a number of C source files, like simple.c which will contain your code.

  • a Makefile which can be copied (or inspired) from the Webots controllers directories. Note that Windows users have several alternatives to the Makefile: They can use a Dev-C++ project or a Microsoft Visual C++ project, as examplified in the Webots controllers/braiten directory.

You can compile your program by typing make in the directory of your controller.

As an introduction, it is recommanded that you copy the simple controller directory from the Webots controllers to your own controllers directory and then try to compile it.

previous page go up next page
^ page top ^

  E-mail to webmaster Last updated: Copyright © 2002 Cyberbotics Ltd.