ekf2: enable multiple height sources fusion

Instead of having a single height source fused into the EKF and the
other ones "waiting" for a failure or the primary sensor, fuse all
sources in EKF2 at the same time. To prevent the sources from fighting against each
other, the "primary" source is set as reference and the other ones are
running a bias estimator in order to make all the secondary height
sources converge to the primary one.

If the reference isn't available, another one is automatically selected
from a priority list. This secondary reference keeps its current bias
estimate but stops updating it in order to be the new reference as close
as possible to the primary one.
This commit is contained in:
bresch
2022-05-19 16:59:35 +02:00
committed by Daniel Agar
parent f5f31006a0
commit 8fd79688c0
17 changed files with 573 additions and 456 deletions
+2 -2
View File
@@ -437,7 +437,7 @@ bool EstimatorInterface::initialise_interface(uint64_t timestamp)
float max_time_delay_ms = math::max((float)_params.sensor_interval_max_ms, _params.auxvel_delay_ms);
// using baro
if (_params.vdist_sensor_type == 0) {
if (_params.fusion_mode & SensorFusionMask::USE_BARO_HGT) {
max_time_delay_ms = math::max(_params.baro_delay_ms, max_time_delay_ms);
}
@@ -452,7 +452,7 @@ bool EstimatorInterface::initialise_interface(uint64_t timestamp)
}
// range aid or range height
if (_params.range_aid || (_params.vdist_sensor_type == VerticalHeightSensor::RANGE)) {
if (_params.range_aid || (_params.fusion_mode & SensorFusionMask::USE_RNG_HGT)) {
max_time_delay_ms = math::max(_params.range_delay_ms, max_time_delay_ms);
}