mirror of
https://github.com/okalachev/flix.git
synced 2026-06-27 21:46:38 +00:00
Exit auto mode when sticks moved only when mode switch is not configured
This commit is contained in:
+1
-1
@@ -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.
|
||||
|
||||
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
|
||||
|
||||
|
||||
+2
-2
@@ -37,8 +37,8 @@ void descend() {
|
||||
void autoFailsafe() {
|
||||
static float roll, pitch, yaw, throttle;
|
||||
if (roll != controlRoll || pitch != controlPitch || yaw != controlYaw || abs(throttle - controlThrottle) > 0.05) {
|
||||
// controls changed
|
||||
if (mode == AUTO) mode = STAB; // regain control by the pilot
|
||||
// controls changed and mode switch is not configured
|
||||
if (mode == AUTO && invalid(controlMode)) mode = STAB; // regain control by the pilot
|
||||
}
|
||||
roll = controlRoll;
|
||||
pitch = controlPitch;
|
||||
|
||||
Reference in New Issue
Block a user