mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-26 09:00:35 +08:00
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:
committed by
Lorenz Meier
parent
5618f34f3b
commit
0a22a9c47c
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user