From 4faf00de942d710f637ed4a4c2d2efa7934c12c1 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Thu, 3 Nov 2022 14:23:06 +0100 Subject: [PATCH] converted MTQ MGM readings from nT to uT --- mission/controller/acs/SensorProcessing.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mission/controller/acs/SensorProcessing.cpp b/mission/controller/acs/SensorProcessing.cpp index 1baa4007..bb445485 100644 --- a/mission/controller/acs/SensorProcessing.cpp +++ b/mission/controller/acs/SensorProcessing.cpp @@ -102,8 +102,10 @@ void SensorProcessing::processMgm(const float *mgm0Value, bool mgm0valid, const } } if (mgm4valid) { - VectorOperations::subtract(mgm4Value, mgmParameters->mgm4hardIronOffset, mgm4ValueNoBias, - 3); + float mgm4ValueNT[3]; + VectorOperations::mulScalar(mgm4Value, 1e3, mgm4ValueNT, 3); // uT to nT + VectorOperations::subtract(mgm4ValueNT, mgmParameters->mgm4hardIronOffset, + mgm4ValueNoBias, 3); MatrixOperations::multiply(mgmParameters->mgm4softIronInverse[0], mgm4ValueNoBias, mgm4ValueCalib, 3, 3, 1); MatrixOperations::multiply(mgmParameters->mgm4orientationMatrix[0], mgm4ValueCalib,