From 34055944cdc34f7eb023c9b1e943f7fdcbea7b06 Mon Sep 17 00:00:00 2001 From: Leonard Hall Date: Tue, 12 Jul 2016 11:26:10 +0900 Subject: [PATCH] AC_PosControl: fix relax_alt_hold_controllers --- libraries/AC_AttitudeControl/AC_PosControl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AC_AttitudeControl/AC_PosControl.cpp b/libraries/AC_AttitudeControl/AC_PosControl.cpp index 89abb8ee34..f513fdc9b0 100644 --- a/libraries/AC_AttitudeControl/AC_PosControl.cpp +++ b/libraries/AC_AttitudeControl/AC_PosControl.cpp @@ -243,7 +243,7 @@ void AC_PosControl::relax_alt_hold_controllers(float throttle_setting) _accel_last_z_cms = 0.0f; _accel_target.z = -(_ahrs.get_accel_ef_blended().z + GRAVITY_MSS) * 100.0f; _flags.reset_accel_to_throttle = true; - _pid_accel_z.set_integrator(throttle_setting*1000.0f); + _pid_accel_z.set_integrator((throttle_setting-_motors.get_throttle_hover())*1000.0f); } // get_alt_error - returns altitude error in cm