Merge pull request 'Fix for MAG Field Vector calculation' (#786) from mgm4-disabled-fix into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

Reviewed-on: #786
This commit is contained in:
Marius Eggert 2023-08-21 14:51:29 +02:00
commit 5060de1f6d
2 changed files with 5 additions and 1 deletions

View File

@ -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 - `PDEC_CONFIG_CORRUPTED` event now actually contains the readback instead of the expected
config 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 # [v6.4.0] 2023-08-16

View File

@ -25,7 +25,8 @@ void SensorProcessing::processMgm(const float *mgm0Value, bool mgm0valid, const
gpsDataProcessed->altitude.value, timeOfMgmMeasurement, magIgrfModel); gpsDataProcessed->altitude.value, timeOfMgmMeasurement, magIgrfModel);
gpsValid = true; 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); PoolReadGuard pg(mgmDataProcessed);
if (pg.getReadResult() == returnvalue::OK) { if (pg.getReadResult() == returnvalue::OK) {