Exit auto mode when sticks moved only when mode switch is not configured

This commit is contained in:
Oleg Kalachev
2026-04-29 15:07:44 +03:00
parent 28da2d3c8e
commit 9ca6841558
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -266,7 +266,7 @@ In this mode, the pilot controls the angular rates. This control method is diffi
In this mode, the pilot inputs are ignored (except the mode switch). The drone can be controlled using [pyflix](../tools/pyflix/) Python library, or by modifying the firmware to implement the needed behavior. In this mode, the pilot inputs are ignored (except the mode switch). The drone can be controlled using [pyflix](../tools/pyflix/) Python library, or by modifying the firmware to implement the needed behavior.
If the pilot moves the control sticks, the drone will switch back to *STAB* mode. If the pilot moves the control sticks and mode switch is not configured, the drone will switch back to *STAB* mode.
## Wi-Fi configuration ## Wi-Fi configuration
+2 -2
View File
@@ -37,8 +37,8 @@ void descend() {
void autoFailsafe() { void autoFailsafe() {
static float roll, pitch, yaw, throttle; static float roll, pitch, yaw, throttle;
if (roll != controlRoll || pitch != controlPitch || yaw != controlYaw || abs(throttle - controlThrottle) > 0.05) { if (roll != controlRoll || pitch != controlPitch || yaw != controlYaw || abs(throttle - controlThrottle) > 0.05) {
// controls changed // controls changed and mode switch is not configured
if (mode == AUTO) mode = STAB; // regain control by the pilot if (mode == AUTO && invalid(controlMode)) mode = STAB; // regain control by the pilot
} }
roll = controlRoll; roll = controlRoll;
pitch = controlPitch; pitch = controlPitch;