eive-obsw/mission/controller/acs/control/SafeCtrl.h

41 lines
1.4 KiB
C
Raw Normal View History

2022-09-20 13:46:42 +02:00
#ifndef SAFECTRL_H_
#define SAFECTRL_H_
#include <stdio.h>
2022-10-20 11:07:45 +02:00
#include <string.h>
2022-09-20 13:46:42 +02:00
#include <time.h>
2022-10-20 11:07:45 +02:00
#include "../AcsParameters.h"
#include "../SensorValues.h"
#include "eive/resultClassIds.h"
2022-09-20 13:46:42 +02:00
2022-10-20 11:07:45 +02:00
class SafeCtrl {
public:
SafeCtrl(AcsParameters *acsParameters_);
virtual ~SafeCtrl();
2022-09-20 13:46:42 +02:00
static const uint8_t INTERFACE_ID = CLASS_ID::ACS_SAFE;
2022-10-20 11:07:45 +02:00
static const ReturnValue_t SAFECTRL_MEKF_INPUT_INVALID = MAKE_RETURN_CODE(0x01);
2022-09-20 13:46:42 +02:00
ReturnValue_t safeMekf(timeval now, double *quatBJ, bool quatBJValid, double *magFieldModel,
bool magFieldModelValid, double *sunDirModel, bool sunDirModelValid,
double *satRateMekf, bool rateMekfValid, double *sunDirRef,
2022-10-20 11:07:45 +02:00
double *satRatRef, // From Guidance (!)
double *outputAngle, double *outputMagMomB);
2022-09-20 13:46:42 +02:00
ReturnValue_t safeNoMekf(timeval now, double *susDirB, bool susDirBValid, double *sunRateB,
bool sunRateBValid, double *magFieldB, bool magFieldBValid,
double *magRateB, bool magRateBValid, double *sunDirRef,
double *satRateRef, double *outputAngle, double *outputMagMomB);
2022-09-20 13:46:42 +02:00
2022-10-20 11:07:45 +02:00
protected:
private:
2023-02-28 09:18:44 +01:00
AcsParameters *acsParameters;
2022-10-20 11:07:45 +02:00
double gainMatrixInertia[3][3];
2022-09-20 13:46:42 +02:00
2022-10-20 11:07:45 +02:00
double magFieldBState[3];
timeval magFieldBStateTime;
2022-09-20 13:46:42 +02:00
};
#endif /* ACS_CONTROL_SAFECTRL_H_ */