cleanup
This commit is contained in:
parent
57b01a5d2c
commit
205a672680
@ -37,9 +37,6 @@ enum commonClassIds : uint8_t {
|
|||||||
SUPV_RETURN_VALUES_IF, // SPVRTVIF
|
SUPV_RETURN_VALUES_IF, // SPVRTVIF
|
||||||
ACS_CTRL, // ACSCTRL
|
ACS_CTRL, // ACSCTRL
|
||||||
ACS_MEKF, // ACSMEKF
|
ACS_MEKF, // ACSMEKF
|
||||||
ACS_SAFE, // ACSSAF
|
|
||||||
ACS_PTG, // ACSPTG
|
|
||||||
ACS_DETUMBLE, // ACSDTB
|
|
||||||
SD_CARD_MANAGER, // SDMA
|
SD_CARD_MANAGER, // SDMA
|
||||||
LOCAL_PARAM_HANDLER, // LPH
|
LOCAL_PARAM_HANDLER, // LPH
|
||||||
PERSISTENT_TM_STORE, // PTM
|
PERSISTENT_TM_STORE, // PTM
|
||||||
|
@ -24,9 +24,6 @@ class PtgCtrl {
|
|||||||
PtgCtrl(AcsParameters *acsParameters_);
|
PtgCtrl(AcsParameters *acsParameters_);
|
||||||
virtual ~PtgCtrl();
|
virtual ~PtgCtrl();
|
||||||
|
|
||||||
static const uint8_t INTERFACE_ID = CLASS_ID::ACS_PTG;
|
|
||||||
static const ReturnValue_t PTGCTRL_MEKF_INPUT_INVALID = MAKE_RETURN_CODE(0x01);
|
|
||||||
|
|
||||||
/* @brief: Calculates the needed torque for the pointing control mechanism
|
/* @brief: Calculates the needed torque for the pointing control mechanism
|
||||||
*/
|
*/
|
||||||
void ptgLaw(AcsParameters::PointingLawParameters *pointingLawParameters, const double *qError,
|
void ptgLaw(AcsParameters::PointingLawParameters *pointingLawParameters, const double *qError,
|
||||||
|
@ -1,14 +1,10 @@
|
|||||||
#include "SafeCtrl.h"
|
#include "SafeCtrl.h"
|
||||||
|
|
||||||
#include <fsfw/globalfunctions/constants.h>
|
|
||||||
#include <fsfw/globalfunctions/math/MatrixOperations.h>
|
#include <fsfw/globalfunctions/math/MatrixOperations.h>
|
||||||
#include <fsfw/globalfunctions/math/QuaternionOperations.h>
|
#include <fsfw/globalfunctions/math/QuaternionOperations.h>
|
||||||
#include <fsfw/globalfunctions/math/VectorOperations.h>
|
#include <fsfw/globalfunctions/math/VectorOperations.h>
|
||||||
#include <fsfw/globalfunctions/sign.h>
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include "../util/MathOperations.h"
|
|
||||||
|
|
||||||
SafeCtrl::SafeCtrl(AcsParameters *acsParameters_) { acsParameters = acsParameters_; }
|
SafeCtrl::SafeCtrl(AcsParameters *acsParameters_) { acsParameters = acsParameters_; }
|
||||||
|
|
||||||
SafeCtrl::~SafeCtrl() {}
|
SafeCtrl::~SafeCtrl() {}
|
||||||
@ -16,15 +12,15 @@ SafeCtrl::~SafeCtrl() {}
|
|||||||
uint8_t SafeCtrl::safeCtrlStrategy(const bool magFieldValid, const ReturnValue_t mekfValid,
|
uint8_t SafeCtrl::safeCtrlStrategy(const bool magFieldValid, const ReturnValue_t mekfValid,
|
||||||
const bool satRotRateValid, const bool sunDirValid) {
|
const bool satRotRateValid, const bool sunDirValid) {
|
||||||
if (not magFieldValid) {
|
if (not magFieldValid) {
|
||||||
return SafeModeStrategy::SAFECTRL_NO_MAG_FIELD_FOR_CONTROL;
|
return acs::SafeModeStrategy::SAFECTRL_NO_MAG_FIELD_FOR_CONTROL;
|
||||||
} else if (mekfValid) {
|
} else if (mekfValid) {
|
||||||
return SafeModeStrategy::SAFECTRL_USE_MEKF;
|
return acs::SafeModeStrategy::SAFECTRL_ACTIVE_MEKF;
|
||||||
} else if (satRotRateValid and sunDirValid) {
|
} else if (satRotRateValid and sunDirValid) {
|
||||||
return SafeModeStrategy::SAFECTRL_USE_NONMEKF;
|
return acs::SafeModeStrategy::SAFECTRL_WITHOUT_MEKF;
|
||||||
} else if (satRotRateValid and not sunDirValid) {
|
} else if (satRotRateValid and not sunDirValid) {
|
||||||
return SafeModeStrategy::SAFECTRL_USE_DAMPING;
|
return acs::SafeModeStrategy::SAFECTRL_ECLIPSE_DAMPING;
|
||||||
} else {
|
} else {
|
||||||
return SafeModeStrategy::SAFECTRL_NO_SENSORS_FOR_CONTROL;
|
return acs::SafeModeStrategy::SAFECTRL_NO_SENSORS_FOR_CONTROL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,35 +2,16 @@
|
|||||||
#define SAFECTRL_H_
|
#define SAFECTRL_H_
|
||||||
|
|
||||||
#include <eive/resultClassIds.h>
|
#include <eive/resultClassIds.h>
|
||||||
|
#include <mission/acs/defs.h>
|
||||||
#include <mission/controller/acs/AcsParameters.h>
|
#include <mission/controller/acs/AcsParameters.h>
|
||||||
#include <mission/controller/acs/SensorValues.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <time.h>
|
|
||||||
|
|
||||||
class SafeCtrl {
|
class SafeCtrl {
|
||||||
public:
|
public:
|
||||||
SafeCtrl(AcsParameters *acsParameters_);
|
SafeCtrl(AcsParameters *acsParameters_);
|
||||||
virtual ~SafeCtrl();
|
virtual ~SafeCtrl();
|
||||||
|
|
||||||
static constexpr uint8_t IF_SAFE_ID = CLASS_ID::ACS_SAFE;
|
|
||||||
static constexpr ReturnValue_t SAFECTRL_NO_MAG_FIELD_FOR_CONTROL =
|
|
||||||
returnvalue::makeCode(IF_SAFE_ID, 2);
|
|
||||||
static constexpr ReturnValue_t SAFECTRL_USE_MEKF = returnvalue::makeCode(IF_SAFE_ID, 3);
|
|
||||||
static constexpr ReturnValue_t SAFECTRL_USE_NONMEKF = returnvalue::makeCode(IF_SAFE_ID, 4);
|
|
||||||
static constexpr ReturnValue_t SAFECTRL_USE_DAMPING = returnvalue::makeCode(IF_SAFE_ID, 5);
|
|
||||||
static constexpr ReturnValue_t SAFECTRL_NO_SENSORS_FOR_CONTROL =
|
|
||||||
returnvalue::makeCode(IF_SAFE_ID, 6);
|
|
||||||
|
|
||||||
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,
|
uint8_t safeCtrlStrategy(const bool magFieldValid, const ReturnValue_t mekfValid,
|
||||||
const bool satRotRateValid, const bool sunDirValid);
|
const bool satRotRateValid, const bool sunDirValid);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user