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

     

2.3 Main Window: Menus and buttons

The main window displays the currently loaded virtual world. It has six menus: File, Simulation, View, Wizard, Tools and Help. There is also a toolbar with eight buttons which are shorcuts for some of the menu items:

Note that only seven of the eight buttons will be present simultaneously.

2.3.1 File Menu

The File menu allows you to perform the usual file operations: loading, saving, etc.

The New menu item (and button) opens a new world containing only an ElevationGrid, displayed as a chessboard of 10 x 10 squares on a surface of 1 m x 1 m.

The Open... menu item (and button) opens a file selection dialog that allows you to choose a .wbt file to load.

The Save menu item (and button) saves the current world using the current filename (the filename that appears at the top of the main window). On each Save the content of the .wbt file is overwritten and no backup copies are created by Webots, therefore you should use this button carefully and eventually do safety copies manually.

The Save As... menu item (and button) saves the current world with a new filename entered by the user. Note that a .wbt file should always be saved in a Webots project directory, and in the worlds subdirectory, otherwise it will not be possible to reopen the file.

The Revert menu item (and button) reloads the current world from the saved version and restarts the simulation from the beginning.

The Import VRML 2.0... menu item adds VRML97 objects at the end of the scene tree. These objects come from a VRML97 file you must specify. This feature is useful for importing complex shapes that were modeled in a 3D modelling program, then exported to VRML97 (or VRML 2.0). Most 3D modelling software, like 3D Studio Max, Maya, AutoCAD, Pro Engineer, AC3D, or Art Of Illusion, include the VRML97 (or VRML 2.0) export feature. Be aware that Webots cannot import files in VRML 1.0 format. Once imported, these objects appear as Group, Transform or Shape nodes at the bottom of the scene tree. You can then either turn these objects into Webots nodes (like Solid, DifferentialWheels, etc.) or cut and paste them into the children list of existing Webots nodes.

The Export VRML 2.0... item allows you to save the currently loaded world as a .wrl file, conforming to the VRML97 standard. Such a file can, in turn, be opened with any VRML97 viewer. This is especially useful for publishing Webots-created worlds on the Web.

The Make Animation... item allows you to create a 3D animation as a .wva file. This file format allows one to playback Webots animations in Webots Player. Webots Player is free and can be downloaded from the Cyberbotics website. Webots Player can show animations in 3D, allowing the user to watch from any angles. It can run as a plugin for Internet Explorer, Firefox or Mozilla, but also as a stand alone application. Webots Player works on Windows, Linux and Mac OS X. It is well suited to demonstrate Webots results, possibly on the Internet / World Wide Web.

