use enum instead of rtval to enable easier tm generation
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
This commit is contained in:
@ -13,18 +13,18 @@ SafeCtrl::SafeCtrl(AcsParameters *acsParameters_) { acsParameters = acsParameter
|
||||
|
||||
SafeCtrl::~SafeCtrl() {}
|
||||
|
||||
ReturnValue_t SafeCtrl::safeCtrlStrategy(const bool magFieldValid, const ReturnValue_t mekfValid,
|
||||
const bool satRotRateValid, const bool sunDirValid) {
|
||||
uint8_t SafeCtrl::safeCtrlStrategy(const bool magFieldValid, const ReturnValue_t mekfValid,
|
||||
const bool satRotRateValid, const bool sunDirValid) {
|
||||
if (not magFieldValid) {
|
||||
return SAFECTRL_NO_MAG_FIELD_FOR_CONTROL;
|
||||
return SafeModeStrategy::SAFECTRL_NO_MAG_FIELD_FOR_CONTROL;
|
||||
} else if (mekfValid) {
|
||||
return SAFECTRL_USE_MEKF;
|
||||
return SafeModeStrategy::SAFECTRL_USE_MEKF;
|
||||
} else if (satRotRateValid and sunDirValid) {
|
||||
return SAFECTRL_USE_NONMEKF;
|
||||
return SafeModeStrategy::SAFECTRL_USE_NONMEKF;
|
||||
} else if (satRotRateValid and not sunDirValid) {
|
||||
return SAFECTRL_USE_DAMPING;
|
||||
return SafeModeStrategy::SAFECTRL_USE_DAMPING;
|
||||
} else {
|
||||
return SAFECTRL_NO_SENSORS_FOR_CONTROL;
|
||||
return SafeModeStrategy::SAFECTRL_NO_SENSORS_FOR_CONTROL;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,8 +22,17 @@ class SafeCtrl {
|
||||
static constexpr ReturnValue_t SAFECTRL_NO_SENSORS_FOR_CONTROL =
|
||||
returnvalue::makeCode(IF_SAFE_ID, 6);
|
||||
|
||||
ReturnValue_t safeCtrlStrategy(const bool magFieldValid, const ReturnValue_t mekfValid,
|
||||
const bool satRotRateValid, const bool sunDirValid);
|
||||
enum SafeModeStrategy : uint8_t {
|
||||
SAFECTRL_OFF = 0,
|
||||
SAFECTRL_NO_MAG_FIELD_FOR_CONTROL = 1,
|
||||
SAFECTRL_NO_SENSORS_FOR_CONTROL = 2,
|
||||
SAFECTRL_USE_MEKF = 10,
|
||||
SAFECTRL_USE_NONMEKF = 11,
|
||||
SAFECTRL_USE_DAMPING = 12,
|
||||
};
|
||||
|
||||
uint8_t safeCtrlStrategy(const bool magFieldValid, const ReturnValue_t mekfValid,
|
||||
const bool satRotRateValid, const bool sunDirValid);
|
||||
|
||||
void safeMekf(const double *magFieldB, const double *satRotRateB, const double *sunDirModelI,
|
||||
const double *quatBI, const double *sunDirRefB, const double satRotRateRef,
|
||||
|
Reference in New Issue
Block a user