mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-27 11:20:35 +08:00
EKF: Improve covariance prediction stability (#795)
* EKF: Improve covariance prediction stability Eliminates collapse of vertical velocity state variance due to rounding errors that can occur under some operating conditions. * EKF: Fix typo * test: Fix initialisation test cases Provide sufficient time for variances to stabilise and fix calculation of reference quaternion for alignment. * test: Allow for accumulated rounding error in IMU sampling test * test: Allow sufficient time for quaternion variances to reduce after initial alignment * test: Increase allowance for tilt alignment delay and inertial nav errors * test: Increase allowance for tilt alignment delay and inertial nav errors * adpat reset velocity test * test: update change indication file * test: Adjust tests to handle alignment time and prediction errors * README.md: Add documentation for change indicator test
This commit is contained in:
@@ -49,7 +49,7 @@ class EkfInitializationTest : public ::testing::Test {
|
||||
SensorSimulator _sensor_simulator;
|
||||
EkfWrapper _ekf_wrapper;
|
||||
|
||||
const float _init_tilt_period = 0.5; // seconds
|
||||
const float _init_tilt_period = 1.0; // seconds
|
||||
|
||||
// GTests is calling this
|
||||
void SetUp() override
|
||||
@@ -155,7 +155,10 @@ TEST_F(EkfInitializationTest, initializeWithTilt)
|
||||
|
||||
TEST_F(EkfInitializationTest, initializeWithPitch90)
|
||||
{
|
||||
const Quatf quat_sim(0.0f, 0.7071068f, 0.0f, 0.7071068f);
|
||||
const float pitch = math::radians(90.0f);
|
||||
const float roll = math::radians(0.0f);
|
||||
const Eulerf euler_angles_sim(roll, pitch, 0.0f);
|
||||
const Quatf quat_sim(euler_angles_sim);
|
||||
|
||||
_sensor_simulator.simulateOrientation(quat_sim);
|
||||
_sensor_simulator.runSeconds(_init_tilt_period);
|
||||
@@ -167,7 +170,10 @@ TEST_F(EkfInitializationTest, initializeWithPitch90)
|
||||
|
||||
TEST_F(EkfInitializationTest, initializeWithRoll90)
|
||||
{
|
||||
const Quatf quat_sim(0.7071068f, 0.7071068f, 0.0f, 0.0f);
|
||||
const float pitch = math::radians(0.0f);
|
||||
const float roll = math::radians(90.0f);
|
||||
const Eulerf euler_angles_sim(roll, pitch, 0.0f);
|
||||
const Quatf quat_sim(euler_angles_sim);
|
||||
|
||||
_sensor_simulator.simulateOrientation(quat_sim);
|
||||
_sensor_simulator.runSeconds(_init_tilt_period);
|
||||
|
||||
Reference in New Issue
Block a user