mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-30 18:06:39 +08:00
test: Update unit test to match expected behaviour
This commit is contained in:
committed by
Daniel Agar
parent
dd259a288f
commit
1b1c049e81
@@ -120,17 +120,12 @@ class EkfInitializationTest : public ::testing::Test {
|
|||||||
{
|
{
|
||||||
const Dcmf R_to_earth = Dcmf(_ekf->getQuaternion());
|
const Dcmf R_to_earth = Dcmf(_ekf->getQuaternion());
|
||||||
const Vector3f dvel_bias_var = _ekf_wrapper.getDeltaVelBiasVariance();
|
const Vector3f dvel_bias_var = _ekf_wrapper.getDeltaVelBiasVariance();
|
||||||
const Vector3f accel_bias = _ekf->getAccelBias();
|
|
||||||
|
|
||||||
for (int i = 0; i < 3; i++){
|
for (int i = 0; i < 3; i++){
|
||||||
if (fabsf(R_to_earth(2, i)) > 0.8f) {
|
if (fabsf(R_to_earth(2, i)) > 0.8f) {
|
||||||
// Highly observable, the variance decreases
|
// Highly observable, the variance decreases
|
||||||
EXPECT_LT(dvel_bias_var(i), 4.0e-6f) << "axis " << i;
|
EXPECT_LT(dvel_bias_var(i), 4.0e-6f) << "axis " << i;
|
||||||
|
|
||||||
} else {
|
|
||||||
// Poorly observable, the variance is set to 0
|
|
||||||
EXPECT_FLOAT_EQ(dvel_bias_var(i), 0.f) << "axis" << i;
|
|
||||||
EXPECT_FLOAT_EQ(accel_bias(i), 0.f) << "axis" << i;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user