Commit Graph
1286 Commits
Author SHA1 Message Date
Peter Barker 9b240db037 AP_Scripting: add a binding for set_alt_m 2025-10-11 12:39:41 -05:00
Tim Tuxworth ae038a5886 AP_Scripting: update plane_flllow.md documentation 2025-10-11 08:19:10 +02:00
Tim Tuxworth 6b4743f027 AP_Scripting: plane_follow.lua applet 2025-10-07 11:48:50 +11:00
George Zogopoulos 6f188f5427 AP_Scripting: Added VSPeak Modell flow meter driver
Changest tested with Kyle

Updated script

Fixed documentation errors

Added VSPF_MODE

Fixed type casting

Added VSPF_PORT to choose serial port

Updated documentation

Fixed wrong handling of sensor mode

Some changes to hopefully get better data parsing

Fixed bugs
2025-10-02 08:34:54 +10:00
Peter Barker e783bb4ab8 AP_Scripting: add define so user can omit AP_Vehicle bindings 2025-10-01 18:05:38 +10:00
Peter Barker da93d1467c AP_Scripting: add define so user can omit AP_Motors bindings 2025-10-01 18:05:38 +10:00
Thomas Watson 4a7ddf545a AP_Scripting: avoid DEV_PRINTF for initial memory usage
This corrupts other MAVLink messages going out at the same time,
particularly in CI, causing tests to fail because scripting restart and
script initial startup messages are destroyed.

Instead use a MAVLink debug statustext, but only send it if the runtime
measurement debug bit is on to avoid an obvious change in behavior and
unnecessary appearance of a new message.
2025-09-30 10:47:25 +10:00
Peter Barker 1fc015c5da AP_Scripting: add a script that changes vehicle between configurations
... different battery configurations, different payload configurations and different arm configurations
2025-09-30 09:42:32 +10:00
Valeriy Van af6d3b584a Plane: Fix typo 2025-09-29 16:20:10 +10:00
Tom Pittenger 08b209d340 AP_Scripting: fix periph:get_vehicle_state to be 64 bit 2025-09-29 15:16:23 +10:00
Andrew Tridgell a3041bd10f AP_Scripting: fixed battery tag on 2nd CAN bus
allow for tags on either bus
2025-09-29 12:43:19 +10:00
Iampete1 b9c177c363 AP_Scripting: check channel is valid before trying to send on it 2025-09-16 11:00:05 +01:00
Iampete1 a0452ba1d4 AP_Scripting: examples: add TraxxasVelineon ESC telem script 2025-09-15 18:18:55 -05:00
Iampete1 3048a04f6b AP_Scripting: Luacheck: allow unused arguments prefixed with a underscore 2025-09-15 18:18:55 -05:00
Iampete1 064655cb4a AP_Scripting: add binding for UART set_unbuffered_writes 2025-09-15 18:18:55 -05:00
Iampete1 5f33bc7af8 AP_Scripting: update esc_telem:update_rpm method to use float 2025-09-15 18:18:55 -05:00
Andrew Tridgell 3393fa2ed9 AP_Scripting: added is_pending() method on sockets
allows for non-blocking TCP connections
2025-09-03 15:17:39 +01:00
Andrew Tridgell 03494bd938 AP_Scripting: added pcall wrapper to LTE_modem 2025-08-31 17:05:52 +01:00
Andrew Tridgell 15d176cc88 AP_Scripting: fixed RSRQ/RSRP mixup 2025-08-31 17:05:52 +01:00
Andrew Tridgell 7d2f8a9190 AP_Scripting: LTE_modem reliability improvements 2025-08-31 17:05:52 +01:00
Andrew Tridgell a080f62bd8 AP_Scripting: added LTE BG95 support
nice modem with good CAT-M support
2025-08-31 17:05:52 +01:00
timtuxworth 435ae628fb AP_Scripting: quadplane terrain avoidance with can't make that climb 2025-08-19 22:23:08 -05:00
Tim Tuxworth cc0b8164d2 AP_Scripting: scripted arming checks 2025-08-16 19:55:15 +01:00
Tim Tuxworth 012fc280a8 Tools: tests for scripted arming checks 2025-08-16 19:55:15 +01:00
Peter Barker 4e7e417dc3 AP_Scripting: add test for NAMED_VALUE_STRING 2025-08-10 08:38:08 +10:00
Andrew Tridgell 7e0daa6609 AP_Scripting: added MOT slew rates to revert_params.lua 2025-08-06 08:25:44 +10:00
Peter Barker 55277a339e AP_Scripting: copter_terrain_brake: read aloud activation message 2025-07-29 21:23:39 +10:00
Andy Piper 7fbdfcee0a AP_Scripting: add stop method 2025-07-23 18:13:36 +10:00
Peter Barker ae48665948 AP_Scripting: add example which prints checksum of @SYS/flash.bin 2025-07-23 10:50:55 +10:00
Andrew Tridgell 318e6b9190 AP_Scripting: update HFE EFI driver script
added option to log all CAN frames for debugging new protocols
2025-07-22 13:02:52 +10:00
Peter Barker 3708936c62 global: correct shebang lines to refernce python3
also remove the odd encoding line which is not required in Py3
2025-07-22 10:45:57 +10:00
Joseph Stewart d9f1287c8b AP_Scripting: Use unified regex pattern for parameter parsing 2025-07-22 09:31:59 +10:00
Joseph Stewart c4ba818ca5 AP_Scripting: write full param lists without timeout 2025-07-22 09:31:59 +10:00
Joseph Stewart ada20e5224 AP_Scripting: Added comma delimited parameter files in param controller 2025-07-22 09:31:59 +10:00
Andrew Tridgell 90700977c5 AP_Scripting: added EFI_DLA64 driver
new protocol for updated EFI engine from DLA
2025-07-21 20:43:33 +10:00
Andrew Tridgell 55c8eee5a5 AP_Scripting: added BTAG_CUR_CYCLES
this can be used by another battery estimation lua script to adjust
for max number of cycles across all batteries
2025-07-17 21:15:30 +10:00
Thomas Watson 3e76fd681c AP_Scripting: drop utf8 string parsing and formatting
Difficult to imagine a use-case and substitutable with raw hex
characters.
2025-07-15 09:58:44 +10:00
Thomas Watson 81fdbae3ea AP_Scripting: remove utf8 library
Difficult to imagine a use-case and easy to re-implement.

