ekf2 unit-tests: adapt to strict GNSS checks on ground

This commit is contained in:
Marco Hauswirth
2026-02-06 11:43:05 +01:00
committed by Matthias Grob
parent f9cdd095b8
commit c4535683a7
2 changed files with 7 additions and 2 deletions
+2 -1
View File
@@ -281,7 +281,8 @@ TEST_F(EkfGpsHeadingTest, yawJmpOnGround)
EXPECT_EQ(_ekf_wrapper.getQuaternionResetCounter(), initial_quat_reset_counter + 1);
// AND THEN: restart GNSS yaw fusion
_sensor_simulator.runSeconds(5);
// The strict checks on ground require min_health_time_us (10s) to pass again.
_sensor_simulator.runSeconds(11);
EXPECT_TRUE(_ekf_wrapper.isIntendingGpsHeadingFusion());
EXPECT_EQ(_ekf_wrapper.getQuaternionResetCounter(), initial_quat_reset_counter + 2);
EXPECT_LT(fabsf(matrix::wrap_pi(_ekf_wrapper.getYawAngle() - gps_heading)), math::radians(1.f));
+5 -1
View File
@@ -81,6 +81,10 @@ TEST_F(EkfGpsTest, gpsTimeout)
// GIVEN:EKF that fuses GPS
EXPECT_TRUE(_ekf_wrapper.isIntendingGpsFusion());
// In air the simplified checks are used which do not include satellite count
_ekf->set_in_air_status(true);
_ekf->set_vehicle_at_rest(false);
// WHEN: the number of satellites drops below the minimum
_sensor_simulator._gps.setNumberOfSatellites(3);
@@ -174,7 +178,7 @@ TEST_F(EkfGpsTest, resetToGpsPosition)
const Vector3f simulated_position_change(20.0f, -1.0f, 0.f);
_sensor_simulator._gps.stepHorizontalPositionByMeters(
Vector2f(simulated_position_change));
_sensor_simulator.runSeconds(6);
_sensor_simulator.runSeconds(11);
// THEN: a reset to the new GPS position should be done
const Vector3f estimated_position = _ekf->getPosition();