From 49d8b85c7f67b47ac38b516ec52218702d9ab197 Mon Sep 17 00:00:00 2001 From: Silvan Fuhrer Date: Tue, 27 Feb 2024 17:23:13 +0100 Subject: [PATCH] FW Attitude Controller: fix manual yaw rate setpoint limit (#22812) Signed-off-by: Silvan Fuhrer --- src/modules/fw_att_control/FixedwingAttitudeControl.cpp | 2 +- src/modules/fw_att_control/FixedwingAttitudeControl.hpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/fw_att_control/FixedwingAttitudeControl.cpp b/src/modules/fw_att_control/FixedwingAttitudeControl.cpp index 35632b7aec60..7de353c8f977 100644 --- a/src/modules/fw_att_control/FixedwingAttitudeControl.cpp +++ b/src/modules/fw_att_control/FixedwingAttitudeControl.cpp @@ -361,7 +361,7 @@ void FixedwingAttitudeControl::Run() /* add yaw rate setpoint from sticks in all attitude-controlled modes */ if (_vcontrol_mode.flag_control_manual_enabled) { - body_rates_setpoint(2) += math::constrain(_manual_control_setpoint.yaw * radians(_param_fw_y_rmax.get()), + body_rates_setpoint(2) += math::constrain(_manual_control_setpoint.yaw * radians(_param_man_yr_max.get()), -radians(_param_fw_y_rmax.get()), radians(_param_fw_y_rmax.get())); } diff --git a/src/modules/fw_att_control/FixedwingAttitudeControl.hpp b/src/modules/fw_att_control/FixedwingAttitudeControl.hpp index 20421f056dd5..6c902878e1f6 100644 --- a/src/modules/fw_att_control/FixedwingAttitudeControl.hpp +++ b/src/modules/fw_att_control/FixedwingAttitudeControl.hpp @@ -155,7 +155,8 @@ class FixedwingAttitudeControl final : public ModuleBase) _param_fw_wr_imax, (ParamFloat) _param_fw_wr_p, - (ParamFloat) _param_fw_y_rmax + (ParamFloat) _param_fw_y_rmax, + (ParamFloat) _param_man_yr_max )