diff --git a/flix/control.ino b/flix/control.ino index 1c157c1..38c59d7 100644 --- a/flix/control.ino +++ b/flix/control.ino @@ -80,7 +80,7 @@ void interpretControls() { if (mode == STAB) { float yawTarget = attitudeTarget.getYaw(); - if (invalid(yawTarget) || controlYaw != 0) yawTarget = attitude.getYaw(); // reset yaw target if NAN or pilot commands yaw rate + if (!armed || invalid(yawTarget) || controlYaw != 0) yawTarget = attitude.getYaw(); // reset yaw target attitudeTarget = Quaternion::fromEuler(Vector(controlRoll * tiltMax, controlPitch * tiltMax, yawTarget)); ratesExtra = Vector(0, 0, -controlYaw * maxRate.z); // positive yaw stick means clockwise rotation in FLU }