← Back to 24T3

Webots Setup

Intro to Webots for MTRN2500.


Installation

Please install Webots 2023a.

DO NOT install the latest version of Webots (2023b) as it may not be compatible with the course.

Webots

Webots is a multi-platform robot simulator. It also comes with a basic text editor and build system.

Webots GUI

The Webots GUI contains subwindows:

webots gui

Webots Project Structure

A Webots project has a folder structure displayed below:

webots-project/ | |_ controllers/ | |_ simple_controller/ | |_ protos/ | |_ basi_robot.proto | |_ worlds/ |_ obstacles.wbt

The project consists of:

Worlds

wbt files are text files that contain a description of world components, for example:

The description of the wbt is outlined in the Scene Tree.

Scene Tree

(highlighted in the Webots GUI as blue)

A scene tree is a collection of nodes which describes the Webots world.

Nodes & Fields

Nodes are building blocks of the Webots world and robots. A list of nodes can be found here: https://cyberbotics.com/doc/reference/node-chart

Nodes can have properties such as translation, rotation, and name. These properties are called “fields”.

webots nodes

Fields can be edited within the Webots GUI when the field is selected in the scene tree via the field editor (highlighted in the Webots GUI as yellow).

Controllers

A controller is a software program (executable/binary) that is used to control robots.

Controllers can be created in Webots via Wizards > New Robot Controller, then clicking through the Wizard.

The created controller can then be attached to an existing robot via its controller node.

Note that the controller needs to be compiled before it can be run.

Running the Simulation

To run the Webots simulation, press the play button in the top bar of the simulation view. The simulation is running if the time stamp is changing.

The Webots simulation can also be fast-forwarded, reversed, or reset.