Running heavy Lua scripts

Hi everyone,

Currently, I am running multiple Lua scripts simultaneously on the flight controller, and I’m starting to hit memory and resource limits.

I’m wondering that is there a recommended way to move some Lua-script functionality to a companion computer instead of running everything on the FC? Or are there alternative approaches to achieve similar behavior without being constrained by FC memory?

Thanks in advance!

The answer is almost certainly yes, but it’s hard to know how to optimize without understanding what those scripts do in the first place.

Hi Yuri, Thanks for the reply.
As an example, let’s assume I’m currently running a Lua-based ship landing script on the flight controller. If I want to move this logic to a Raspberry Pi companion computer, could you suggest a few keywords or concepts I should look into?

Look at what the script does and see which features can be easily handled via MavLink communication between an offboard computer and the autopilot.

2 Likes