mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-27 18:27:05 +08:00
GNSS yaw: add observation jump on ground
Some receivers are initializing to some heading and then resetting to the correct one after a couple of seconds. EKF2 should detect that and reset to the new value
This commit is contained in:
committed by
Mathieu Bresciani
parent
30c7a596af
commit
3fe04a91f6
@@ -213,7 +213,26 @@ TEST_F(EkfGpsHeadingTest, fallBackToMag)
|
|||||||
EXPECT_EQ(_ekf_wrapper.getQuaternionResetCounter(), initial_quat_reset_counter + 1);
|
EXPECT_EQ(_ekf_wrapper.getQuaternionResetCounter(), initial_quat_reset_counter + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(EkfGpsHeadingTest, yaw_jump)
|
TEST_F(EkfGpsHeadingTest, yaw_jump_on_ground)
|
||||||
|
{
|
||||||
|
// GIVEN: the GPS yaw fusion activated
|
||||||
|
float gps_heading = _ekf_wrapper.getYawAngle();
|
||||||
|
_sensor_simulator._gps.setYaw(gps_heading);
|
||||||
|
_sensor_simulator.runSeconds(1);
|
||||||
|
_ekf->set_in_air_status(false);
|
||||||
|
|
||||||
|
// WHEN: the measurement suddenly changes
|
||||||
|
const int initial_quat_reset_counter = _ekf_wrapper.getQuaternionResetCounter();
|
||||||
|
gps_heading = matrix::wrap_pi(_ekf_wrapper.getYawAngle() + math::radians(45.f));
|
||||||
|
_sensor_simulator._gps.setYaw(gps_heading);
|
||||||
|
_sensor_simulator.runSeconds(2);
|
||||||
|
|
||||||
|
// THEN: the fusion should reset
|
||||||
|
EXPECT_TRUE(_ekf_wrapper.isIntendingGpsHeadingFusion());
|
||||||
|
EXPECT_EQ(_ekf_wrapper.getQuaternionResetCounter(), initial_quat_reset_counter + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(EkfGpsHeadingTest, yaw_jump_in_air)
|
||||||
{
|
{
|
||||||
// GIVEN: the GPS yaw fusion activated
|
// GIVEN: the GPS yaw fusion activated
|
||||||
float gps_heading = _ekf_wrapper.getYawAngle();
|
float gps_heading = _ekf_wrapper.getYawAngle();
|
||||||
|
|||||||
Reference in New Issue
Block a user