From c4c5a2f201159806db891dc97be1aa02e54b38c9 Mon Sep 17 00:00:00 2001 From: bresch Date: Mon, 31 Jan 2022 14:35:26 +0100 Subject: [PATCH] ekf_test: fix terrain unit tests --- src/modules/ekf2/test/test_EKF_terrain_estimator.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/ekf2/test/test_EKF_terrain_estimator.cpp b/src/modules/ekf2/test/test_EKF_terrain_estimator.cpp index 0eed5cb7f6..1c993e78d2 100644 --- a/src/modules/ekf2/test/test_EKF_terrain_estimator.cpp +++ b/src/modules/ekf2/test/test_EKF_terrain_estimator.cpp @@ -114,7 +114,7 @@ TEST_F(EkfTerrainTest, setFlowAndRangeTerrainFusion) EXPECT_TRUE(_ekf_wrapper.isIntendingTerrainRngFusion()); EXPECT_FALSE(_ekf_wrapper.isIntendingTerrainFlowFusion()); const float estimated_distance_to_ground = _ekf->getTerrainVertPos(); - EXPECT_NEAR(estimated_distance_to_ground, simulated_distance_to_ground, 1e-4); + EXPECT_NEAR(estimated_distance_to_ground, simulated_distance_to_ground, 1e-3f); // WHEN: rng fusion is disabled _ekf_wrapper.disableTerrainRngFusion(); @@ -138,6 +138,7 @@ TEST_F(EkfTerrainTest, testFlowForTerrainFusion) // GIVEN: flow for terrain enabled but not range finder _ekf_wrapper.enableTerrainFlowFusion(); _ekf_wrapper.disableTerrainRngFusion(); + _ekf_wrapper.enableFlowFusion(); // WHEN: the sensors do not agree const float rng_height = 1.f;