mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 06:03:33 +08:00
mixer: FunctionMotors: leave NAN control values at NAN with non-zero THR_MDL_FAC
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
committed by
Matthias Grob
parent
3941b19968
commit
d7904b5f2c
@@ -87,16 +87,19 @@ public:
|
|||||||
const float tmp2 = b * b / (4.f * a * a);
|
const float tmp2 = b * b / (4.f * a * a);
|
||||||
|
|
||||||
for (int i = 0; i < num_values; ++i) {
|
for (int i = 0; i < num_values; ++i) {
|
||||||
|
|
||||||
float control = values[i];
|
float control = values[i];
|
||||||
|
|
||||||
if (control > 0.f) {
|
if (PX4_ISFINITE(control)) {
|
||||||
values[i] = -tmp1 + sqrtf(tmp2 + (control / a));
|
if (control > 0.f) {
|
||||||
|
values[i] = -tmp1 + sqrtf(tmp2 + (control / a));
|
||||||
|
|
||||||
} else if (control < -0.f) {
|
} else if (control < -0.f) {
|
||||||
values[i] = tmp1 - sqrtf(tmp2 - (control / a));
|
values[i] = tmp1 - sqrtf(tmp2 - (control / a));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
values[i] = 0.f;
|
values[i] = 0.f;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user