eive-obsw/mission/acs/defs.h

100 lines
3.6 KiB
C
Raw Normal View History

#ifndef MISSION_ACSDEFS_H_
#define MISSION_ACSDEFS_H_
2023-02-02 17:12:22 +01:00
#include <eive/eventSubsystemIds.h>
#include <fsfw/modes/HasModesIF.h>
2023-04-28 15:30:09 +02:00
#include <mission/sysDefs.h>
namespace acs {
2023-04-02 20:12:24 +02:00
enum class SimpleSensorMode { NORMAL = 0, OFF = 1 };
2023-03-24 14:52:26 +01:00
// These modes are the modes of the ACS controller and of the ACS subsystem.
2023-02-13 01:26:30 +01:00
enum AcsMode : Mode_t {
OFF = HasModesIF::MODE_OFF,
2023-04-28 15:30:09 +02:00
SAFE = satsystem::Mode::SAFE,
PTG_IDLE = satsystem::Mode::PTG_IDLE,
PTG_NADIR = satsystem::Mode::PTG_NADIR,
PTG_TARGET = satsystem::Mode::PTG_TARGET,
PTG_TARGET_GS = satsystem::Mode::PTG_TARGET_GS,
PTG_INERTIAL = satsystem::Mode::PTG_INERTIAL,
};
2023-03-10 13:17:46 +01:00
enum SafeSubmode : Submode_t { DEFAULT = 0, DETUMBLE = 1 };
2023-11-02 16:59:09 +01:00
enum ControlModeStrategy : uint8_t {
2023-11-14 13:22:35 +01:00
CTRL_OFF = 0,
CTRL_NO_MAG_FIELD_FOR_CONTROL = 1,
CTRL_NO_SENSORS_FOR_CONTROL = 2,
// OBSW version <= v6.1.0
2023-07-26 13:17:54 +02:00
LEGACY_SAFECTRL_ACTIVE_MEKF = 10,
LEGACY_SAFECTRL_WITHOUT_MEKF = 11,
LEGACY_SAFECTRL_ECLIPSE_DAMPING = 12,
LEGACY_SAFECTRL_ECLIPSE_IDELING = 13,
// Added in v6.2.0
SAFECTRL_MEKF = 14,
SAFECTRL_GYR = 15,
SAFECTRL_SUSMGM = 16,
SAFECTRL_ECLIPSE_DAMPING_GYR = 17,
SAFECTRL_ECLIPSE_DAMPING_SUSMGM = 18,
SAFECTRL_ECLIPSE_IDELING = 19,
2023-04-06 10:37:25 +02:00
SAFECTRL_DETUMBLE_FULL = 20,
SAFECTRL_DETUMBLE_DETERIORATED = 21,
2023-11-02 16:59:09 +01:00
// Added in vNext
2023-11-23 16:56:36 +01:00
PTGCTRL_MEKF = 100,
PTGCTRL_STR = 101,
PTGCTRL_QUEST = 102,
2023-04-06 10:37:25 +02:00
};
2023-11-27 10:37:40 +01:00
namespace gps {
enum Source : uint8_t {
2023-08-07 13:36:40 +02:00
NONE,
GPS,
2023-08-14 12:48:22 +02:00
GPS_EXTRAPOLATED,
2023-08-07 13:36:40 +02:00
SPG4,
};
2023-11-27 10:37:40 +01:00
}
2023-08-07 13:36:40 +02:00
2023-11-27 10:37:40 +01:00
namespace rotrate {
enum Source : uint8_t {
NONE,
2023-11-24 11:30:27 +01:00
SUSMGM,
QUEST,
STR,
};
2023-11-27 10:37:40 +01:00
}
2023-11-24 11:30:27 +01:00
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::ACS_SUBSYSTEM;
2023-03-24 14:52:26 +01:00
//! [EXPORT] : [COMMENT] The limits for the rotation in safe mode were violated.
2023-03-24 15:18:52 +01:00
static constexpr Event SAFE_RATE_VIOLATION = MAKE_EVENT(0, severity::MEDIUM);
2024-01-27 13:58:17 +01:00
//! [EXPORT] : [COMMENT] The limits for the rotation in pointing mode were violated.
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);
2023-03-24 14:52:26 +01:00
//! [EXPORT] : [COMMENT] Multiple RWs are invalid, uncommandable and therefore higher ACS modes
//! cannot be maintained.
static constexpr Event MULTIPLE_RW_INVALID = MAKE_EVENT(2, severity::HIGH);
2023-03-24 14:52:26 +01:00
//! [EXPORT] : [COMMENT] MEKF was not able to compute a solution.
//! P1: MEKF state on exit
2023-02-22 14:50:38 +01:00
static constexpr Event MEKF_INVALID_INFO = MAKE_EVENT(3, severity::INFO);
2023-03-24 15:18:52 +01:00
//! [EXPORT] : [COMMENT] MEKF is able to compute a solution again.
static constexpr Event MEKF_RECOVERY = MAKE_EVENT(4, severity::INFO);
2023-03-24 15:18:52 +01:00
//! [EXPORT] : [COMMENT] MEKF performed an automatic reset after detection of nonfinite values.
static constexpr Event MEKF_AUTOMATIC_RESET = MAKE_EVENT(5, severity::INFO);
2023-11-15 16:54:54 +01:00
//! [EXPORT] : [COMMENT] For a prolonged time, no attitude information was available for the
//! Pointing Controller. Falling back to Safe Mode.
static constexpr Event PTG_CTRL_NO_ATTITUDE_INFORMATION = MAKE_EVENT(6, severity::HIGH);
2023-03-24 14:52:26 +01:00
//! [EXPORT] : [COMMENT] The ACS safe mode controller was not able to compute a solution and has
//! failed.
2023-03-24 14:58:49 +01:00
//! P1: Missing information about magnetic field, P2: Missing information about rotational rate
2023-03-24 15:18:52 +01:00
static constexpr Event SAFE_MODE_CONTROLLER_FAILURE = MAKE_EVENT(7, severity::HIGH);
2023-08-09 13:44:10 +02:00
//! [EXPORT] : [COMMENT] The TLE for the SGP4 Propagator has become too old.
2023-08-09 13:41:25 +02:00
static constexpr Event TLE_TOO_OLD = MAKE_EVENT(8, severity::INFO);
2023-12-01 11:41:35 +01:00
//! [EXPORT] : [COMMENT] The TLE could not be read from the filesystem.
2023-11-29 16:59:03 +01:00
static constexpr Event TLE_FILE_READ_FAILED = MAKE_EVENT(9, severity::LOW);
2023-02-13 01:26:30 +01:00
extern const char* getModeStr(AcsMode mode);
} // namespace acs
#endif /* MISSION_ACSDEFS_H_ */