From 3927c183def7eaf50d526124c96ba700f9ae4695 Mon Sep 17 00:00:00 2001 From: bresch Date: Fri, 22 Oct 2021 17:21:54 +0200 Subject: [PATCH] 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 --- src/modules/ekf2/test/test_EKF_airspeed.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/ekf2/test/test_EKF_airspeed.cpp b/src/modules/ekf2/test/test_EKF_airspeed.cpp index 0480267107..4d60275542 100644 --- a/src/modules/ekf2/test/test_EKF_airspeed.cpp +++ b/src/modules/ekf2/test/test_EKF_airspeed.cpp @@ -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) 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); }