Add threshold for rc sticks move for quitting auto mode

This commit is contained in:
Oleg Kalachev
2026-07-21 10:58:22 +03:00
parent 4582942919
commit 74b082957e
+1 -1
View File
@@ -38,7 +38,7 @@ void descend() {
// Allow pilot to interrupt automatic flight
void autoFailsafe() {
static float roll, pitch, yaw, throttle;
if (roll != controlRoll || pitch != controlPitch || yaw != controlYaw || abs(throttle - controlThrottle) > 0.05) {
if (abs(roll - controlRoll) > 0.05 || abs(pitch - controlPitch) > 0.05 || abs(yaw - controlYaw) > 0.05 || abs(throttle - controlThrottle) > 0.05) {
// controls changed and mode switch is not configured
if (mode == AUTO && invalid(controlMode)) mode = STAB; // regain control by the pilot
}