WindEstimator: added support for pre-set airspeed scale factor

Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
RomanBapst
2019-08-08 09:15:25 +02:00
committed by Beat Küng
parent a7d9c73d4d
commit 62fa464e4d
2 changed files with 10 additions and 7 deletions
+5 -5
View File
@@ -330,15 +330,15 @@ WindEstimator::run_sanity_checks()
return;
}
// constrain airspeed scale factor, negative values physically do not make sense
if (_scale_estimation_on) {
// check if we should inhibit learning of airspeed scale factor and rather use a pre-set value.
// airspeed scale factor errors arise from sensor installation which does not change and only needs
// to be computed once for a perticular installation.
if (_enforced_airspeed_scale < 0) {
_state(tas) = math::max(0.0f, _state(tas));
} else {
_state(tas) = 1.0f;
_state(tas) = _enforced_airspeed_scale;
}
// attain symmetry
for (unsigned row = 0; row < 3; row++) {
for (unsigned column = 0; column < row; column++) {