Webots Reference Manual

previous page go up next page

Thanks

1. Introduction

2. Node Chart

3. Nodes and API Functions

4. Prototypes

5. Physics Plugin

6. Fast2D Plugin

7. MTN Functions

8. Webots World Files

     

1.1 Nodes and Functions

1.1.1 Nodes

The Webots nodes listed in this manual are described using standard VRML syntax. Principally, Webots uses a subset of the VRML97 nodes and fields, but it also defines additional nodes and fields specific to robotic definitions. For example, the Webots WorldInfo and Sphere nodes have additional fields with respect to VRML97.

1.1.2 The C/C++ API

Chapter 3 covers all the functions of the Controller API, which allows you to program robots both in simulation and in practice (through Webots remote control or cross-compilation). The chapter describes the C prototypes of these functions, which can be used from a C or C++ controller program.

1.1.3 The Java API

It is also possible to program both simulated and real robots in Java. The Java API is not documented explicitly, however, it was developed as a direct copy of the C/C++ API. Hence, all the Java method names and parameters are the same as the C functions described in this chapter, with a few exceptions:

  • The char * type in C is replaced by the String class in Java.

  • The DeviceTag and NodeRef types in C are replaced by the int type in Java.

  • Pointers to arrays of data in C are replaced by arrays of data in Java. For example, the camera_get_image() Java method is defined as returning an array of int, rather than a pointer to a memory chunk. Each value of this array represents the color of a pixel.

A reference file for the Java API, called Controller.java, is provided in the doc directory of the Webots distribution.

1.1.4 Remote Control

The C, C++ or Java API can be used for programming a remotely controlled Khepera or Aibo robot. This can be achieved through the robot window in the Webots graphical user interface.

1.1.5 Cross-compilation

A number of limitations are inherent in the cross-compilation of controllers using the Webots API. These limitations are often consequences of the limitations of the real robots. For example, the Khepera robot can be programmed in C only, and not in C++. Please read the robot-specific chapters in the Webots User Guide for a description of the limitations and programming languages available for each robotic platform.

previous page go up next page
^ page top ^

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