safeCtrl using MEKF can now be disabled
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
Marius Eggert 2023-04-11 11:19:04 +02:00
parent c66799b24f
commit b6ba2f291a
5 changed files with 8 additions and 3 deletions

View File

@ -173,6 +173,7 @@ void AcsController::performSafe() {
uint8_t safeCtrlStrat = safeCtrl.safeCtrlStrategy(
mgmDataProcessed.mgmVecTot.isValid(), not mekfInvalidFlag,
gyrDataProcessed.gyrVecTot.isValid(), susDataProcessed.susVecTot.isValid(),
acsParameters.safeModeControllerParameters.useMekf,
acsParameters.safeModeControllerParameters.dampingDuringEclipse);
switch (safeCtrlStrat) {
case (acs::SafeModeStrategy::SAFECTRL_ACTIVE_MEKF):

View File

@ -354,6 +354,9 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
parameterWrapper->set(safeModeControllerParameters.angleStartSpin);
break;
case 0xA:
parameterWrapper->set(safeModeControllerParameters.useMekf);
break;
case 0xB:
parameterWrapper->set(safeModeControllerParameters.dampingDuringEclipse);
break;
default:

View File

@ -825,6 +825,7 @@ class AcsParameters : public HasParametersIF {
float angleStartSpin = 20 * M_PI / 180;
uint8_t useMekf = true;
uint8_t dampingDuringEclipse = true;
} safeModeControllerParameters;

View File

@ -11,10 +11,10 @@ SafeCtrl::~SafeCtrl() {}
uint8_t SafeCtrl::safeCtrlStrategy(const bool magFieldValid, const ReturnValue_t mekfValid,
const bool satRotRateValid, const bool sunDirValid,
const uint8_t dampingEnabled) {
const uint8_t mekfEnabled, const uint8_t dampingEnabled) {
if (not magFieldValid) {
return acs::SafeModeStrategy::SAFECTRL_NO_MAG_FIELD_FOR_CONTROL;
} else if (mekfValid) {
} else if (mekfEnabled and mekfValid) {
return acs::SafeModeStrategy::SAFECTRL_ACTIVE_MEKF;
} else if (satRotRateValid and sunDirValid) {
return acs::SafeModeStrategy::SAFECTRL_WITHOUT_MEKF;

View File

@ -14,7 +14,7 @@ class SafeCtrl {
uint8_t safeCtrlStrategy(const bool magFieldValid, const ReturnValue_t mekfValid,
const bool satRotRateValid, const bool sunDirValid,
const uint8_t dampingEnabled);
const uint8_t mekfEnabled, const uint8_t dampingEnabled);
void safeMekf(const double *magFieldB, const double *satRotRateB, const double *sunDirModelI,
const double *quatBI, const double *sunDirRefB, const double satRotRateRef,