Commit Graph

1181 Commits

Author SHA1 Message Date
Stephen Dade
7ee0232d83 AP_Scripting: Better mavlink parsing for MAVLinkHL and Rockblock 2025-02-27 11:39:56 +11:00
Peter Barker
6338d10b5f global: create and use HAL_PROGRAM_SIZE_LIMIT_KB
We will reserve BOARD_FLASH_SIZE for the internal flash on stm32 flash processors, use HAL_PROGRAM_SIZE_LIMIT_KB in the general code base.

Notable change here is that boards with external flash will start to get features only available with more than 2MB of program storage
2025-02-26 10:06:39 +11:00
Bob Long
f72022f606 AP_Scripting: call reset_all_aux_auths on start 2025-02-25 11:19:59 +11:00
Thomas Watson
232f6524f6 AP_Scripting: patch vendored Lua to 5.3.6
In particular this fixes some exceedingly rare/impossible
use-after-frees.

Add the new docs from the distribution and clarify where we get our code
from. To maintain our alterations, the following patches have been
applied to the source from upstream's repository (1221e987...75ea9ccb)
to bring the source up to date:

* Bug: Long brackets with a huge number of '=' causes overflow

  A long bracket with too many equal signs can overflow the 'int' used for
  the counting and some arithmetic done on the value. Changing the counter
  to 'size_t' avoids that. (Because what is counted goes to a buffer, an
  overflow in the counter will first raise a buffer-overflow error.)

* Fixed bug in 'lua_upvaluejoin'

  Bug-fix: joining an upvalue with itself could cause a use-after-free
  crash.

* Fixed typos in comments

* Fixed missing GC barriers in compiler and undump

  While building a new prototype, the GC needs barriers for every object
  (strings and nested prototypes) that is attached to the new prototype.

* Updated release number and copyright year

* Fixed bug: invalid mode can crash 'io.popen'

* Fixed bug: Negation overflow in getlocal/setlocal

* 'realloc' can fail when shrinking a block

  According to ISO C, 'realloc' can fail when shrinking a block. If that
  happens, 'l_alloc' simply ignores the fail and returns the original
  block.

* Fixed bug of long strings in binary chunks

  When "undumping" a long string, the function 'LoadVector' can call the
  reader function, which can run the garbage collector, which can collect
  the string being read. So, the string must be anchored during the call
  to 'LoadVector'.
2025-02-22 14:45:30 +00:00
Shiv Tyagi
297ec3fa7c AP_Scripting: use new AP_PERIPH_RC_OUT_ENABLED define 2025-02-22 18:26:07 +11:00
Shiv Tyagi
44d07c8f79 AP_Scripting: use new AP_PERIPH_NOTIFY_ENABLED define 2025-02-20 13:32:20 +11:00
Peter Barker
42c1ad30c9 AP_Scripting: remove use of OwnPtr 2025-02-11 11:54:52 +11:00
Thomas Watson
c7f32c2fb4 AP_Scripting: mavlink: clearer error messages 2025-02-11 10:26:59 +11:00
Thomas Watson
55a0cbbd9a AP_Scripting: mavlink: remove redundant Lua buffer usage 2025-02-11 10:26:59 +11:00
Thomas Watson
2b995b2087 AP_Scripting: mavlink: fix RX init locking
If there is an error, the semaphore will never be released. Fix by only
calling functions which could cause errors after it's released.
2025-02-11 10:26:59 +11:00
Thomas Watson
962616a76f AP_Scripting: update so mavlink init intent matches behavior
RX message ID buffer sizes have been shrunk to the amount actually used.
2025-02-08 13:52:21 -06:00
Iampete1
fe3f12dc87 AP_Scripting: Docs: correct argument order on mavlink:init 2025-02-08 11:38:06 -06:00
Stephen Dade
d5c1478324 AP_Scripting: Update rockblock and MAVLinkHL with additional commands and gcs timeout 2025-02-08 09:42:06 +11:00
Shiv Tyagi
4fca0ccd0b AP_Scripting: use AP_PERIPH_BARO_ENABLED in place of HAL_PERIPH_ENABLE_BRO 2025-01-31 08:25:28 +11:00
Randy Mackay
e4f26cd509 AP_Scripting: Torqeedo TorqLink lua driver
Co-authored-by: Shift-Ronan <88686667+Shift-Ronan@users.noreply.github.com>
2025-01-29 06:49:08 +11:00
Peter Barker
c6c6e9fc99 AP_Scripting: rename SRV_Channel::Aux_servo_function_t to SRV_Channel::Function 2025-01-28 21:56:46 +11:00
Randy Mackay
e294cc03f9 AP_Scripting: video-stream-information param index fix 2025-01-28 12:21:33 +11:00
Peter Barker
346c746d29 AP_Scripting: make dotriaconta_octaquad_x a quad-X 2025-01-27 14:03:41 +11:00
Peter Barker
58fa14ebe6 AP_Scripting: rename setup example script for dotriaconta_quad_x 2025-01-27 14:03:41 +11:00
murata
502b3a8713 AP_Scripting: Support Hexadeca-Octa (OCTA-X16) 2025-01-27 14:03:41 +11:00
Andrew Tridgell
aae0613e17 AP_Scripting: added 32 motor example 2025-01-27 14:03:41 +11:00
Peter Barker
c5058fa360 AP_Scripting: create AP_PERIPH_GPS_ENABLED 2025-01-23 17:47:58 +11:00
Thomas Watson
429ed5cdd2 AP_Scripting: only log aerobatic trick file when supported
LittleFS does not have this function implemented due to logging
bandwidth, so `logger:log_file_content` is nil. Don't call it unless it
exists, assuming this logging is not critical.
2025-01-21 15:19:55 +00:00
Andy Piper
628b000ace AP_Scripting: scripting directory configuration for posix IO
ensure SITL uses ./scripts
2025-01-21 11:10:31 +11:00
Andy Piper
f706b8615e AP_Scripting: allow scripting on 2Mb boards with littlefs 2025-01-21 11:10:31 +11:00
Peter Barker
98dbcd5d08 AP_Scripting: update examples to not use deprecated methods 2025-01-21 10:54:05 +11:00
Peter Barker
8ea5ef2784 AP_Scripting: allow for more than 327m range rangefinders 2025-01-21 10:54:05 +11:00
Iampete1
00e920b79d AP_Scripting: servo telem rename valid_types to present_types 2025-01-14 10:49:31 +11:00
Iampete1
265f5dfad9 AP_Scripting: allow generation of fields that check or set a bitmask 2025-01-14 10:49:31 +11:00
Iampete1
4189167a78 AP_Scripting: docs: remove incorrect camera creation function
Fix generator to skip generation of docs for generation methods that
don't exist, and to avoid generating Lua creation methods that couldn't
be called.

