Browse Source

ekf2_test: adjust airspeed unit test

an airpseed of > 2m/s is required to start the fusion (set by param)
fw mode is also required

Given the larger estimated windspeed after those changes, the change of
static pressure is larger and the height estimate takes more time to
reach the final value
master
bresch 3 years ago committed by Mathieu Bresciani
parent
commit
3927c183de
  1. 5
      src/modules/ekf2/test/test_EKF_airspeed.cpp

5
src/modules/ekf2/test/test_EKF_airspeed.cpp

@ -75,12 +75,13 @@ TEST_F(EkfAirspeedTest, testWindVelocityEstimation) @@ -75,12 +75,13 @@ TEST_F(EkfAirspeedTest, testWindVelocityEstimation)
{
const Vector3f simulated_velocity_earth(0.0f, 1.5f, 0.0f);
const Vector2f airspeed_body(0.4f, 0.0f);
const Vector2f airspeed_body(2.4f, 0.0f);
_ekf_wrapper.enableExternalVisionVelocityFusion();
_sensor_simulator._vio.setVelocity(simulated_velocity_earth);
_sensor_simulator.startExternalVision();
_ekf->set_in_air_status(true);
_ekf->set_is_fixed_wing(true);
_sensor_simulator.startAirspeedSensor();
_sensor_simulator._airspeed.setData(airspeed_body(0), airspeed_body(0));
@ -116,6 +117,6 @@ TEST_F(EkfAirspeedTest, testWindVelocityEstimation) @@ -116,6 +117,6 @@ TEST_F(EkfAirspeedTest, testWindVelocityEstimation)
const float expected_height_after_pressure_correction = height_before_pressure_correction -
expected_height_difference;
EXPECT_NEAR(height_after_pressure_correction, expected_height_after_pressure_correction, 1e-3f);
EXPECT_NEAR(height_after_pressure_correction, expected_height_after_pressure_correction, 1e-2f);
}

Loading…
Cancel
Save