Scripts

CoppeliaSim is a highly customizable simulator: almost every step of a simulation is user-defined. Additionally, the simulator itself can also be customized to a large extent. This flexibility is allowed through an integrated script interpreter (Lua) and an external script interpreter (Python). Both operate in almost the same fashion, except for small differences. For more information on Lua, refer to the Lua crash course section and the online documentation.

[Lua and Python logo]


CoppeliaSim extends Lua's and Python's API function and adds CoppeliaSim specific commands that can be recognized by their sim-prefixes (e.g. sim.getObjectPosition). For a list of all CoppeliaSim specific API functions, refer to the regular API. New, customized API functions can also be registered from a plugin. Refer to the related API-functions for more information.

Several types of scripts are supported in CoppeliaSim: the sandbox script, add-ons, and embedded scripts (themselves composed of a main script, child scripts and customization 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). On the other hand, the sandbox script and add-ons are not associated with any specific scene, model or object, and will run across all scenes in a similar way.

[Script types]


Scripts are invoked via callback functions by CoppeliaSim, and follow a specific execution order. They can run threaded or non-threaded.

CoppeliaSim scripts may be published under any license.