AP_AHRS: when no accel info available in buffer use current value
this prevents an initialisation error, and is reasonable in flight too Pair-Programmed-With: Paul Riseborough <p_riseborough@live.com.au>
This commit is contained in:
parent
315290029a
commit
b3c1e515dc
@ -476,6 +476,11 @@ Vector3f AP_AHRS_DCM::ra_delayed(uint8_t instance, const Vector3f &ra)
|
||||
// get the old element, and then fill it with the new element
|
||||
Vector3f ret = _ra_delay_buffer[instance];
|
||||
_ra_delay_buffer[instance] = ra;
|
||||
if (ret.is_zero()) {
|
||||
// use the current vector if the previous vector is exactly
|
||||
// zero. This prevents an error on initialisation
|
||||
return ra;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user