no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | ref:script_controller [2023/12/14 16:03] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== ScriptController ====== | ||
+ | [[controller|Controller]] defined through a Lua script. | ||
+ | |||
+ | Runs the script defined in the file defined by '' | ||
+ | script_file = " | ||
+ | external_files = [ " | ||
+ | } | ||
+ | </ | ||
+ | -- This function is called at the start of the simulation | ||
+ | -- ' | ||
+ | -- ' | ||
+ | -- ' | ||
+ | end | ||
+ | |||
+ | function update( model, time, controller ) | ||
+ | -- This function is called at each simulation timestep | ||
+ | -- Use it to update the actuator inputs | ||
+ | -- ' | ||
+ | -- ' | ||
+ | -- ' | ||
+ | return false -- change to ' | ||
+ | end | ||
+ | |||
+ | function store_data( current_frame ) | ||
+ | -- This function is called at each simulation timestep | ||
+ | -- ' | ||
+ | end | ||
+ | </ | ||
+ | |||
+ | **Inherits from** [[composite_controller|CompositeController]]. | ||
+ | |||
+ | ==== Public Attributes ==== | ||
+ | ^ Parameter ^ Type ^ Description ^ | ||
+ | ^ script_file | path | filename of the Lua script, path is relative to the .scone file | | ||
+ | ^ external_files | ArrayOfFiles | Array of files used by the Lua script; files included by ' | ||
+ | ^ name | String | Name of the controller, uses as a prefix for the control parameters; empty by default. | | ||
+ | ^ start_time | TimeInSeconds | Time [s] at which [[controller|Controller]] becomes active; default = 0. | | ||
+ | ^ stop_time | TimeInSeconds | Time [s] at which [[controller|Controller]] becomes inactive; default = until simulation ends. | | ||
+ | ^ signature_prefix | String | Prefix signature with custom string. Special tags: DATE_TIME, DATE_TIME_EXACT, | ||
+ | ^ signature_postfix | String | Append custom string to signature. Special tags: DATE_TIME, DATE_TIME_EXACT, | ||
+ | ^ signature | String | Set custom signature and omit the auto-generated signature. | | ||
+ | |||
+ | < | ||