From e5be4344be87defbc53ad857444768c5208d6aed Mon Sep 17 00:00:00 2001 From: Pradeep Date: Wed, 28 Feb 2024 17:16:09 +1100 Subject: [PATCH] AP_Scripting: Lua bindings for safety checks ESC, MotorsMatrix, EFI This commit introduces Lua bindings for the following methods: - ESC- `get_last_telem_data_ms` - MotorMatrix `get_lost_motor` - MotorMatrix `get_thrust_boost` - EFI `get_last_update_ms` Note: - For get_last_telem_data_ms - CPN reset is reported. But ESC disconnected with CPN is not reported. This needs to be looked into --- libraries/AP_Scripting/generator/description/bindings.desc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/AP_Scripting/generator/description/bindings.desc b/libraries/AP_Scripting/generator/description/bindings.desc index 83e168fa57..b63d4b734d 100644 --- a/libraries/AP_Scripting/generator/description/bindings.desc +++ b/libraries/AP_Scripting/generator/description/bindings.desc @@ -314,6 +314,7 @@ singleton AP_ESC_Telem method get_consumption_mah boolean uint8_t 0 NUM_SERVO_CH singleton AP_ESC_Telem method get_usage_seconds boolean uint8_t 0 NUM_SERVO_CHANNELS uint32_t'Null singleton AP_ESC_Telem method update_rpm void uint8_t 0 NUM_SERVO_CHANNELS uint16_t'skip_check float'skip_check singleton AP_ESC_Telem method set_rpm_scale void uint8_t 0 NUM_SERVO_CHANNELS float'skip_check +singleton AP_ESC_Telem method get_last_telem_data_ms uint32_t uint8_t 0 NUM_SERVO_CHANNELS include AP_Param/AP_Param.h singleton AP_Param rename param @@ -393,6 +394,8 @@ singleton AP_MotorsMatrix rename MotorsMatrix singleton AP_MotorsMatrix method init boolean uint8_t 0 AP_MOTORS_MAX_NUM_MOTORS singleton AP_MotorsMatrix method add_motor_raw void int8_t 0 (AP_MOTORS_MAX_NUM_MOTORS-1) float'skip_check float'skip_check float'skip_check uint8_t 0 AP_MOTORS_MAX_NUM_MOTORS singleton AP_MotorsMatrix method set_throttle_factor boolean int8_t 0 (AP_MOTORS_MAX_NUM_MOTORS-1) float 0 FLT_MAX +singleton AP_MotorsMatrix method get_lost_motor uint8_t +singleton AP_MotorsMatrix method get_thrust_boost boolean include AP_Frsky_Telem/AP_Frsky_SPort.h singleton AP_Frsky_SPort rename frsky_sport @@ -572,6 +575,7 @@ ap_object AP_EFI_Backend method handle_scripting boolean EFI_State singleton AP_EFI depends (AP_EFI_SCRIPTING_ENABLED == 1) singleton AP_EFI rename efi singleton AP_EFI method get_backend AP_EFI_Backend uint8_t 0 UINT8_MAX +singleton AP_EFI method get_last_update_ms uint32_t -- ----END EFI Library----