Merge pull request 'MTQ Scaling Bugfix' (#653) from mtq-cmd-bugfix into v2.1.0-dev
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

Reviewed-on: #653
This commit is contained in:
Robin Müller 2023-05-30 09:25:24 +02:00
commit fe34f69abe
2 changed files with 3 additions and 1 deletions

View File

@ -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

View File

@ -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<double>::maxAbsValue(dipolMomentActuatorDouble, 3, &maxIdx);
double maxAbsValue = abs(dipolMomentActuatorDouble[maxIdx]);
double maxAbsValue = std::abs(dipolMomentActuatorDouble[maxIdx]);
if (maxAbsValue > maxDipol) {
double scalingFactor = maxDipol / maxAbsValue;
VectorOperations<double>::mulScalar(dipolMomentActuatorDouble, scalingFactor,