From acc50ca7aae7e75a02aef027d25b8c4548e36615 Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 3 Aug 2023 10:09:43 +0200 Subject: [PATCH] fused rotation rate calculation during eclipse can be disabled --- mission/controller/acs/AcsParameters.cpp | 3 +++ mission/controller/acs/AcsParameters.h | 1 + mission/controller/acs/FusedRotationEstimation.cpp | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mission/controller/acs/AcsParameters.cpp b/mission/controller/acs/AcsParameters.cpp index 9b0755cd..bcb1a7f4 100644 --- a/mission/controller/acs/AcsParameters.cpp +++ b/mission/controller/acs/AcsParameters.cpp @@ -26,6 +26,9 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, case 0x1: parameterWrapper->set(onBoardParams.mekfViolationTimer); break; + case 0x2: + parameterWrapper->set(onBoardParams.fusedRateSafeDuringEclipse); + break; default: return INVALID_IDENTIFIER_ID; } diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index cdaf4899..0f2b53c9 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -19,6 +19,7 @@ class AcsParameters : public HasParametersIF { struct OnBoardParams { double sampleTime = 0.4; // [s] uint16_t mekfViolationTimer = 750; + uint8_t fusedRateSafeDuringEclipse = true; } onBoardParams; struct InertiaEIVE { diff --git a/mission/controller/acs/FusedRotationEstimation.cpp b/mission/controller/acs/FusedRotationEstimation.cpp index 6653f4d1..a818536f 100644 --- a/mission/controller/acs/FusedRotationEstimation.cpp +++ b/mission/controller/acs/FusedRotationEstimation.cpp @@ -83,7 +83,8 @@ void FusedRotationEstimation::estimateFusedRotationRateSafe( void FusedRotationEstimation::estimateFusedRotationRateEclipse( acsctrl::GyrDataProcessed *gyrDataProcessed, acsctrl::FusedRotRateData *fusedRotRateData) { - if (not gyrDataProcessed->gyrVecTot.isValid() or + if (not acsParameters->onBoardParams.fusedRateSafeDuringEclipse or + not gyrDataProcessed->gyrVecTot.isValid() or VectorOperations::norm(fusedRotRateData->rotRateTotal.value, 3) == 0) { { PoolReadGuard pg(fusedRotRateData);