Embedded scripts

CoppeliaSim supports, next to the sandbox script and add-ons, also embedded scripts: an embedded script is a script that is embedded in a scene (or model), i.e. a script that is part of the scene and that will be saved and loaded together with the rest of the scene (or model). There are different types of embedded scripts that are supported. Each type has specific features and application areas:

[Embedded script types]


Two major types of embedded scripts are supported:

  • Simulation scripts: simulation scripts are scripts that are executed only during simulation, and that are used to customize a simulation or a simulation model. The main simulation loop is handled via the main script, and models/robots can be controlled via child scripts.
  • Customization scripts: those are scripts that can also be executed while simulation is not running, and that are used to customize a simulation scene or a specific model.

  • It is useful to remember that some script types are associated with scene objects (attached to scene objects, i.e. associated scripts) such as child scripts and customization scripts. Associated scripts, which form the basis of CoppeliaSim's distributed control architecture, share the convenient property to be automatically duplicated if their associated object is duplicated.

    Embedded scripts, and all scripts in general, are invoked via callback functions by CoppeliaSim, and follow a specific execution order. They can run threaded or non-threaded.