AP_DAL: check for zero time in accel/gyro filtering
This commit is contained in:
parent
367c993673
commit
70abf799c3
@ -51,6 +51,10 @@ void AP_DAL_InertialSensor::start_frame()
|
||||
// update filtered gyro and accel
|
||||
void AP_DAL_InertialSensor::update_filtered(uint8_t i)
|
||||
{
|
||||
if (is_positive(_RISI[i].delta_angle_dt)) {
|
||||
gyro_filtered[i] = gyro_filtered[i] * alpha + (_RISI[i].delta_angle/_RISI[i].delta_angle_dt) * (1-alpha);
|
||||
}
|
||||
if (is_positive(_RISI[i].delta_velocity_dt)) {
|
||||
accel_filtered[i] = accel_filtered[i] * alpha + (_RISI[i].delta_velocity/_RISI[i].delta_velocity_dt) * (1-alpha);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user