Saves 1280 bytes.
2025-07-15 09:58:44 +10:00
Thomas Watson 6b3e37698f AP_Scripting: use native implementation of luaO_ceillog2
Using a builtin instruction (on Cortex M3/M4/M7) saves 268 bytes.

Tested that the result is the same for all values:

  ```c
  #include <stdio.h>
  #include <limits.h>
  #include <inttypes.h>

  int cl2_new(unsigned int x) {
    const int bitwidth = CHAR_BIT*sizeof(x);
    x--;
    const int clz = x ? __builtin_clz(x) : bitwidth; // clz(0) is undefined
    return bitwidth-clz;
  }

  int cl2_old(unsigned int x) {
    static const uint8_t log_2[256] = {  /* log_2[i] = ceil(log2(i - 1)) */
      0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
      6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
      7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
      7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
      8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
      8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
      8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
      8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8
    };
    int l = 0;
    x--;
    while (x >= 256) { l += 8; x >>= 8; }
    return l + log_2[x];
  }

  int main(int argc, char** argv) {
      for (unsigned int i=1; i!=0; i++) { // 0 is not in the domain
          int v_new = cl2_new(i);
          int v_old = cl2_old(i);
          if (v_new != v_old) {
              printf("%u: %d != %d\n", i, v_new, v_old);
              break;
          }
      }
  }
  ```
2025-07-14 15:58:32 -05:00
Christian Clauss 7351a858b5 AP_Scripting: Fix ‘buff’ may be used uninitialized
Fixes: #30623
* #30623

Initialized the `buff` to remove a frequent warning in our GitHub Actions.
```diff
-  char buff[LUA_TMPNAMBUFSIZE];
+  char buff[LUA_TMPNAMBUFSIZE] = {0};
```
2025-07-13 17:14:25 +10:00
Andrew Tridgell 086472de8f AP_Scripting: added an add_route() binding
allows custom network routes
2025-07-13 13:31:59 +10:00
Andrew Tridgell 8bf182faf5 AP_Scripting: changed LTE_BAND and LTE_MCCMNC to no-change by default
avoid setting band and network if not wanted
2025-07-11 08:04:51 +10:00
Andrew Tridgell d379de6f9c AP_Scripting: support mode modem chipsets in LTE_modem driver
support Air780, EC200 and SIM7070G
add escaping to CMUX data
improved logging
2025-07-09 18:24:24 +10:00
Iampete1 cce22722e9 AP_Scripting: applets: UniversalAutoLand: rename params to avoid name conflict with native mode 2025-07-08 10:03:42 +10:00
Andrew Tridgell 85b2de8b95 AP_Scripting: added docs for plane_ship_landing.lua
based on https://discuss.ardupilot.org/t/ship-landing-support/82772
2025-07-05 18:23:23 +10:00
Peter Barker 8aaeef5724 AP_Scripting: docs_check.py: flake8 correctness
... also avoid catching bare exception, handle the case where the regex isn't matching
2025-06-22 09:04:16 +10:00
Yuri RageandThomas Watson e952d4b16b AP_Scripting: add net-ntrip applet
Co-authored-by: Thomas Watson <twatson52@mac.com>

Co-authored-by: Thomas Watson <twatson52@mac.com>
2025-06-20 19:44:33 -05:00
Christian Clauss dc9446af62 wscript: Add # flake8: noqa linter directive 2025-06-20 20:30:15 +10:00
Christian Clauss e4fb97b745 AP_Scripting: Add # flake8: noqa linter directive 2025-06-20 20:30:15 +10:00
Andrew Tridgell acda8428f8 AP_Scripting: use CMUX for LTE_modem
using CMUX allows us to have AT commands run in parallel with PPP or
TCP data, allowing for signal strength and other data to be retrieved

this also adds auto-bauding, with separate LTE_IBAUD and LTE_BAUD
parameters, avoiding the need to configure the hardware baud rate with
a terminal program
2025-06-16 12:29:44 +10:00