Webots User Guide

previous page go up next page

Foreword

Thanks

1. Installing Webots

2. Getting Started with Webots

3. Sample Webots Applications

4. Tutorial: Modeling and simulating your robot

5. Programming Controllers and Plugins

6. Using the e-puck robot

7. Using the KheperaTM robot

8. Using the IPRTM robots

9. Using the LEGO MindstormsTM robots

10. Using the AiboTM robots

11. Robot Soccer Lab

     

5.13 Programming Webots controllers with URBI

5.13.1 Introduction to URBI

What is URBI ?

URBI is the Universal Robotic Body Interface, developed by GOSTAI You can find more information about URBI on its community page.

URBI is a simple yet powerful scripted language meant to be used as a convenient interface to real robots. URBI is designed to work as a client/server architecture, the robot being the server, and the actual controller being the client. However it is possible to make the client run on the same machine as the server, or to run URBI scripts directly on the server-side, without a client.

URBI is not designed to write complex or computationally expensive controllers, but to provide useful time-oriented control mechanisms, thus allowing the user to easily write simple perception-action loops directly in URBI by abstracting away low-level hardware details.

URBI for Webots

URBI for Webots is URBI server for Webots, meaning that it is an application, running as a Webots controller, which acts as a URBI server, whereas the program which actually controls your simulated robot is either a URBI script or a URBI client you have designed. It is easy to switch from the simulation to a real robot using the same URBI client or program.

As of Webots 5.10.0, URBI for Webots is only implemented for the Windows and Linux version of Webots. Mac OS X versions of URBI for Webots is currently under development and will be integrated in upcoming versions of Webots.

In this tutorial we will only focus on URBI script. Please refer to general URBI documentation to get familiar with URBI clients. It is strongly advised that you read the URBI language documentation and tutorial available here: http://www.gostai.com/doc.php.

The basic use of URBI for Webots depends on:

  • The URBI for Webots controller is called URBI_webots and is stored in the projects / packages / urbi / controllers / urbi subdirectory of Webots. Each URBI for Webots world uses this executable.

  • An XML configuration file which contains information specific to your robot; in particular it declares which devices are available, their names and their parameters.

  • A telnet client connection to port 54000 of the machine running URBI for Webots, to send simple commands from manually. You can also use robot-specific programs such as the Aibo Telecommande available from here.

Installation of URBI for Webots

To install URBI for Webots on your computer, you must obtain the correct setup program for your operating system. A graphical installer is available for Windows. Debian packages and tarballs are available for Linux. The complete installation process is described in the URBI for Webots manual.

5.13.2 Running the examples

Simply open the kiki_urbi.wbt model in the worlds directory, and click on the play button. The kiki robot should zoom across the world, avoiding walls: a small, very simple to understand and modify, URBI script is actually running!

Another more complex example is provided in the aibo_ers7_urbi_dance.wbt world: this script, written by Diego de Pardo, won the Sony Daft-Punk dance competition on a real Aibo robot. Finally, another model is provided in the aibo_ers7_urbi.wbt world to serve as a basis for your own Aibo simulations.

5.13.3 Kiki and URBI

To learn more about URBI for Webots, we shall take a closer look at the kiki robot programmed with an URBI script. First, open the world kiki_urbi.wbt in the URBI world directory (located by default in the projects / packages / urbi / worlds subdirectory of your Webots directory).

Now open a telnet connection to localhost on port 54000 (the standart URBI port) and type the following:


   stopall; // kiki should stop.
   circle: wheelL.val = 300 & wheelR.val = 250; // move in circle
   

Try it, and next time the robot gets close to a wall it will simply bump into it. Now type stop circle; to stop it and type the following:


  wave: wheelL.val = 150 sin:3000 ampli:50  &
  wave: wheelR.val = 150 sin:3000 ampli:50 phase:180,
   

Now, type stop wave; to stop all movement.

5.13.4 Going further

Note: As you experiment with URBI for Webots, keep in mind that when you stop the Webots simulation, it also suspends the associated controllers, hence it suspends the URBI server, so that your telnet session will not respond until you press play again to start the simulation.

To have a closer look at how URBI for Webots works, go to the data / kiki directory and open the following files with your favorite text editor:

  • URBI.INI: This URBI script is launched at each start-up of the server from this directory. In this example, it contains an alias allowing you to use wheels to refer to both wheels, and it also loads the tut1.u demo script.

  • tut1.u: This is the main URBI script controlling the kiki robot.

You can now start to create your own scripts and load them from the URBI.INI file.

5.13.5 Create you own URBI based controller

To handle each robot's set of specific features, Webots uses a set of devices which is fully supported by URBI for Webots. Please read the official URBI for Webots documentation to learn more. Have fun with URBI!

previous page go up next page
^ page top ^

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