Hello,
I work on a project that runs on Pixhawk, and all the control and guidance loops are implemented using Lua scripting.
As the project is getting big, we are looking for a way to make it modular, containing an individual script for each section in the project, and a separate main script.
what is the best way to do it?
Firmware: Plane 4.5.7
Hardware: Cube Orange
lua supports loading files in script.
how can I do it? what is the syntax?
I use plane 4.5.7 and require doesn’t work.
thank you in advance.
In the source code for scripting library there is docs.lua file that contains all the ardupilot bindings.
---@meta
-- ArduPilot lua scripting documentation in EmmyLua Annotations
-- This file should be auto generated and then manual edited
-- generate with --scripting-docs, eg ./waf copter --scripting-docs
-- see: https://github.com/sumneko/lua-language-server/wiki/EmmyLua-Annotations
-- luacheck: ignore 121 (Setting a read-only global variable)
-- luacheck: ignore 122 (Setting a read-only field of a global variable)
-- luacheck: ignore 212 (Unused argument)
-- luacheck: ignore 241 (Local variable is mutated but never accessed)
-- luacheck: ignore 221 (Local variable is accessed but never set.)
-- set and get for field types share function names
---@diagnostic disable: duplicate-set-field
---@diagnostic disable: missing-return
-- integer enum value unknown by docs generator
---@type integer
local enum_integer
-- manual bindings
This file has been truncated. show original