Webots Reference Manual - chapter 7 - section 2

Webots Reference Manual


7.2 Plugin Architecture

7.2.1 Overview

The Webots' Fast2D mode is built on a plugin architecture. The Fast2D plugin is a dynamically linked library that provides the functions necessary for the 2D simulation. These functions are responsible for the simulation of:

The plugin architecture makes it possible to use different plugins for different worlds (.wbt files) and allows Webots users to design their own custom plugins.

7.2.2 Dynamically Linked Libraries

The Fast2D plugin is loaded by Webots when the user loads a world (.wbt file) that requires Fast2D simulation mode. The WorldInfo node of the world has a field called fast2d which specifies the name of the dynamically linked library to be used as plugin for this world. For example:

WorldInfo {
  fast2d "enki"
}

An empty fast2d field means that no plugin is required and that the simulation must be carried out in 3D mode. When the fast2d field in not empty, Webots looks for the corresponding plugin in the plugins/fast2d directory located at the same directory level as the worlds and controllers directories. More precisely, Webots looks for the plugin file $(pluginname)/$(pluginname).$(extension) at these two locations:

  1. $(projectdir)/plugins/fast2d/

  2. $(webotsdir)/resources/projects/default/plugins/fast2d/

Where $(projectdir) represents a Webots project directory, $(pluginname) is the plugin name as specified in the fast2d field of the WorldInfo node, $(extension) is an operating system dependent filename extension such as so (Linux) or dll (Windows) and $(webotsdir) is the path specified by the WEBOTS_HOME environment variable. If WEBOTS_HOME is undefined then $(webotsdir) is the path from which the Webots executable was started. If the required plugin is not found, Webots attempts to run the simulation using the built-in 3D simulator. According to the "enki" example above, and assuming that the current project directory $(projectdir) is /home/user/webots and that WEBOTS_HOME=/usr/local/webots, then the Linux version of Webots looks for the plugin in:

  1. /home/user/webots/plugins/fast2d/enki/enki.so

  2. /usr/local/webots/resources/projects/default/plugins/fast2d/enki/enki.so

Since the plugin name is referred to by the WorldInfo node of a world (.wbt file), it is possible to have a different plugin for each world.

7.2.3 Enki Plugin

The Linux and Windows distributions of Webots come with a pre-installed Fast2D plugin called the Enki plugin. The Enki plugin is based on the Enki simulator, which is a fast open source 2D robot simulator developed at the Laboratory of Intelligent Systems, at the EPFL in Lausanne, Switzerland, by Stephane Magnenat, Markus Waibel and Antoine Beyeler. You can find more information about Enki at the Enki website.

release 7.0.2
Copyright © 2012 Cyberbotics Ltd. All right reserved.