mirror of
https://github.com/okalachev/flix.git
synced 2025-07-31 05:18:56 +00:00
Fixed
This commit is contained in:
parent
3d72224b32
commit
f46842f341
@ -29,7 +29,6 @@ void autoFailsafe() {
|
||||
|
||||
if (roll != controlRoll || pitch != controlPitch || yaw != controlYaw || abs(throttle - controlThrottle) > 0.05) {
|
||||
if (mode == AUTO && !isfinite(controlMode)) {
|
||||
print("Failsafe: regain control to pilot\n");
|
||||
mode = STAB; // regain control to the pilot
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,14 @@ float mapff(float x, float in_min, float in_max, float out_min, float out_max) {
|
||||
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
|
||||
}
|
||||
|
||||
bool invalid(float x) {
|
||||
return !isfinite(x);
|
||||
}
|
||||
|
||||
bool valid(float x) {
|
||||
return isfinite(x);
|
||||
}
|
||||
|
||||
// Wrap angle to [-PI, PI)
|
||||
float wrapAngle(float angle) {
|
||||
angle = fmodf(angle, 2 * PI);
|
||||
|
Loading…
x
Reference in New Issue
Block a user