Script simulation parameters

The main script and each child script have a list of simulation parameters. Those parameters can be used as a quick way of adjusting values of a specific model for example (e.g. the maximum velocity of a mobile robot or the resolution of a sensor). The script simulation parameters for a script can be accessed by double-clicking the appropriate icon in the scene hierarchy:

[Script simulation parameter icons (1) empty parameter list, (2) non-empty parameter list]

[Script simulation parameters dialog]

If the user modifies a value in the parameter list, scripts can react to that modification and adjust their behavior accordingly. A script can use the simGetScriptSimulationParameter function to retrieve the value of a parameter, or the simSetScriptSimulationParameter function to modify the value of a parameter. Script simulation parameters can also be used for specific inter-script messaging purposes.

Items in the script simulation parameters dialog are briefly described hereafter:

  • Add new parameter: adds a new parameter to the list.
  • Script parameters: list of parameters. Individual parameters can be renamed with a double-click, and their values modified.
  • Value: string value of the parameter. The string can contain any value, including embedded zeros.
  • Unit: the unit of the value (if applicable). The unit is merely intended to inform the user.
  • Parameter is private: if enabled, then the selected parameter is not shown during a simulation (in that case the parameter is probably not meant to be modified during a simulation).
  • Parameter is persistent: if enabled, then the selected parameter will not be restored to its original value at simulation end.

  • Recommended topics

  • Related API functions
  • The main script
  • Child scripts