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

     

3.4 How To

This part of the chapter contains examples of how to use various Webots devices in order to achieve more complexe behaviours and/or functionalities. The world files are located in the projects / samples / howto / world directory, and their controllers in the projects / samples / howto / controllers directory. For each, the world file and its corresponding controller are named for the behaviour they are an example of.

3.4.1 binocular.wbt

Keywords: DifferentialWheels, Camera, stereoscopy, MyBot

binocular

Figure 3.24: binocular.wbt

In this example a robot moves in the world while avoiding the obstacles. It uses two Camera devices in order to perform stereoscopy. In this example, the robot does not analyse the images it receives from the two cameras. The source code for this controller is in the binocular directory.

3.4.2 biped.wbt

Keywords: Robot node, legged robot, servo_motor_off, active joint

biped

Figure 3.25: biped.wbt

In this example a biped robot stands on its feet while turning its head. After a few seconds, all of its Servo devices are turned off and it falls to the ground. This example is good for illustrating how to build your own Robot. The source code for this controller is in the biped directory.

3.4.3 force_control.wbt

Keywords: force control, linear Servo, Robot node, spring and damper

force_control

Figure 3.26: force_control.wbt

This example shows two Box nodes connected by a linear Servo. This demonstrates how to use the wb_servo_set_force() function in order to control a Servo's motion by torque or force. A simple spring and damping behaviour is achieved. The source code for this example can be found in: projects/samples/howto/controllers/force_control/force_control.c. For more information about this function, please refer to Webots Reference Manual.

3.4.4 inverted_pendulum.wbt

Keywords: Robot node, inverted pendulum, PID, linear Servo

inverted_pendulum

Figure 3.27: inverted_pendulum.wbt

In this example a robot moves from left to right in order to keep its pendulum vertical. This is the Inverted Pendulum problem, and it is solved in our example by using a PID (Proportional Integral Differential) controller. The source code for this controller is in the inverted_pendulum directory.

3.4.5 physics.wbt

Keywords: DifferentialWheels, custom ODE plugin, OpenGL drawing, flying robot, MyBot, Emitter, Receiver

physics

Figure 3.28: physics.wbt

In this example a robot flies using a custom ODE physics plugin. This plugins is an example of:

  • how to use Webots objects in ODE

  • how to exchange information with the controller

  • how to add custom forces

  • how to move objects

  • how to handle collisions

  • how to draw objects using OpenGL

The source code for this controller is in the physics directory, and the ODE plugin is in the plugins / physics / flying_mybot directory.

3.4.6 supervisor.wbt

Keywords: Supervisor, DifferentialWheels, soccer game, label, import node, restart simulation, screenshot, load controller

supervisor

Figure 3.29: supervisor.wbt

In this example two teams of very simple robots play a soccer game in which the Supervisor is the referee. It is also used to display the scores, restart the game and import another ball in the game. The source code for this controller is in the supervisor directory, and the code for the players is in the soccer directory.

3.4.7 texture_change.wbt

Keywords: DifferentialWheels, Supervisor, texture, supervisor_field_set, Camera, MyBot

texture_change

Figure 3.30: texture_change.wbt

In this example a robot moves forward and backward in front of a large textured IndexedFaceSet panel. While the robot is using its Camera device to watch the panel, a Supervisor is alternating the images used as textures on the panel. The source code for the controller of the robot is in the texture_robot directory, and the code for the Supervisor is in texture_change.

3.4.8 town.wbt

Keywords: Transform, USE, DEF

town

Figure 3.31: town.wbt

In this example, various Transform nodes are used with some DEF and USE nodes in order to create a complex, attractive "town."

previous page go up next page
^ page top ^

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