From ac04fcd8367e45a0b5429ddcf812f331088057a4 Mon Sep 17 00:00:00 2001 From: Leonard Hall Date: Tue, 12 Jul 2016 11:24:51 +0900 Subject: [PATCH] AC_AttControl: fix set_yaw_target_to_current_heading --- libraries/AC_AttitudeControl/AC_AttitudeControl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AC_AttitudeControl/AC_AttitudeControl.h b/libraries/AC_AttitudeControl/AC_AttitudeControl.h index 1579cd10c8..ead59fe553 100644 --- a/libraries/AC_AttitudeControl/AC_AttitudeControl.h +++ b/libraries/AC_AttitudeControl/AC_AttitudeControl.h @@ -108,7 +108,7 @@ public: void reset_rate_controller_I_terms(); // Sets yaw target to vehicle heading - void set_yaw_target_to_current_heading() { _attitude_target_euler_angle.z = _ahrs.yaw; } + void set_yaw_target_to_current_heading() { shift_ef_yaw_target(degrees(_ahrs.yaw - _attitude_target_euler_angle.z)*100.0f); } // Shifts earth frame yaw target by yaw_shift_cd. yaw_shift_cd should be in centidegrees and is added to the current target heading void shift_ef_yaw_target(float yaw_shift_cd);