mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 00:11:36 +08:00
EKF: Add a parameter to enable setting of a minimum buffer length to handle large sensor timing jitter
This commit is contained in:
@@ -186,6 +186,7 @@ struct parameters {
|
|||||||
int32_t sensor_interval_min_ms{20}; // minimum time of arrival difference between non IMU sensor updates. Sets the size of the observation buffers.
|
int32_t sensor_interval_min_ms{20}; // minimum time of arrival difference between non IMU sensor updates. Sets the size of the observation buffers.
|
||||||
|
|
||||||
// measurement time delays
|
// measurement time delays
|
||||||
|
float min_delay_ms{0.0f}; // used to a set a minimum buffer length independent of specified sensor delays
|
||||||
float mag_delay_ms{0.0f}; // magnetometer measurement delay relative to the IMU (msec)
|
float mag_delay_ms{0.0f}; // magnetometer measurement delay relative to the IMU (msec)
|
||||||
float baro_delay_ms{0.0f}; // barometer height measurement delay relative to the IMU (msec)
|
float baro_delay_ms{0.0f}; // barometer height measurement delay relative to the IMU (msec)
|
||||||
float gps_delay_ms{110.0f}; // GPS measurement delay relative to the IMU (msec)
|
float gps_delay_ms{110.0f}; // GPS measurement delay relative to the IMU (msec)
|
||||||
|
|||||||
@@ -350,13 +350,14 @@ void EstimatorInterface::setExtVisionData(uint64_t time_usec, ext_vision_message
|
|||||||
|
|
||||||
bool EstimatorInterface::initialise_interface(uint64_t timestamp)
|
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,
|
uint16_t max_time_delay_ms = math::max(_params.mag_delay_ms,
|
||||||
math::max(_params.range_delay_ms,
|
math::max(_params.range_delay_ms,
|
||||||
math::max(_params.gps_delay_ms,
|
math::max(_params.gps_delay_ms,
|
||||||
math::max(_params.flow_delay_ms,
|
math::max(_params.flow_delay_ms,
|
||||||
math::max(_params.ev_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
|
// 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;
|
_imu_buffer_length = (max_time_delay_ms / FILTER_UPDATE_PERIOD_MS) + 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user