Co-authored-by: Thomas Watson <twatson52@icloud.com>
2025-01-14 10:49:31 +11:00
Iampete1
decfeeeaf5 AP_Scripting: add bindings for servo telem 2025-01-14 10:49:31 +11:00
Iampete1
50c45cff75 AP_Scripting: applets: fix luacheck issues in sport aerobattics and script controller 2025-01-05 14:17:10 +00:00
Thomas Watson
01964d8cc0 AP_Scripting: demystify require test
Explain more thoroughly how the test works using lessons learned from
studying the compiled bytecode and function data.

Tested that it still fails after reverting the patches in PR #27652.
2025-01-05 10:36:10 +11:00
Iampete1
0dbbb87ce2 AP_Scripting: fix remaining luacheck issues 2024-12-24 14:48:58 -06:00
Iampete1
754fc867c2 AP_Scripting: set source index when running aux functions 2024-12-24 11:34:07 +11:00
Iampete1
473c39a9e9 AP_Scripting: move to AuxFuncTrigger structure 2024-12-24 11:34:07 +11:00
Iampete1
6b0d59340e AP_Scripting: Examples: Flip_Mode: combine allow entry methods 2024-12-24 11:05:56 +11:00
Andrew Tridgell
613b835d67 AP_Scripting: added QUIK_ANGLE_MAX for lua quicktune
this brings the same protection to the lua script as was added for the
C++ implementation
2024-12-22 07:09:31 +11:00
Andrew Tridgell
9503744e6a AP_Scripting: added get_att_error_angle_deg binding for AC_AttitudeControl 2024-12-22 07:09:31 +11:00
Andreas Gising
300e5ccedd AP_Scripting: add glide-into-wind example without RC override 2024-12-18 19:35:34 +11:00
Randy Mackay
523b34fbb9 AP_Scripting: add follow-target-send applet 2024-12-18 18:28:12 +11:00
Randy Mackay
5c7cfa13cf AP_Scripting: add FOLLOW_TARGET msg definition 2024-12-18 18:28:12 +11:00
Randy Mackay
56cb20ac50 AP_Scripting: add get_vel_target poscontrol binding 2024-12-18 18:28:12 +11:00
Henry Wurzburg
051c2dcd35 Tools: add Plane autoland applet 2024-12-10 13:18:41 +11:00
Henry Wurzburg
637fea1f2d AP_Scripting: add Plane autoland applet 2024-12-10 13:18:41 +11:00
Iampete1
e4de4c9b41 AP_Scripting: Examples: message_interval: give checker a hint about types 2024-12-08 08:09:06 +09:00
Randy Mackay
1308efb9a4 AP_Scripting: promote video-stream-information to applet 2024-12-05 16:46:48 +09:00
Randy Mackay
3325bdd7df AP_Scripting: set-video-stream-info encoding binding and docs 2024-12-05 16:46:48 +09:00
Randy Mackay
eaf20db6ea AP_Scripting: ahrs/ekf origin script promoted to an applet 2024-12-03 11:15:00 +11:00
Andrew Tridgell
10209a2a13 AP_Scripting: added UltraMotion servo driver 2024-11-28 09:24:03 +11:00