From a6995c93cc01ef7e256199becc3f0c89c0739643 Mon Sep 17 00:00:00 2001 From: magate <69254089+magate@users.noreply.github.com> Date: Wed, 24 Apr 2024 12:10:13 -0700 Subject: [PATCH] AP_Scripting: allow revert of angular rate limits --- libraries/AP_Scripting/applets/revert_param.lua | 8 ++++++++ libraries/AP_Scripting/applets/revert_param.md | 2 ++ 2 files changed, 10 insertions(+) diff --git a/libraries/AP_Scripting/applets/revert_param.lua b/libraries/AP_Scripting/applets/revert_param.lua index 27dc9cc943bcf..8ea0498f47e5e 100644 --- a/libraries/AP_Scripting/applets/revert_param.lua +++ b/libraries/AP_Scripting/applets/revert_param.lua @@ -56,6 +56,7 @@ local PSC_prefixes = { "PSC", "Q_P" } local PID_prefixes = { "_RAT_RLL_", "_RAT_PIT_", "_RAT_YAW_" } local PID_suffixes = { "FF", "P", "I", "D", "D_FF", "PDMX", "NEF", "NTF", "IMAX", "FLTD", "FLTE", "FLTT", "SMAX" } local angle_axes = { "RLL", "PIT", "YAW" } +local rate_limit_axes = { "R", "P", "Y"} local PSC_types = { "ACCZ", "VELZ", "POSZ", "VELXY", "POSXY" } local OTHER_PARAMS = { "INS_GYRO_FILTER", "INS_ACCEL_FILTER", "PTCH2SRV_TCONST", "RLL2SRV_TCONST" } @@ -89,6 +90,13 @@ for _, atc in ipairs(ATC_prefixes) do end end +-- add angular rate limits +for _, atc in ipairs(ATC_prefixes) do + for _, axis in ipairs(rate_limit_axes) do + add_param(atc .. "_RATE_" .. axis .. "_MAX") + end +end + -- add fixed wing tuning for _, suffix in ipairs(PID_suffixes) do add_param("RLL_RATE_" .. suffix) diff --git a/libraries/AP_Scripting/applets/revert_param.md b/libraries/AP_Scripting/applets/revert_param.md index 63d564db7b490..8b1aafbfdd6f7 100644 --- a/libraries/AP_Scripting/applets/revert_param.md +++ b/libraries/AP_Scripting/applets/revert_param.md @@ -47,6 +47,7 @@ The script covers the following parameters on quadplanes: - Q_A_ANG_RLL_P - Q_A_ANG_PIT_P - Q_A_ANG_YAW_P + - Q_A_RATE_*_MAX - Q_P_ACCZ_* - Q_P_VELZ_* - Q_P_POSZ_* @@ -61,6 +62,7 @@ The script covers the following parameters on copters: - ATC_ANG_RLL_P - ATC_ANG_PIT_P - ATC_ANG_YAW_P + - ATC_RATE_*_MAX - PSC_ACCZ_* - PSC_VELZ_* - PSC_POSZ_*