From eff9116aec3a31d861444c41ca8747045aef9c81 Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 11 Apr 2024 13:57:40 +0200 Subject: [PATCH] ??? --- mission/controller/acs/Guidance.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index 07730e09..2c1b3c63 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -303,9 +303,9 @@ void Guidance::comparePtg(double currentQuat[4], double currentSatRotRate[3], do // First calculate error quaternion between current and target orientation without reference // quaternion double errorQuatWoRef[4] = {0, 0, 0, 0}; - QuaternionOperations::multiply(targetQuat, currentQuat, errorQuatWoRef); + QuaternionOperations::multiply(currentQuat, targetQuat, errorQuatWoRef); // Then add rotation from reference quaternion - QuaternionOperations::multiply(errorQuatWoRef, refQuat, errorQuat); + QuaternionOperations::multiply(refQuat, errorQuatWoRef, errorQuat); // Keep scalar part of quaternion positive if (errorQuat[3] < 0) { VectorOperations::mulScalar(errorQuat, -1, errorQuat, 4);