A Lua script ran for too long in one go
What ArduPilot says:
- … exceeded time limit
Each time ArduPilot calls a script, the script may execute at most SCR_VM_I_COUNT Lua instructions (10000 by default, never fewer than 1000) before it hands control back. A script that goes over is stopped with “Lua: FILE exceeded time limit”, removed, and not run again. The limit keeps one script from taking the processor away from the others and from the flight code.
What to do, most likely first
The applet is a heavy one, and its instructions give a higher
SCR_VM_I_COUNT.CheckRead the applet's own page: the Lua Applet Catalog shows the parameters each one needs.
FixSet
SCR_VM_I_COUNTto the value the applet asks for and reboot.Your script does too much in one call: a long loop, a big table, a file read to the end.
FixSplit the work over several calls: do a part, return, and continue on the next call.
A loop in the script never ends.
FixCorrect the loop's condition. A higher limit only makes such a script hang longer.
Parameters to look at
| Parameter | What it is |
|---|---|
SCR_VM_I_COUNT | Scripting Virtual Machine Instruction Count |
SCR_THD_PRIORITY | Scripting thread priority |
Where to do it:Lua Applet Catalog
The code that sends it
… exceeded time limit
libraries/AP_Scripting/lua_scripts.cpp lua_scripts::run_next_script() · Open in ArduPilot Copter-4.7.1