continued acs subsystem
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
This commit is contained in:
parent
a0db5dcc7c
commit
874e06baa1
@ -1,6 +1,8 @@
|
|||||||
#include <commonObjects.h>
|
#include <commonObjects.h>
|
||||||
|
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
|
||||||
|
|
||||||
#include "acsModeTree.h"
|
#include "acsModeTree.h"
|
||||||
|
#include "mission/controller/controllerdefinitions/AcsControllerDefinitions.h"
|
||||||
#include <fsfw/subsystem/modes/ModeDefinitions.h>
|
#include <fsfw/subsystem/modes/ModeDefinitions.h>
|
||||||
#include <fsfw/subsystem/Subsystem.h>
|
#include <fsfw/subsystem/Subsystem.h>
|
||||||
#include <fsfw/modes/HasModesIF.h>
|
#include <fsfw/modes/HasModesIF.h>
|
||||||
@ -9,50 +11,69 @@ FixedArrayList<ModeListEntry, 2> ACS_SEQUENCE_OFF = FixedArrayList<ModeListEntry
|
|||||||
FixedArrayList<ModeListEntry, 0> ACS_TABLE_OFF_TGT = FixedArrayList<ModeListEntry, 0>();
|
FixedArrayList<ModeListEntry, 0> ACS_TABLE_OFF_TGT = FixedArrayList<ModeListEntry, 0>();
|
||||||
FixedArrayList<ModeListEntry, 6> ACS_TABLE_OFF_TRANS = FixedArrayList<ModeListEntry, 6>();
|
FixedArrayList<ModeListEntry, 6> ACS_TABLE_OFF_TRANS = FixedArrayList<ModeListEntry, 6>();
|
||||||
|
|
||||||
static constexpr Mode_t ACS_SEQUENCE_OFF_ID = HasModesIF::MODE_OFF;
|
static constexpr Mode_t ACS_SEQUENCE_OFF_ID = acs::CtrlModes::OFF;
|
||||||
static constexpr Mode_t ACS_TABLE_OFF_TGT_ID = 0x61000000;
|
static constexpr Mode_t ACS_TABLE_OFF_TGT_ID = (acs::CtrlModes::OFF << 8) | 1;
|
||||||
static constexpr Mode_t ACS_TABLE_OFF_TRANS_ID = 0x61000001;
|
static constexpr Mode_t ACS_TABLE_OFF_TRANS_ID = (acs::CtrlModes::OFF << 8) | 2;
|
||||||
|
|
||||||
|
FixedArrayList<ModeListEntry, 2> ACS_SEQUENCE_DETUMBLE = FixedArrayList<ModeListEntry, 2>();
|
||||||
|
FixedArrayList<ModeListEntry, 3> ACS_TABLE_DETUMBLE_TGT = FixedArrayList<ModeListEntry, 3>();
|
||||||
|
FixedArrayList<ModeListEntry, 5> ACS_TABLE_DETUMBLE_TRANS_0 = FixedArrayList<ModeListEntry, 5>();
|
||||||
|
FixedArrayList<ModeListEntry, 1> ACS_TABLE_DETUMBLE_TRANS_1 = FixedArrayList<ModeListEntry, 1>();
|
||||||
|
|
||||||
|
static constexpr Mode_t ACS_SEQUENCE_DETUMBLE_ID = acs::CtrlModes::DETUMBLE;
|
||||||
|
static constexpr Mode_t ACS_TABLE_DETUMBLE_TGT_ID = (acs::CtrlModes::DETUMBLE << 8) | 1;
|
||||||
|
static constexpr Mode_t ACS_TABLE_DETUMBLE_TRANS_0_ID = (acs::CtrlModes::DETUMBLE << 8) | 2;
|
||||||
|
static constexpr Mode_t ACS_TABLE_DETUMBLE_TRANS_1_ID = (acs::CtrlModes::DETUMBLE << 8) | 3;
|
||||||
|
|
||||||
|
// Alias for checker function
|
||||||
|
const auto CHK = satsystem::checkInsert;
|
||||||
|
static const auto OFF = HasModesIF::MODE_OFF;
|
||||||
|
static const auto NML = DeviceHandlerIF::MODE_NORMAL;
|
||||||
|
|
||||||
void satsystem::acsSubsystemInit() {
|
void satsystem::acsSubsystemInit() {
|
||||||
ModeListEntry entry;
|
ModeListEntry entry;
|
||||||
Subsystem *acsSubsystem = new Subsystem(objects::ACS_SUBSYSTEM, objects::EIVE_SYSTEM, 20, 20);
|
Subsystem *acsSubsystem = new Subsystem(objects::ACS_SUBSYSTEM, objects::EIVE_SYSTEM, 20, 20);
|
||||||
buildOffSequence(acsSubsystem, entry);
|
buildOffSequence(acsSubsystem, entry);
|
||||||
|
buildDetumbleSequence(acsSubsystem, entry);
|
||||||
|
acsSubsystem->setInitialMode(HasModesIF::MODE_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
void satsystem::buildOffSequence(Subsystem* ss, ModeListEntry& eh) {
|
void satsystem::buildOffSequence(Subsystem* ss, ModeListEntry& eh) {
|
||||||
|
std::string context = "satsystem::buildOffSequence";
|
||||||
|
auto ctxc = context.c_str();
|
||||||
// Build OFF target
|
// Build OFF target
|
||||||
ss->addTable(&ACS_TABLE_OFF_TGT, ACS_TABLE_OFF_TGT_ID, false, true);
|
ss->addTable(&ACS_TABLE_OFF_TGT, ACS_TABLE_OFF_TGT_ID, false, true);
|
||||||
|
|
||||||
// Build OFF transition
|
// Build OFF transition
|
||||||
eh.setObject(objects::ACS_CONTROLLER);
|
eh.setObject(objects::ACS_CONTROLLER);
|
||||||
eh.setMode(HasModesIF::MODE_OFF);
|
eh.setMode(OFF);
|
||||||
eh.setSubmode(0);
|
eh.setSubmode(0);
|
||||||
ACS_TABLE_OFF_TRANS.insert(eh);
|
CHK(ACS_TABLE_OFF_TRANS.insert(eh), ctxc);
|
||||||
|
|
||||||
eh.setObject(objects::IMTQ_HANDLER);
|
eh.setObject(objects::IMTQ_HANDLER);
|
||||||
eh.setMode(HasModesIF::MODE_OFF);
|
eh.setMode(OFF);
|
||||||
eh.setSubmode(0);
|
eh.setSubmode(0);
|
||||||
ACS_TABLE_OFF_TRANS.insert(eh);
|
CHK(ACS_TABLE_OFF_TRANS.insert(eh), ctxc);
|
||||||
|
|
||||||
eh.setObject(objects::STAR_TRACKER);
|
eh.setObject(objects::STAR_TRACKER);
|
||||||
eh.setMode(HasModesIF::MODE_OFF);
|
eh.setMode(OFF);
|
||||||
eh.setSubmode(0);
|
eh.setSubmode(0);
|
||||||
ACS_TABLE_OFF_TRANS.insert(eh);
|
CHK(ACS_TABLE_OFF_TRANS.insert(eh), ctxc);
|
||||||
|
|
||||||
eh.setObject(objects::ACS_BOARD_ASS);
|
eh.setObject(objects::ACS_BOARD_ASS);
|
||||||
eh.setMode(HasModesIF::MODE_OFF);
|
eh.setMode(OFF);
|
||||||
eh.setSubmode(0);
|
eh.setSubmode(0);
|
||||||
ACS_TABLE_OFF_TRANS.insert(eh);
|
CHK(ACS_TABLE_OFF_TRANS.insert(eh), ctxc);
|
||||||
|
|
||||||
eh.setObject(objects::SUS_BOARD_ASS);
|
eh.setObject(objects::SUS_BOARD_ASS);
|
||||||
eh.setMode(HasModesIF::MODE_OFF);
|
eh.setMode(OFF);
|
||||||
eh.setSubmode(0);
|
eh.setSubmode(0);
|
||||||
ACS_TABLE_OFF_TRANS.insert(eh);
|
CHK(ACS_TABLE_OFF_TRANS.insert(eh), ctxc);
|
||||||
|
|
||||||
eh.setObject(objects::RW_ASS);
|
eh.setObject(objects::RW_ASS);
|
||||||
eh.setMode(HasModesIF::MODE_OFF);
|
eh.setMode(OFF);
|
||||||
eh.setSubmode(0);
|
eh.setSubmode(0);
|
||||||
ACS_TABLE_OFF_TRANS.insert(eh);
|
CHK(ACS_TABLE_OFF_TRANS.insert(eh), ctxc);
|
||||||
|
|
||||||
ss->addTable(&ACS_TABLE_OFF_TRANS, ACS_TABLE_OFF_TRANS_ID, false, true);
|
ss->addTable(&ACS_TABLE_OFF_TRANS, ACS_TABLE_OFF_TRANS_ID, false, true);
|
||||||
|
|
||||||
@ -60,13 +81,91 @@ void satsystem::buildOffSequence(Subsystem* ss, ModeListEntry& eh) {
|
|||||||
eh.setTableId(ACS_TABLE_OFF_TGT_ID);
|
eh.setTableId(ACS_TABLE_OFF_TGT_ID);
|
||||||
eh.setWaitSeconds(0);
|
eh.setWaitSeconds(0);
|
||||||
eh.setCheckSuccess(false);
|
eh.setCheckSuccess(false);
|
||||||
ACS_SEQUENCE_OFF.insert(eh);
|
CHK(ACS_SEQUENCE_OFF.insert(eh), ctxc);
|
||||||
|
|
||||||
eh.setTableId(ACS_TABLE_OFF_TRANS_ID);
|
eh.setTableId(ACS_TABLE_OFF_TRANS_ID);
|
||||||
eh.setWaitSeconds(0);
|
eh.setWaitSeconds(0);
|
||||||
eh.setCheckSuccess(false);
|
eh.setCheckSuccess(false);
|
||||||
ACS_SEQUENCE_OFF.insert(eh);
|
CHK(ACS_SEQUENCE_OFF.insert(eh), ctxc);
|
||||||
|
|
||||||
ss->addSequence(&ACS_SEQUENCE_OFF, ACS_SEQUENCE_OFF_ID, ACS_SEQUENCE_OFF_ID, false, true);
|
ss->addSequence(&ACS_SEQUENCE_OFF, ACS_SEQUENCE_OFF_ID, ACS_SEQUENCE_OFF_ID, false, true);
|
||||||
ss->setInitialMode(HasModesIF::MODE_OFF);
|
}
|
||||||
|
|
||||||
|
void satsystem::buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) {
|
||||||
|
|
||||||
|
std::string context = "satsystem::buildDetumbleSequence";
|
||||||
|
auto ctxc = context.c_str();
|
||||||
|
// Build DETUMBLE target
|
||||||
|
eh.setObject(objects::ACS_CONTROLLER);
|
||||||
|
eh.setMode(acs::CtrlModes::DETUMBLE);
|
||||||
|
eh.setSubmode(0);
|
||||||
|
CHK(ACS_TABLE_DETUMBLE_TGT.insert(eh), ctxc);
|
||||||
|
|
||||||
|
eh.setObject(objects::IMTQ_HANDLER);
|
||||||
|
eh.setMode(NML);
|
||||||
|
eh.setSubmode(0);
|
||||||
|
CHK(ACS_TABLE_DETUMBLE_TGT.insert(eh), ctxc);
|
||||||
|
|
||||||
|
eh.setObject(objects::SUS_BOARD_ASS);
|
||||||
|
eh.setMode(NML);
|
||||||
|
eh.setSubmode(0);
|
||||||
|
CHK(ACS_TABLE_DETUMBLE_TGT.insert(eh), ctxc);
|
||||||
|
|
||||||
|
eh.setObject(objects::ACS_BOARD_ASS);
|
||||||
|
eh.setMode(NML);
|
||||||
|
eh.setSubmode(0);
|
||||||
|
CHK(ACS_TABLE_DETUMBLE_TGT.insert(eh), ctxc);
|
||||||
|
|
||||||
|
ss->addTable(&ACS_TABLE_DETUMBLE_TGT, ACS_TABLE_DETUMBLE_TGT_ID, false, true);
|
||||||
|
|
||||||
|
// Build DETUMBLE transition 0
|
||||||
|
|
||||||
|
eh.setObject(objects::IMTQ_HANDLER);
|
||||||
|
eh.setMode(NML);
|
||||||
|
eh.setSubmode(0);
|
||||||
|
CHK(ACS_TABLE_DETUMBLE_TRANS_0.insert(eh), ctxc);
|
||||||
|
|
||||||
|
eh.setObject(objects::STAR_TRACKER);
|
||||||
|
eh.setMode(OFF);
|
||||||
|
eh.setSubmode(0);
|
||||||
|
CHK(ACS_TABLE_DETUMBLE_TRANS_0.insert(eh), ctxc);
|
||||||
|
|
||||||
|
eh.setObject(objects::ACS_BOARD_ASS);
|
||||||
|
eh.setMode(NML);
|
||||||
|
eh.setSubmode(0);
|
||||||
|
CHK(ACS_TABLE_DETUMBLE_TRANS_0.insert(eh), ctxc);
|
||||||
|
|
||||||
|
eh.setObject(objects::SUS_BOARD_ASS);
|
||||||
|
eh.setMode(NML);
|
||||||
|
eh.setSubmode(0);
|
||||||
|
CHK(ACS_TABLE_DETUMBLE_TRANS_0.insert(eh), ctxc);
|
||||||
|
|
||||||
|
eh.setObject(objects::RW_ASS);
|
||||||
|
eh.setMode(OFF);
|
||||||
|
eh.setSubmode(0);
|
||||||
|
CHK(ACS_TABLE_DETUMBLE_TRANS_0.insert(eh), ctxc);
|
||||||
|
|
||||||
|
ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_0, ACS_TABLE_DETUMBLE_TRANS_0_ID, false, true);
|
||||||
|
|
||||||
|
// Build DETUMBLE transition 1
|
||||||
|
|
||||||
|
eh.setObject(objects::ACS_CONTROLLER);
|
||||||
|
eh.setMode(acs::CtrlModes::DETUMBLE);
|
||||||
|
eh.setSubmode(0);
|
||||||
|
CHK(ACS_TABLE_DETUMBLE_TRANS_1.insert(eh), ctxc);
|
||||||
|
ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_1, ACS_TABLE_DETUMBLE_TRANS_1_ID, false, true);
|
||||||
|
|
||||||
|
ss->addSequence(&ACS_SEQUENCE_DETUMBLE, ACS_SEQUENCE_DETUMBLE_ID, 0 /*Ü TODO*/, false, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void satsystem::buildSafeSequence(Subsystem* ss, ModeListEntry& eh) {}
|
||||||
|
|
||||||
|
void satsystem::buildIdleSequence(Subsystem* ss, ModeListEntry& eh) {}
|
||||||
|
|
||||||
|
void satsystem::buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) {}
|
||||||
|
|
||||||
|
void satsystem::checkInsert(ReturnValue_t result, const char* ctx) {
|
||||||
|
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::error << "Insertion failed at " << ctx << std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,5 +6,10 @@ namespace satsystem {
|
|||||||
|
|
||||||
void acsSubsystemInit();
|
void acsSubsystemInit();
|
||||||
void buildOffSequence(Subsystem* ss, ModeListEntry& entryHelper);
|
void buildOffSequence(Subsystem* ss, ModeListEntry& entryHelper);
|
||||||
|
void buildDetumbleSequence(Subsystem* ss, ModeListEntry& entryHelper);
|
||||||
|
void buildSafeSequence(Subsystem* ss, ModeListEntry& entryHelper);
|
||||||
|
void buildIdleSequence(Subsystem* ss, ModeListEntry& entryHelper);
|
||||||
|
void buildTargetPtSequence(Subsystem* ss, ModeListEntry& entryHelper);
|
||||||
|
|
||||||
|
void checkInsert(ReturnValue_t result, const char* ctx);
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 19e8ee90be12f72ceb8c2aefdfd665b5babad417
|
Subproject commit 9d7963f3292c669814810adf50d6820b2e5c29b7
|
@ -0,0 +1,21 @@
|
|||||||
|
#ifndef MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCONTROLLERDEFINITIONS_H_
|
||||||
|
#define MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCONTROLLERDEFINITIONS_H_
|
||||||
|
|
||||||
|
#include <fsfw/modes/HasModesIF.h>
|
||||||
|
|
||||||
|
namespace acs {
|
||||||
|
|
||||||
|
enum CtrlModes {
|
||||||
|
OFF = HasModesIF::MODE_OFF,
|
||||||
|
IDLE = 1,
|
||||||
|
DETUMBLE = 2,
|
||||||
|
SAFE = 3,
|
||||||
|
IDLE = 4,
|
||||||
|
TARGET_PT = 5
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCONTROLLERDEFINITIONS_H_ */
|
Loading…
Reference in New Issue
Block a user