From 7c10f4b1cdd345733671a1ffee6b148637096f55 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Mon, 29 Apr 2024 10:24:53 +0200 Subject: [PATCH 1/3] fix calculation of target rotation --- mission/controller/acs/Guidance.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index 2c1b3c63..1700d265 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -232,6 +232,7 @@ void Guidance::targetRotationRate(const double timeDelta, double quatIX[4], doub } if (timeDelta != 0.0) { QuaternionOperations::rotationFromQuaternions(quatIX, quatIXprev, timeDelta, refSatRate); + VectorOperations::mulScalar(refSatRate, -1, refSatRate, 3); } else { std::memcpy(refSatRate, ZERO_VEC3, 3 * sizeof(double)); } @@ -315,9 +316,9 @@ void Guidance::comparePtg(double currentQuat[4], double currentSatRotRate[3], do // Calculate error satellite rotational rate // Convert target rotational rate into body RF - double errorQuatInv[4] = {0, 0, 0, 0}, targetSatRotRateB[3] = {0, 0, 0}; - QuaternionOperations::inverse(errorQuat, errorQuatInv); - QuaternionOperations::multiplyVector(errorQuatInv, targetSatRotRate, targetSatRotRateB); + double targetSatRotRateB[3] = {0, 0, 0}; + QuaternionOperations::multiplyVector(currentQuat, targetSatRotRate, targetSatRotRateB); + VectorOperations::copy(targetSatRotRateB, targetSatRotRateB, 3); // Combine the target and reference satellite rotational rates double combinedRefSatRotRate[3] = {0, 0, 0}; VectorOperations::add(targetSatRotRate, refSatRotRate, combinedRefSatRotRate, 3); -- 2.43.0 From 26341743a8f34a8e8607b0191256997fbc4e9062 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Mon, 29 Apr 2024 10:26:12 +0200 Subject: [PATCH 2/3] changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d58be5b2..ae07d8ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,8 +16,14 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +## Fixed + +- Fixed calculation for target rotation rate during pointing modes. + # [v7.8.1] 2024-04-11 +## Fixed + - Reverted fix for wrong order in quaternion multiplication for computation of the error quaternion. # [v7.8.0] 2024-04-10 -- 2.43.0 From 75070b5e661154f34202f86e4d1bbe899c835a2f Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Mon, 29 Apr 2024 10:42:52 +0200 Subject: [PATCH 3/3] i am smart --- mission/controller/acs/Guidance.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index 1700d265..7d931565 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -318,7 +318,7 @@ void Guidance::comparePtg(double currentQuat[4], double currentSatRotRate[3], do // Convert target rotational rate into body RF double targetSatRotRateB[3] = {0, 0, 0}; QuaternionOperations::multiplyVector(currentQuat, targetSatRotRate, targetSatRotRateB); - VectorOperations::copy(targetSatRotRateB, targetSatRotRateB, 3); + VectorOperations::copy(targetSatRotRateB, targetSatRotRate, 3); // Combine the target and reference satellite rotational rates double combinedRefSatRotRate[3] = {0, 0, 0}; VectorOperations::add(targetSatRotRate, refSatRotRate, combinedRefSatRotRate, 3); -- 2.43.0