From 41c8d7e0dd884f7a73983f4d4b6c3c2748e8137c Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 4 Dec 2023 11:15:08 +0100 Subject: [PATCH] replaced one ToDo with another one --- mission/controller/acs/SensorProcessing.cpp | 3 +++ mission/controller/acs/SensorProcessing.h | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mission/controller/acs/SensorProcessing.cpp b/mission/controller/acs/SensorProcessing.cpp index 975b38b1..23388e5f 100644 --- a/mission/controller/acs/SensorProcessing.cpp +++ b/mission/controller/acs/SensorProcessing.cpp @@ -18,6 +18,9 @@ void SensorProcessing::processMgm(const float *mgm0Value, bool mgm0valid, const double magIgrfModel[3] = {0.0, 0.0, 0.0}; bool gpsValid = false; if (gpsDataProcessed->source.value != acs::GpsSource::NONE) { + // There seems to be a bug here, which causes the model vector to drift until infinity, if the + // model class is not initialized new every time. Works for now, but should be investigated. + Igrf13Model igrf13; igrf13.schmidtNormalization(); igrf13.updateCoeffGH(timeAbsolute); igrf13.magFieldComp(gpsDataProcessed->gdLongitude.value, gpsDataProcessed->gcLatitude.value, diff --git a/mission/controller/acs/SensorProcessing.h b/mission/controller/acs/SensorProcessing.h index 7caa29f8..fea0fd01 100644 --- a/mission/controller/acs/SensorProcessing.h +++ b/mission/controller/acs/SensorProcessing.h @@ -35,8 +35,6 @@ class SensorProcessing { static constexpr double ZERO_VEC_D[3] = {0, 0, 0}; static constexpr double ECCENTRICITY_WGS84 = 0.0818195; - Igrf13Model igrf13; - protected: void processMgm(const float *mgm0Value, bool mgm0valid, const float *mgm1Value, bool mgm1valid, const float *mgm2Value, bool mgm2valid, const float *mgm3Value, bool mgm3valid,