mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 20:33:34 +08:00
EKF: Fix use of incorrect timestamp
This was incorrectly using the IMU (1/250 sec) timestamp instead of the EKF (1/100 sec) value. The corresponding accelerometer limit has been made a parameter and adjusted to match previous behaviour.
This commit is contained in:
committed by
Lorenz Meier
parent
879ad1fd2c
commit
cf31945038
@@ -269,6 +269,9 @@ struct parameters {
|
|||||||
float vel_Tau; // velocity state correction time constant (1/sec)
|
float vel_Tau; // velocity state correction time constant (1/sec)
|
||||||
float pos_Tau; // postion state correction time constant (1/sec)
|
float pos_Tau; // postion state correction time constant (1/sec)
|
||||||
|
|
||||||
|
// state limits
|
||||||
|
float acc_bias_lim; // maximum accel bias magnitude (m/s/s)
|
||||||
|
|
||||||
unsigned no_gps_timeout_max; // maximum time we allow dead reckoning while both gps position and velocity measurements are being
|
unsigned no_gps_timeout_max; // maximum time we allow dead reckoning while both gps position and velocity measurements are being
|
||||||
// rejected
|
// rejected
|
||||||
|
|
||||||
@@ -373,6 +376,9 @@ struct parameters {
|
|||||||
vel_Tau = 0.25f;
|
vel_Tau = 0.25f;
|
||||||
pos_Tau = 0.25f;
|
pos_Tau = 0.25f;
|
||||||
|
|
||||||
|
// state limiting
|
||||||
|
acc_bias_lim = 0.4f;
|
||||||
|
|
||||||
no_gps_timeout_max = 7e6; // maximum seven seconds of dead reckoning time for gps
|
no_gps_timeout_max = 7e6; // maximum seven seconds of dead reckoning time for gps
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -535,11 +535,11 @@ void Ekf::constrainStates()
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
_state.gyro_bias(i) = math::constrain(_state.gyro_bias(i), -0.349066f * _dt_imu_avg, 0.349066f * _dt_imu_avg);
|
_state.gyro_bias(i) = math::constrain(_state.gyro_bias(i), -0.349066f * _dt_ekf_avg, 0.349066f * _dt_ekf_avg);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
_state.accel_bias(i) = math::constrain(_state.accel_bias(i), -1.0f * _dt_imu_avg, 1.0f * _dt_imu_avg);
|
_state.accel_bias(i) = math::constrain(_state.accel_bias(i), -_params.acc_bias_lim * _dt_ekf_avg, _params.acc_bias_lim * _dt_ekf_avg);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user