vehicle_status_flags: cleanup message, move non-failsafe flags to vehicle_status

This commit is contained in:
Beat Küng
2022-10-11 22:31:20 -04:00
committed by Daniel Agar
parent ae6377dfa0
commit e4bb219d10
30 changed files with 325 additions and 259 deletions
@@ -101,6 +101,16 @@ void MagBiasEstimator::Run()
ScheduleOnInterval(20_ms);
}
}
bool system_calibrating = vehicle_status.calibration_enabled;
if (system_calibrating != _system_calibrating) {
_system_calibrating = system_calibrating;
for (auto &reset : _reset_field_estimator) {
reset = true;
}
}
}
}
@@ -130,22 +140,6 @@ void MagBiasEstimator::Run()
}
}
if (_vehicle_status_flags_sub.updated()) {
vehicle_status_flags_s vehicle_status_flags;
if (_vehicle_status_flags_sub.copy(&vehicle_status_flags)) {
bool system_calibrating = vehicle_status_flags.calibration_enabled;
if (system_calibrating != _system_calibrating) {
_system_calibrating = system_calibrating;
for (auto &reset : _reset_field_estimator) {
reset = true;
}
}
}
}
// do nothing during regular sensor calibration
if (_system_calibrating) {
return;