From c4cc02b3f2fa67d90b610dc5984ff4a63c23f3a7 Mon Sep 17 00:00:00 2001 From: Roman Date: Thu, 26 Jan 2017 10:36:28 +0100 Subject: [PATCH] yaw controller: fix bug where roll for turn coordination was constrained wrongly Signed-off-by: Roman --- attitude_fw/ecl_yaw_controller.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attitude_fw/ecl_yaw_controller.cpp b/attitude_fw/ecl_yaw_controller.cpp index 344fe2de50..3472d57628 100644 --- a/attitude_fw/ecl_yaw_controller.cpp +++ b/attitude_fw/ecl_yaw_controller.cpp @@ -110,7 +110,7 @@ float ECL_YawController::control_attitude_impl_openloop(const struct ECL_Control } } - constrained_roll = math::constrain(constrained_roll, -ctl_data.roll_setpoint, ctl_data.roll_setpoint); + constrained_roll = math::constrain(constrained_roll, -fabsf(ctl_data.roll_setpoint), fabsf(ctl_data.roll_setpoint)); if (!inverted) {