Skip to content
Snippets Groups Projects
Commit b3c1e515 authored by Andrew Tridgell's avatar Andrew Tridgell
Browse files

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>
parent 31529002
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment