diff --git a/libraries/AC_AttitudeControl/AC_AttitudeControl.cpp b/libraries/AC_AttitudeControl/AC_AttitudeControl.cpp index db70ee14fb..bcf99f93a8 100644 --- a/libraries/AC_AttitudeControl/AC_AttitudeControl.cpp +++ b/libraries/AC_AttitudeControl/AC_AttitudeControl.cpp @@ -552,6 +552,7 @@ void AC_AttitudeControl::update_rate_bf_targets() _rate_bf_target.z = _p_angle_yaw.kP() * _angle_bf_error.z; } + // include roll and pitch rate required to account for precession of the desired attitude about the body frame yaw axes _rate_bf_target.x += _angle_bf_error.y * _ahrs.get_gyro().z; _rate_bf_target.y += -_angle_bf_error.x * _ahrs.get_gyro().z; }