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

     

2.2 Controller

2.2.1 Location

The controller program is still found in the controllers directory of your user directory defined in the Webots preferences. However, the name of the directory for each controller has changed: rename yourcontroller.khepera to yourcontroller (simply remove the .khepera extension). The same applies for the alice and supervisor controller directories where the .alice and .supervisor extensions must be removed. Note that if you used the same prefix for both khepera and a supervisor controller (e.g. stick_pulling.khepera and stick_pulling.supervisory), you will have to rename one of them because you cannot have two directories with the same name. For example, the stick_pulling.khepera directory can be renamed to stick_pulling and the stick_pulling.supervisor directory can be renamed to stick_pulling_supervisor.

2.2.2 Khepera

The khepera_xxx functions have disappeared. You must replace them with their counterparts of the new API as illustrated on table 2.2:

Webots 2 Webots
khepera_live robot_live
khepera_die robot_die
khepera_step robot_step
khepera_set_speed differential_wheels_set_speed
khepera_enable_proximity distance_sensor_enable
khepera_disable_proximity distance_sensor_disable
khepera_get_proximity distance_sensor_get_value

Table 2.2: Some equivalent function calls between Webots 2 and Webots

Morover, the #include <Khepera.h> must be replaced by the following:

#include <device/robot.h>
#include <device/differential_wheels.h>
#include <device/distance_sensor.h>

2.2.3 Alice

The alice_xxx functions have also disappeared. Now you can program the Alice robot (indeed a differentially wheeled robot) just like any other robot in Webots. Thus all the functions described in the above subsection also apply to an Alice robot model.

2.2.4 GUI

The gui_xxx functions have all disappeared and should now be replaced by GTK+ functions. GTK+ is much more powerful than the GUI provided with Webots 2 and is well documented. You can find the GTK+ documentation (Tutorial and Reference Manual) on the Webots CD-ROM, in books available in computer science libraries, and on the GTK+ web site.

2.2.5 Supervisor

The syntax of supervisor functions has changed a lot from Webots 2 to be more consistent with the rest of the API. For example, a supervisor is now considered as a robot, hence the supervisor_step function has been replaced by the robot_step function. However,the way in which the supervisor interacts with webots remains unchanged.

previous page go up next page
^ page top ^

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