mirror of
https://github.com/okalachev/flix.git
synced 2025-08-17 09:06:11 +00:00
Fixed
This commit is contained in:
@@ -29,7 +29,6 @@ void autoFailsafe() {
|
|||||||
|
|
||||||
if (roll != controlRoll || pitch != controlPitch || yaw != controlYaw || abs(throttle - controlThrottle) > 0.05) {
|
if (roll != controlRoll || pitch != controlPitch || yaw != controlYaw || abs(throttle - controlThrottle) > 0.05) {
|
||||||
if (mode == AUTO && !isfinite(controlMode)) {
|
if (mode == AUTO && !isfinite(controlMode)) {
|
||||||
print("Failsafe: regain control to pilot\n");
|
|
||||||
mode = STAB; // regain control to the pilot
|
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;
|
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)
|
// Wrap angle to [-PI, PI)
|
||||||
float wrapAngle(float angle) {
|
float wrapAngle(float angle) {
|
||||||
angle = fmodf(angle, 2 * PI);
|
angle = fmodf(angle, 2 * PI);
|
||||||
|
Reference in New Issue
Block a user