diff --git a/CHANGELOG.md b/CHANGELOG.md index 5220985e..db8ff779 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,9 @@ will consitute of a breaking change warranting a new major release: - `PDEC_CONFIG_CORRUPTED` event now actually contains the readback instead of the expected config +- Magnetic field vector was not calculated if only MGM4 was available, but still written to + the dataset. This would result in a NaN vector. Allowance for usage of MGM4 is now checked + before entering calculation. # [v6.4.0] 2023-08-16 diff --git a/mission/controller/acs/SensorProcessing.cpp b/mission/controller/acs/SensorProcessing.cpp index 686a2fcf..4405790c 100644 --- a/mission/controller/acs/SensorProcessing.cpp +++ b/mission/controller/acs/SensorProcessing.cpp @@ -25,7 +25,8 @@ void SensorProcessing::processMgm(const float *mgm0Value, bool mgm0valid, const gpsDataProcessed->altitude.value, timeOfMgmMeasurement, magIgrfModel); gpsValid = true; } - if (!mgm0valid && !mgm1valid && !mgm2valid && !mgm3valid && !mgm4valid) { + if (not mgm0valid and not mgm1valid and not mgm2valid and not mgm3valid and + (not mgm4valid or not mgmParameters->useMgm4)) { { PoolReadGuard pg(mgmDataProcessed); if (pg.getReadResult() == returnvalue::OK) {