mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-25 02:10:35 +08:00
fix a div/0 condition
This commit is contained in:
@@ -51,7 +51,7 @@ public:
|
|||||||
// prevent divide by zero
|
// prevent divide by zero
|
||||||
// also covers u1. normx is never negative
|
// also covers u1. normx is never negative
|
||||||
if (normx < 1e-8f) {
|
if (normx < 1e-8f) {
|
||||||
return;
|
break;
|
||||||
}
|
}
|
||||||
float w[M] = {};
|
float w[M] = {};
|
||||||
w[0] = 1.0f;
|
w[0] = 1.0f;
|
||||||
@@ -128,6 +128,7 @@ public:
|
|||||||
for (size_t z = 0; z < N; z++) {
|
for (size_t z = 0; z < N; z++) {
|
||||||
x(z) = 0.0f;
|
x(z) = 0.0f;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
x(i) = x(i) / _A(i,i);
|
x(i) = x(i) / _A(i,i);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user