Interface to Webots for dynamic simulations.

This interface is intended to be instantiated from inside the controller script of a Webots Robot node with the supervisor field set to true. Such a script can create a WebotsSimulator (passing in a reference to the supervisor node) and then call its simulate method as usual to run a simulation. For an example, see examples/webots/generic/controllers/

Scenarios written for this interface should use our generic Webots world model scenic.simulators.webots.model or a model derived from it. Objects which are instances of WebotsObject will be matched to Webots nodes; see the model documentation for details.

Summary of Module Members



Get field from webots object.


Whether or not physics is enabled for this WebotsObject



Simulation object for Webots.


Simulator object for Webots.

Member Details

class WebotsSimulator(supervisor)[source]

Bases: Simulator

Simulator object for Webots.


supervisor – Supervisor node handle from the Webots Python API.

class WebotsSimulation(scene, supervisor, coordinateSystem=<scenic.simulators.webots.utils.WebotsCoordinateSystem object>, *, timestep, **kwargs)[source]

Bases: Simulation

Simulation object for Webots.


supervisor – Webots supervisor node used for the simulation. This is exposed for the use of scenarios which need to call Webots APIs directly; e.g. simulation().supervisor.setLabel(...).

getFieldSafe(webotsObject, fieldName)[source]

Get field from webots object. Return null if no such field exists.

Needed to workaround this issue (

  • webotsObject – webots object

  • fieldName – name of the field to look for


Field|None – Field object if the field with the given name exists. None otherwise.


Whether or not physics is enabled for this WebotsObject