mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-29 03:30:36 +08:00
GNSS yaw tests: adjust timing
the starting condition needs more than 1 sample to determine if the data comes regularly the timeout on "no data" is defined by the fusion reset timeout parameter (7 seconds)
This commit is contained in:
@@ -105,7 +105,7 @@ TEST_F(EkfGpsHeadingTest, fusionStartWithReset)
|
|||||||
_sensor_simulator._gps.setYaw(gps_heading);
|
_sensor_simulator._gps.setYaw(gps_heading);
|
||||||
_ekf_wrapper.enableGpsHeadingFusion();
|
_ekf_wrapper.enableGpsHeadingFusion();
|
||||||
const int initial_quat_reset_counter = _ekf_wrapper.getQuaternionResetCounter();
|
const int initial_quat_reset_counter = _ekf_wrapper.getQuaternionResetCounter();
|
||||||
_sensor_simulator.runSeconds(0.2);
|
_sensor_simulator.runSeconds(0.4);
|
||||||
|
|
||||||
// THEN: GPS heading fusion should have started;
|
// THEN: GPS heading fusion should have started;
|
||||||
EXPECT_TRUE(_ekf_wrapper.isIntendingGpsHeadingFusion());
|
EXPECT_TRUE(_ekf_wrapper.isIntendingGpsHeadingFusion());
|
||||||
@@ -203,7 +203,7 @@ TEST_F(EkfGpsHeadingTest, fallBackToMag)
|
|||||||
// BUT WHEN: the GPS yaw is suddenly invalid
|
// BUT WHEN: the GPS yaw is suddenly invalid
|
||||||
gps_heading = NAN;
|
gps_heading = NAN;
|
||||||
_sensor_simulator._gps.setYaw(gps_heading);
|
_sensor_simulator._gps.setYaw(gps_heading);
|
||||||
_sensor_simulator.runSeconds(6);
|
_sensor_simulator.runSeconds(7.5);
|
||||||
|
|
||||||
// THEN: after a few seconds, the fusion should stop and
|
// THEN: after a few seconds, the fusion should stop and
|
||||||
// the estimator should fall back to mag fusion
|
// the estimator should fall back to mag fusion
|
||||||
|
|||||||
Reference in New Issue
Block a user