we prob need a state machine here
Some checks failed
EIVE/eive-obsw/pipeline/pr-main There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/pr-main There was a failure building this commit
This commit is contained in:
parent
82dd505194
commit
ba6eac505e
@ -66,8 +66,10 @@ enum Source : uint8_t {
|
|||||||
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::ACS_SUBSYSTEM;
|
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::ACS_SUBSYSTEM;
|
||||||
//! [EXPORT] : [COMMENT] The limits for the rotation in safe mode were violated.
|
//! [EXPORT] : [COMMENT] The limits for the rotation in safe mode were violated.
|
||||||
static constexpr Event SAFE_RATE_VIOLATION = MAKE_EVENT(0, severity::MEDIUM);
|
static constexpr Event SAFE_RATE_VIOLATION = MAKE_EVENT(0, severity::MEDIUM);
|
||||||
//! [EXPORT] : [COMMENT] The system has recovered from a safe rate rotation violation.
|
//! [EXPORT] : [COMMENT] The limits for the rotation in pointing mode were violated.
|
||||||
static constexpr Event SAFE_RATE_RECOVERY = MAKE_EVENT(1, severity::MEDIUM);
|
static constexpr Event PTG_RATE_VIOLATION = MAKE_EVENT(10, severity::MEDIUM);
|
||||||
|
//! [EXPORT] : [COMMENT] The system has recovered from a rate rotation violation.
|
||||||
|
static constexpr Event RATE_RECOVERY = MAKE_EVENT(1, severity::MEDIUM);
|
||||||
//! [EXPORT] : [COMMENT] Multiple RWs are invalid, uncommandable and therefore higher ACS modes
|
//! [EXPORT] : [COMMENT] Multiple RWs are invalid, uncommandable and therefore higher ACS modes
|
||||||
//! cannot be maintained.
|
//! cannot be maintained.
|
||||||
static constexpr Event MULTIPLE_RW_INVALID = MAKE_EVENT(2, severity::HIGH);
|
static constexpr Event MULTIPLE_RW_INVALID = MAKE_EVENT(2, severity::HIGH);
|
||||||
|
@ -179,22 +179,38 @@ void AcsController::performAttitudeControl() {
|
|||||||
&susDataProcessed, &attitudeEstimationData, &acsParameters);
|
&susDataProcessed, &attitudeEstimationData, &acsParameters);
|
||||||
|
|
||||||
if (not submode == acs::SafeSubmode::DETUMBLE) {
|
if (not submode == acs::SafeSubmode::DETUMBLE) {
|
||||||
if (acsParameters.safeModeControllerParameters.useMekf) {
|
}
|
||||||
if (mgmDataProcessed.mgmVecTotDerivative.isValid() and
|
|
||||||
VectorOperations<double>::norm(mgmDataProcessed.mgmVecTotDerivative.value,
|
switch (detumbleState) {
|
||||||
3) > // units do not agree
|
case DetumbleState::NO_DETUMBLE:
|
||||||
|
if (fusedRotRateData.rotRateTotal.isValid() and
|
||||||
|
VectorOperations<double>::norm(fusedRotRateData.rotRateTotal.value, 3) >
|
||||||
acsParameters.detumbleParameter.omegaDetumbleStart) {
|
acsParameters.detumbleParameter.omegaDetumbleStart) {
|
||||||
detumbleCounter++;
|
detumbleCounter++;
|
||||||
|
} else if (detumbleCounter > 0) {
|
||||||
|
detumbleCounter -= 1;
|
||||||
}
|
}
|
||||||
} else if (detumbleCounter > 0) {
|
if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) {
|
||||||
detumbleCounter -= 1;
|
if (mode == acs::AcsMode::SAFE) {
|
||||||
}
|
detumbleState = DetumbleState::DETUMBLE_FROM_SAFE;
|
||||||
if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) {
|
break;
|
||||||
|
}
|
||||||
|
detumbleState = DetumbleState::DETUMBLE_FROM_PTG;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DetumbleState::DETUMBLE_FROM_PTG:
|
||||||
|
triggerEvent(acs::PTG_RATE_VIOLATION);
|
||||||
|
break;
|
||||||
|
case DetumbleState::DETUMBLE_FROM_SAFE:
|
||||||
detumbleCounter = 0;
|
detumbleCounter = 0;
|
||||||
// Triggers detumble mode transition in subsystem
|
// Triggers detumble mode transition in subsystem
|
||||||
triggerEvent(acs::SAFE_RATE_VIOLATION);
|
triggerEvent(acs::SAFE_RATE_VIOLATION);
|
||||||
startTransition(mode, acs::SafeSubmode::DETUMBLE); // this does not work
|
startTransition(mode, acs::SafeSubmode::DETUMBLE);
|
||||||
}
|
break;
|
||||||
|
case DetumbleState::IN_DETUMBLE:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
sif::error << "AcsController: Invalid DetumbleState: " << detumbleState << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result != MultiplicativeKalmanFilter::MEKF_RUNNING and
|
if (result != MultiplicativeKalmanFilter::MEKF_RUNNING and
|
||||||
|
@ -101,6 +101,9 @@ class AcsController : public ExtendedControllerBase, public ReceivesParameterMes
|
|||||||
enum class InternalState { STARTUP, INITIAL_DELAY, READY };
|
enum class InternalState { STARTUP, INITIAL_DELAY, READY };
|
||||||
InternalState internalState = InternalState::STARTUP;
|
InternalState internalState = InternalState::STARTUP;
|
||||||
|
|
||||||
|
enum class DetumbleState { NO_DETUMBLE, DETUMBLE_FROM_SAFE, DETUMBLE_FROM_PTG, IN_DETUMBLE };
|
||||||
|
DetumbleState detumbleState = DetumbleState::NO_DETUMBLE;
|
||||||
|
|
||||||
/** Device command IDs */
|
/** Device command IDs */
|
||||||
static const DeviceCommandId_t SOLAR_ARRAY_DEPLOYMENT_SUCCESSFUL = 0x0;
|
static const DeviceCommandId_t SOLAR_ARRAY_DEPLOYMENT_SUCCESSFUL = 0x0;
|
||||||
static const DeviceCommandId_t RESET_MEKF = 0x1;
|
static const DeviceCommandId_t RESET_MEKF = 0x1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user