The Make Movie... item allows you to create an MPEG movie under Linux and Mac OS X, or an AVI movie under Windows. As these movies are created with 25 frame per second, you should adapt the basicTimeStep and the displayRefresh fields of the WorldInfo node in the Scene Tree window to obtain a movie running at real time. Leaving the basic time step at 32 ms and setting the display refresh to 1 basic simulation step will produce movies running slightly faster than real time. If you need exactly real time, set the basic time step to 25 ms (it might then be optimal to adapt your controllers' robot_step() functions using a multiple of 25, like 50, 75 or 100). It is also possible to make accelerated movies by setting the display refresh to 2 (or more) basic time steps, while leaving the basic time step at its original value (32 or 25).

The Take Screenshot... item allows you to take a screenshot of the current view in Webots. It opens a file dialog to save the current view as a PNG image.

The Quit Webots terminates the current simulation and closes Webots.

2.3.2 Simulation Menu

The Simulation menu is used to control the execution of the simulation.

The Stop menu item (and button) pauses the simulation.

The Step menu item (and button) executes one basic time step of simulation. The duration of this step is defined in the basicTimeStep field of the WorldInfo node, and can be adjusted in the scene tree window to suit your needs.

The Run menu item (and button) runs the simulation until it is interrupted by Stop or Step. In run mode, the 3D display of the scene is refreshed every n basic time steps, where n is defined in the displayRefresh field of the WorldInfo node.

The Fast menu item (and button) is like Run, except that no graphical rendering is performed (Webots PRO only). As the graphical rendering is disabled (black screen) this allows for a faster simulation and therefore this is well suited for cpu-intensive simulations (genetic algorithms, vision, learning, etc.).

The Show Robot Window item allows you to open a robot specific window. The type of the window depends on the type of robot, in particular Webots has specific windows for e-puck, Khepera and Aibo robots. This menu is disabled when no robot is currently selected.

2.3.3 View Menu

The View menu allows to control the viewing in the main window.

The Follow Object menu item allows to switch between a fixed (static) viewpoint and a viewpoint that follows a mobile object (usually a robot). If you want the viewpoint to follow an object, first you need to select the object with the mouse and then check the Follow Object menu item. Note that the Follow Object state is saved in the .wbt file.

The Restore Viewpoint item restores the viewpoint's position and orientation to their initial settings when the file was loaded or reverted. This also restores the projection mode to perspective. This feature is handy when you get lost while navigating in the scene, and want to return to the original viewpoint.

The Projection submenu allows to choose between the Perspective and the Orthographic projection mode for Webots main window. The perspective mode is the default; it corresponds to a natural projection: in which the farther an object is from the viewer the smaller it appears in the image. With the orthographic projection, the distance from the viewer does not affect how large an object appears. Furthermore, with the orthographic mode, lines which are parallel in the model are drawn parallel on the screen, therefore this projection is sometimes useful while creating a robot model.

The Rendering submenu allows to choose between the Regular (the default) and the Bounding Objects rendering modes for Webots main window. In Regular mode, the objects are rendered with their geometrical faces, materials, colors and textures, in the same way they are usually seen by an eye or a camera. In Bounding Objects mode, only the bounding objects are rendered. This can be used to debug a problem with the collision detection.

The Show Contact Points item allows to draw the contact points generated by the collision detection engine. Contact points that do not generate a corresponding contact force are not shown. A contact force is generated only for objects simulated with physics (Physics node required).

2.3.4 Wizard Menu

The Wizard menu makes it easier to create new projects and new controllers.

The New Project Directory... menu item first prompts you to choose a filesystem location and then it creates a project directory. A project directory contains several subdirectories that are used to store the files related to a particular Webots project, i.e. world files, controller files, data files, plugins, etc. Webots remembers the current project directory and automatically opens and saves any type of file from the corresponding subdirectory of the current project directory.

The New Robot Controller... menu item allows you to create a new controller program. You will first be prompted to choose between a C, C++, Java or a Python controller. Then, Webots will ask you to enter the name of your controller and finally it will create all the necessary files (including a template source code file) in your current project directory.

2.3.5 Tools Menu

The Tools menu allows you to open various Webots windows.

The Scene Tree menu item opens the Scene Tree window in which you can edit the virtual world. Alternatively it is also possible to double-click on some of the objects in the main window: this automatically opens the Scene Tree with the corresponding object selected.

The Text Editor menu item open Webots text editor. This editor can be used for editing and compiling controller source code.

The Log menu item opens Webots Log, which is a read-only console that is used to displays Webots error messages and controller output.

The Upload to e-puck robot... menu item allows you to choose a Bluetooth connection and upload to an e-puck robot.

The Preferences item pops up a window with two tabs:

  • The General tab:

    The Language option allows you to choose the language of Webots user interface (restart needed).

    The Startup mode allows you to choose the state of the simulation when Webots is started (stop, run, fast; see the Simulation menu).

    The Editor font defines the font to be used in Webots text editor. It is recommended to select a fixed width font for better source code display. The default value for this font is "default". After changing the font, you will have to close and reopen the source code editor for the change to take effect.

    The Java command defines the Java command used to launch the Java Virtual Machine (JVM) for the execution of Java controllers. Typically, it should be set to java under Linux and Mac OS X and to javaw.exe under Windows. It may be useful to change it to java.exe on Windows to display the DOS console in which JVM messages may be printed. Also, it may be useful to add extra command line options to the java command, like java -Xms6144k. Please note that the -classpath option is automatically appened to the specified java command in order to find all the necessary libraries for execution of a Webots controller. If you need to add extra values to the -classpath option, set them in your global CLASSPATH environment variable and Webots will append them to its -classpath option.

  • The Rendering tab controls some aspects of the 3D rendering in the main window:

    Check Display global coordinate system to display the world coordinate system (bottom right corner of the window) as red, green and blue arrows representing the x, y and z axes respectively.

    Check Display sensor rays to show the sensor rays for the non-selected robots (the rays of the selected robots are always shown). The distance sensor rays are drawn as red lines (which become green beyond collision points), and light sensor rays are displayed as yellow lines.

    Check Display device axes to display the servo and connector axes. The servo axes are drawn as dashed black thick lines while the connector axes are drawn as green and blue lines representing the y and z axes respectively and black lines representing the potential docking alignments.

    Check Display camera frustums to show the OpenGL culling frustum for every camera in the scene, using a magenta wire frame. The OpenGL culling frustum is a truncated pyramid corresponding to the field of view of a camera. More information about this concept is available in the OpenGL documentation.

    Check Display lights to show the PointLight nodes displayed as several intersecting yellow lines.

    The Coordinate system size field controls the size of the crosses that represent the centers of the solid nodes (when they are selected). For each solid node, two centers can appears: the geometrical center (defined by the translation and rotation fields) and the center of mass (defined in the Physics node).

    The Axis size field controls the size of the servo axes displayed as dashed black thick lines.

2.3.6 Help menu

In the Help menu, the About... item opens the About... window that displays the license information.

The Webots Guided Tour... menu item starts a guided tour that demonstrates Webots capabilies through a series of examples.

The Register... item tells you your ComputerID and brings up Webots registration page.

The OpenGL Information... menu item gives you information about your current OpenGL hardware and driver. It can be used to diagnose a rendering problems.

The remaining menu items bring up various information as indicated, in the form of HTML pages, PDF documents, etc.

2.3.7 Speedometer and Virtual Time

A speedometer (see figure 2.2) allows you to observe the speed of the simulation on your computer. It is displayed on the bottom right hand side of the main window, and indicates how fast the simulation runs compared to real time. In other words, it represents the speed of the virtual time. If the value of the speedometer is 2, it means that your computer simulation is running twice as fast as the corresponding real robots would. This information is valid both in Run mode and Fast mode.

speedometer

Figure 2.2: Speedometer

To the left of the speedometer, the virtual time is displayed using following format:

H:MM:SS:MMM

where H is the number of hours (may be several digits), MM is the number of minutes, SS is the number of seconds, and MMM is the number of milliseconds (see figure 2.2). If the speedometer value is greater than one, the virtual time is progressing faster than real time.

The basic time step for simulation can be set in the basicTimeStep field of the WorldInfo node in the scene tree window. It is expressed in virtual time milliseconds. The value of this time step defines the length of the time step executed during the Step mode. This step is multiplied by the displayRefresh field of the same WorldInfo node to define how frequently the display is refreshed.

2.3.8 Selecting an object

A single mouse click on a solid object allows you to select this object. Selecting a robot enables the Robot View item in the simulation menu. Double-clicking on a solid object opens the scene tree window, in which the world and robots can be edited. The selected solid object appears selected in the scene tree window as well.

2.3.9 Navigation in the scene

The view of the scene is generated by a virtual camera set in a given position and orientation. You can change this position and orientation to navigate in the scene by using the mouse buttons. The x, y, and z axes mentioned below correspond to the coordinate system of the camera; z is the axis corresponding to the direction the camera is pointing.

  • Rotate viewpoint: To rotate the camera around the x and y axis, place the mouse pointer in the 3D scene, press the left mouse button and drag the mouse:

    if you clicked on a solid object, the rotation will be centered around the origin of the local coordinate system of this object.

    if you clicked outside of any solid object, the rotation will be centered around the origin of the world coordinate system.

  • Translate viewpoint: To translate the camera in the x and y directions, place the mouse pointer in the 3D scene, press the right mouse button and drag the mouse.

  • Zoom / Rotate viewpoint: Place the mouse pointer in the 3D scene, then:

    if you press both left and right mouse buttons simultaneously (or just the middle button) and drag the mouse vertically, the camera will zoom in or out.

    The mouse wheel can also be used to make the camera zoom in or out.

    if you press both left and right mouse buttons (or the middle button) and drag the mouse horizontally, the camera will rotate around its z axis.

2.3.10 Moving a solid object

In order to move an object, select the object, then hold the shift key down while using the mouse.

  • Translation: Pressing the left mouse button while the shift key is pressed allows you to drag solid objects parallel to the ground (xz plane).

  • Rotation: Pressing the right mouse button while the shift key is pressed rotates solid objects: First, select a solid object, then shift-press-and-drag to rotate the selected object around its y axis. The rotation axis can be changed by releasing and quickly re-pressing the shift key.

  • Lift: Pressing both left and right mouse buttons, pressing the middle mouse button, or rolling the mouse wheel while the shift key is pressed allows you to raise or lower the selected object.

previous page go up next page
^ page top ^

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