
Lua is a garbage collected, imperative programming language. These features are usually enabled by default, set SRTL_POINTS = 0, TERRAIN_ENABLE = 0). On autopilots with a STM32F4 microcontroller, Smart RTL (Rover, Copter) and Terrain Following (Plane, Copter) need to be nearly always disabled. If set too high other autopilot features such as Terrain Following or even the EKF may fail to initialize. If this parameter is set too low, scripts may fail to run. The autopilot’s free memory depends highly upon which features and peripherals are enabled. The default of 43 kB is sufficient for small scripts and fits onto most autopilots. SCR_HEAP_SIZE can be adjusted to increase or decrease the amount of memory available for scripts. Messages and errors are sent to the ground station and, if using Mission Planner, can be viewed in the Data screen’s “Messages” tab. When the autopilot is powered on it will load and start all scripts. In addition, four dedicated script parameters are available: SCR_USER1 thru SCR_USER4 and are accessed with the same method as any other parameter, but these are reserved for script use. Up to 8 RC channels can be assigned as scripting inputs/controls using the``RCX_OPTION`` = “300-307” options. To download from the github locations, first click the script name, then select “raw” in upper right corner, then right mouse click to “Save Page as” a text file with the “.lua” file extension
Lua script in fastoredis drivers#
See Script Applets.ĭrivers Lua scripts can actually provide hardware drivers for new peripheral hardware that is not directly supported in the ArduPilot firmware, such a new EFIs or Gimbals. For example, there is a script to allow a user to change a SmartAudio capable video transmitter’s output power level from a transmitter channel and set its power-up value via parameter. md file of the same name detailing its capabilities, use, and setup. The latest development scripts can be found here.Īpplets which are scripts that require no user editing before use, can be found here. Sample/Example Scripts can be found here for stable Plane, Copter and Rover.
Lua script in fastoredis simulator#
If using a simulator, the scripts folder is in the directory the simulator was started from. If using Mission Planner, this can be done using MAVFTP. This folder can also be created manually on the SD card. If this folder does not exist, you can create it by setting SCR_ENABLE to 1 and rebooting. lua) to the autopilot’s SD card’s APM/scripts folder. Set SCR_ENABLE to 1 to enable scripting (refresh or reboot to see all SCR_ parameters).



High powered autopilots like the CubePilot Cube Orange and HolyBro Durandal will certainly work well but check the specifications of your autopilot. Ensure your autopilot has at least 2 MB of flash and 70 kB of memory.
