mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-09 09:28:31 -04:00
AP_NavEKF3: Correctly initialise dtIMUavg time step and apply LPF
This commit is contained in:
parent
4ce0a8e24e
commit
7abf9997e6
@ -302,8 +302,8 @@ void NavEKF3_core::readIMUData()
|
||||
{
|
||||
const AP_InertialSensor &ins = _ahrs->get_ins();
|
||||
|
||||
// average IMU sampling rate
|
||||
dtIMUavg = ins.get_loop_delta_t();
|
||||
// calculate an averaged IMU update rate using a spike and lowpass filter combination
|
||||
dtIMUavg = 0.02f * constrain_float(ins.get_loop_delta_t(),0.5f * dtIMUavg, 2.0f * dtIMUavg) + 0.98f * dtIMUavg;
|
||||
|
||||
// the imu sample time is used as a common time reference throughout the filter
|
||||
imuSampleTime_ms = frontend->imuSampleTime_us / 1000;
|
||||
|
@ -200,7 +200,7 @@ void NavEKF3_core::InitialiseVariables()
|
||||
badIMUdata = false;
|
||||
finalInflightYawInit = false;
|
||||
finalInflightMagInit = false;
|
||||
dtIMUavg = 0.0025f;
|
||||
dtIMUavg = ins.get_loop_delta_t();
|
||||
dtEkfAvg = EKF_TARGET_DT;
|
||||
dt = 0;
|
||||
velDotNEDfilt.zero();
|
||||
|
Loading…
Reference in New Issue
Block a user