![]() |
3.3 Scene Tree WindowAs seen in the previous section, to access to the Scene Tree Window you can either choose Scene Tree Window in the Edit menu, or click on the pointer button and double-click on a solid object. The scene tree contains all information necessary to describe the graphic representation and simulation of the 3D world. A world in Webots includes one or more robots and their environment. The scene tree of Webots is structured like a VRML file. It is composed of a list of nodes, each containing fields. Fields can contain values (text string, numerical values) or nodes. Some nodes in Webots are VRML nodes, partially or totally implemented, while others are specific to Webots. For instance the Solid node inherits from the Transform node of VRML and can be selected and moved with the buttons in the World Window. This section describes the buttons of the Scene Tree Window, the VRML nodes, the Webots specific nodes and how to write a .wbt file in a text editor. ![]() 3.3.1 Buttons of the Scene Tree WindowThe scene tree with the list of nodes appears on the left side of the window. Clicking on the + in front of a node or double-clicking on the node displays the fields inside the node, and similarly expands the fields. The field values can be defined on the top right side of the window. Five editing buttons are available on the bottom right side of the window:
These three buttons let you cut, copy and paste nodes and fields. However, you can't perform these operations on the three first nodes of the tree (WorldInfo, Viewpoint and Background). These nodes are mandatory and don't need to be duplicated. Similarly, you can't copy the Supervisor node because only one supervisor is allowed. Please note that when you cut or copy a robot node, like a DifferentialWheels or Supervisor node, the controller field of this node is reset to "void".
3.3.2 VRML nodesA number of VRML 2.0 nodes are partially or completely supported in Webots. The exact features of VRML 2.0 are the subject of a standard managed by the International Standards Organization (ISO/IEC 14772-1:1997). You can find the complete specifications on the official VRML Web site: \texttt{http://www.vrml.org}. The VRML nodes supported in Webots are the following:
The Reference Manual gives a more comprehensive list of nodes with associated fields. 3.3.3 Webots specific nodesIn order to implement powerful simulations including mobile robots with two-wheel differential steerings, a number of nodes specific to Webots have been added to the VRML set of nodes. VRML uses a hierarchical structure for nodes. For example, the Transform node inherits from the Group node, such that, like the Group node, the Transform node has a children field, but it also adds three additional fields: translation, rotation and scale. In the same way, Webots introduces new nodes which inherit from the VRML Transform node, principally the Solid node. Other Webots nodes (DifferentialWheels, DistanceSensor, Camera, etc.) inherit from this Solid node. The different fields of the Webots nodes are explained below. The Reference Manual gives a complete list of Webots nodes and their associated fields along with a brief description of each field. The Solid nodeA solid is a group of shapes that you can drag and drop in the world, using the mouse. Moreover, the sensors of the robots and the collision detector of the simulator are able to detect solids. The Solid node represents this group of shapes in the scene tree. Principle of the collision detection of the simulator: The collision detection engine is able to detect a collision between two Solid nodes. It calculates the intersection between the bounding objects of the solids. A bounding object (described in the boundingObject field of the Solid node) is a geometric shape or a group of geometric shapes which bounds the solid. If the boundingObject field is NULL, then no collision detection is performed for this Solid node. list of children of the Solid node are used to compute the bounding object. The collision detection is mainly of use between a robot DifferentialWheels node) and an obstacle (Solid node), and between two robots. Two Solid nodes can never interpenetrate each other; their movement is stopped just before the collision. A description of the fields of the Solid node is given below. The Solid node inherits from the VRML Transform node. The additional fields are:
Example: a solid with a bounding box different from its list of children. Let us consider the Khepera robot model. It is not exactly a Solid node, but the principle for the boundingObject is the same. Open the khepera.wbt file and look at the boundingObject field of the DifferentialWheels node. The bounding object is a cylinder which has been transformed. See figure 3.4. ![]() Figure 3.4: The bounding box of the Khepera robot The DifferentialWheels nodeThe DifferentialWheels node inherits from the Solid node. It is used to represent any robot with two-wheel differential steering. The two specific fields which are essential for the simulation are axleLength and wheelRadius. The value of axleLength is the distance (in meters) between the two wheels of the robot, and the value of wheelRadius is the radius (in meters) of the wheels. Moreover, the origin of the robot coordinate system is the projection on the ground plane of the center of the axle of the wheels. x is the axis of the wheel axle, y is the vertical axis and z is the axis pointing towards the rear of the robot (the front of the robot has negative z coordinates). The DifferentialWheels node inherits from the Solid node. The additional fields are:
The DistanceSensor nodeThe DistanceSensor node is used to model sonar sensors, infra-red sensors and laser range finders. It uses a ray casting algorithm to detect collision between the sensor ray and Solid nodes in the world. The DistanceSensor node inherits from the Solid node. it includes two additional specific fields:
Note: the ray of a sensor can be displayed in the world view by selecting Display sensor rays in the File/Preferences menu under the Rendering panel. In the case of an "infra-red" sensor, the value returned by the lookup table is modified by a reflection factor depending on the color properties of the object hit by the sensor ray. This reflection factor is computed as follow: f = 0.2 + 0.8 * red_level where red_level is the level of red color of the object hit by the sensor ray. This factor is then multiplicated to the return value computed from the lookup table. Please note that a primtive support for DistanceSensor nodes used for reading the red color level of a textured ground was implemented. This is useful to simulate line following behaviors. This feature is demonstrated in the ground_color.wbt example. In short, the ground texture should lie in a rectangular IndexedFaceSet node centered at (0,0,0). The LightSensor nodeThe LightSensor node is used to model a phototransistor-like sensor which measure the level of ambiant light in a given direction. The light level measured by the LightSensor node is computed from each PointLight node in the scene, taking into account the distance between the sensor and the light, the orientation of the sensor relatively to the light, the intensity of the light (computed from its ambient intensity, intensity and color). The LightSensor node inherits from the Solid node. it includes an additional specific field:
The Camera nodeThe Camera node is used to model a robot's on-board camera. The Camera node inherits from the Solid node. The fields specific to the Camera node are:
The Charger nodeThe Charger node is used to model a special kind of battery charger for the robots. A robot has to get close to a charger in order to recharge itself. A charger is not like a standard battery charger you plug to the power supply. Instead, it is a battery itself: it accumulates energy with time. It could be compared to a solar power plan loading a battery. When the robot comes to get energy, it can't get more than the charger has currently accumulated. The Charger node inherits from the Solid node. The fields specific to the Charger node are:
The Emitter nodeThe Emitter node is used to model an infra-red or radio emitter on-board a robot. You must insert the Emitter node into the list of children of the robot. Please note that an emitter can only emit data but it cannot receive any information. In order to enable a bi-directional communication system, a robot needs both an Emitter and a Receiver node. The Emitter node inherits from the Solid node. The fields specific to the Emitter node are:
The Receiver nodeThe Receiver node is used to model an infra-red or radio receiver. A receiver, just like an emitter, is usually on-board a robot. Please note that a receiver can only receive data but it cannot emit any information. In order to enable a bi-directional communication system, a robot needs both an Emitter and a Receiver node. The fields and values of the Receiver node are nearly the same as those of the Emitter node. As the Emitter node, the Receiver node inherits from the Solid node. The fields specific to the Receiver node are:
The HyperGate nodeA hypergate is defined as a cylindrical area in the world. When a robot (more precisely the origin of the robot coordinate system) enters it, it disappears and gets transferred to another world specified in the HyperGate node. The HyperGate node inherits from the Solid node. The fields specific to the HyperGate node are:
The Physics nodeThis node is used to specify a number of physical properties associated to a Solid node, like its mass, friction coefficient, energy absobtion, etc. It was implemented to enable the modelling robot soccer systems, where a robot, or several robots can push a ball which can roll and bounce against the walls. An example of using the Physics node is provided in the alice_soccer.wbt world. The list of available fields is mentioned in the reference manual and in the resources/nodes/Physics.wrl file with the physical unit for each field. The Supervisor nodeA supervisor is a program which controls a world and its robots. For convenience it is represented as a robot without any wheels, driven by a controller with extended capabilities which supervises the whole world. A world cannot have more than one supervisor. The Supervisor node inherits from the Solid node. Its other fields include some of the DifferentialWheels node fields:
The TouchSensor nodeThe TouchSensor node is used to model bumper sensors. A bumper sensor will detect the collision with any Solid object in the world, including other DifferentialWheels nodes. Collision detection is based upon the boundingObject field of the TouchSensor node and the boundingObject field of other Solid nodes. The TouchSensor node inherits from the Solid node. It includes two additional specific fields:
Note: only the "bumper" type is currently supported, but other types, including "button", "force" or "whisker" are likely to be implemented in a forthcoming version of Webots. 3.3.4 Writing a Webots file in a text editorIt is possible to write a Webots world file (.wbt) using a text editor. A world file contains a header, nodes containing fields and values. Note that only a few VRML nodes are implemented, and that there are nodes specific to Webots. Moreover, comments can only be written in the DEF, and not like in a VRML file. The Webots header is:
Note: we recommend that you write your file using the tree editor. However it may be easier to make some particular modifications using a text editor (like using the search and replace feature of a text editor). ![]() ![]() ![]() ^ page top ^ |
E-mail to webmaster | Last updated: | Copyright © 2002 Cyberbotics Ltd. |