EKF: Add a parameter to enable setting of a minimum buffer length to handle large sensor timing jitter

This commit is contained in:
Paul Riseborough
2017-05-26 21:29:11 +10:00
parent a17879ab91
commit 16c7041f4a
2 changed files with 4 additions and 2 deletions
+3 -2
View File
@@ -350,13 +350,14 @@ void EstimatorInterface::setExtVisionData(uint64_t time_usec, ext_vision_message
bool EstimatorInterface::initialise_interface(uint64_t timestamp)
{
// find the maximum time delay required to compensate for
// find the maximum time delay the buffers are required to handle
uint16_t max_time_delay_ms = math::max(_params.mag_delay_ms,
math::max(_params.range_delay_ms,
math::max(_params.gps_delay_ms,
math::max(_params.flow_delay_ms,
math::max(_params.ev_delay_ms,
math::max(_params.airspeed_delay_ms, _params.baro_delay_ms))))));
math::max(_params.min_delay_ms,
math::max(_params.airspeed_delay_ms, _params.baro_delay_ms)))))));
// calculate the IMU buffer length required to accomodate the maximum delay with some allowance for jitter
_imu_buffer_length = (max_time_delay_ms / FILTER_UPDATE_PERIOD_MS) + 1;