2022-08-12 12:29:28 +02:00
|
|
|
#ifndef MISSION_CONTROLLER_ACSCONTROLLER_H_
|
|
|
|
#define MISSION_CONTROLLER_ACSCONTROLLER_H_
|
|
|
|
|
2022-08-15 10:50:19 +02:00
|
|
|
#include <commonObjects.h>
|
|
|
|
#include "controllerdefinitions/AcsCtrlDefinitions.h"
|
2022-08-12 12:29:28 +02:00
|
|
|
#include <fsfw/controller/ExtendedControllerBase.h>
|
2022-08-15 10:50:19 +02:00
|
|
|
#include "fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h"
|
|
|
|
#include "fsfw_hal/devicehandlers/MgmRM3100Handler.h"
|
|
|
|
#include "mission/devices/devicedefinitions/IMTQHandlerDefinitions.h"
|
2022-08-12 12:29:28 +02:00
|
|
|
|
2022-08-15 09:58:18 +02:00
|
|
|
class AcsController : public ExtendedControllerBase {
|
|
|
|
public:
|
2022-08-15 10:50:19 +02:00
|
|
|
static constexpr dur_millis_t INIT_DELAY = 500;
|
|
|
|
|
2022-08-15 09:58:18 +02:00
|
|
|
AcsController(object_id_t objectId);
|
2022-08-12 12:29:28 +02:00
|
|
|
|
2022-08-15 09:58:18 +02:00
|
|
|
private:
|
2022-08-15 10:50:19 +02:00
|
|
|
enum class InternalState { STARTUP, INITIAL_DELAY, READY };
|
|
|
|
|
|
|
|
InternalState internalState = InternalState::STARTUP;
|
|
|
|
|
2022-08-12 12:29:28 +02:00
|
|
|
ReturnValue_t handleCommandMessage(CommandMessage* message) override;
|
|
|
|
void performControlOperation() override;
|
|
|
|
|
|
|
|
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
2022-08-15 09:58:18 +02:00
|
|
|
LocalDataPoolManager& poolManager) override;
|
2022-08-12 12:29:28 +02:00
|
|
|
LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override;
|
|
|
|
|
|
|
|
// Mode abstract functions
|
|
|
|
ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode,
|
2022-08-15 09:58:18 +02:00
|
|
|
uint32_t* msToReachTheMode) override;
|
2022-08-12 12:29:28 +02:00
|
|
|
|
2022-08-26 16:12:22 +02:00
|
|
|
ModeDefinitionHelper getModeDefinitionHelper() override;
|
|
|
|
|
2022-08-12 12:29:28 +02:00
|
|
|
// MGMs
|
2022-08-15 10:50:19 +02:00
|
|
|
acsctrl::MgmData mgmData;
|
|
|
|
|
2022-08-25 14:43:27 +02:00
|
|
|
MGMLIS3MDL::MgmPrimaryDataset mgm0Lis3Set = MGMLIS3MDL::MgmPrimaryDataset(objects::MGM_0_LIS3_HANDLER);
|
|
|
|
RM3100::Rm3100PrimaryDataset mgm1Rm3100Set = RM3100::Rm3100PrimaryDataset(objects::MGM_1_RM3100_HANDLER);
|
|
|
|
MGMLIS3MDL::MgmPrimaryDataset mgm2Lis3Set = MGMLIS3MDL::MgmPrimaryDataset(objects::MGM_2_LIS3_HANDLER);
|
|
|
|
RM3100::Rm3100PrimaryDataset mgm3Rm3100Set = RM3100::Rm3100PrimaryDataset(objects::MGM_3_RM3100_HANDLER);
|
|
|
|
IMTQ::CalibratedMtmMeasurementSet imtqMgmSet = IMTQ::CalibratedMtmMeasurementSet(objects::IMTQ_HANDLER);
|
2022-08-15 10:50:19 +02:00
|
|
|
|
2022-08-15 11:19:08 +02:00
|
|
|
PoolEntry<float> mgm0PoolVec = PoolEntry<float>(3);
|
|
|
|
PoolEntry<float> mgm1PoolVec = PoolEntry<float>(3);
|
|
|
|
PoolEntry<float> mgm2PoolVec = PoolEntry<float>(3);
|
|
|
|
PoolEntry<float> mgm3PoolVec = PoolEntry<float>(3);
|
2022-08-16 11:27:16 +02:00
|
|
|
PoolEntry<int32_t> imtqMgmPoolVec = PoolEntry<int32_t>(3);
|
2022-08-15 11:19:08 +02:00
|
|
|
PoolEntry<uint8_t> imtqCalActStatus = PoolEntry<uint8_t>();
|
2022-08-15 10:50:19 +02:00
|
|
|
void copyMgmData();
|
2022-08-12 12:29:28 +02:00
|
|
|
|
2022-08-15 10:50:19 +02:00
|
|
|
// Initial delay to make sure all pool variables have been initialized their owners
|
|
|
|
Countdown initialCountdown = Countdown(INIT_DELAY);
|
2022-08-12 12:29:28 +02:00
|
|
|
// Sun Sensors
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* MISSION_CONTROLLER_ACSCONTROLLER_H_ */
|