From 335394b8639814edee4b107e087482ac46cd9cd9 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 26 May 2023 13:51:24 +0200 Subject: [PATCH 1/2] fixed use of c abs which will truncate the value --- mission/controller/acs/ActuatorCmd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/controller/acs/ActuatorCmd.cpp b/mission/controller/acs/ActuatorCmd.cpp index d2fe2d65..a8fab6a4 100644 --- a/mission/controller/acs/ActuatorCmd.cpp +++ b/mission/controller/acs/ActuatorCmd.cpp @@ -61,7 +61,7 @@ void ActuatorCmd::cmdDipolMtq(const double *dipolMoment, int16_t *dipolMomentAct // Scaling along largest element if dipol exceeds maximum uint8_t maxIdx = 0; VectorOperations::maxAbsValue(dipolMomentActuatorDouble, 3, &maxIdx); - double maxAbsValue = abs(dipolMomentActuatorDouble[maxIdx]); + double maxAbsValue = std::abs(dipolMomentActuatorDouble[maxIdx]); if (maxAbsValue > maxDipol) { double scalingFactor = maxDipol / maxAbsValue; VectorOperations::mulScalar(dipolMomentActuatorDouble, scalingFactor, -- 2.43.0 From a7c6cd017d80b88bfe64418d6f00b6634dc5c264 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 26 May 2023 13:53:46 +0200 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39f6a0a8..1dfeed76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -84,6 +84,8 @@ will consitute of a breaking change warranting a new major release: - When a PUS parsing error occured while parsing a TM store file, the dump completion procedure was always executed. - Some smaller logic fixes in the TM store base class +- Fixed usage of C `abs` instead of C++ `std::abs`, which results in MTQ commands not being + scaled correctly between 1Am² and 0.2Am². # [v2.0.5] 2023-05-11 -- 2.43.0