change gyro & accel dt from float to uint64. This has the benefit of

calculating the estimator timeslip correctly.

Signed-off-by: Nicolae Rosia <nicolae.rosia@gmail.com>
This commit is contained in:
Nicolae Rosia
2017-07-12 17:38:35 +03:00
committed by Lorenz Meier
parent 5618f34f3b
commit 0a22a9c47c
6 changed files with 25 additions and 23 deletions
@@ -1359,7 +1359,7 @@ void AttitudePositionEstimatorEKF::pollData()
_ekf->angRate.y = _sensor_combined.gyro_rad[1];
_ekf->angRate.z = _sensor_combined.gyro_rad[2];
float gyro_dt = _sensor_combined.gyro_integral_dt;
float gyro_dt = _sensor_combined.gyro_integral_dt / 1.e6f;
_ekf->dAngIMU = _ekf->angRate * gyro_dt;
perf_count(_perf_gyro);
@@ -1370,7 +1370,7 @@ void AttitudePositionEstimatorEKF::pollData()
_ekf->accel.y = _sensor_combined.accelerometer_m_s2[1];
_ekf->accel.z = _sensor_combined.accelerometer_m_s2[2];
float accel_dt = _sensor_combined.accelerometer_integral_dt;
float accel_dt = _sensor_combined.accelerometer_integral_dt / 1.e6f;
_ekf->dVelIMU = _ekf->accel * accel_dt;
_last_accel = _sensor_combined.timestamp + _sensor_combined.accelerometer_timestamp_relative;
@@ -1394,8 +1394,8 @@ void AttitudePositionEstimatorEKF::pollData()
// leave this in as long as larger improvements are still being made.
#if 0
float deltaTIntegral = _sensor_combined.gyro_integral_dt;
float deltaTIntAcc = _sensor_combined.accelerometer_integral_dt;
float deltaTIntegral = _sensor_combined.gyro_integral_dt / 1.e6f;
float deltaTIntAcc = _sensor_combined.accelerometer_integral_dt / 1.e6f;
static unsigned dtoverflow5 = 0;
static unsigned dtoverflow10 = 0;