From a0db5dcc7cb3f39106ecf0dc2ec36b025936a529 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 22 Apr 2022 17:00:23 +0200 Subject: [PATCH 01/43] add first mode sequence for acs ss --- bsp_q7s/core/CMakeLists.txt | 1 + bsp_q7s/core/acsModeTree.cpp | 72 +++++++++++++++++++++++++++++++++++ bsp_q7s/core/acsModeTree.h | 10 +++++ common/config/commonObjects.h | 5 ++- generators/fsfwgen | 2 +- 5 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 bsp_q7s/core/acsModeTree.cpp create mode 100644 bsp_q7s/core/acsModeTree.h diff --git a/bsp_q7s/core/CMakeLists.txt b/bsp_q7s/core/CMakeLists.txt index 8731b7a3..30538565 100644 --- a/bsp_q7s/core/CMakeLists.txt +++ b/bsp_q7s/core/CMakeLists.txt @@ -1,4 +1,5 @@ target_sources(${OBSW_NAME} PRIVATE + acsModeTree.cpp CoreController.cpp obsw.cpp InitMission.cpp diff --git a/bsp_q7s/core/acsModeTree.cpp b/bsp_q7s/core/acsModeTree.cpp new file mode 100644 index 00000000..c097d971 --- /dev/null +++ b/bsp_q7s/core/acsModeTree.cpp @@ -0,0 +1,72 @@ +#include + +#include "acsModeTree.h" +#include +#include +#include + +FixedArrayList ACS_SEQUENCE_OFF = FixedArrayList(); +FixedArrayList ACS_TABLE_OFF_TGT = FixedArrayList(); +FixedArrayList ACS_TABLE_OFF_TRANS = FixedArrayList(); + +static constexpr Mode_t ACS_SEQUENCE_OFF_ID = HasModesIF::MODE_OFF; +static constexpr Mode_t ACS_TABLE_OFF_TGT_ID = 0x61000000; +static constexpr Mode_t ACS_TABLE_OFF_TRANS_ID = 0x61000001; + +void satsystem::acsSubsystemInit() { + ModeListEntry entry; + Subsystem *acsSubsystem = new Subsystem(objects::ACS_SUBSYSTEM, objects::EIVE_SYSTEM, 20, 20); + buildOffSequence(acsSubsystem, entry); +} + +void satsystem::buildOffSequence(Subsystem* ss, ModeListEntry& eh) { + // Build OFF target + ss->addTable(&ACS_TABLE_OFF_TGT, ACS_TABLE_OFF_TGT_ID, false, true); + + // Build OFF transition + eh.setObject(objects::ACS_CONTROLLER); + eh.setMode(HasModesIF::MODE_OFF); + eh.setSubmode(0); + ACS_TABLE_OFF_TRANS.insert(eh); + + eh.setObject(objects::IMTQ_HANDLER); + eh.setMode(HasModesIF::MODE_OFF); + eh.setSubmode(0); + ACS_TABLE_OFF_TRANS.insert(eh); + + eh.setObject(objects::STAR_TRACKER); + eh.setMode(HasModesIF::MODE_OFF); + eh.setSubmode(0); + ACS_TABLE_OFF_TRANS.insert(eh); + + eh.setObject(objects::ACS_BOARD_ASS); + eh.setMode(HasModesIF::MODE_OFF); + eh.setSubmode(0); + ACS_TABLE_OFF_TRANS.insert(eh); + + eh.setObject(objects::SUS_BOARD_ASS); + eh.setMode(HasModesIF::MODE_OFF); + eh.setSubmode(0); + ACS_TABLE_OFF_TRANS.insert(eh); + + eh.setObject(objects::RW_ASS); + eh.setMode(HasModesIF::MODE_OFF); + eh.setSubmode(0); + ACS_TABLE_OFF_TRANS.insert(eh); + + ss->addTable(&ACS_TABLE_OFF_TRANS, ACS_TABLE_OFF_TRANS_ID, false, true); + + // Build OFF sequence + eh.setTableId(ACS_TABLE_OFF_TGT_ID); + eh.setWaitSeconds(0); + eh.setCheckSuccess(false); + ACS_SEQUENCE_OFF.insert(eh); + + eh.setTableId(ACS_TABLE_OFF_TRANS_ID); + eh.setWaitSeconds(0); + eh.setCheckSuccess(false); + ACS_SEQUENCE_OFF.insert(eh); + + ss->addSequence(&ACS_SEQUENCE_OFF, ACS_SEQUENCE_OFF_ID, ACS_SEQUENCE_OFF_ID, false, true); + ss->setInitialMode(HasModesIF::MODE_OFF); +} diff --git a/bsp_q7s/core/acsModeTree.h b/bsp_q7s/core/acsModeTree.h new file mode 100644 index 00000000..34811349 --- /dev/null +++ b/bsp_q7s/core/acsModeTree.h @@ -0,0 +1,10 @@ +#include + +class Subsystem; + +namespace satsystem { + +void acsSubsystemInit(); +void buildOffSequence(Subsystem* ss, ModeListEntry& entryHelper); + +} diff --git a/common/config/commonObjects.h b/common/config/commonObjects.h index a4f3319e..0b27a023 100644 --- a/common/config/commonObjects.h +++ b/common/config/commonObjects.h @@ -97,7 +97,10 @@ enum commonObjects: uint32_t { // 0x73 ('s') for assemblies and system/subsystem components ACS_BOARD_ASS = 0x73000001, SUS_BOARD_ASS = 0x73000002, - TCS_BOARD_ASS = 0x73000003 + TCS_BOARD_ASS = 0x73000003, + RW_ASS = 0x73000004, + ACS_SUBSYSTEM = 0x73010001, + EIVE_SYSTEM = 0x73010000, }; } diff --git a/generators/fsfwgen b/generators/fsfwgen index 5ad9fb94..19e8ee90 160000 --- a/generators/fsfwgen +++ b/generators/fsfwgen @@ -1 +1 @@ -Subproject commit 5ad9fb94af3312d29863527106396395f7b808a5 +Subproject commit 19e8ee90be12f72ceb8c2aefdfd665b5babad417 From 874e06baa1b8e97061c35779dc06157c872e9395 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 22 Apr 2022 17:49:28 +0200 Subject: [PATCH 02/43] continued acs subsystem --- bsp_q7s/core/acsModeTree.cpp | 135 +++++++++++++++--- bsp_q7s/core/acsModeTree.h | 5 + generators/fsfwgen | 2 +- .../AcsControllerDefinitions.h | 21 +++ 4 files changed, 144 insertions(+), 19 deletions(-) create mode 100644 mission/controller/controllerdefinitions/AcsControllerDefinitions.h diff --git a/bsp_q7s/core/acsModeTree.cpp b/bsp_q7s/core/acsModeTree.cpp index c097d971..58c1159a 100644 --- a/bsp_q7s/core/acsModeTree.cpp +++ b/bsp_q7s/core/acsModeTree.cpp @@ -1,6 +1,8 @@ #include +#include #include "acsModeTree.h" +#include "mission/controller/controllerdefinitions/AcsControllerDefinitions.h" #include #include #include @@ -9,50 +11,69 @@ FixedArrayList ACS_SEQUENCE_OFF = FixedArrayList ACS_TABLE_OFF_TGT = FixedArrayList(); FixedArrayList ACS_TABLE_OFF_TRANS = FixedArrayList(); -static constexpr Mode_t ACS_SEQUENCE_OFF_ID = HasModesIF::MODE_OFF; -static constexpr Mode_t ACS_TABLE_OFF_TGT_ID = 0x61000000; -static constexpr Mode_t ACS_TABLE_OFF_TRANS_ID = 0x61000001; +static constexpr Mode_t ACS_SEQUENCE_OFF_ID = acs::CtrlModes::OFF; +static constexpr Mode_t ACS_TABLE_OFF_TGT_ID = (acs::CtrlModes::OFF << 8) | 1; +static constexpr Mode_t ACS_TABLE_OFF_TRANS_ID = (acs::CtrlModes::OFF << 8) | 2; + +FixedArrayList ACS_SEQUENCE_DETUMBLE = FixedArrayList(); +FixedArrayList ACS_TABLE_DETUMBLE_TGT = FixedArrayList(); +FixedArrayList ACS_TABLE_DETUMBLE_TRANS_0 = FixedArrayList(); +FixedArrayList ACS_TABLE_DETUMBLE_TRANS_1 = FixedArrayList(); + +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() { ModeListEntry entry; Subsystem *acsSubsystem = new Subsystem(objects::ACS_SUBSYSTEM, objects::EIVE_SYSTEM, 20, 20); buildOffSequence(acsSubsystem, entry); + buildDetumbleSequence(acsSubsystem, entry); + acsSubsystem->setInitialMode(HasModesIF::MODE_OFF); } void satsystem::buildOffSequence(Subsystem* ss, ModeListEntry& eh) { + std::string context = "satsystem::buildOffSequence"; + auto ctxc = context.c_str(); // Build OFF target ss->addTable(&ACS_TABLE_OFF_TGT, ACS_TABLE_OFF_TGT_ID, false, true); // Build OFF transition eh.setObject(objects::ACS_CONTROLLER); - eh.setMode(HasModesIF::MODE_OFF); + eh.setMode(OFF); eh.setSubmode(0); - ACS_TABLE_OFF_TRANS.insert(eh); + CHK(ACS_TABLE_OFF_TRANS.insert(eh), ctxc); eh.setObject(objects::IMTQ_HANDLER); - eh.setMode(HasModesIF::MODE_OFF); + eh.setMode(OFF); eh.setSubmode(0); - ACS_TABLE_OFF_TRANS.insert(eh); + CHK(ACS_TABLE_OFF_TRANS.insert(eh), ctxc); eh.setObject(objects::STAR_TRACKER); - eh.setMode(HasModesIF::MODE_OFF); + eh.setMode(OFF); eh.setSubmode(0); - ACS_TABLE_OFF_TRANS.insert(eh); + CHK(ACS_TABLE_OFF_TRANS.insert(eh), ctxc); eh.setObject(objects::ACS_BOARD_ASS); - eh.setMode(HasModesIF::MODE_OFF); + eh.setMode(OFF); eh.setSubmode(0); - ACS_TABLE_OFF_TRANS.insert(eh); + CHK(ACS_TABLE_OFF_TRANS.insert(eh), ctxc); eh.setObject(objects::SUS_BOARD_ASS); - eh.setMode(HasModesIF::MODE_OFF); + eh.setMode(OFF); eh.setSubmode(0); - ACS_TABLE_OFF_TRANS.insert(eh); + CHK(ACS_TABLE_OFF_TRANS.insert(eh), ctxc); eh.setObject(objects::RW_ASS); - eh.setMode(HasModesIF::MODE_OFF); + eh.setMode(OFF); 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); @@ -60,13 +81,91 @@ void satsystem::buildOffSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(ACS_TABLE_OFF_TGT_ID); eh.setWaitSeconds(0); eh.setCheckSuccess(false); - ACS_SEQUENCE_OFF.insert(eh); + CHK(ACS_SEQUENCE_OFF.insert(eh), ctxc); eh.setTableId(ACS_TABLE_OFF_TRANS_ID); eh.setWaitSeconds(0); 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->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; + } } diff --git a/bsp_q7s/core/acsModeTree.h b/bsp_q7s/core/acsModeTree.h index 34811349..8f0c593d 100644 --- a/bsp_q7s/core/acsModeTree.h +++ b/bsp_q7s/core/acsModeTree.h @@ -6,5 +6,10 @@ namespace satsystem { void acsSubsystemInit(); 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); } diff --git a/generators/fsfwgen b/generators/fsfwgen index 19e8ee90..9d7963f3 160000 --- a/generators/fsfwgen +++ b/generators/fsfwgen @@ -1 +1 @@ -Subproject commit 19e8ee90be12f72ceb8c2aefdfd665b5babad417 +Subproject commit 9d7963f3292c669814810adf50d6820b2e5c29b7 diff --git a/mission/controller/controllerdefinitions/AcsControllerDefinitions.h b/mission/controller/controllerdefinitions/AcsControllerDefinitions.h new file mode 100644 index 00000000..43cce539 --- /dev/null +++ b/mission/controller/controllerdefinitions/AcsControllerDefinitions.h @@ -0,0 +1,21 @@ +#ifndef MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCONTROLLERDEFINITIONS_H_ +#define MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCONTROLLERDEFINITIONS_H_ + +#include + +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_ */ From e3783d09416e46c2cb995752f8b6ee0c2af1e7bf Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 23 Apr 2022 12:37:12 +0200 Subject: [PATCH 03/43] small fix --- fsfw | 2 +- .../controller/controllerdefinitions/AcsControllerDefinitions.h | 1 - tmtc | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/fsfw b/fsfw index 24ef96d1..280b641c 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 24ef96d1b802e768d395f94b69f9f81a3c6d1e66 +Subproject commit 280b641cbc621d0c00c89851aaffbb64d5e5f40b diff --git a/mission/controller/controllerdefinitions/AcsControllerDefinitions.h b/mission/controller/controllerdefinitions/AcsControllerDefinitions.h index 43cce539..c05f1b27 100644 --- a/mission/controller/controllerdefinitions/AcsControllerDefinitions.h +++ b/mission/controller/controllerdefinitions/AcsControllerDefinitions.h @@ -7,7 +7,6 @@ namespace acs { enum CtrlModes { OFF = HasModesIF::MODE_OFF, - IDLE = 1, DETUMBLE = 2, SAFE = 3, IDLE = 4, diff --git a/tmtc b/tmtc index 28983d38..b1aaef90 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 28983d387b82578a73fbfe052cb53dec1910d021 +Subproject commit b1aaef90c72874f501c6524ec967827f17e8cedf From baa6f05f8eeaa79c6f7ac7855db4587646c0db2b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 25 Apr 2022 08:48:22 +0200 Subject: [PATCH 04/43] neat --- bsp_q7s/core/acsModeTree.cpp | 185 +++++++----------- bsp_q7s/core/acsModeTree.h | 2 +- .../AcsControllerDefinitions.h | 10 +- 3 files changed, 70 insertions(+), 127 deletions(-) diff --git a/bsp_q7s/core/acsModeTree.cpp b/bsp_q7s/core/acsModeTree.cpp index 58c1159a..207a98bf 100644 --- a/bsp_q7s/core/acsModeTree.cpp +++ b/bsp_q7s/core/acsModeTree.cpp @@ -1,38 +1,36 @@ +#include "acsModeTree.h" + #include #include - -#include "acsModeTree.h" -#include "mission/controller/controllerdefinitions/AcsControllerDefinitions.h" -#include -#include #include +#include +#include -FixedArrayList ACS_SEQUENCE_OFF = FixedArrayList(); -FixedArrayList ACS_TABLE_OFF_TGT = FixedArrayList(); -FixedArrayList ACS_TABLE_OFF_TRANS = FixedArrayList(); - -static constexpr Mode_t ACS_SEQUENCE_OFF_ID = acs::CtrlModes::OFF; -static constexpr Mode_t ACS_TABLE_OFF_TGT_ID = (acs::CtrlModes::OFF << 8) | 1; -static constexpr Mode_t ACS_TABLE_OFF_TRANS_ID = (acs::CtrlModes::OFF << 8) | 2; - -FixedArrayList ACS_SEQUENCE_DETUMBLE = FixedArrayList(); -FixedArrayList ACS_TABLE_DETUMBLE_TGT = FixedArrayList(); -FixedArrayList ACS_TABLE_DETUMBLE_TRANS_0 = FixedArrayList(); -FixedArrayList ACS_TABLE_DETUMBLE_TRANS_1 = FixedArrayList(); - -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; +#include "mission/controller/controllerdefinitions/AcsControllerDefinitions.h" // Alias for checker function const auto CHK = satsystem::checkInsert; static const auto OFF = HasModesIF::MODE_OFF; static const auto NML = DeviceHandlerIF::MODE_NORMAL; +auto ACS_SEQUENCE_OFF = std::make_pair(acs::CtrlModes::OFF, FixedArrayList()); +auto ACS_TABLE_OFF_TGT = + std::make_pair((acs::CtrlModes::OFF << 8) | 1, FixedArrayList()); +auto ACS_TABLE_OFF_TRANS = + std::make_pair((acs::CtrlModes::OFF << 8) | 2, FixedArrayList()); + +auto ACS_SEQUENCE_DETUMBLE = + std::make_pair(acs::CtrlModes::DETUMBLE, FixedArrayList()); +auto ACS_TABLE_DETUMBLE_TGT = + std::make_pair((acs::CtrlModes::DETUMBLE << 8) | 1, FixedArrayList()); +auto ACS_TABLE_DETUMBLE_TRANS_0 = + std::make_pair((acs::CtrlModes::DETUMBLE << 8) | 2, FixedArrayList()); +auto ACS_TABLE_DETUMBLE_TRANS_1 = + std::make_pair((acs::CtrlModes::DETUMBLE << 8) | 3, FixedArrayList()); + void satsystem::acsSubsystemInit() { 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); buildDetumbleSequence(acsSubsystem, entry); acsSubsystem->setInitialMode(HasModesIF::MODE_OFF); @@ -41,121 +39,74 @@ void satsystem::acsSubsystemInit() { void satsystem::buildOffSequence(Subsystem* ss, ModeListEntry& eh) { std::string context = "satsystem::buildOffSequence"; auto ctxc = context.c_str(); - // Build OFF target - ss->addTable(&ACS_TABLE_OFF_TGT, ACS_TABLE_OFF_TGT_ID, false, true); + + auto ih = [&](object_id_t obj, Mode_t mode, Submode_t submode, + ArrayList& sequence) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + CHK(sequence.insert(eh), ctxc); + }; // Build OFF transition - eh.setObject(objects::ACS_CONTROLLER); - eh.setMode(OFF); - eh.setSubmode(0); - CHK(ACS_TABLE_OFF_TRANS.insert(eh), ctxc); - - eh.setObject(objects::IMTQ_HANDLER); - eh.setMode(OFF); - eh.setSubmode(0); - CHK(ACS_TABLE_OFF_TRANS.insert(eh), ctxc); - - eh.setObject(objects::STAR_TRACKER); - eh.setMode(OFF); - eh.setSubmode(0); - CHK(ACS_TABLE_OFF_TRANS.insert(eh), ctxc); - - eh.setObject(objects::ACS_BOARD_ASS); - eh.setMode(OFF); - eh.setSubmode(0); - CHK(ACS_TABLE_OFF_TRANS.insert(eh), ctxc); - - eh.setObject(objects::SUS_BOARD_ASS); - eh.setMode(OFF); - eh.setSubmode(0); - CHK(ACS_TABLE_OFF_TRANS.insert(eh), ctxc); - - eh.setObject(objects::RW_ASS); - eh.setMode(OFF); - eh.setSubmode(0); - CHK(ACS_TABLE_OFF_TRANS.insert(eh), ctxc); - - ss->addTable(&ACS_TABLE_OFF_TRANS, ACS_TABLE_OFF_TRANS_ID, false, true); + ih(objects::ACS_CONTROLLER, OFF, 0, ACS_TABLE_OFF_TRANS.second); + ih(objects::IMTQ_HANDLER, OFF, 0, ACS_TABLE_OFF_TRANS.second); + ih(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_OFF_TRANS.second); + ih(objects::ACS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); + ih(objects::SUS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); + ih(objects::RW_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); // Build OFF sequence - eh.setTableId(ACS_TABLE_OFF_TGT_ID); + eh.setTableId(ACS_TABLE_OFF_TGT.first); eh.setWaitSeconds(0); eh.setCheckSuccess(false); - CHK(ACS_SEQUENCE_OFF.insert(eh), ctxc); + CHK(ACS_SEQUENCE_OFF.second.insert(eh), ctxc); - eh.setTableId(ACS_TABLE_OFF_TRANS_ID); + eh.setTableId(ACS_TABLE_OFF_TRANS.first); eh.setWaitSeconds(0); eh.setCheckSuccess(false); - CHK(ACS_SEQUENCE_OFF.insert(eh), ctxc); + CHK(ACS_SEQUENCE_OFF.second.insert(eh), ctxc); - ss->addSequence(&ACS_SEQUENCE_OFF, ACS_SEQUENCE_OFF_ID, ACS_SEQUENCE_OFF_ID, false, true); + // Build OFF target + ss->addTable(&ACS_TABLE_OFF_TGT.second, ACS_TABLE_OFF_TGT.first, false, true); + ss->addTable(&ACS_TABLE_OFF_TRANS.second, ACS_TABLE_OFF_TRANS.first, false, true); + ss->addSequence(&ACS_SEQUENCE_OFF.second, ACS_SEQUENCE_OFF.first, ACS_SEQUENCE_OFF.first, false, + true); } void satsystem::buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { - std::string context = "satsystem::buildDetumbleSequence"; auto ctxc = context.c_str(); + auto ih = [&](object_id_t obj, Mode_t mode, Submode_t submode, + ArrayList& sequence) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + CHK(sequence.insert(eh), ctxc); + }; // Build DETUMBLE target - eh.setObject(objects::ACS_CONTROLLER); - eh.setMode(acs::CtrlModes::DETUMBLE); - eh.setSubmode(0); - CHK(ACS_TABLE_DETUMBLE_TGT.insert(eh), ctxc); + ih(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TGT.second); + ih(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); + ih(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); + ih(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); - 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); + ss->addTable(&ACS_TABLE_DETUMBLE_TGT.second, ACS_TABLE_DETUMBLE_TGT.first, 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); + ih(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + ih(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + ih(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + ih(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + ih(objects::RW_ASS, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); // Build DETUMBLE transition 1 + ih(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TRANS_1.second); - 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); + // Build full sequence + ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_0.second, ACS_TABLE_DETUMBLE_TRANS_0.first, false, true); + ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_1.second, ACS_TABLE_DETUMBLE_TRANS_1.first, false, true); + ss->addSequence(&ACS_SEQUENCE_DETUMBLE.second, ACS_SEQUENCE_DETUMBLE.first, + ACS_SEQUENCE_DETUMBLE.first, false, true); } void satsystem::buildSafeSequence(Subsystem* ss, ModeListEntry& eh) {} @@ -165,7 +116,7 @@ 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) { + if (result != HasReturnvaluesIF::RETURN_OK) { sif::error << "Insertion failed at " << ctx << std::endl; } } diff --git a/bsp_q7s/core/acsModeTree.h b/bsp_q7s/core/acsModeTree.h index 8f0c593d..f37d0f75 100644 --- a/bsp_q7s/core/acsModeTree.h +++ b/bsp_q7s/core/acsModeTree.h @@ -12,4 +12,4 @@ void buildIdleSequence(Subsystem* ss, ModeListEntry& entryHelper); void buildTargetPtSequence(Subsystem* ss, ModeListEntry& entryHelper); void checkInsert(ReturnValue_t result, const char* ctx); -} +} // namespace satsystem diff --git a/mission/controller/controllerdefinitions/AcsControllerDefinitions.h b/mission/controller/controllerdefinitions/AcsControllerDefinitions.h index c05f1b27..d0733046 100644 --- a/mission/controller/controllerdefinitions/AcsControllerDefinitions.h +++ b/mission/controller/controllerdefinitions/AcsControllerDefinitions.h @@ -5,16 +5,8 @@ namespace acs { -enum CtrlModes { - OFF = HasModesIF::MODE_OFF, - DETUMBLE = 2, - SAFE = 3, - IDLE = 4, - TARGET_PT = 5 -}; +enum CtrlModes { OFF = HasModesIF::MODE_OFF, DETUMBLE = 2, SAFE = 3, IDLE = 4, TARGET_PT = 5 }; } - - #endif /* MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCONTROLLERDEFINITIONS_H_ */ From bbb4ba2191582bb70d4289329504a84bfd85b3e3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 25 Apr 2022 10:08:29 +0200 Subject: [PATCH 05/43] baseline acs mode tree done --- bsp_q7s/core/acsModeTree.cpp | 268 +++++++++++++++++++++++++++++------ 1 file changed, 226 insertions(+), 42 deletions(-) diff --git a/bsp_q7s/core/acsModeTree.cpp b/bsp_q7s/core/acsModeTree.cpp index 207a98bf..f99b79fc 100644 --- a/bsp_q7s/core/acsModeTree.cpp +++ b/bsp_q7s/core/acsModeTree.cpp @@ -20,100 +20,284 @@ auto ACS_TABLE_OFF_TRANS = std::make_pair((acs::CtrlModes::OFF << 8) | 2, FixedArrayList()); auto ACS_SEQUENCE_DETUMBLE = - std::make_pair(acs::CtrlModes::DETUMBLE, FixedArrayList()); + std::make_pair(acs::CtrlModes::DETUMBLE, FixedArrayList()); auto ACS_TABLE_DETUMBLE_TGT = - std::make_pair((acs::CtrlModes::DETUMBLE << 8) | 1, FixedArrayList()); + std::make_pair((acs::CtrlModes::DETUMBLE << 8) | 1, FixedArrayList()); auto ACS_TABLE_DETUMBLE_TRANS_0 = std::make_pair((acs::CtrlModes::DETUMBLE << 8) | 2, FixedArrayList()); auto ACS_TABLE_DETUMBLE_TRANS_1 = std::make_pair((acs::CtrlModes::DETUMBLE << 8) | 3, FixedArrayList()); +auto ACS_SEQUENCE_SAFE = + std::make_pair(acs::CtrlModes::SAFE, FixedArrayList()); +auto ACS_TABLE_SAFE_TGT = + std::make_pair((acs::CtrlModes::SAFE << 8) | 1, FixedArrayList()); +auto ACS_TABLE_SAFE_TRANS_0 = + std::make_pair((acs::CtrlModes::SAFE << 8) | 2, FixedArrayList()); +auto ACS_TABLE_SAFE_TRANS_1 = + std::make_pair((acs::CtrlModes::SAFE << 8) | 3, FixedArrayList()); + +auto ACS_SEQUENCE_IDLE = + std::make_pair(acs::CtrlModes::IDLE, FixedArrayList()); +auto ACS_TABLE_IDLE_TGT = + std::make_pair((acs::CtrlModes::IDLE << 8) | 1, FixedArrayList()); +auto ACS_TABLE_IDLE_TRANS_0 = + std::make_pair((acs::CtrlModes::IDLE << 8) | 2, FixedArrayList()); +auto ACS_TABLE_IDLE_TRANS_1 = + std::make_pair((acs::CtrlModes::IDLE << 8) | 3, FixedArrayList()); + +auto ACS_SEQUENCE_TARGET_PT = + std::make_pair(acs::CtrlModes::TARGET_PT, FixedArrayList()); +auto ACS_TABLE_TARGET_PT_TGT = + std::make_pair((acs::CtrlModes::TARGET_PT << 8) | 1, FixedArrayList()); +auto ACS_TABLE_TARGET_PT_TRANS_0 = + std::make_pair((acs::CtrlModes::TARGET_PT << 8) | 2, FixedArrayList()); +auto ACS_TABLE_TARGET_PT_TRANS_1 = + std::make_pair((acs::CtrlModes::TARGET_PT << 8) | 3, FixedArrayList()); + +enum InsertType { + TABLE, + SEQ +}; + void satsystem::acsSubsystemInit() { ModeListEntry entry; Subsystem* acsSubsystem = new Subsystem(objects::ACS_SUBSYSTEM, objects::EIVE_SYSTEM, 20, 20); buildOffSequence(acsSubsystem, entry); + buildSafeSequence(acsSubsystem, entry); buildDetumbleSequence(acsSubsystem, entry); + buildIdleSequence(acsSubsystem, entry); + buildTargetPtSequence(acsSubsystem, entry); acsSubsystem->setInitialMode(HasModesIF::MODE_OFF); } void satsystem::buildOffSequence(Subsystem* ss, ModeListEntry& eh) { std::string context = "satsystem::buildOffSequence"; auto ctxc = context.c_str(); + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, + ArrayList& table) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + CHK(table.insert(eh), ctxc); + }; + // Insert Helper Sequence + auto ihs = [&]( ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + CHK(sequence.insert(eh), ctxc); + }; - auto ih = [&](object_id_t obj, Mode_t mode, Submode_t submode, + // OFF Target table is empty + ss->addTable(&ACS_TABLE_OFF_TGT.second, ACS_TABLE_OFF_TGT.first, false, true); + + // Build OFF transition + iht(objects::ACS_CONTROLLER, OFF, 0, ACS_TABLE_OFF_TRANS.second); + iht(objects::IMTQ_HANDLER, OFF, 0, ACS_TABLE_OFF_TRANS.second); + iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_OFF_TRANS.second); + iht(objects::ACS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); + iht(objects::SUS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); + iht(objects::RW_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); + ss->addTable(&ACS_TABLE_OFF_TRANS.second, ACS_TABLE_OFF_TRANS.first, false, true); + + // Build OFF sequence + ihs(ACS_SEQUENCE_OFF.second, ACS_TABLE_OFF_TGT.first, 0, false); + ihs(ACS_SEQUENCE_OFF.second, ACS_TABLE_OFF_TRANS.first, 0, false); + ss->addSequence(&ACS_SEQUENCE_OFF.second, ACS_SEQUENCE_OFF.first, ACS_SEQUENCE_OFF.first, false, + true); +} + +void satsystem::buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { + std::string context = "satsystem::buildSafeSequence"; + auto ctxc = context.c_str(); + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, ArrayList& sequence) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); CHK(sequence.insert(eh), ctxc); }; + // Insert Helper Sequence + auto ihs = [&]( ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + CHK(sequence.insert(eh), ctxc); + }; + // Build SAFE target + iht(objects::ACS_CONTROLLER, acs::CtrlModes::SAFE, 0, ACS_TABLE_SAFE_TGT.second); + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_SAFE_TGT.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TGT.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TGT.second); + ss->addTable(&ACS_TABLE_SAFE_TGT.second, ACS_TABLE_OFF_TGT.first, false, true); - // Build OFF transition - ih(objects::ACS_CONTROLLER, OFF, 0, ACS_TABLE_OFF_TRANS.second); - ih(objects::IMTQ_HANDLER, OFF, 0, ACS_TABLE_OFF_TRANS.second); - ih(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_OFF_TRANS.second); - ih(objects::ACS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); - ih(objects::SUS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); - ih(objects::RW_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); + // Build SAFE transition 0 + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_SAFE_TRANS_0.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TRANS_0.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TRANS_0.second); + iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second); + iht(objects::RW_ASS, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second); + ss->addTable(&ACS_TABLE_SAFE_TRANS_0.second, ACS_TABLE_SAFE_TRANS_0.first, false, true); - // Build OFF sequence - eh.setTableId(ACS_TABLE_OFF_TGT.first); - eh.setWaitSeconds(0); - eh.setCheckSuccess(false); - CHK(ACS_SEQUENCE_OFF.second.insert(eh), ctxc); + // Build SAFE transition 1 + iht(objects::ACS_CONTROLLER, acs::CtrlModes::SAFE, 0, ACS_TABLE_SAFE_TRANS_1.second); + ss->addTable(&ACS_TABLE_SAFE_TRANS_1.second, ACS_TABLE_SAFE_TRANS_1.first, false, true); - eh.setTableId(ACS_TABLE_OFF_TRANS.first); - eh.setWaitSeconds(0); - eh.setCheckSuccess(false); - CHK(ACS_SEQUENCE_OFF.second.insert(eh), ctxc); - - // Build OFF target - ss->addTable(&ACS_TABLE_OFF_TGT.second, ACS_TABLE_OFF_TGT.first, false, true); - ss->addTable(&ACS_TABLE_OFF_TRANS.second, ACS_TABLE_OFF_TRANS.first, false, true); - ss->addSequence(&ACS_SEQUENCE_OFF.second, ACS_SEQUENCE_OFF.first, ACS_SEQUENCE_OFF.first, false, + // Build SAFE sequence + ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TGT.first, 0, false); + ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TRANS_0.first, 0, false); + ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TRANS_1.first, 0, false); + ss->addSequence(&ACS_SEQUENCE_SAFE.second, ACS_SEQUENCE_SAFE.first, ACS_SEQUENCE_OFF.first, false, true); } void satsystem::buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { std::string context = "satsystem::buildDetumbleSequence"; auto ctxc = context.c_str(); - auto ih = [&](object_id_t obj, Mode_t mode, Submode_t submode, + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, ArrayList& sequence) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); CHK(sequence.insert(eh), ctxc); }; + // Insert Helper Sequence + auto ihs = [&]( ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + CHK(sequence.insert(eh), ctxc); + }; // Build DETUMBLE target - ih(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TGT.second); - ih(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); - ih(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); - ih(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); - + iht(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TGT.second); + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); ss->addTable(&ACS_TABLE_DETUMBLE_TGT.second, ACS_TABLE_DETUMBLE_TGT.first, false, true); // Build DETUMBLE transition 0 - ih(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); - ih(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); - ih(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); - ih(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); - ih(objects::RW_ASS, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + iht(objects::RW_ASS, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_0.second, ACS_TABLE_DETUMBLE_TRANS_0.first, false, true); // Build DETUMBLE transition 1 - ih(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TRANS_1.second); - - // Build full sequence - ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_0.second, ACS_TABLE_DETUMBLE_TRANS_0.first, false, true); + iht(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TRANS_1.second); ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_1.second, ACS_TABLE_DETUMBLE_TRANS_1.first, false, true); + + // Build DETUMBLE sequence + ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TGT.first, 0, false); + ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TRANS_0.first, 0, false); + ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TRANS_1.first, 0, false); ss->addSequence(&ACS_SEQUENCE_DETUMBLE.second, ACS_SEQUENCE_DETUMBLE.first, ACS_SEQUENCE_DETUMBLE.first, false, true); } -void satsystem::buildSafeSequence(Subsystem* ss, ModeListEntry& eh) {} -void satsystem::buildIdleSequence(Subsystem* ss, ModeListEntry& eh) {} +void satsystem::buildIdleSequence(Subsystem* ss, ModeListEntry& eh) { + std::string context = "satsystem::buildIdleSequence"; + auto ctxc = context.c_str(); + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, + ArrayList& sequence) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + CHK(sequence.insert(eh), ctxc); + }; + // Insert Helper Sequence + auto ihs = [&]( ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + CHK(sequence.insert(eh), ctxc); + }; + // Build IDLE target + iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, 0, ACS_TABLE_IDLE_TGT.second); + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_TGT.second); + iht(objects::RW_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second); + ss->addTable(&ACS_TABLE_IDLE_TGT.second, ACS_TABLE_IDLE_TGT.first, false, true); -void satsystem::buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) {} + // Build IDLE transition 0 + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + iht(objects::RW_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + ss->addTable(&ACS_TABLE_IDLE_TRANS_0.second, ACS_TABLE_IDLE_TRANS_0.first, false, true); + + // Build IDLE transition 1 + iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, 0, ACS_TABLE_DETUMBLE_TRANS_1.second); + ss->addTable(&ACS_TABLE_IDLE_TRANS_1.second, ACS_TABLE_IDLE_TRANS_1.first, false, true); + + // Build IDLE sequence + ihs(ACS_SEQUENCE_IDLE.second, ACS_TABLE_IDLE_TGT.first, 0, false); + ihs(ACS_SEQUENCE_IDLE.second, ACS_TABLE_IDLE_TRANS_0.first, 0, false); + ihs(ACS_SEQUENCE_IDLE.second, ACS_TABLE_IDLE_TRANS_1.first, 0, false); + ss->addSequence(&ACS_SEQUENCE_IDLE.second, ACS_SEQUENCE_IDLE.first, + ACS_SEQUENCE_IDLE.first, false, true); +} + +void satsystem::buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { + std::string context = "satsystem::buildTargetPtSequence"; + auto ctxc = context.c_str(); + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, + ArrayList& sequence) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + CHK(sequence.insert(eh), ctxc); + }; + // Insert Helper Sequence + auto ihs = [&]( ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + CHK(sequence.insert(eh), ctxc); + }; + + // Build TARGET PT table + iht(objects::ACS_CONTROLLER, acs::CtrlModes::TARGET_PT, 0, ACS_TABLE_TARGET_PT_TGT.second); + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); + iht(objects::RW_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); + iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); + ss->addTable(&ACS_TABLE_TARGET_PT_TGT.second, ACS_TABLE_TARGET_PT_TGT.first, false, true); + + // Build TARGET PT transition 0 + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); + iht(objects::RW_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); + iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); + ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_0.second, ACS_TABLE_TARGET_PT_TRANS_0.first, false, true); + + // Build TARGET PT transition 1 + iht(objects::ACS_CONTROLLER, acs::CtrlModes::TARGET_PT, 0, ACS_TABLE_TARGET_PT_TRANS_1.second); + ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_1.second, ACS_TABLE_TARGET_PT_TRANS_1.first, false, true); + + // Build IDLE sequence + ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TGT.first, 0, false); + ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TRANS_0.first, 0, false); + ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TRANS_1.first, 0, false); + ss->addSequence(&ACS_SEQUENCE_TARGET_PT.second, ACS_SEQUENCE_TARGET_PT.first, + ACS_SEQUENCE_TARGET_PT.first, false, true); +} void satsystem::checkInsert(ReturnValue_t result, const char* ctx) { if (result != HasReturnvaluesIF::RETURN_OK) { From 298148eebfd6f542a07741cafc41dd2b44390c16 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 25 Apr 2022 10:08:54 +0200 Subject: [PATCH 06/43] bump fsfwgen --- generators/fsfwgen | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/fsfwgen b/generators/fsfwgen index 9d7963f3..d2bdabbf 160000 --- a/generators/fsfwgen +++ b/generators/fsfwgen @@ -1 +1 @@ -Subproject commit 9d7963f3292c669814810adf50d6820b2e5c29b7 +Subproject commit d2bdabbf0f213747efc18cb45fcf2a2294b14bc8 From 9ba65b04fd703d55518f8506e6aa6ce143205ebe Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 25 Apr 2022 10:30:47 +0200 Subject: [PATCH 07/43] add IDLE charge mode --- bsp_q7s/core/acsModeTree.cpp | 224 ++++++++++++------ bsp_q7s/core/acsModeTree.h | 1 + .../AcsControllerDefinitions.h | 6 +- 3 files changed, 154 insertions(+), 77 deletions(-) diff --git a/bsp_q7s/core/acsModeTree.cpp b/bsp_q7s/core/acsModeTree.cpp index f99b79fc..b944caa9 100644 --- a/bsp_q7s/core/acsModeTree.cpp +++ b/bsp_q7s/core/acsModeTree.cpp @@ -13,60 +13,66 @@ const auto CHK = satsystem::checkInsert; static const auto OFF = HasModesIF::MODE_OFF; static const auto NML = DeviceHandlerIF::MODE_NORMAL; -auto ACS_SEQUENCE_OFF = std::make_pair(acs::CtrlModes::OFF, FixedArrayList()); +auto ACS_SEQUENCE_OFF = + std::make_pair(acs::CtrlModes::OFF << 24, FixedArrayList()); auto ACS_TABLE_OFF_TGT = - std::make_pair((acs::CtrlModes::OFF << 8) | 1, FixedArrayList()); + std::make_pair((acs::CtrlModes::OFF << 24) | 1, FixedArrayList()); auto ACS_TABLE_OFF_TRANS = - std::make_pair((acs::CtrlModes::OFF << 8) | 2, FixedArrayList()); + std::make_pair((acs::CtrlModes::OFF << 24) | 2, FixedArrayList()); auto ACS_SEQUENCE_DETUMBLE = - std::make_pair(acs::CtrlModes::DETUMBLE, FixedArrayList()); + std::make_pair(acs::CtrlModes::DETUMBLE << 24, FixedArrayList()); auto ACS_TABLE_DETUMBLE_TGT = - std::make_pair((acs::CtrlModes::DETUMBLE << 8) | 1, FixedArrayList()); + std::make_pair((acs::CtrlModes::DETUMBLE << 24) | 1, FixedArrayList()); auto ACS_TABLE_DETUMBLE_TRANS_0 = - std::make_pair((acs::CtrlModes::DETUMBLE << 8) | 2, FixedArrayList()); + std::make_pair((acs::CtrlModes::DETUMBLE << 24) | 2, FixedArrayList()); auto ACS_TABLE_DETUMBLE_TRANS_1 = - std::make_pair((acs::CtrlModes::DETUMBLE << 8) | 3, FixedArrayList()); + std::make_pair((acs::CtrlModes::DETUMBLE << 24) | 3, FixedArrayList()); auto ACS_SEQUENCE_SAFE = - std::make_pair(acs::CtrlModes::SAFE, FixedArrayList()); + std::make_pair(acs::CtrlModes::SAFE << 24, FixedArrayList()); auto ACS_TABLE_SAFE_TGT = - std::make_pair((acs::CtrlModes::SAFE << 8) | 1, FixedArrayList()); + std::make_pair((acs::CtrlModes::SAFE << 24) | 1, FixedArrayList()); auto ACS_TABLE_SAFE_TRANS_0 = - std::make_pair((acs::CtrlModes::SAFE << 8) | 2, FixedArrayList()); + std::make_pair((acs::CtrlModes::SAFE << 24) | 2, FixedArrayList()); auto ACS_TABLE_SAFE_TRANS_1 = - std::make_pair((acs::CtrlModes::SAFE << 8) | 3, FixedArrayList()); + std::make_pair((acs::CtrlModes::SAFE << 24) | 3, FixedArrayList()); auto ACS_SEQUENCE_IDLE = - std::make_pair(acs::CtrlModes::IDLE, FixedArrayList()); + std::make_pair(acs::CtrlModes::IDLE << 24, FixedArrayList()); auto ACS_TABLE_IDLE_TGT = - std::make_pair((acs::CtrlModes::IDLE << 8) | 1, FixedArrayList()); + std::make_pair((acs::CtrlModes::IDLE << 24) | 1, FixedArrayList()); auto ACS_TABLE_IDLE_TRANS_0 = - std::make_pair((acs::CtrlModes::IDLE << 8) | 2, FixedArrayList()); + std::make_pair((acs::CtrlModes::IDLE << 24) | 2, FixedArrayList()); auto ACS_TABLE_IDLE_TRANS_1 = - std::make_pair((acs::CtrlModes::IDLE << 8) | 3, FixedArrayList()); + std::make_pair((acs::CtrlModes::IDLE << 24) | 3, FixedArrayList()); + +auto ACS_SEQUENCE_IDLE_CHRG = std::make_pair(acs::CtrlModes::IDLE << 24 | (acs::IDLE_CHARGE << 8), + FixedArrayList()); +auto ACS_TABLE_IDLE_CHRG_TGT = std::make_pair( + (acs::CtrlModes::IDLE << 24) | (acs::IDLE_CHARGE << 8) | 1, FixedArrayList()); +auto ACS_TABLE_IDLE_CHRG_TRANS_0 = std::make_pair( + (acs::CtrlModes::IDLE << 24) | (acs::IDLE_CHARGE << 8) | 2, FixedArrayList()); +auto ACS_TABLE_IDLE_CHRG_TRANS_1 = std::make_pair( + (acs::CtrlModes::IDLE << 24) | (acs::IDLE_CHARGE << 8) | 3, FixedArrayList()); auto ACS_SEQUENCE_TARGET_PT = std::make_pair(acs::CtrlModes::TARGET_PT, FixedArrayList()); auto ACS_TABLE_TARGET_PT_TGT = - std::make_pair((acs::CtrlModes::TARGET_PT << 8) | 1, FixedArrayList()); + std::make_pair((acs::CtrlModes::TARGET_PT << 24) | 1, FixedArrayList()); auto ACS_TABLE_TARGET_PT_TRANS_0 = - std::make_pair((acs::CtrlModes::TARGET_PT << 8) | 2, FixedArrayList()); + std::make_pair((acs::CtrlModes::TARGET_PT << 24) | 2, FixedArrayList()); auto ACS_TABLE_TARGET_PT_TRANS_1 = - std::make_pair((acs::CtrlModes::TARGET_PT << 8) | 3, FixedArrayList()); - -enum InsertType { - TABLE, - SEQ -}; + std::make_pair((acs::CtrlModes::TARGET_PT << 24) | 3, FixedArrayList()); void satsystem::acsSubsystemInit() { ModeListEntry entry; - Subsystem* acsSubsystem = new Subsystem(objects::ACS_SUBSYSTEM, objects::EIVE_SYSTEM, 20, 20); + Subsystem* acsSubsystem = new Subsystem(objects::ACS_SUBSYSTEM, objects::EIVE_SYSTEM, 12, 24); buildOffSequence(acsSubsystem, entry); buildSafeSequence(acsSubsystem, entry); buildDetumbleSequence(acsSubsystem, entry); buildIdleSequence(acsSubsystem, entry); + buildIdleChargeSequence(acsSubsystem, entry); buildTargetPtSequence(acsSubsystem, entry); acsSubsystem->setInitialMode(HasModesIF::MODE_OFF); } @@ -75,16 +81,15 @@ void satsystem::buildOffSequence(Subsystem* ss, ModeListEntry& eh) { std::string context = "satsystem::buildOffSequence"; auto ctxc = context.c_str(); // Insert Helper Table - auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, - ArrayList& table) { + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, ArrayList& table) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); CHK(table.insert(eh), ctxc); }; // Insert Helper Sequence - auto ihs = [&]( ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, - bool checkSuccess) { + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); @@ -92,7 +97,7 @@ void satsystem::buildOffSequence(Subsystem* ss, ModeListEntry& eh) { }; // OFF Target table is empty - ss->addTable(&ACS_TABLE_OFF_TGT.second, ACS_TABLE_OFF_TGT.first, false, true); + CHK(ss->addTable(&ACS_TABLE_OFF_TGT.second, ACS_TABLE_OFF_TGT.first, false, true), ctxc); // Build OFF transition iht(objects::ACS_CONTROLLER, OFF, 0, ACS_TABLE_OFF_TRANS.second); @@ -101,13 +106,14 @@ void satsystem::buildOffSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::ACS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); iht(objects::SUS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); iht(objects::RW_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); - ss->addTable(&ACS_TABLE_OFF_TRANS.second, ACS_TABLE_OFF_TRANS.first, false, true); + CHK(ss->addTable(&ACS_TABLE_OFF_TRANS.second, ACS_TABLE_OFF_TRANS.first, false, true), ctxc); // Build OFF sequence ihs(ACS_SEQUENCE_OFF.second, ACS_TABLE_OFF_TGT.first, 0, false); ihs(ACS_SEQUENCE_OFF.second, ACS_TABLE_OFF_TRANS.first, 0, false); - ss->addSequence(&ACS_SEQUENCE_OFF.second, ACS_SEQUENCE_OFF.first, ACS_SEQUENCE_OFF.first, false, - true); + CHK(ss->addSequence(&ACS_SEQUENCE_OFF.second, ACS_SEQUENCE_OFF.first, ACS_SEQUENCE_OFF.first, + false, true), + ctxc); } void satsystem::buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { @@ -115,15 +121,15 @@ void satsystem::buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { auto ctxc = context.c_str(); // Insert Helper Table auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, - ArrayList& sequence) { + ArrayList& sequence) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); CHK(sequence.insert(eh), ctxc); }; // Insert Helper Sequence - auto ihs = [&]( ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, - bool checkSuccess) { + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); @@ -134,7 +140,7 @@ void satsystem::buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_SAFE_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TGT.second); iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TGT.second); - ss->addTable(&ACS_TABLE_SAFE_TGT.second, ACS_TABLE_OFF_TGT.first, false, true); + CHK(ss->addTable(&ACS_TABLE_SAFE_TGT.second, ACS_TABLE_OFF_TGT.first, false, true), ctxc); // Build SAFE transition 0 iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_SAFE_TRANS_0.second); @@ -142,18 +148,21 @@ void satsystem::buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TRANS_0.second); iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second); iht(objects::RW_ASS, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second); - ss->addTable(&ACS_TABLE_SAFE_TRANS_0.second, ACS_TABLE_SAFE_TRANS_0.first, false, true); + CHK(ss->addTable(&ACS_TABLE_SAFE_TRANS_0.second, ACS_TABLE_SAFE_TRANS_0.first, false, true), + ctxc); // Build SAFE transition 1 iht(objects::ACS_CONTROLLER, acs::CtrlModes::SAFE, 0, ACS_TABLE_SAFE_TRANS_1.second); - ss->addTable(&ACS_TABLE_SAFE_TRANS_1.second, ACS_TABLE_SAFE_TRANS_1.first, false, true); + CHK(ss->addTable(&ACS_TABLE_SAFE_TRANS_1.second, ACS_TABLE_SAFE_TRANS_1.first, false, true), + ctxc); // Build SAFE sequence - ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TGT.first, 0, false); + ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TGT.first, 0, true); ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TRANS_0.first, 0, false); ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TRANS_1.first, 0, false); - ss->addSequence(&ACS_SEQUENCE_SAFE.second, ACS_SEQUENCE_SAFE.first, ACS_SEQUENCE_OFF.first, false, - true); + CHK(ss->addSequence(&ACS_SEQUENCE_SAFE.second, ACS_SEQUENCE_SAFE.first, ACS_SEQUENCE_OFF.first, + false, true), + ctxc); } void satsystem::buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { @@ -161,15 +170,15 @@ void satsystem::buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { auto ctxc = context.c_str(); // Insert Helper Table auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, - ArrayList& sequence) { + ArrayList& sequence) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); CHK(sequence.insert(eh), ctxc); }; // Insert Helper Sequence - auto ihs = [&]( ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, - bool checkSuccess) { + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); @@ -180,7 +189,8 @@ void satsystem::buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); - ss->addTable(&ACS_TABLE_DETUMBLE_TGT.second, ACS_TABLE_DETUMBLE_TGT.first, false, true); + CHK(ss->addTable(&ACS_TABLE_DETUMBLE_TGT.second, ACS_TABLE_DETUMBLE_TGT.first, false, true), + ctxc); // Build DETUMBLE transition 0 iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); @@ -188,35 +198,39 @@ void satsystem::buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); iht(objects::RW_ASS, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); - ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_0.second, ACS_TABLE_DETUMBLE_TRANS_0.first, false, true); + CHK(ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_0.second, ACS_TABLE_DETUMBLE_TRANS_0.first, false, + true), + ctxc); // Build DETUMBLE transition 1 iht(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TRANS_1.second); - ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_1.second, ACS_TABLE_DETUMBLE_TRANS_1.first, false, true); + CHK(ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_1.second, ACS_TABLE_DETUMBLE_TRANS_1.first, false, + true), + ctxc); // Build DETUMBLE sequence - ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TGT.first, 0, false); + ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TGT.first, 0, true); ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TRANS_0.first, 0, false); ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TRANS_1.first, 0, false); - ss->addSequence(&ACS_SEQUENCE_DETUMBLE.second, ACS_SEQUENCE_DETUMBLE.first, - ACS_SEQUENCE_DETUMBLE.first, false, true); + CHK(ss->addSequence(&ACS_SEQUENCE_DETUMBLE.second, ACS_SEQUENCE_DETUMBLE.first, + ACS_SEQUENCE_SAFE.first, false, true), + ctxc); } - void satsystem::buildIdleSequence(Subsystem* ss, ModeListEntry& eh) { std::string context = "satsystem::buildIdleSequence"; auto ctxc = context.c_str(); // Insert Helper Table auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, - ArrayList& sequence) { + ArrayList& sequence) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); CHK(sequence.insert(eh), ctxc); }; // Insert Helper Sequence - auto ihs = [&]( ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, - bool checkSuccess) { + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); @@ -231,23 +245,77 @@ void satsystem::buildIdleSequence(Subsystem* ss, ModeListEntry& eh) { ss->addTable(&ACS_TABLE_IDLE_TGT.second, ACS_TABLE_IDLE_TGT.first, false, true); // Build IDLE transition 0 - iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); - iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); - iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); - iht(objects::RW_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); - iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_TRANS_0.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TRANS_0.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TRANS_0.second); + iht(objects::RW_ASS, NML, 0, ACS_TABLE_IDLE_TRANS_0.second); + iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_IDLE_TRANS_0.second); ss->addTable(&ACS_TABLE_IDLE_TRANS_0.second, ACS_TABLE_IDLE_TRANS_0.first, false, true); // Build IDLE transition 1 - iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, 0, ACS_TABLE_DETUMBLE_TRANS_1.second); + iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, 0, ACS_TABLE_IDLE_TRANS_1.second); ss->addTable(&ACS_TABLE_IDLE_TRANS_1.second, ACS_TABLE_IDLE_TRANS_1.first, false, true); // Build IDLE sequence - ihs(ACS_SEQUENCE_IDLE.second, ACS_TABLE_IDLE_TGT.first, 0, false); - ihs(ACS_SEQUENCE_IDLE.second, ACS_TABLE_IDLE_TRANS_0.first, 0, false); + ihs(ACS_SEQUENCE_IDLE.second, ACS_TABLE_IDLE_TGT.first, 0, true); + ihs(ACS_SEQUENCE_IDLE.second, ACS_TABLE_IDLE_TRANS_0.first, 0, true); ihs(ACS_SEQUENCE_IDLE.second, ACS_TABLE_IDLE_TRANS_1.first, 0, false); - ss->addSequence(&ACS_SEQUENCE_IDLE.second, ACS_SEQUENCE_IDLE.first, - ACS_SEQUENCE_IDLE.first, false, true); + ss->addSequence(&ACS_SEQUENCE_IDLE.second, ACS_SEQUENCE_IDLE.first, ACS_SEQUENCE_SAFE.first, + false, true); +} + +void satsystem::buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { + std::string context = "satsystem::buildIdleChargeSequence"; + auto ctxc = context.c_str(); + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, + ArrayList& sequence) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + CHK(sequence.insert(eh), ctxc); + }; + // Insert Helper Sequence + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + CHK(sequence.insert(eh), ctxc); + }; + // Build IDLE target + iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, acs::IDLE_CHARGE, + ACS_TABLE_IDLE_CHRG_TGT.second); + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second); + CHK(ss->addTable(&ACS_TABLE_IDLE_CHRG_TGT.second, ACS_TABLE_IDLE_CHRG_TGT.first, false, true), + ctxc); + + // Build IDLE transition 0 + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); + iht(objects::RW_ASS, OFF, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); + iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); + CHK(ss->addTable(&ACS_TABLE_IDLE_CHRG_TRANS_0.second, ACS_TABLE_IDLE_CHRG_TRANS_0.first, false, + true), + ctxc); + + // Build IDLE transition 1 + iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, acs::IDLE_CHARGE, + ACS_TABLE_IDLE_CHRG_TRANS_1.second); + CHK(ss->addTable(&ACS_TABLE_IDLE_CHRG_TRANS_1.second, ACS_TABLE_IDLE_CHRG_TRANS_1.first, false, + true), + ctxc); + + // Build IDLE sequence + ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TGT.first, 0, true); + ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TRANS_0.first, 0, true); + ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TRANS_1.first, 0, false); + CHK(ss->addSequence(&ACS_SEQUENCE_IDLE_CHRG.second, ACS_SEQUENCE_IDLE_CHRG.first, + ACS_SEQUENCE_SAFE.first, false, true), + ctxc); } void satsystem::buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { @@ -255,15 +323,15 @@ void satsystem::buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { auto ctxc = context.c_str(); // Insert Helper Table auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, - ArrayList& sequence) { + ArrayList& sequence) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); CHK(sequence.insert(eh), ctxc); }; // Insert Helper Sequence - auto ihs = [&]( ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, - bool checkSuccess) { + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); @@ -277,7 +345,8 @@ void satsystem::buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); iht(objects::RW_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); - ss->addTable(&ACS_TABLE_TARGET_PT_TGT.second, ACS_TABLE_TARGET_PT_TGT.first, false, true); + CHK(ss->addTable(&ACS_TABLE_TARGET_PT_TGT.second, ACS_TABLE_TARGET_PT_TGT.first, false, true), + ctxc); // Build TARGET PT transition 0 iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); @@ -285,22 +354,27 @@ void satsystem::buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); iht(objects::RW_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); - ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_0.second, ACS_TABLE_TARGET_PT_TRANS_0.first, false, true); + CHK(ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_0.second, ACS_TABLE_TARGET_PT_TRANS_0.first, false, + true), + ctxc); // Build TARGET PT transition 1 iht(objects::ACS_CONTROLLER, acs::CtrlModes::TARGET_PT, 0, ACS_TABLE_TARGET_PT_TRANS_1.second); - ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_1.second, ACS_TABLE_TARGET_PT_TRANS_1.first, false, true); + CHK(ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_1.second, ACS_TABLE_TARGET_PT_TRANS_1.first, false, + true), + ctxc); // Build IDLE sequence - ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TGT.first, 0, false); - ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TRANS_0.first, 0, false); + ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TGT.first, 0, true); + ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TRANS_0.first, 0, true); ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TRANS_1.first, 0, false); - ss->addSequence(&ACS_SEQUENCE_TARGET_PT.second, ACS_SEQUENCE_TARGET_PT.first, - ACS_SEQUENCE_TARGET_PT.first, false, true); + CHK(ss->addSequence(&ACS_SEQUENCE_TARGET_PT.second, ACS_SEQUENCE_TARGET_PT.first, + ACS_SEQUENCE_IDLE.first, false, true), + ctxc); } void satsystem::checkInsert(ReturnValue_t result, const char* ctx) { if (result != HasReturnvaluesIF::RETURN_OK) { - sif::error << "Insertion failed at " << ctx << std::endl; + sif::warning << "satsystem::checkInsert: Insertion failed at " << ctx << std::endl; } } diff --git a/bsp_q7s/core/acsModeTree.h b/bsp_q7s/core/acsModeTree.h index f37d0f75..b6c96e39 100644 --- a/bsp_q7s/core/acsModeTree.h +++ b/bsp_q7s/core/acsModeTree.h @@ -9,6 +9,7 @@ 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 buildIdleChargeSequence(Subsystem* ss, ModeListEntry& entryHelper); void buildTargetPtSequence(Subsystem* ss, ModeListEntry& entryHelper); void checkInsert(ReturnValue_t result, const char* ctx); diff --git a/mission/controller/controllerdefinitions/AcsControllerDefinitions.h b/mission/controller/controllerdefinitions/AcsControllerDefinitions.h index d0733046..8122178d 100644 --- a/mission/controller/controllerdefinitions/AcsControllerDefinitions.h +++ b/mission/controller/controllerdefinitions/AcsControllerDefinitions.h @@ -5,8 +5,10 @@ namespace acs { -enum CtrlModes { OFF = HasModesIF::MODE_OFF, DETUMBLE = 2, SAFE = 3, IDLE = 4, TARGET_PT = 5 }; +enum CtrlModes { OFF = HasModesIF::MODE_OFF, SAFE = 1, DETUMBLE = 2, IDLE = 3, TARGET_PT = 4 }; -} +static constexpr Submode_t IDLE_CHARGE = 1; + +} // namespace acs #endif /* MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCONTROLLERDEFINITIONS_H_ */ From f014e2d5c794897f17fa0a5a70e7ca3ae716a299 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 25 Apr 2022 10:36:03 +0200 Subject: [PATCH 08/43] system folder restructuring --- bsp_q7s/core/CMakeLists.txt | 1 - bsp_q7s/core/ObjectFactory.cpp | 30 +++++++++---------- linux/ObjectFactory.cpp | 8 ++--- mission/devices/PayloadPcduHandler.h | 4 +-- mission/system/CMakeLists.txt | 19 ++---------- .../system/{ => objects}/AcsBoardAssembly.cpp | 0 .../system/{ => objects}/AcsBoardAssembly.h | 0 mission/system/{ => objects}/AcsBoardFdir.cpp | 0 mission/system/{ => objects}/AcsBoardFdir.h | 0 mission/system/{ => objects}/AcsSubsystem.cpp | 0 mission/system/{ => objects}/AcsSubsystem.h | 0 mission/system/objects/CMakeLists.txt | 17 +++++++++++ mission/system/{ => objects}/ComSubsystem.cpp | 0 mission/system/{ => objects}/ComSubsystem.h | 0 .../{ => objects}/DualLaneAssemblyBase.cpp | 0 .../{ => objects}/DualLaneAssemblyBase.h | 2 +- .../DualLanePowerStateMachine.cpp | 0 .../{ => objects}/DualLanePowerStateMachine.h | 2 +- mission/system/{ => objects}/EiveSystem.cpp | 0 mission/system/{ => objects}/EiveSystem.h | 0 .../system/{ => objects}/PayloadSubsystem.cpp | 0 .../system/{ => objects}/PayloadSubsystem.h | 0 .../{ => objects}/PowerStateMachineBase.cpp | 0 .../{ => objects}/PowerStateMachineBase.h | 0 mission/system/{ => objects}/RtdFdir.cpp | 0 mission/system/{ => objects}/RtdFdir.h | 0 mission/system/{ => objects}/SusAssembly.cpp | 0 mission/system/{ => objects}/SusAssembly.h | 0 mission/system/{ => objects}/SusFdir.cpp | 0 mission/system/{ => objects}/SusFdir.h | 0 .../system/{ => objects}/TcsBoardAssembly.cpp | 0 .../system/{ => objects}/TcsBoardAssembly.h | 0 mission/system/{ => objects}/definitions.h | 0 mission/system/tree/CMakeLists.txt | 3 ++ .../system/tree}/acsModeTree.cpp | 0 .../system/tree}/acsModeTree.h | 0 36 files changed, 45 insertions(+), 41 deletions(-) rename mission/system/{ => objects}/AcsBoardAssembly.cpp (100%) rename mission/system/{ => objects}/AcsBoardAssembly.h (100%) rename mission/system/{ => objects}/AcsBoardFdir.cpp (100%) rename mission/system/{ => objects}/AcsBoardFdir.h (100%) rename mission/system/{ => objects}/AcsSubsystem.cpp (100%) rename mission/system/{ => objects}/AcsSubsystem.h (100%) create mode 100644 mission/system/objects/CMakeLists.txt rename mission/system/{ => objects}/ComSubsystem.cpp (100%) rename mission/system/{ => objects}/ComSubsystem.h (100%) rename mission/system/{ => objects}/DualLaneAssemblyBase.cpp (100%) rename mission/system/{ => objects}/DualLaneAssemblyBase.h (98%) rename mission/system/{ => objects}/DualLanePowerStateMachine.cpp (100%) rename mission/system/{ => objects}/DualLanePowerStateMachine.h (91%) rename mission/system/{ => objects}/EiveSystem.cpp (100%) rename mission/system/{ => objects}/EiveSystem.h (100%) rename mission/system/{ => objects}/PayloadSubsystem.cpp (100%) rename mission/system/{ => objects}/PayloadSubsystem.h (100%) rename mission/system/{ => objects}/PowerStateMachineBase.cpp (100%) rename mission/system/{ => objects}/PowerStateMachineBase.h (100%) rename mission/system/{ => objects}/RtdFdir.cpp (100%) rename mission/system/{ => objects}/RtdFdir.h (100%) rename mission/system/{ => objects}/SusAssembly.cpp (100%) rename mission/system/{ => objects}/SusAssembly.h (100%) rename mission/system/{ => objects}/SusFdir.cpp (100%) rename mission/system/{ => objects}/SusFdir.h (100%) rename mission/system/{ => objects}/TcsBoardAssembly.cpp (100%) rename mission/system/{ => objects}/TcsBoardAssembly.h (100%) rename mission/system/{ => objects}/definitions.h (100%) create mode 100644 mission/system/tree/CMakeLists.txt rename {bsp_q7s/core => mission/system/tree}/acsModeTree.cpp (100%) rename {bsp_q7s/core => mission/system/tree}/acsModeTree.h (100%) diff --git a/bsp_q7s/core/CMakeLists.txt b/bsp_q7s/core/CMakeLists.txt index 30538565..8731b7a3 100644 --- a/bsp_q7s/core/CMakeLists.txt +++ b/bsp_q7s/core/CMakeLists.txt @@ -1,5 +1,4 @@ target_sources(${OBSW_NAME} PRIVATE - acsModeTree.cpp CoreController.cpp obsw.cpp InitMission.cpp diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index ecc88ede..a675ffc5 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -37,11 +37,11 @@ #include "linux/obc/PdecHandler.h" #include "linux/obc/Ptme.h" #include "linux/obc/PtmeConfig.h" -#include "mission/system/AcsBoardFdir.h" -#include "mission/system/RtdFdir.h" -#include "mission/system/SusAssembly.h" -#include "mission/system/SusFdir.h" -#include "mission/system/TcsBoardAssembly.h" +#include "mission/system/objects/AcsBoardFdir.h" +#include "mission/system/objects/RtdFdir.h" +#include "mission/system/objects/SusAssembly.h" +#include "mission/system/objects/SusFdir.h" +#include "mission/system/objects/TcsBoardAssembly.h" #include "tmtc/apid.h" #include "tmtc/pusIds.h" @@ -92,13 +92,13 @@ #include "mission/devices/devicedefinitions/SusDefinitions.h" #include "mission/devices/devicedefinitions/SyrlinksDefinitions.h" #include "mission/devices/devicedefinitions/payloadPcduDefinitions.h" -#include "mission/system/AcsBoardAssembly.h" +#include "mission/system/objects/AcsBoardAssembly.h" #include "mission/tmtc/CCSDSHandler.h" #include "mission/tmtc/VirtualChannel.h" #include "mission/utility/TmFunnel.h" -ResetArgs resetArgsGnss0; -ResetArgs resetArgsGnss1; +ResetArgs RESET_ARGS_GNSS_0; +ResetArgs RESET_ARGS_GNSS_1; void ObjectFactory::setStatics() { Factory::setStaticFrameworkObjectIds(); } @@ -537,15 +537,15 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI #if OBSW_DEBUG_GPS == 1 debugGps = true; #endif - resetArgsGnss1.gnss1 = true; - resetArgsGnss1.gpioComIF = gpioComIF; - resetArgsGnss1.waitPeriodMs = 100; - resetArgsGnss0.gnss1 = false; - resetArgsGnss0.gpioComIF = gpioComIF; - resetArgsGnss0.waitPeriodMs = 100; + RESET_ARGS_GNSS_1.gnss1 = true; + RESET_ARGS_GNSS_1.gpioComIF = gpioComIF; + RESET_ARGS_GNSS_1.waitPeriodMs = 100; + RESET_ARGS_GNSS_0.gnss1 = false; + RESET_ARGS_GNSS_0.gpioComIF = gpioComIF; + RESET_ARGS_GNSS_0.waitPeriodMs = 100; auto gpsHandler0 = new GPSHyperionLinuxController(objects::GPS_CONTROLLER, objects::NO_OBJECT, debugGps); - gpsHandler0->setResetPinTriggerFunction(gps::triggerGpioResetPin, &resetArgsGnss0); + gpsHandler0->setResetPinTriggerFunction(gps::triggerGpioResetPin, &RESET_ARGS_GNSS_0); AcsBoardHelper acsBoardHelper = AcsBoardHelper( objects::MGM_0_LIS3_HANDLER, objects::MGM_1_RM3100_HANDLER, objects::MGM_2_LIS3_HANDLER, diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index 7811fdbe..6b86b128 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -9,10 +9,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "OBSWConfig.h" #include "devConf.h" diff --git a/mission/devices/PayloadPcduHandler.h b/mission/devices/PayloadPcduHandler.h index dba5b4ef..d5d0f5b1 100644 --- a/mission/devices/PayloadPcduHandler.h +++ b/mission/devices/PayloadPcduHandler.h @@ -10,8 +10,8 @@ #include "fsfw_hal/common/gpio/GpioIF.h" #include "mission/devices/devicedefinitions/payloadPcduDefinitions.h" #include "mission/memory/SdCardMountedIF.h" -#include "mission/system/DualLanePowerStateMachine.h" -#include "mission/system/definitions.h" +#include "mission/system/objects/DualLanePowerStateMachine.h" +#include "mission/system/objects/definitions.h" #ifdef FSFW_OSAL_LINUX class SpiComIF; diff --git a/mission/system/CMakeLists.txt b/mission/system/CMakeLists.txt index 59418a07..0e9ce773 100644 --- a/mission/system/CMakeLists.txt +++ b/mission/system/CMakeLists.txt @@ -1,17 +1,2 @@ -target_sources(${LIB_EIVE_MISSION} PRIVATE - EiveSystem.cpp - AcsSubsystem.cpp - ComSubsystem.cpp - PayloadSubsystem.cpp - - AcsBoardAssembly.cpp - SusAssembly.cpp - DualLanePowerStateMachine.cpp - PowerStateMachineBase.cpp - DualLaneAssemblyBase.cpp - TcsBoardAssembly.cpp - - AcsBoardFdir.cpp - SusFdir.cpp - RtdFdir.cpp -) \ No newline at end of file +add_subdirectory(objects) +add_subdirectory(tree) diff --git a/mission/system/AcsBoardAssembly.cpp b/mission/system/objects/AcsBoardAssembly.cpp similarity index 100% rename from mission/system/AcsBoardAssembly.cpp rename to mission/system/objects/AcsBoardAssembly.cpp diff --git a/mission/system/AcsBoardAssembly.h b/mission/system/objects/AcsBoardAssembly.h similarity index 100% rename from mission/system/AcsBoardAssembly.h rename to mission/system/objects/AcsBoardAssembly.h diff --git a/mission/system/AcsBoardFdir.cpp b/mission/system/objects/AcsBoardFdir.cpp similarity index 100% rename from mission/system/AcsBoardFdir.cpp rename to mission/system/objects/AcsBoardFdir.cpp diff --git a/mission/system/AcsBoardFdir.h b/mission/system/objects/AcsBoardFdir.h similarity index 100% rename from mission/system/AcsBoardFdir.h rename to mission/system/objects/AcsBoardFdir.h diff --git a/mission/system/AcsSubsystem.cpp b/mission/system/objects/AcsSubsystem.cpp similarity index 100% rename from mission/system/AcsSubsystem.cpp rename to mission/system/objects/AcsSubsystem.cpp diff --git a/mission/system/AcsSubsystem.h b/mission/system/objects/AcsSubsystem.h similarity index 100% rename from mission/system/AcsSubsystem.h rename to mission/system/objects/AcsSubsystem.h diff --git a/mission/system/objects/CMakeLists.txt b/mission/system/objects/CMakeLists.txt new file mode 100644 index 00000000..22fd63b7 --- /dev/null +++ b/mission/system/objects/CMakeLists.txt @@ -0,0 +1,17 @@ +target_sources(${LIB_EIVE_MISSION} PRIVATE + EiveSystem.cpp + AcsSubsystem.cpp + ComSubsystem.cpp + PayloadSubsystem.cpp + + AcsBoardAssembly.cpp + SusAssembly.cpp + DualLanePowerStateMachine.cpp + PowerStateMachineBase.cpp + DualLaneAssemblyBase.cpp + TcsBoardAssembly.cpp + + AcsBoardFdir.cpp + SusFdir.cpp + RtdFdir.cpp +) diff --git a/mission/system/ComSubsystem.cpp b/mission/system/objects/ComSubsystem.cpp similarity index 100% rename from mission/system/ComSubsystem.cpp rename to mission/system/objects/ComSubsystem.cpp diff --git a/mission/system/ComSubsystem.h b/mission/system/objects/ComSubsystem.h similarity index 100% rename from mission/system/ComSubsystem.h rename to mission/system/objects/ComSubsystem.h diff --git a/mission/system/DualLaneAssemblyBase.cpp b/mission/system/objects/DualLaneAssemblyBase.cpp similarity index 100% rename from mission/system/DualLaneAssemblyBase.cpp rename to mission/system/objects/DualLaneAssemblyBase.cpp diff --git a/mission/system/DualLaneAssemblyBase.h b/mission/system/objects/DualLaneAssemblyBase.h similarity index 98% rename from mission/system/DualLaneAssemblyBase.h rename to mission/system/objects/DualLaneAssemblyBase.h index 4233d860..7a8c7ac9 100644 --- a/mission/system/DualLaneAssemblyBase.h +++ b/mission/system/objects/DualLaneAssemblyBase.h @@ -2,7 +2,7 @@ #define MISSION_SYSTEM_DUALLANEASSEMBLYBASE_H_ #include -#include +#include /** * @brief Encapsulates assemblies which are also responsible for dual lane power switching diff --git a/mission/system/DualLanePowerStateMachine.cpp b/mission/system/objects/DualLanePowerStateMachine.cpp similarity index 100% rename from mission/system/DualLanePowerStateMachine.cpp rename to mission/system/objects/DualLanePowerStateMachine.cpp diff --git a/mission/system/DualLanePowerStateMachine.h b/mission/system/objects/DualLanePowerStateMachine.h similarity index 91% rename from mission/system/DualLanePowerStateMachine.h rename to mission/system/objects/DualLanePowerStateMachine.h index d2160c64..7a6f29b6 100644 --- a/mission/system/DualLanePowerStateMachine.h +++ b/mission/system/objects/DualLanePowerStateMachine.h @@ -3,7 +3,7 @@ #include #include -#include +#include #include "definitions.h" diff --git a/mission/system/EiveSystem.cpp b/mission/system/objects/EiveSystem.cpp similarity index 100% rename from mission/system/EiveSystem.cpp rename to mission/system/objects/EiveSystem.cpp diff --git a/mission/system/EiveSystem.h b/mission/system/objects/EiveSystem.h similarity index 100% rename from mission/system/EiveSystem.h rename to mission/system/objects/EiveSystem.h diff --git a/mission/system/PayloadSubsystem.cpp b/mission/system/objects/PayloadSubsystem.cpp similarity index 100% rename from mission/system/PayloadSubsystem.cpp rename to mission/system/objects/PayloadSubsystem.cpp diff --git a/mission/system/PayloadSubsystem.h b/mission/system/objects/PayloadSubsystem.h similarity index 100% rename from mission/system/PayloadSubsystem.h rename to mission/system/objects/PayloadSubsystem.h diff --git a/mission/system/PowerStateMachineBase.cpp b/mission/system/objects/PowerStateMachineBase.cpp similarity index 100% rename from mission/system/PowerStateMachineBase.cpp rename to mission/system/objects/PowerStateMachineBase.cpp diff --git a/mission/system/PowerStateMachineBase.h b/mission/system/objects/PowerStateMachineBase.h similarity index 100% rename from mission/system/PowerStateMachineBase.h rename to mission/system/objects/PowerStateMachineBase.h diff --git a/mission/system/RtdFdir.cpp b/mission/system/objects/RtdFdir.cpp similarity index 100% rename from mission/system/RtdFdir.cpp rename to mission/system/objects/RtdFdir.cpp diff --git a/mission/system/RtdFdir.h b/mission/system/objects/RtdFdir.h similarity index 100% rename from mission/system/RtdFdir.h rename to mission/system/objects/RtdFdir.h diff --git a/mission/system/SusAssembly.cpp b/mission/system/objects/SusAssembly.cpp similarity index 100% rename from mission/system/SusAssembly.cpp rename to mission/system/objects/SusAssembly.cpp diff --git a/mission/system/SusAssembly.h b/mission/system/objects/SusAssembly.h similarity index 100% rename from mission/system/SusAssembly.h rename to mission/system/objects/SusAssembly.h diff --git a/mission/system/SusFdir.cpp b/mission/system/objects/SusFdir.cpp similarity index 100% rename from mission/system/SusFdir.cpp rename to mission/system/objects/SusFdir.cpp diff --git a/mission/system/SusFdir.h b/mission/system/objects/SusFdir.h similarity index 100% rename from mission/system/SusFdir.h rename to mission/system/objects/SusFdir.h diff --git a/mission/system/TcsBoardAssembly.cpp b/mission/system/objects/TcsBoardAssembly.cpp similarity index 100% rename from mission/system/TcsBoardAssembly.cpp rename to mission/system/objects/TcsBoardAssembly.cpp diff --git a/mission/system/TcsBoardAssembly.h b/mission/system/objects/TcsBoardAssembly.h similarity index 100% rename from mission/system/TcsBoardAssembly.h rename to mission/system/objects/TcsBoardAssembly.h diff --git a/mission/system/definitions.h b/mission/system/objects/definitions.h similarity index 100% rename from mission/system/definitions.h rename to mission/system/objects/definitions.h diff --git a/mission/system/tree/CMakeLists.txt b/mission/system/tree/CMakeLists.txt new file mode 100644 index 00000000..f88891d4 --- /dev/null +++ b/mission/system/tree/CMakeLists.txt @@ -0,0 +1,3 @@ +target_sources(${LIB_EIVE_MISSION} PRIVATE + acsModeTree.cpp +) diff --git a/bsp_q7s/core/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp similarity index 100% rename from bsp_q7s/core/acsModeTree.cpp rename to mission/system/tree/acsModeTree.cpp diff --git a/bsp_q7s/core/acsModeTree.h b/mission/system/tree/acsModeTree.h similarity index 100% rename from bsp_q7s/core/acsModeTree.h rename to mission/system/tree/acsModeTree.h From f9dd77b8ec2ea608a2ee3960ab158b305de54904 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 25 Apr 2022 10:50:59 +0200 Subject: [PATCH 09/43] create and schedule ACS SS --- bsp_q7s/core/InitMission.cpp | 14 +++++++++----- bsp_q7s/core/ObjectFactory.cpp | 4 ++++ mission/system/tree/acsModeTree.cpp | 26 +++++++++++++++++--------- mission/system/tree/acsModeTree.h | 9 +-------- 4 files changed, 31 insertions(+), 22 deletions(-) diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index ced1d12a..b2fbb41f 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -114,9 +114,9 @@ void initmission::initTasks() { #endif /* OBSW_USE_CCSDS_IP_CORE == 1 */ #if OBSW_ADD_ACS_HANDLERS == 1 - PeriodicTaskIF* acsTask = factory->createPeriodicTask( - "ACS_CTRL", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); - result = acsTask->addComponent(objects::GPS_CONTROLLER); + PeriodicTaskIF* gpsTask = factory->createPeriodicTask( + "ACS_CTRL", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); + result = gpsTask->addComponent(objects::GPS_CONTROLLER); if (result != HasReturnvaluesIF::RETURN_OK) { initmission::printAddObjectError("GPS_CTRL", objects::GPS_CONTROLLER); } @@ -124,7 +124,7 @@ void initmission::initTasks() { #endif /* OBSW_ADD_ACS_HANDLERS */ PeriodicTaskIF* sysTask = factory->createPeriodicTask( - "SYS_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); + "SYS_TASK", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); result = sysTask->addComponent(objects::ACS_BOARD_ASS); if (result != HasReturnvaluesIF::RETURN_OK) { initmission::printAddObjectError("ACS_BOARD_ASS", objects::ACS_BOARD_ASS); @@ -139,6 +139,10 @@ void initmission::initTasks() { if (result != HasReturnvaluesIF::RETURN_OK) { initmission::printAddObjectError("TCS_BOARD_ASS", objects::TCS_BOARD_ASS); } + result = sysTask->addComponent(objects::ACS_SUBSYSTEM); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("ACS_SUBSYSTEM", objects::ACS_SUBSYSTEM); + } // FS task, task interval does not matter because it runs in permanent loop, priority low // because it is a non-essential background task @@ -227,7 +231,7 @@ void initmission::initTasks() { #endif /* OBSW_ADD_STAR_TRACKER == 1 */ #if OBSW_ADD_ACS_HANDLERS == 1 - acsTask->startTask(); + gpsTask->startTask(); #endif sysTask->startTask(); diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index a675ffc5..19457188 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -42,6 +42,7 @@ #include "mission/system/objects/SusAssembly.h" #include "mission/system/objects/SusFdir.h" #include "mission/system/objects/TcsBoardAssembly.h" +#include "mission/system/tree/acsModeTree.h" #include "tmtc/apid.h" #include "tmtc/pusIds.h" @@ -135,6 +136,7 @@ void ObjectFactory::produce(void* args) { SpiComIF* spiComIF = nullptr; I2cComIF* i2cComIF = nullptr; PowerSwitchIF* pwrSwitcher = nullptr; + createCommunicationInterfaces(&gpioComIF, &uartComIF, &spiComIF, &i2cComIF); createTmpComponents(); new CoreController(objects::CORE_CONTROLLER); @@ -205,6 +207,8 @@ void ObjectFactory::produce(void* args) { new PlocUpdater(objects::PLOC_UPDATER); new PlocMemoryDumper(objects::PLOC_MEMORY_DUMPER); + + satsystem::initAcsSubsystem(); } void ObjectFactory::createTmpComponents() { diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index b944caa9..e5748f08 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -8,8 +8,16 @@ #include "mission/controller/controllerdefinitions/AcsControllerDefinitions.h" +void checkInsert(ReturnValue_t result, const char* ctx); +void buildOffSequence(Subsystem* ss, ModeListEntry& eh); +void buildDetumbleSequence(Subsystem* ss, ModeListEntry& entryHelper); +void buildSafeSequence(Subsystem* ss, ModeListEntry& entryHelper); +void buildIdleSequence(Subsystem* ss, ModeListEntry& entryHelper); +void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& entryHelper); +void buildTargetPtSequence(Subsystem* ss, ModeListEntry& entryHelper); + // Alias for checker function -const auto CHK = satsystem::checkInsert; +const auto CHK = checkInsert; static const auto OFF = HasModesIF::MODE_OFF; static const auto NML = DeviceHandlerIF::MODE_NORMAL; @@ -65,7 +73,7 @@ auto ACS_TABLE_TARGET_PT_TRANS_0 = auto ACS_TABLE_TARGET_PT_TRANS_1 = std::make_pair((acs::CtrlModes::TARGET_PT << 24) | 3, FixedArrayList()); -void satsystem::acsSubsystemInit() { +void satsystem::initAcsSubsystem() { ModeListEntry entry; Subsystem* acsSubsystem = new Subsystem(objects::ACS_SUBSYSTEM, objects::EIVE_SYSTEM, 12, 24); buildOffSequence(acsSubsystem, entry); @@ -77,7 +85,7 @@ void satsystem::acsSubsystemInit() { acsSubsystem->setInitialMode(HasModesIF::MODE_OFF); } -void satsystem::buildOffSequence(Subsystem* ss, ModeListEntry& eh) { +void buildOffSequence(Subsystem* ss, ModeListEntry& eh) { std::string context = "satsystem::buildOffSequence"; auto ctxc = context.c_str(); // Insert Helper Table @@ -116,7 +124,7 @@ void satsystem::buildOffSequence(Subsystem* ss, ModeListEntry& eh) { ctxc); } -void satsystem::buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { +void buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { std::string context = "satsystem::buildSafeSequence"; auto ctxc = context.c_str(); // Insert Helper Table @@ -165,7 +173,7 @@ void satsystem::buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { ctxc); } -void satsystem::buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { +void buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { std::string context = "satsystem::buildDetumbleSequence"; auto ctxc = context.c_str(); // Insert Helper Table @@ -217,7 +225,7 @@ void satsystem::buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { ctxc); } -void satsystem::buildIdleSequence(Subsystem* ss, ModeListEntry& eh) { +void buildIdleSequence(Subsystem* ss, ModeListEntry& eh) { std::string context = "satsystem::buildIdleSequence"; auto ctxc = context.c_str(); // Insert Helper Table @@ -264,7 +272,7 @@ void satsystem::buildIdleSequence(Subsystem* ss, ModeListEntry& eh) { false, true); } -void satsystem::buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { +void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { std::string context = "satsystem::buildIdleChargeSequence"; auto ctxc = context.c_str(); // Insert Helper Table @@ -318,7 +326,7 @@ void satsystem::buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { ctxc); } -void satsystem::buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { +void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { std::string context = "satsystem::buildTargetPtSequence"; auto ctxc = context.c_str(); // Insert Helper Table @@ -373,7 +381,7 @@ void satsystem::buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { ctxc); } -void satsystem::checkInsert(ReturnValue_t result, const char* ctx) { +void checkInsert(ReturnValue_t result, const char* ctx) { if (result != HasReturnvaluesIF::RETURN_OK) { sif::warning << "satsystem::checkInsert: Insertion failed at " << ctx << std::endl; } diff --git a/mission/system/tree/acsModeTree.h b/mission/system/tree/acsModeTree.h index b6c96e39..5ad5d7c9 100644 --- a/mission/system/tree/acsModeTree.h +++ b/mission/system/tree/acsModeTree.h @@ -4,13 +4,6 @@ class Subsystem; namespace satsystem { -void acsSubsystemInit(); -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 buildIdleChargeSequence(Subsystem* ss, ModeListEntry& entryHelper); -void buildTargetPtSequence(Subsystem* ss, ModeListEntry& entryHelper); +void initAcsSubsystem(); -void checkInsert(ReturnValue_t result, const char* ctx); } // namespace satsystem From b4a54804dfbbefbeea06028f50a391bcaf78a164 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 28 Apr 2022 13:07:28 +0200 Subject: [PATCH 10/43] submodule update --- generators/fsfwgen | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/fsfwgen b/generators/fsfwgen index d2bdabbf..2a408e8c 160000 --- a/generators/fsfwgen +++ b/generators/fsfwgen @@ -1 +1 @@ -Subproject commit d2bdabbf0f213747efc18cb45fcf2a2294b14bc8 +Subproject commit 2a408e8c7dd2ebe974b9699fb5aee0889aa86392 From 40b84b0576cd3fac16a2788ac17a70254fd20392 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 28 Apr 2022 13:08:19 +0200 Subject: [PATCH 11/43] update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2ef8a06..e1b7d3cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ list yields a list of all related PRs for each release. # [v1.11.0] +## Added + +- ACS Subsystem + ## Changed - Update rootfs base of Linux, all related OBSW changes From 5de45a7ae7d70a40387636813dc0c01f4bd6f641 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 28 Apr 2022 16:05:01 +0200 Subject: [PATCH 12/43] more readable --- mission/system/tree/acsModeTree.cpp | 64 ++++++++++++++--------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index e5748f08..b78a5ff2 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -17,7 +17,7 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& entryHelper); void buildTargetPtSequence(Subsystem* ss, ModeListEntry& entryHelper); // Alias for checker function -const auto CHK = checkInsert; +const auto check = checkInsert; static const auto OFF = HasModesIF::MODE_OFF; static const auto NML = DeviceHandlerIF::MODE_NORMAL; @@ -93,7 +93,7 @@ void buildOffSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(table.insert(eh), ctxc); + check(table.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -101,11 +101,11 @@ void buildOffSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // OFF Target table is empty - CHK(ss->addTable(&ACS_TABLE_OFF_TGT.second, ACS_TABLE_OFF_TGT.first, false, true), ctxc); + check(ss->addTable(&ACS_TABLE_OFF_TGT.second, ACS_TABLE_OFF_TGT.first, false, true), ctxc); // Build OFF transition iht(objects::ACS_CONTROLLER, OFF, 0, ACS_TABLE_OFF_TRANS.second); @@ -114,12 +114,12 @@ void buildOffSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::ACS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); iht(objects::SUS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); iht(objects::RW_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); - CHK(ss->addTable(&ACS_TABLE_OFF_TRANS.second, ACS_TABLE_OFF_TRANS.first, false, true), ctxc); + check(ss->addTable(&ACS_TABLE_OFF_TRANS.second, ACS_TABLE_OFF_TRANS.first, false, true), ctxc); // Build OFF sequence ihs(ACS_SEQUENCE_OFF.second, ACS_TABLE_OFF_TGT.first, 0, false); ihs(ACS_SEQUENCE_OFF.second, ACS_TABLE_OFF_TRANS.first, 0, false); - CHK(ss->addSequence(&ACS_SEQUENCE_OFF.second, ACS_SEQUENCE_OFF.first, ACS_SEQUENCE_OFF.first, + check(ss->addSequence(&ACS_SEQUENCE_OFF.second, ACS_SEQUENCE_OFF.first, ACS_SEQUENCE_OFF.first, false, true), ctxc); } @@ -133,7 +133,7 @@ void buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -141,14 +141,14 @@ void buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Build SAFE target iht(objects::ACS_CONTROLLER, acs::CtrlModes::SAFE, 0, ACS_TABLE_SAFE_TGT.second); iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_SAFE_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TGT.second); iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TGT.second); - CHK(ss->addTable(&ACS_TABLE_SAFE_TGT.second, ACS_TABLE_OFF_TGT.first, false, true), ctxc); + check(ss->addTable(&ACS_TABLE_SAFE_TGT.second, ACS_TABLE_OFF_TGT.first, false, true), ctxc); // Build SAFE transition 0 iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_SAFE_TRANS_0.second); @@ -156,19 +156,19 @@ void buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TRANS_0.second); iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second); iht(objects::RW_ASS, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second); - CHK(ss->addTable(&ACS_TABLE_SAFE_TRANS_0.second, ACS_TABLE_SAFE_TRANS_0.first, false, true), + check(ss->addTable(&ACS_TABLE_SAFE_TRANS_0.second, ACS_TABLE_SAFE_TRANS_0.first, false, true), ctxc); // Build SAFE transition 1 iht(objects::ACS_CONTROLLER, acs::CtrlModes::SAFE, 0, ACS_TABLE_SAFE_TRANS_1.second); - CHK(ss->addTable(&ACS_TABLE_SAFE_TRANS_1.second, ACS_TABLE_SAFE_TRANS_1.first, false, true), + check(ss->addTable(&ACS_TABLE_SAFE_TRANS_1.second, ACS_TABLE_SAFE_TRANS_1.first, false, true), ctxc); // Build SAFE sequence ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TGT.first, 0, true); ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TRANS_0.first, 0, false); ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TRANS_1.first, 0, false); - CHK(ss->addSequence(&ACS_SEQUENCE_SAFE.second, ACS_SEQUENCE_SAFE.first, ACS_SEQUENCE_OFF.first, + check(ss->addSequence(&ACS_SEQUENCE_SAFE.second, ACS_SEQUENCE_SAFE.first, ACS_SEQUENCE_OFF.first, false, true), ctxc); } @@ -182,7 +182,7 @@ void buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -190,14 +190,14 @@ void buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Build DETUMBLE target iht(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TGT.second); iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); - CHK(ss->addTable(&ACS_TABLE_DETUMBLE_TGT.second, ACS_TABLE_DETUMBLE_TGT.first, false, true), + check(ss->addTable(&ACS_TABLE_DETUMBLE_TGT.second, ACS_TABLE_DETUMBLE_TGT.first, false, true), ctxc); // Build DETUMBLE transition 0 @@ -206,13 +206,13 @@ void buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); iht(objects::RW_ASS, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); - CHK(ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_0.second, ACS_TABLE_DETUMBLE_TRANS_0.first, false, + check(ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_0.second, ACS_TABLE_DETUMBLE_TRANS_0.first, false, true), ctxc); // Build DETUMBLE transition 1 iht(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TRANS_1.second); - CHK(ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_1.second, ACS_TABLE_DETUMBLE_TRANS_1.first, false, + check(ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_1.second, ACS_TABLE_DETUMBLE_TRANS_1.first, false, true), ctxc); @@ -220,7 +220,7 @@ void buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TGT.first, 0, true); ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TRANS_0.first, 0, false); ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TRANS_1.first, 0, false); - CHK(ss->addSequence(&ACS_SEQUENCE_DETUMBLE.second, ACS_SEQUENCE_DETUMBLE.first, + check(ss->addSequence(&ACS_SEQUENCE_DETUMBLE.second, ACS_SEQUENCE_DETUMBLE.first, ACS_SEQUENCE_SAFE.first, false, true), ctxc); } @@ -234,7 +234,7 @@ void buildIdleSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -242,7 +242,7 @@ void buildIdleSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Build IDLE target iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, 0, ACS_TABLE_IDLE_TGT.second); @@ -281,7 +281,7 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -289,7 +289,7 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Build IDLE target iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, acs::IDLE_CHARGE, @@ -297,7 +297,7 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second); iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second); - CHK(ss->addTable(&ACS_TABLE_IDLE_CHRG_TGT.second, ACS_TABLE_IDLE_CHRG_TGT.first, false, true), + check(ss->addTable(&ACS_TABLE_IDLE_CHRG_TGT.second, ACS_TABLE_IDLE_CHRG_TGT.first, false, true), ctxc); // Build IDLE transition 0 @@ -306,14 +306,14 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); iht(objects::RW_ASS, OFF, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); - CHK(ss->addTable(&ACS_TABLE_IDLE_CHRG_TRANS_0.second, ACS_TABLE_IDLE_CHRG_TRANS_0.first, false, + check(ss->addTable(&ACS_TABLE_IDLE_CHRG_TRANS_0.second, ACS_TABLE_IDLE_CHRG_TRANS_0.first, false, true), ctxc); // Build IDLE transition 1 iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, acs::IDLE_CHARGE, ACS_TABLE_IDLE_CHRG_TRANS_1.second); - CHK(ss->addTable(&ACS_TABLE_IDLE_CHRG_TRANS_1.second, ACS_TABLE_IDLE_CHRG_TRANS_1.first, false, + check(ss->addTable(&ACS_TABLE_IDLE_CHRG_TRANS_1.second, ACS_TABLE_IDLE_CHRG_TRANS_1.first, false, true), ctxc); @@ -321,7 +321,7 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TGT.first, 0, true); ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TRANS_0.first, 0, true); ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TRANS_1.first, 0, false); - CHK(ss->addSequence(&ACS_SEQUENCE_IDLE_CHRG.second, ACS_SEQUENCE_IDLE_CHRG.first, + check(ss->addSequence(&ACS_SEQUENCE_IDLE_CHRG.second, ACS_SEQUENCE_IDLE_CHRG.first, ACS_SEQUENCE_SAFE.first, false, true), ctxc); } @@ -335,7 +335,7 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, @@ -343,7 +343,7 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { eh.setTableId(tableId); eh.setWaitSeconds(waitSeconds); eh.setCheckSuccess(checkSuccess); - CHK(sequence.insert(eh), ctxc); + check(sequence.insert(eh), ctxc); }; // Build TARGET PT table @@ -353,7 +353,7 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); iht(objects::RW_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); - CHK(ss->addTable(&ACS_TABLE_TARGET_PT_TGT.second, ACS_TABLE_TARGET_PT_TGT.first, false, true), + check(ss->addTable(&ACS_TABLE_TARGET_PT_TGT.second, ACS_TABLE_TARGET_PT_TGT.first, false, true), ctxc); // Build TARGET PT transition 0 @@ -362,13 +362,13 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); iht(objects::RW_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); - CHK(ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_0.second, ACS_TABLE_TARGET_PT_TRANS_0.first, false, + check(ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_0.second, ACS_TABLE_TARGET_PT_TRANS_0.first, false, true), ctxc); // Build TARGET PT transition 1 iht(objects::ACS_CONTROLLER, acs::CtrlModes::TARGET_PT, 0, ACS_TABLE_TARGET_PT_TRANS_1.second); - CHK(ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_1.second, ACS_TABLE_TARGET_PT_TRANS_1.first, false, + check(ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_1.second, ACS_TABLE_TARGET_PT_TRANS_1.first, false, true), ctxc); @@ -376,7 +376,7 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TGT.first, 0, true); ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TRANS_0.first, 0, true); ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TRANS_1.first, 0, false); - CHK(ss->addSequence(&ACS_SEQUENCE_TARGET_PT.second, ACS_SEQUENCE_TARGET_PT.first, + check(ss->addSequence(&ACS_SEQUENCE_TARGET_PT.second, ACS_SEQUENCE_TARGET_PT.first, ACS_SEQUENCE_IDLE.first, false, true), ctxc); } From aa9acef76a9e0593ad37ec92389a96da46f3627c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 2 May 2022 12:53:12 +0200 Subject: [PATCH 13/43] bump tmtc submodule --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 8d0a8312..0a47c17f 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 8d0a83122932deb49a9e536bea1a0b5723b1cb2a +Subproject commit 0a47c17fa699dc571d2d3e63ec08c9f4cf513f65 From 83c7ec8067490665b2c14ecb5ddb80a1bd0acb20 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 25 May 2022 10:12:37 +0200 Subject: [PATCH 14/43] solve merge conflicts --- bsp_q7s/core/InitMission.cpp | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index 008bc68f..b6a4fa37 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -154,6 +154,10 @@ void initmission::initTasks() { initmission::printAddObjectError("SUS_BOARD_ASS", objects::SUS_BOARD_ASS); } #endif + result = sysTask->addComponent(objects::ACS_SUBSYSTEM); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("ACS_SUBSYSTEM", objects::ACS_SUBSYSTEM); + } PeriodicTaskIF* tcsPollingTask = factory->createPeriodicTask( "TCS_POLLING_TASK", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.5, missedDeadlineFunc); @@ -161,13 +165,7 @@ void initmission::initTasks() { if (result != HasReturnvaluesIF::RETURN_OK) { initmission::printAddObjectError("SPI_RTD_POLLING", objects::SPI_RTD_COM_IF); } -<<<<<<< HEAD - result = sysTask->addComponent(objects::ACS_SUBSYSTEM); - if (result != HasReturnvaluesIF::RETURN_OK) { - initmission::printAddObjectError("ACS_SUBSYSTEM", objects::ACS_SUBSYSTEM); - } -#endif /* OBSW_ADD_RTD_DEVICES == 1 */ -======= + PeriodicTaskIF* tcsTask = factory->createPeriodicTask( "TCS_TASK", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc); std::array rtdIds = { @@ -198,7 +196,6 @@ void initmission::initTasks() { tcsTask->addComponent(rtd, DeviceHandlerIF::GET_READ); } #endif /* OBSW_ADD_RTD_DEVICES */ ->>>>>>> origin/develop // FS task, task interval does not matter because it runs in permanent loop, priority low // because it is a non-essential background task @@ -295,14 +292,7 @@ void initmission::initTasks() { strHelperTask->startTask(); #endif /* OBSW_ADD_STAR_TRACKER == 1 */ -<<<<<<< HEAD -#if OBSW_ADD_ACS_HANDLERS == 1 - gpsTask->startTask(); -#endif -#if OBSW_ADD_RTD_DEVICES == 1 -======= acsTask->startTask(); ->>>>>>> origin/develop sysTask->startTask(); tcsPollingTask->startTask(); tcsTask->startTask(); From 86d3732f65dea0e443dda139daf9c8469e714429 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 29 Aug 2022 15:57:26 +0200 Subject: [PATCH 15/43] retval replacements --- bsp_q7s/core/InitMission.cpp | 2 +- mission/system/tree/acsModeTree.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index 3aed9bd8..01662b59 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -160,7 +160,7 @@ void initmission::initTasks() { } #endif result = sysTask->addComponent(objects::ACS_SUBSYSTEM); - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { initmission::printAddObjectError("ACS_SUBSYSTEM", objects::ACS_SUBSYSTEM); } diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index bfab8c26..9f7d18df 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -382,7 +382,7 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { } void checkInsert(ReturnValue_t result, const char* ctx) { - if (result != HasReturnvaluesIF::RETURN_OK) { + if (result != returnvalue::OK) { sif::warning << "satsystem::checkInsert: Insertion failed at " << ctx << std::endl; } } From 5813c5dd4384bbe5b699a68ce7a98bcb92dcee6c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 27 Sep 2022 14:58:40 +0200 Subject: [PATCH 16/43] bump fsfw --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 7e0a5d5a..808e3e04 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 7e0a5d5a9e4f38c6d818bbdd5b44d34d8007eb1e +Subproject commit 808e3e0462999d7caa1b6834174140dbbeb8b01c From 6bdc0b23dec886c171554471e6763fd421e37815 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 29 Sep 2022 13:13:38 +0200 Subject: [PATCH 17/43] bump fsfw and tmtc --- fsfw | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fsfw b/fsfw index 9927dbb2..808e3e04 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 9927dbb2e47d9f7a54f4e386a0e1f41b84ff2e0e +Subproject commit 808e3e0462999d7caa1b6834174140dbbeb8b01c diff --git a/tmtc b/tmtc index f8e8f9a1..debbe981 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit f8e8f9a125bb9b919da2fceeeb4b143aff5bf6ed +Subproject commit debbe9813b1ff0d395cccabad84ee4afe10f64e5 From 8a5248a46dd48bc38b815209fc46bf325a24341d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 29 Sep 2022 14:03:09 +0200 Subject: [PATCH 18/43] include fix --- mission/system/tree/acsModeTree.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index 9f7d18df..f0fbbea9 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -1,6 +1,6 @@ #include "acsModeTree.h" +#include "eive/objects.h" -#include #include #include #include From 0f609fdaba586809dba81ea8ec8103218cb16644 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 29 Sep 2022 16:47:47 +0200 Subject: [PATCH 19/43] thats a bit tricky --- bsp_q7s/core/ObjectFactory.cpp | 7 ++++--- bsp_q7s/core/ObjectFactory.h | 4 ++-- bsp_q7s/fmObjectFactory.cpp | 6 +++--- fsfw | 2 +- mission/system/tree/acsModeTree.cpp | 11 +++++++++-- mission/system/tree/acsModeTree.h | 2 +- 6 files changed, 20 insertions(+), 12 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index cc59baaa..770a9063 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -1,3 +1,4 @@ +#include #include "ObjectFactory.h" #include "OBSWConfig.h" @@ -233,7 +234,7 @@ void ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF) { } void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF, - PowerSwitchIF* pwrSwitcher) { + PowerSwitchIF* pwrSwitcher, object_id_t acsSubsystemId) { using namespace gpio; GpioCookie* gpioCookieAcsBoard = new GpioCookie(); @@ -477,7 +478,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI objects::MGM_0_LIS3_HANDLER, objects::MGM_1_RM3100_HANDLER, objects::MGM_2_LIS3_HANDLER, objects::MGM_3_RM3100_HANDLER, objects::GYRO_0_ADIS_HANDLER, objects::GYRO_1_L3G_HANDLER, objects::GYRO_2_ADIS_HANDLER, objects::GYRO_3_L3G_HANDLER, objects::GPS_CONTROLLER); - auto acsAss = new AcsBoardAssembly(objects::ACS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher, + auto acsAss = new AcsBoardAssembly(objects::ACS_BOARD_ASS, acsSubsystemId, pwrSwitcher, acsBoardHelper, gpioComIF); static_cast(acsAss); #endif /* OBSW_ADD_ACS_HANDLERS == 1 */ @@ -885,7 +886,7 @@ void ObjectFactory::createStrComponents(PowerSwitchIF* pwrSwitcher) { starTracker->setPowerSwitcher(pwrSwitcher); } -void ObjectFactory::createImtqComponents(PowerSwitchIF* pwrSwitcher) { +void ObjectFactory::createImtqComponents(PowerSwitchIF* pwrSwitcher, object_id_t acsSubsystem) { I2cCookie* imtqI2cCookie = new I2cCookie(addresses::IMTQ, IMTQ::MAX_REPLY_SIZE, q7s::I2C_DEFAULT_DEV); auto imtqHandler = new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie, diff --git a/bsp_q7s/core/ObjectFactory.h b/bsp_q7s/core/ObjectFactory.h index 0b81c235..181ca6d4 100644 --- a/bsp_q7s/core/ObjectFactory.h +++ b/bsp_q7s/core/ObjectFactory.h @@ -28,9 +28,9 @@ void createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF, void createTmpComponents(); void createRadSensorComponent(LinuxLibgpioIF* gpioComIF); void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF, - PowerSwitchIF* pwrSwitcher); + PowerSwitchIF* pwrSwitcher, object_id_t acsSubsystemId); void createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwitcher, HealthTableIF* healthTable); -void createImtqComponents(PowerSwitchIF* pwrSwitcher); +void createImtqComponents(PowerSwitchIF* pwrSwitcher, object_id_t subsystemId); void createBpxBatteryComponent(); void createStrComponents(PowerSwitchIF* pwrSwitcher); void createSolarArrayDeploymentComponents(); diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index 81194754..a31775da 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -31,7 +31,7 @@ void ObjectFactory::produce(void* args) { createSunSensorComponents(gpioComIF, spiMainComIF, pwrSwitcher, q7s::SPI_DEFAULT_DEV); #if OBSW_ADD_ACS_BOARD == 1 - createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher); + createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher, objects::ACS_SUBSYSTEM); #endif createHeaterComponents(gpioComIF, pwrSwitcher, healthTable); createSolarArrayDeploymentComponents(); @@ -43,7 +43,7 @@ void ObjectFactory::produce(void* args) { createPayloadComponents(gpioComIF); #if OBSW_ADD_MGT == 1 - createImtqComponents(pwrSwitcher); + createImtqComponents(pwrSwitcher, objects::ACS_SUBSYSTEM); #endif createReactionWheelComponents(gpioComIF, pwrSwitcher); @@ -65,5 +65,5 @@ void ObjectFactory::produce(void* args) { createMiscComponents(); createThermalController(); createAcsController(); - satsystem::initAcsSubsystem(); + satsystem::initAcsSubsystem(objects::NO_OBJECT); } diff --git a/fsfw b/fsfw index c47bed07..78314ad9 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit c47bed07606548fd2510caa45bdd9fc867732065 +Subproject commit 78314ad9668a2e01408a0111f7f306bbb468a40f diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index f0fbbea9..9436a688 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -73,9 +73,16 @@ auto ACS_TABLE_TARGET_PT_TRANS_0 = auto ACS_TABLE_TARGET_PT_TRANS_1 = std::make_pair((acs::CtrlModes::TARGET_PT << 24) | 3, FixedArrayList()); -void satsystem::initAcsSubsystem() { +void satsystem::initAcsSubsystem(object_id_t satSystemObjId) { ModeListEntry entry; - Subsystem* acsSubsystem = new Subsystem(objects::ACS_SUBSYSTEM, objects::EIVE_SYSTEM, 12, 24); + Subsystem* acsSubsystem = new Subsystem(objects::ACS_SUBSYSTEM, satSystemObjId, 12, 24); + acsSubsystem->registerChild(objects::ACS_CONTROLLER); + acsSubsystem->registerChild(objects::IMTQ_HANDLER); + acsSubsystem->registerChild(objects::STAR_TRACKER); + acsSubsystem->registerChild(objects::ACS_BOARD_ASS); + acsSubsystem->registerChild(objects::SUS_BOARD_ASS); + acsSubsystem->registerChild(objects::IMTQ_HANDLER); + acsSubsystem->registerChild(objects::RW_ASS); buildOffSequence(acsSubsystem, entry); buildSafeSequence(acsSubsystem, entry); buildDetumbleSequence(acsSubsystem, entry); diff --git a/mission/system/tree/acsModeTree.h b/mission/system/tree/acsModeTree.h index 5ad5d7c9..1b7c31eb 100644 --- a/mission/system/tree/acsModeTree.h +++ b/mission/system/tree/acsModeTree.h @@ -4,6 +4,6 @@ class Subsystem; namespace satsystem { -void initAcsSubsystem(); +void initAcsSubsystem(object_id_t satSystemObjId); } // namespace satsystem From f27fccfd29fcf2956cd379bcd3593dff45894eb1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 29 Sep 2022 17:06:19 +0200 Subject: [PATCH 20/43] set DHB parents differently now --- bsp_q7s/core/ObjectFactory.cpp | 25 +++++++++--------- fsfw | 2 +- linux/ObjectFactory.cpp | 48 ++++++++++++++-------------------- 3 files changed, 33 insertions(+), 42 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 770a9063..a7d0648c 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -237,6 +237,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI PowerSwitchIF* pwrSwitcher, object_id_t acsSubsystemId) { using namespace gpio; GpioCookie* gpioCookieAcsBoard = new GpioCookie(); + std::vector> assemblyChildren; std::stringstream consumer; GpiodRegularByLineName* gpio = nullptr; @@ -345,7 +346,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI spiCookie, spi::LIS3_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::MGM_0_LIS3_HANDLER); mgmLis3Handler->setCustomFdir(fdir); - static_cast(mgmLis3Handler); + assemblyChildren.push_back(*mgmLis3Handler); #if OBSW_TEST_ACS == 1 mgmLis3Handler->setStartUpImmediately(); mgmLis3Handler->setToGoToNormalMode(true); @@ -361,8 +362,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI spi::RM3100_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::MGM_1_RM3100_HANDLER); mgmRm3100Handler->setCustomFdir(fdir); - mgmRm3100Handler->setParent(objects::ACS_BOARD_ASS); - static_cast(mgmRm3100Handler); + assemblyChildren.push_back(*mgmRm3100Handler); #if OBSW_TEST_ACS == 1 mgmRm3100Handler->setStartUpImmediately(); mgmRm3100Handler->setToGoToNormalMode(true); @@ -377,8 +377,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI spiCookie, spi::LIS3_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::MGM_2_LIS3_HANDLER); mgmLis3Handler->setCustomFdir(fdir); - mgmLis3Handler->setParent(objects::ACS_BOARD_ASS); - static_cast(mgmLis3Handler); + assemblyChildren.push_back(*mgmLis3Handler); #if OBSW_TEST_ACS == 1 mgmLis3Handler->setStartUpImmediately(); mgmLis3Handler->setToGoToNormalMode(true); @@ -393,7 +392,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI spiCookie, spi::RM3100_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::MGM_3_RM3100_HANDLER); mgmRm3100Handler->setCustomFdir(fdir); - mgmRm3100Handler->setParent(objects::ACS_BOARD_ASS); + assemblyChildren.push_back(*mgmRm3100Handler); #if OBSW_TEST_ACS == 1 mgmRm3100Handler->setStartUpImmediately(); mgmRm3100Handler->setToGoToNormalMode(true); @@ -411,8 +410,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI ADIS1650X::Type::ADIS16505); fdir = new AcsBoardFdir(objects::GYRO_0_ADIS_HANDLER); adisHandler->setCustomFdir(fdir); - adisHandler->setParent(objects::ACS_BOARD_ASS); - static_cast(adisHandler); + assemblyChildren.push_back(*adisHandler); #if OBSW_TEST_ACS == 1 adisHandler->setStartUpImmediately(); adisHandler->setToGoToNormalModeImmediately(); @@ -427,7 +425,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI objects::GYRO_1_L3G_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::L3G_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::GYRO_1_L3G_HANDLER); gyroL3gHandler->setCustomFdir(fdir); - gyroL3gHandler->setParent(objects::ACS_BOARD_ASS); + assemblyChildren.push_back(*gyroL3gHandler); static_cast(gyroL3gHandler); #if OBSW_TEST_ACS == 1 gyroL3gHandler->setStartUpImmediately(); @@ -444,7 +442,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI spiCookie, ADIS1650X::Type::ADIS16505); fdir = new AcsBoardFdir(objects::GYRO_2_ADIS_HANDLER); adisHandler->setCustomFdir(fdir); - adisHandler->setParent(objects::ACS_BOARD_ASS); + assemblyChildren.push_back(*adisHandler); #if OBSW_TEST_ACS == 1 adisHandler->setStartUpImmediately(); adisHandler->setToGoToNormalModeImmediately(); @@ -456,7 +454,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI spiCookie, spi::L3G_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::GYRO_3_L3G_HANDLER); gyroL3gHandler->setCustomFdir(fdir); - gyroL3gHandler->setParent(objects::ACS_BOARD_ASS); + assemblyChildren.push_back(*gyroL3gHandler); #if OBSW_TEST_ACS == 1 gyroL3gHandler->setStartUpImmediately(); gyroL3gHandler->setToGoToNormalMode(true); @@ -473,7 +471,6 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI auto gpsCtrl = new GPSHyperionLinuxController(objects::GPS_CONTROLLER, objects::NO_OBJECT, debugGps); gpsCtrl->setResetPinTriggerFunction(gps::triggerGpioResetPin, &RESET_ARGS_GNSS); - AcsBoardHelper acsBoardHelper = AcsBoardHelper( objects::MGM_0_LIS3_HANDLER, objects::MGM_1_RM3100_HANDLER, objects::MGM_2_LIS3_HANDLER, objects::MGM_3_RM3100_HANDLER, objects::GYRO_0_ADIS_HANDLER, objects::GYRO_1_L3G_HANDLER, @@ -481,6 +478,10 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI auto acsAss = new AcsBoardAssembly(objects::ACS_BOARD_ASS, acsSubsystemId, pwrSwitcher, acsBoardHelper, gpioComIF); static_cast(acsAss); + auto assQueueId = acsAss->getCommandQueue(); + for (auto& assChild: assemblyChildren) { + assChild.get().setParentQueue(assQueueId); + } #endif /* OBSW_ADD_ACS_HANDLERS == 1 */ } diff --git a/fsfw b/fsfw index 78314ad9..77f7fa2e 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 78314ad9668a2e01408a0111f7f306bbb468a40f +Subproject commit 77f7fa2ef125635d87ad9fd3f0cf79e1cd74d071 diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index bcbe9683..e0a38642 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -76,7 +76,6 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo susHandlers[0] = new SusHandler(objects::SUS_0_N_LOC_XFYFZM_PT_XF, 0, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_0_N_LOC_XFYFZM_PT_XF); - susHandlers[0]->setParent(objects::SUS_BOARD_ASS); susHandlers[0]->setCustomFdir(fdir); spiCookie = new SpiCookie(addresses::SUS_1, gpioIds::CS_SUS_1, SUS::MAX_CMD_SIZE, @@ -84,7 +83,6 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo susHandlers[1] = new SusHandler(objects::SUS_1_N_LOC_XBYFZM_PT_XB, 1, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_1_N_LOC_XBYFZM_PT_XB); - susHandlers[1]->setParent(objects::SUS_BOARD_ASS); susHandlers[1]->setCustomFdir(fdir); spiCookie = new SpiCookie(addresses::SUS_2, gpioIds::CS_SUS_2, SUS::MAX_CMD_SIZE, @@ -92,7 +90,6 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo susHandlers[2] = new SusHandler(objects::SUS_2_N_LOC_XFYBZB_PT_YB, 2, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_2_N_LOC_XFYBZB_PT_YB); - susHandlers[2]->setParent(objects::SUS_BOARD_ASS); susHandlers[2]->setCustomFdir(fdir); spiCookie = new SpiCookie(addresses::SUS_3, gpioIds::CS_SUS_3, SUS::MAX_CMD_SIZE, @@ -100,7 +97,6 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo susHandlers[3] = new SusHandler(objects::SUS_3_N_LOC_XFYBZF_PT_YF, 3, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_3_N_LOC_XFYBZF_PT_YF); - susHandlers[3]->setParent(objects::SUS_BOARD_ASS); susHandlers[3]->setCustomFdir(fdir); spiCookie = new SpiCookie(addresses::SUS_4, gpioIds::CS_SUS_4, SUS::MAX_CMD_SIZE, @@ -108,7 +104,6 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo susHandlers[4] = new SusHandler(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, 4, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_4_N_LOC_XMYFZF_PT_ZF); - susHandlers[4]->setParent(objects::SUS_BOARD_ASS); susHandlers[4]->setCustomFdir(fdir); spiCookie = new SpiCookie(addresses::SUS_5, gpioIds::CS_SUS_5, SUS::MAX_CMD_SIZE, @@ -116,7 +111,6 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo susHandlers[5] = new SusHandler(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, 5, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_5_N_LOC_XFYMZB_PT_ZB); - susHandlers[5]->setParent(objects::SUS_BOARD_ASS); susHandlers[5]->setCustomFdir(fdir); spiCookie = new SpiCookie(addresses::SUS_6, gpioIds::CS_SUS_6, SUS::MAX_CMD_SIZE, @@ -124,7 +118,6 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo susHandlers[6] = new SusHandler(objects::SUS_6_R_LOC_XFYBZM_PT_XF, 6, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_6_R_LOC_XFYBZM_PT_XF); - susHandlers[6]->setParent(objects::SUS_BOARD_ASS); susHandlers[6]->setCustomFdir(fdir); spiCookie = new SpiCookie(addresses::SUS_7, gpioIds::CS_SUS_7, SUS::MAX_CMD_SIZE, @@ -132,7 +125,6 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo susHandlers[7] = new SusHandler(objects::SUS_7_R_LOC_XBYBZM_PT_XB, 7, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_7_R_LOC_XBYBZM_PT_XB); - susHandlers[7]->setParent(objects::SUS_BOARD_ASS); susHandlers[7]->setCustomFdir(fdir); spiCookie = new SpiCookie(addresses::SUS_8, gpioIds::CS_SUS_8, SUS::MAX_CMD_SIZE, @@ -140,7 +132,6 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo susHandlers[8] = new SusHandler(objects::SUS_8_R_LOC_XBYBZB_PT_YB, 8, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_8_R_LOC_XBYBZB_PT_YB); - susHandlers[8]->setParent(objects::SUS_BOARD_ASS); susHandlers[8]->setCustomFdir(fdir); spiCookie = new SpiCookie(addresses::SUS_9, gpioIds::CS_SUS_9, SUS::MAX_CMD_SIZE, @@ -148,7 +139,6 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo susHandlers[9] = new SusHandler(objects::SUS_9_R_LOC_XBYBZB_PT_YF, 9, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_9_R_LOC_XBYBZB_PT_YF); - susHandlers[9]->setParent(objects::SUS_BOARD_ASS); susHandlers[9]->setCustomFdir(fdir); spiCookie = new SpiCookie(addresses::SUS_10, gpioIds::CS_SUS_10, SUS::MAX_CMD_SIZE, @@ -156,7 +146,6 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo susHandlers[10] = new SusHandler(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, 10, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_10_N_LOC_XMYBZF_PT_ZF); - susHandlers[10]->setParent(objects::SUS_BOARD_ASS); susHandlers[10]->setCustomFdir(fdir); spiCookie = new SpiCookie(addresses::SUS_11, gpioIds::CS_SUS_11, SUS::MAX_CMD_SIZE, @@ -164,20 +153,8 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo susHandlers[11] = new SusHandler(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, 11, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_11_R_LOC_XBYMZB_PT_ZB); - susHandlers[11]->setParent(objects::SUS_BOARD_ASS); susHandlers[11]->setCustomFdir(fdir); - for (auto& sus : susHandlers) { - if (sus != nullptr) { -#if OBSW_TEST_SUS == 1 - sus->setStartUpImmediately(); - sus->setToGoToNormalMode(true); -#endif -#if OBSW_DEBUG_SUS == 1 - sus->enablePeriodicPrintout(true, 3); -#endif - } - } std::array susIds = { objects::SUS_0_N_LOC_XFYFZM_PT_XF, objects::SUS_1_N_LOC_XBYFZM_PT_XB, objects::SUS_2_N_LOC_XFYBZB_PT_YB, objects::SUS_3_N_LOC_XFYBZF_PT_YF, @@ -189,6 +166,18 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo auto susAss = new SusAssembly(objects::SUS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher, susAssHelper); static_cast(susAss); + for (auto& sus : susHandlers) { + if (sus != nullptr) { + sus->setParentQueue(susAss->getCommandQueue()); +#if OBSW_TEST_SUS == 1 + sus->setStartUpImmediately(); + sus->setToGoToNormalMode(true); +#endif +#if OBSW_DEBUG_SUS == 1 + sus->enablePeriodicPrintout(true, 3); +#endif + } + } #endif /* OBSW_ADD_SUN_SENSORS == 1 */ } @@ -290,6 +279,12 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF, std::array rtdCookies = {}; std::array rtds = {}; RtdFdir* rtdFdir = nullptr; + + TcsBoardHelper helper(rtdInfos); + TcsBoardAssembly* tcsBoardAss = + new TcsBoardAssembly(objects::TCS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher, + pcdu::Switches::PDU1_CH0_TCS_BOARD_3V3, helper); + static_cast(tcsBoardAss); // Create special low level reader communication interface new Max31865RtdReader(objects::SPI_RTD_COM_IF, comIF, gpioComIF); for (uint8_t idx = 0; idx < NUM_RTDS; idx++) { @@ -301,7 +296,7 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF, rtds[idx] = new Max31865EiveHandler(rtdInfos[idx].first, objects::SPI_RTD_COM_IF, rtdLowLevelCookie); rtds[idx]->setDeviceInfo(idx, rtdInfos[idx].second); - rtds[idx]->setParent(objects::TCS_BOARD_ASS); + rtds[idx]->setParentQueue(tcsBoardAss->getCommandQueue()); rtdFdir = new RtdFdir(rtdInfos[idx].first); rtds[idx]->setCustomFdir(rtdFdir); #if OBSW_DEBUG_RTD == 1 @@ -313,11 +308,6 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF, #endif } - TcsBoardHelper helper(rtdInfos); - TcsBoardAssembly* tcsBoardAss = - new TcsBoardAssembly(objects::TCS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher, - pcdu::Switches::PDU1_CH0_TCS_BOARD_3V3, helper); - static_cast(tcsBoardAss); #endif // OBSW_ADD_RTD_DEVICES == 1 } From 30dd6f17787bd1225ed98809da378510a190aef4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 29 Sep 2022 17:24:58 +0200 Subject: [PATCH 21/43] bump fsfw --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 77f7fa2e..b9d0ff8f 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 77f7fa2ef125635d87ad9fd3f0cf79e1cd74d071 +Subproject commit b9d0ff8fb7401db087d9a68dc9918a8f88033560 From 08c03520f503b74d9c34bfb8e7070fa67d653ab9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 29 Sep 2022 17:41:50 +0200 Subject: [PATCH 22/43] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 52d91fe8..c8eaf180 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 52d91fe857e464a6e2d852d0c862dbec623eeef8 +Subproject commit c8eaf180dc724ccd8eab54a66109d861ce14a2d1 From 82cb87abae542b78349cf9f0914ddad2f51fff9c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 29 Sep 2022 17:47:09 +0200 Subject: [PATCH 23/43] re-point fsfw --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index b9d0ff8f..f78344b8 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit b9d0ff8fb7401db087d9a68dc9918a8f88033560 +Subproject commit f78344b8fba94158f3703ee1caa070bf97a04d0a From 6af7ccc6a20f86fec0ce494101fab3c49d96a481 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 29 Sep 2022 19:40:00 +0200 Subject: [PATCH 24/43] need to fix all of these TODOs --- bsp_q7s/core/CoreController.cpp | 5 +- bsp_q7s/core/ObjectFactory.cpp | 14 ++-- bsp_q7s/core/ObjectFactory.h | 2 +- bsp_q7s/fmObjectFactory.cpp | 2 +- fsfw | 2 +- linux/ObjectFactory.cpp | 14 ++-- linux/ObjectFactory.h | 3 +- mission/controller/AcsController.cpp | 2 +- mission/controller/ThermalController.cpp | 4 +- mission/controller/ThermalController.h | 2 +- mission/system/objects/AcsBoardAssembly.cpp | 82 +++++++++---------- mission/system/objects/AcsBoardAssembly.h | 4 +- mission/system/objects/AcsSubsystem.cpp | 6 +- mission/system/objects/AcsSubsystem.h | 3 +- mission/system/objects/CMakeLists.txt | 27 +++--- mission/system/objects/ComSubsystem.cpp | 6 +- mission/system/objects/ComSubsystem.h | 3 +- .../system/objects/DualLaneAssemblyBase.cpp | 9 +- mission/system/objects/DualLaneAssemblyBase.h | 4 +- mission/system/objects/EiveSystem.cpp | 4 +- mission/system/objects/EiveSystem.h | 3 +- mission/system/objects/PayloadSubsystem.cpp | 6 +- mission/system/objects/PayloadSubsystem.h | 2 +- mission/system/objects/RwAssembly.cpp | 13 +-- mission/system/objects/SusAssembly.cpp | 18 ++-- mission/system/objects/SusAssembly.h | 3 +- mission/system/objects/TcsBoardAssembly.cpp | 20 ++--- mission/system/objects/TcsBoardAssembly.h | 4 +- mission/system/tree/CMakeLists.txt | 4 +- mission/system/tree/acsModeTree.cpp | 26 +++--- mission/system/tree/acsModeTree.h | 2 + 31 files changed, 143 insertions(+), 156 deletions(-) diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index 24286d5c..31f81fb9 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -31,10 +31,7 @@ xsc::Chip CoreController::CURRENT_CHIP = xsc::Chip::NO_CHIP; xsc::Copy CoreController::CURRENT_COPY = xsc::Copy::NO_COPY; CoreController::CoreController(object_id_t objectId) - : ExtendedControllerBase(objectId, objects::NO_OBJECT, 5), - opDivider5(5), - opDivider10(10), - hkSet(this) { + : ExtendedControllerBase(objectId, 5), opDivider5(5), opDivider10(10), hkSet(this) { ReturnValue_t result = returnvalue::OK; try { result = initWatchdogFifo(); diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index a7d0648c..27789807 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -1,6 +1,7 @@ -#include #include "ObjectFactory.h" +#include + #include "OBSWConfig.h" #include "bsp_q7s/boardtest/Q7STestTask.h" #include "bsp_q7s/callbacks/gnssCallback.h" @@ -35,7 +36,6 @@ #include "linux/obc/PdecHandler.h" #include "linux/obc/Ptme.h" #include "linux/obc/PtmeConfig.h" - #include "mission/csp/CspCookie.h" #include "mission/system/fdir/AcsBoardFdir.h" #include "mission/system/fdir/GomspacePowerFdir.h" @@ -46,7 +46,6 @@ #include "mission/system/objects/SusAssembly.h" #include "mission/system/objects/TcsBoardAssembly.h" #include "mission/system/tree/acsModeTree.h" - #include "tmtc/pusIds.h" #if OBSW_TEST_LIBGPIOD == 1 #include "linux/boardtest/LibgpiodTest.h" @@ -234,7 +233,7 @@ void ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF) { } void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF, - PowerSwitchIF* pwrSwitcher, object_id_t acsSubsystemId) { + PowerSwitchIF* pwrSwitcher) { using namespace gpio; GpioCookie* gpioCookieAcsBoard = new GpioCookie(); std::vector> assemblyChildren; @@ -475,11 +474,12 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI objects::MGM_0_LIS3_HANDLER, objects::MGM_1_RM3100_HANDLER, objects::MGM_2_LIS3_HANDLER, objects::MGM_3_RM3100_HANDLER, objects::GYRO_0_ADIS_HANDLER, objects::GYRO_1_L3G_HANDLER, objects::GYRO_2_ADIS_HANDLER, objects::GYRO_3_L3G_HANDLER, objects::GPS_CONTROLLER); - auto acsAss = new AcsBoardAssembly(objects::ACS_BOARD_ASS, acsSubsystemId, pwrSwitcher, - acsBoardHelper, gpioComIF); + auto acsAss = + new AcsBoardAssembly(objects::ACS_BOARD_ASS, pwrSwitcher, acsBoardHelper, gpioComIF); + acsAss->connectModeTreeParent(satsystem::ACS_SUBSYSTEM); static_cast(acsAss); auto assQueueId = acsAss->getCommandQueue(); - for (auto& assChild: assemblyChildren) { + for (auto& assChild : assemblyChildren) { assChild.get().setParentQueue(assQueueId); } #endif /* OBSW_ADD_ACS_HANDLERS == 1 */ diff --git a/bsp_q7s/core/ObjectFactory.h b/bsp_q7s/core/ObjectFactory.h index 181ca6d4..498ce166 100644 --- a/bsp_q7s/core/ObjectFactory.h +++ b/bsp_q7s/core/ObjectFactory.h @@ -28,7 +28,7 @@ void createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF, void createTmpComponents(); void createRadSensorComponent(LinuxLibgpioIF* gpioComIF); void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF, - PowerSwitchIF* pwrSwitcher, object_id_t acsSubsystemId); + PowerSwitchIF* pwrSwitcher); void createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwitcher, HealthTableIF* healthTable); void createImtqComponents(PowerSwitchIF* pwrSwitcher, object_id_t subsystemId); void createBpxBatteryComponent(); diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index a31775da..2c948e6d 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -31,7 +31,7 @@ void ObjectFactory::produce(void* args) { createSunSensorComponents(gpioComIF, spiMainComIF, pwrSwitcher, q7s::SPI_DEFAULT_DEV); #if OBSW_ADD_ACS_BOARD == 1 - createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher, objects::ACS_SUBSYSTEM); + createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher); #endif createHeaterComponents(gpioComIF, pwrSwitcher, healthTable); createSolarArrayDeploymentComponents(); diff --git a/fsfw b/fsfw index f78344b8..f8240048 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit f78344b8fba94158f3703ee1caa070bf97a04d0a +Subproject commit f824004897e29bf90c2b02578625ba3d51786fdf diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index e0a38642..6b0b5e22 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -163,8 +163,7 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo objects::SUS_8_R_LOC_XBYBZB_PT_YB, objects::SUS_9_R_LOC_XBYBZB_PT_YF, objects::SUS_10_N_LOC_XMYBZF_PT_ZF, objects::SUS_11_R_LOC_XBYMZB_PT_ZB}; SusAssHelper susAssHelper = SusAssHelper(susIds); - auto susAss = - new SusAssembly(objects::SUS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher, susAssHelper); + auto susAss = new SusAssembly(objects::SUS_BOARD_ASS, pwrSwitcher, susAssHelper); static_cast(susAss); for (auto& sus : susHandlers) { if (sus != nullptr) { @@ -281,9 +280,8 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF, RtdFdir* rtdFdir = nullptr; TcsBoardHelper helper(rtdInfos); - TcsBoardAssembly* tcsBoardAss = - new TcsBoardAssembly(objects::TCS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher, - pcdu::Switches::PDU1_CH0_TCS_BOARD_3V3, helper); + TcsBoardAssembly* tcsBoardAss = new TcsBoardAssembly( + objects::TCS_BOARD_ASS, pwrSwitcher, pcdu::Switches::PDU1_CH0_TCS_BOARD_3V3, helper); static_cast(tcsBoardAss); // Create special low level reader communication interface new Max31865RtdReader(objects::SPI_RTD_COM_IF, comIF, gpioComIF); @@ -312,10 +310,12 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF, } void ObjectFactory::createThermalController() { - new ThermalController(objects::THERMAL_CONTROLLER, objects::NO_OBJECT); + new ThermalController(objects::THERMAL_CONTROLLER); } -void ObjectFactory::createAcsController() { new AcsController(objects::ACS_CONTROLLER); } +AcsController* ObjectFactory::createAcsController() { + return new AcsController(objects::ACS_CONTROLLER); +} void ObjectFactory::gpioChecker(ReturnValue_t result, std::string output) { if (result != returnvalue::OK) { diff --git a/linux/ObjectFactory.h b/linux/ObjectFactory.h index 56a5664b..dc3766b8 100644 --- a/linux/ObjectFactory.h +++ b/linux/ObjectFactory.h @@ -8,6 +8,7 @@ class GpioIF; class SpiComIF; class PowerSwitchIF; +class AcsController; namespace ObjectFactory { @@ -19,6 +20,6 @@ void createRtdComponents(std::string spiDev, GpioIF* gpioComIF, PowerSwitchIF* p void gpioChecker(ReturnValue_t result, std::string output); void createThermalController(); -void createAcsController(); +AcsController* createAcsController(); } // namespace ObjectFactory diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 09e91e26..8c2d1c9a 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -3,7 +3,7 @@ #include AcsController::AcsController(object_id_t objectId) - : ExtendedControllerBase(objectId, objects::NO_OBJECT), mgmData(this) {} + : ExtendedControllerBase(objectId), mgmData(this) {} ReturnValue_t AcsController::handleCommandMessage(CommandMessage *message) { return returnvalue::OK; diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 52fb40e9..30f08de5 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -14,8 +14,8 @@ #include #include -ThermalController::ThermalController(object_id_t objectId, object_id_t parentId) - : ExtendedControllerBase(objectId, parentId), +ThermalController::ThermalController(object_id_t objectId) + : ExtendedControllerBase(objectId), sensorTemperatures(this), susTemperatures(this), deviceTemperatures(this), diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 29661d5e..d671412e 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -12,7 +12,7 @@ class ThermalController : public ExtendedControllerBase { public: static const uint16_t INVALID_TEMPERATURE = 999; - ThermalController(object_id_t objectId, object_id_t parentId); + ThermalController(object_id_t objectId); ReturnValue_t initialize() override; diff --git a/mission/system/objects/AcsBoardAssembly.cpp b/mission/system/objects/AcsBoardAssembly.cpp index 6a59183c..f89f475c 100644 --- a/mission/system/objects/AcsBoardAssembly.cpp +++ b/mission/system/objects/AcsBoardAssembly.cpp @@ -6,11 +6,10 @@ #include "OBSWConfig.h" -AcsBoardAssembly::AcsBoardAssembly(object_id_t objectId, object_id_t parentId, - PowerSwitchIF* switcher, AcsBoardHelper helper, GpioIF* gpioIF) - : DualLaneAssemblyBase(objectId, parentId, switcher, SWITCH_A, SWITCH_B, - POWER_STATE_MACHINE_TIMEOUT, SIDE_SWITCH_TRANSITION_NOT_ALLOWED, - TRANSITION_OTHER_SIDE_FAILED), +AcsBoardAssembly::AcsBoardAssembly(object_id_t objectId, PowerSwitchIF* switcher, + AcsBoardHelper helper, GpioIF* gpioIF) + : DualLaneAssemblyBase(objectId, switcher, SWITCH_A, SWITCH_B, POWER_STATE_MACHINE_TIMEOUT, + SIDE_SWITCH_TRANSITION_NOT_ALLOWED, TRANSITION_OTHER_SIDE_FAILED), helper(helper), gpioIF(gpioIF) { if (switcher == nullptr) { @@ -276,41 +275,42 @@ void AcsBoardAssembly::refreshHelperModes() { } ReturnValue_t AcsBoardAssembly::initialize() { - ReturnValue_t result = registerChild(helper.gyro0AdisIdSideA); - if (result != returnvalue::OK) { - return result; - } - result = registerChild(helper.gyro1L3gIdSideA); - if (result != returnvalue::OK) { - return result; - } - result = registerChild(helper.gyro2AdisIdSideB); - if (result != returnvalue::OK) { - return result; - } - result = registerChild(helper.gyro3L3gIdSideB); - if (result != returnvalue::OK) { - return result; - } - result = registerChild(helper.mgm0Lis3IdSideA); - if (result != returnvalue::OK) { - return result; - } - result = registerChild(helper.mgm1Rm3100IdSideA); - if (result != returnvalue::OK) { - return result; - } - result = registerChild(helper.mgm2Lis3IdSideB); - if (result != returnvalue::OK) { - return result; - } - result = registerChild(helper.mgm3Rm3100IdSideB); - if (result != returnvalue::OK) { - return result; - } - result = registerChild(helper.gpsId); - if (result != returnvalue::OK) { - return result; - } + // TODO: Fix this + // ReturnValue_t result = registerChild(helper.gyro0AdisIdSideA); + // if (result != returnvalue::OK) { + // return result; + // } + // result = registerChild(helper.gyro1L3gIdSideA); + // if (result != returnvalue::OK) { + // return result; + // } + // result = registerChild(helper.gyro2AdisIdSideB); + // if (result != returnvalue::OK) { + // return result; + // } + // result = registerChild(helper.gyro3L3gIdSideB); + // if (result != returnvalue::OK) { + // return result; + // } + // result = registerChild(helper.mgm0Lis3IdSideA); + // if (result != returnvalue::OK) { + // return result; + // } + // result = registerChild(helper.mgm1Rm3100IdSideA); + // if (result != returnvalue::OK) { + // return result; + // } + // result = registerChild(helper.mgm2Lis3IdSideB); + // if (result != returnvalue::OK) { + // return result; + // } + // result = registerChild(helper.mgm3Rm3100IdSideB); + // if (result != returnvalue::OK) { + // return result; + // } + // result = registerChild(helper.gpsId); + // if (result != returnvalue::OK) { + // return result; + // } return AssemblyBase::initialize(); } diff --git a/mission/system/objects/AcsBoardAssembly.h b/mission/system/objects/AcsBoardAssembly.h index 820060ce..1fe3336d 100644 --- a/mission/system/objects/AcsBoardAssembly.h +++ b/mission/system/objects/AcsBoardAssembly.h @@ -94,8 +94,8 @@ class AcsBoardAssembly : public DualLaneAssemblyBase { static constexpr uint8_t NUMBER_DEVICES_MODE_TABLE = 9; - AcsBoardAssembly(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher, - AcsBoardHelper helper, GpioIF* gpioIF); + AcsBoardAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher, AcsBoardHelper helper, + GpioIF* gpioIF); /** * In dual mode, the A side or the B side GPS device can be used, but not both. diff --git a/mission/system/objects/AcsSubsystem.cpp b/mission/system/objects/AcsSubsystem.cpp index 37da0123..96735ae9 100644 --- a/mission/system/objects/AcsSubsystem.cpp +++ b/mission/system/objects/AcsSubsystem.cpp @@ -1,5 +1,5 @@ #include "AcsSubsystem.h" -AcsSubsystem::AcsSubsystem(object_id_t setObjectId, object_id_t parent, - uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables) - : Subsystem(setObjectId, parent, maxNumberOfSequences, maxNumberOfTables) {} +AcsSubsystem::AcsSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, + uint32_t maxNumberOfTables) + : Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) {} diff --git a/mission/system/objects/AcsSubsystem.h b/mission/system/objects/AcsSubsystem.h index 20fffdbe..8673395a 100644 --- a/mission/system/objects/AcsSubsystem.h +++ b/mission/system/objects/AcsSubsystem.h @@ -5,8 +5,7 @@ class AcsSubsystem : public Subsystem { public: - AcsSubsystem(object_id_t setObjectId, object_id_t parent, uint32_t maxNumberOfSequences, - uint32_t maxNumberOfTables); + AcsSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables); private: }; diff --git a/mission/system/objects/CMakeLists.txt b/mission/system/objects/CMakeLists.txt index edab746b..39d7c800 100644 --- a/mission/system/objects/CMakeLists.txt +++ b/mission/system/objects/CMakeLists.txt @@ -1,14 +1,13 @@ -target_sources(${LIB_EIVE_MISSION} PRIVATE - EiveSystem.cpp - AcsSubsystem.cpp - ComSubsystem.cpp - PayloadSubsystem.cpp - - AcsBoardAssembly.cpp - SusAssembly.cpp - RwAssembly.cpp - DualLanePowerStateMachine.cpp - PowerStateMachineBase.cpp - DualLaneAssemblyBase.cpp - TcsBoardAssembly.cpp -) +target_sources( + ${LIB_EIVE_MISSION} + PRIVATE EiveSystem.cpp + AcsSubsystem.cpp + ComSubsystem.cpp + PayloadSubsystem.cpp + AcsBoardAssembly.cpp + SusAssembly.cpp + RwAssembly.cpp + DualLanePowerStateMachine.cpp + PowerStateMachineBase.cpp + DualLaneAssemblyBase.cpp + TcsBoardAssembly.cpp) diff --git a/mission/system/objects/ComSubsystem.cpp b/mission/system/objects/ComSubsystem.cpp index 3308de8c..794eede6 100644 --- a/mission/system/objects/ComSubsystem.cpp +++ b/mission/system/objects/ComSubsystem.cpp @@ -1,5 +1,5 @@ #include "ComSubsystem.h" -ComSubsystem::ComSubsystem(object_id_t setObjectId, object_id_t parent, - uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables) - : Subsystem(setObjectId, parent, maxNumberOfSequences, maxNumberOfTables) {} +ComSubsystem::ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, + uint32_t maxNumberOfTables) + : Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) {} diff --git a/mission/system/objects/ComSubsystem.h b/mission/system/objects/ComSubsystem.h index fc35438c..0bdaeb15 100644 --- a/mission/system/objects/ComSubsystem.h +++ b/mission/system/objects/ComSubsystem.h @@ -5,8 +5,7 @@ class ComSubsystem : public Subsystem { public: - ComSubsystem(object_id_t setObjectId, object_id_t parent, uint32_t maxNumberOfSequences, - uint32_t maxNumberOfTables); + ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables); private: }; diff --git a/mission/system/objects/DualLaneAssemblyBase.cpp b/mission/system/objects/DualLaneAssemblyBase.cpp index f9ca44fe..a55553a0 100644 --- a/mission/system/objects/DualLaneAssemblyBase.cpp +++ b/mission/system/objects/DualLaneAssemblyBase.cpp @@ -4,12 +4,11 @@ #include "OBSWConfig.h" -DualLaneAssemblyBase::DualLaneAssemblyBase(object_id_t objectId, object_id_t parentId, - PowerSwitchIF* pwrSwitcher, pcdu::Switches switch1, - pcdu::Switches switch2, Event pwrTimeoutEvent, - Event sideSwitchNotAllowedEvent, +DualLaneAssemblyBase::DualLaneAssemblyBase(object_id_t objectId, PowerSwitchIF* pwrSwitcher, + pcdu::Switches switch1, pcdu::Switches switch2, + Event pwrTimeoutEvent, Event sideSwitchNotAllowedEvent, Event transitionOtherSideFailedEvent) - : AssemblyBase(objectId, parentId, 20), + : AssemblyBase(objectId, 20), pwrStateMachine(switch1, switch2, pwrSwitcher), pwrTimeoutEvent(pwrTimeoutEvent), sideSwitchNotAllowedEvent(sideSwitchNotAllowedEvent), diff --git a/mission/system/objects/DualLaneAssemblyBase.h b/mission/system/objects/DualLaneAssemblyBase.h index 7a8c7ac9..eadfb77f 100644 --- a/mission/system/objects/DualLaneAssemblyBase.h +++ b/mission/system/objects/DualLaneAssemblyBase.h @@ -18,8 +18,8 @@ class DualLaneAssemblyBase : public AssemblyBase, public ConfirmsFailuresIF { static constexpr UniqueEventId_t POWER_STATE_MACHINE_TIMEOUT_ID = 2; static constexpr UniqueEventId_t SIDE_SWITCH_TRANSITION_NOT_ALLOWED_ID = 3; - DualLaneAssemblyBase(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher, - pcdu::Switches switch1, pcdu::Switches switch2, Event pwrSwitchTimeoutEvent, + DualLaneAssemblyBase(object_id_t objectId, PowerSwitchIF* pwrSwitcher, pcdu::Switches switch1, + pcdu::Switches switch2, Event pwrSwitchTimeoutEvent, Event sideSwitchNotAllowedEvent, Event transitionOtherSideFailedEvent); protected: diff --git a/mission/system/objects/EiveSystem.cpp b/mission/system/objects/EiveSystem.cpp index 1be0152a..a870214d 100644 --- a/mission/system/objects/EiveSystem.cpp +++ b/mission/system/objects/EiveSystem.cpp @@ -1,5 +1,5 @@ #include "EiveSystem.h" -EiveSystem::EiveSystem(object_id_t setObjectId, object_id_t parent, uint32_t maxNumberOfSequences, +EiveSystem::EiveSystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables) - : Subsystem(setObjectId, parent, maxNumberOfSequences, maxNumberOfTables) {} + : Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) {} diff --git a/mission/system/objects/EiveSystem.h b/mission/system/objects/EiveSystem.h index 671d47b6..e88d2402 100644 --- a/mission/system/objects/EiveSystem.h +++ b/mission/system/objects/EiveSystem.h @@ -5,8 +5,7 @@ class EiveSystem : public Subsystem { public: - EiveSystem(object_id_t setObjectId, object_id_t parent, uint32_t maxNumberOfSequences, - uint32_t maxNumberOfTables); + EiveSystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables); private: }; diff --git a/mission/system/objects/PayloadSubsystem.cpp b/mission/system/objects/PayloadSubsystem.cpp index 97008c2f..8bc98f0b 100644 --- a/mission/system/objects/PayloadSubsystem.cpp +++ b/mission/system/objects/PayloadSubsystem.cpp @@ -1,5 +1,5 @@ #include "PayloadSubsystem.h" -PayloadSubsystem::PayloadSubsystem(object_id_t setObjectId, object_id_t parent, - uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables) - : Subsystem(setObjectId, parent, maxNumberOfSequences, maxNumberOfTables) {} +PayloadSubsystem::PayloadSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, + uint32_t maxNumberOfTables) + : Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) {} diff --git a/mission/system/objects/PayloadSubsystem.h b/mission/system/objects/PayloadSubsystem.h index b25454f7..af3c1efb 100644 --- a/mission/system/objects/PayloadSubsystem.h +++ b/mission/system/objects/PayloadSubsystem.h @@ -5,7 +5,7 @@ class PayloadSubsystem : public Subsystem { public: - PayloadSubsystem(object_id_t setObjectId, object_id_t parent, uint32_t maxNumberOfSequences, + PayloadSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables); private: diff --git a/mission/system/objects/RwAssembly.cpp b/mission/system/objects/RwAssembly.cpp index 6e393034..df8a54ce 100644 --- a/mission/system/objects/RwAssembly.cpp +++ b/mission/system/objects/RwAssembly.cpp @@ -169,12 +169,13 @@ bool RwAssembly::isUseable(object_id_t object, Mode_t mode) { ReturnValue_t RwAssembly::initialize() { ReturnValue_t result = returnvalue::OK; - for (const auto& obj : helper.rwIds) { - result = registerChild(obj); - if (result != returnvalue::OK) { - return result; - } - } + // TODO: Fix this + // for (const auto& obj : helper.rwIds) { + // result = registerChild(obj); + // if (result != returnvalue::OK) { + // return result; + // } + // } return SubsystemBase::initialize(); } diff --git a/mission/system/objects/SusAssembly.cpp b/mission/system/objects/SusAssembly.cpp index 472a6580..b81c6b0d 100644 --- a/mission/system/objects/SusAssembly.cpp +++ b/mission/system/objects/SusAssembly.cpp @@ -4,9 +4,8 @@ #include #include -SusAssembly::SusAssembly(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher, - SusAssHelper helper) - : DualLaneAssemblyBase(objectId, parentId, pwrSwitcher, SWITCH_NOM, SWITCH_RED, +SusAssembly::SusAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher, SusAssHelper helper) + : DualLaneAssemblyBase(objectId, pwrSwitcher, SWITCH_NOM, SWITCH_RED, POWER_STATE_MACHINE_TIMEOUT, SIDE_SWITCH_TRANSITION_NOT_ALLOWED, TRANSITION_OTHER_SIDE_FAILED), helper(helper), @@ -123,12 +122,13 @@ ReturnValue_t SusAssembly::checkChildrenStateOn(Mode_t wantedMode, Submode_t wan ReturnValue_t SusAssembly::initialize() { ReturnValue_t result = returnvalue::OK; - for (const auto& id : helper.susIds) { - result = registerChild(id); - if (result != returnvalue::OK) { - return result; - } - } + // TODO: Fix this + // for (const auto& id : helper.susIds) { + // result = registerChild(id); + // if (result != returnvalue::OK) { + // return result; + // } + // } return AssemblyBase::initialize(); } diff --git a/mission/system/objects/SusAssembly.h b/mission/system/objects/SusAssembly.h index 3cce9d86..673e91f5 100644 --- a/mission/system/objects/SusAssembly.h +++ b/mission/system/objects/SusAssembly.h @@ -40,8 +40,7 @@ class SusAssembly : public DualLaneAssemblyBase { static constexpr Event SIDE_SWITCH_TRANSITION_NOT_ALLOWED = event::makeEvent(SUBSYSTEM_ID, 3, severity::LOW); - SusAssembly(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher, - SusAssHelper helper); + SusAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher, SusAssHelper helper); private: enum class States { IDLE, SWITCHING_POWER, MODE_COMMANDING } state = States::IDLE; diff --git a/mission/system/objects/TcsBoardAssembly.cpp b/mission/system/objects/TcsBoardAssembly.cpp index c753504b..23a202be 100644 --- a/mission/system/objects/TcsBoardAssembly.cpp +++ b/mission/system/objects/TcsBoardAssembly.cpp @@ -3,10 +3,9 @@ #include #include -TcsBoardAssembly::TcsBoardAssembly(object_id_t objectId, object_id_t parentId, - PowerSwitchIF* pwrSwitcher, power::Switch_t theSwitch, - TcsBoardHelper helper) - : AssemblyBase(objectId, parentId, 24), switcher(pwrSwitcher, theSwitch), helper(helper) { +TcsBoardAssembly::TcsBoardAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher, + power::Switch_t theSwitch, TcsBoardHelper helper) + : AssemblyBase(objectId, 24), switcher(pwrSwitcher, theSwitch), helper(helper) { eventQueue = QueueFactory::instance()->createMessageQueue(24); ModeListEntry entry; for (uint8_t idx = 0; idx < NUMBER_RTDS; idx++) { @@ -92,12 +91,13 @@ ReturnValue_t TcsBoardAssembly::isModeCombinationValid(Mode_t mode, Submode_t su ReturnValue_t TcsBoardAssembly::initialize() { ReturnValue_t result = returnvalue::OK; - for (const auto& obj : helper.rtdInfos) { - result = registerChild(obj.first); - if (result != returnvalue::OK) { - return result; - } - } + // TODO: Fix this + // for (const auto& obj : helper.rtdInfos) { + // result = registerChild(obj.first); + // if (result != returnvalue::OK) { + // return result; + // } + // } return SubsystemBase::initialize(); } diff --git a/mission/system/objects/TcsBoardAssembly.h b/mission/system/objects/TcsBoardAssembly.h index 6042abaa..fb5f7d38 100644 --- a/mission/system/objects/TcsBoardAssembly.h +++ b/mission/system/objects/TcsBoardAssembly.h @@ -20,8 +20,8 @@ class TcsBoardAssembly : public AssemblyBase, public ConfirmsFailuresIF { static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::TCS_BOARD_ASS; static constexpr Event CHILDREN_LOST_MODE = event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM); - TcsBoardAssembly(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher, - power::Switch_t switcher, TcsBoardHelper helper); + TcsBoardAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher, power::Switch_t switcher, + TcsBoardHelper helper); ReturnValue_t initialize() override; diff --git a/mission/system/tree/CMakeLists.txt b/mission/system/tree/CMakeLists.txt index f88891d4..ec7e0c96 100644 --- a/mission/system/tree/CMakeLists.txt +++ b/mission/system/tree/CMakeLists.txt @@ -1,3 +1 @@ -target_sources(${LIB_EIVE_MISSION} PRIVATE - acsModeTree.cpp -) +target_sources(${LIB_EIVE_MISSION} PRIVATE acsModeTree.cpp) diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index 9436a688..fe541d31 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -1,13 +1,15 @@ #include "acsModeTree.h" -#include "eive/objects.h" #include #include #include #include +#include "eive/objects.h" #include "mission/controller/controllerdefinitions/AcsControllerDefinitions.h" +Subsystem satsystem::ACS_SUBSYSTEM(objects::ACS_SUBSYSTEM, 12, 24); + void checkInsert(ReturnValue_t result, const char* ctx); void buildOffSequence(Subsystem* ss, ModeListEntry& eh); void buildDetumbleSequence(Subsystem* ss, ModeListEntry& entryHelper); @@ -75,21 +77,13 @@ auto ACS_TABLE_TARGET_PT_TRANS_1 = void satsystem::initAcsSubsystem(object_id_t satSystemObjId) { ModeListEntry entry; - Subsystem* acsSubsystem = new Subsystem(objects::ACS_SUBSYSTEM, satSystemObjId, 12, 24); - acsSubsystem->registerChild(objects::ACS_CONTROLLER); - acsSubsystem->registerChild(objects::IMTQ_HANDLER); - acsSubsystem->registerChild(objects::STAR_TRACKER); - acsSubsystem->registerChild(objects::ACS_BOARD_ASS); - acsSubsystem->registerChild(objects::SUS_BOARD_ASS); - acsSubsystem->registerChild(objects::IMTQ_HANDLER); - acsSubsystem->registerChild(objects::RW_ASS); - buildOffSequence(acsSubsystem, entry); - buildSafeSequence(acsSubsystem, entry); - buildDetumbleSequence(acsSubsystem, entry); - buildIdleSequence(acsSubsystem, entry); - buildIdleChargeSequence(acsSubsystem, entry); - buildTargetPtSequence(acsSubsystem, entry); - acsSubsystem->setInitialMode(HasModesIF::MODE_OFF); + buildOffSequence(&ACS_SUBSYSTEM, entry); + buildSafeSequence(&ACS_SUBSYSTEM, entry); + buildDetumbleSequence(&ACS_SUBSYSTEM, entry); + buildIdleSequence(&ACS_SUBSYSTEM, entry); + buildIdleChargeSequence(&ACS_SUBSYSTEM, entry); + buildTargetPtSequence(&ACS_SUBSYSTEM, entry); + ACS_SUBSYSTEM.setInitialMode(HasModesIF::MODE_OFF); } void buildOffSequence(Subsystem* ss, ModeListEntry& eh) { diff --git a/mission/system/tree/acsModeTree.h b/mission/system/tree/acsModeTree.h index 1b7c31eb..37469707 100644 --- a/mission/system/tree/acsModeTree.h +++ b/mission/system/tree/acsModeTree.h @@ -4,6 +4,8 @@ class Subsystem; namespace satsystem { +extern Subsystem ACS_SUBSYSTEM; + void initAcsSubsystem(object_id_t satSystemObjId); } // namespace satsystem From d10ff4efa62f318188f4e374756df007adc40d09 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 30 Sep 2022 12:09:03 +0200 Subject: [PATCH 25/43] compiles again --- bsp_q7s/core/ObjectFactory.cpp | 2 +- bsp_q7s/core/ObjectFactory.h | 2 +- bsp_q7s/fmObjectFactory.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 27789807..0c776096 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -887,7 +887,7 @@ void ObjectFactory::createStrComponents(PowerSwitchIF* pwrSwitcher) { starTracker->setPowerSwitcher(pwrSwitcher); } -void ObjectFactory::createImtqComponents(PowerSwitchIF* pwrSwitcher, object_id_t acsSubsystem) { +void ObjectFactory::createImtqComponents(PowerSwitchIF* pwrSwitcher) { I2cCookie* imtqI2cCookie = new I2cCookie(addresses::IMTQ, IMTQ::MAX_REPLY_SIZE, q7s::I2C_DEFAULT_DEV); auto imtqHandler = new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie, diff --git a/bsp_q7s/core/ObjectFactory.h b/bsp_q7s/core/ObjectFactory.h index 498ce166..0b81c235 100644 --- a/bsp_q7s/core/ObjectFactory.h +++ b/bsp_q7s/core/ObjectFactory.h @@ -30,7 +30,7 @@ void createRadSensorComponent(LinuxLibgpioIF* gpioComIF); void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF, PowerSwitchIF* pwrSwitcher); void createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwitcher, HealthTableIF* healthTable); -void createImtqComponents(PowerSwitchIF* pwrSwitcher, object_id_t subsystemId); +void createImtqComponents(PowerSwitchIF* pwrSwitcher); void createBpxBatteryComponent(); void createStrComponents(PowerSwitchIF* pwrSwitcher); void createSolarArrayDeploymentComponents(); diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index 2c948e6d..2aabe8c3 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -43,7 +43,7 @@ void ObjectFactory::produce(void* args) { createPayloadComponents(gpioComIF); #if OBSW_ADD_MGT == 1 - createImtqComponents(pwrSwitcher, objects::ACS_SUBSYSTEM); + createImtqComponents(pwrSwitcher); #endif createReactionWheelComponents(gpioComIF, pwrSwitcher); From dcd0a650f04a69bcfb84396ded049dbd14d82ae0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 30 Sep 2022 13:30:22 +0200 Subject: [PATCH 26/43] this should do the job --- bsp_q7s/core/ObjectFactory.cpp | 53 ++++++++++++--------- fsfw | 2 +- linux/ObjectFactory.cpp | 12 ++++- mission/system/objects/AcsBoardAssembly.cpp | 37 -------------- mission/system/objects/RwAssembly.cpp | 8 ---- mission/system/objects/SusAssembly.cpp | 8 ---- 6 files changed, 41 insertions(+), 79 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 0c776096..59388646 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -43,7 +43,6 @@ #include "mission/system/fdir/SusFdir.h" #include "mission/system/fdir/SyrlinksFdir.h" #include "mission/system/objects/RwAssembly.h" -#include "mission/system/objects/SusAssembly.h" #include "mission/system/objects/TcsBoardAssembly.h" #include "mission/system/tree/acsModeTree.h" #include "tmtc/pusIds.h" @@ -341,11 +340,11 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI SpiCookie* spiCookie = new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED); - auto mgmLis3Handler = new MgmLIS3MDLHandler(objects::MGM_0_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, + auto mgmLis3Handler0 = new MgmLIS3MDLHandler(objects::MGM_0_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::LIS3_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::MGM_0_LIS3_HANDLER); - mgmLis3Handler->setCustomFdir(fdir); - assemblyChildren.push_back(*mgmLis3Handler); + mgmLis3Handler0->setCustomFdir(fdir); + assemblyChildren.push_back(*mgmLis3Handler0); #if OBSW_TEST_ACS == 1 mgmLis3Handler->setStartUpImmediately(); mgmLis3Handler->setToGoToNormalMode(true); @@ -356,12 +355,12 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI spiCookie = new SpiCookie(addresses::MGM_1_RM3100, gpioIds::MGM_1_RM3100_CS, RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED); - auto mgmRm3100Handler = + auto mgmRm3100Handler1 = new MgmRM3100Handler(objects::MGM_1_RM3100_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::RM3100_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::MGM_1_RM3100_HANDLER); - mgmRm3100Handler->setCustomFdir(fdir); - assemblyChildren.push_back(*mgmRm3100Handler); + mgmRm3100Handler1->setCustomFdir(fdir); + assemblyChildren.push_back(*mgmRm3100Handler1); #if OBSW_TEST_ACS == 1 mgmRm3100Handler->setStartUpImmediately(); mgmRm3100Handler->setToGoToNormalMode(true); @@ -372,11 +371,11 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI spiCookie = new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED); - mgmLis3Handler = new MgmLIS3MDLHandler(objects::MGM_2_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, + auto* mgmLis3Handler2 = new MgmLIS3MDLHandler(objects::MGM_2_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::LIS3_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::MGM_2_LIS3_HANDLER); - mgmLis3Handler->setCustomFdir(fdir); - assemblyChildren.push_back(*mgmLis3Handler); + mgmLis3Handler2->setCustomFdir(fdir); + assemblyChildren.push_back(*mgmLis3Handler2); #if OBSW_TEST_ACS == 1 mgmLis3Handler->setStartUpImmediately(); mgmLis3Handler->setToGoToNormalMode(true); @@ -387,11 +386,11 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI spiCookie = new SpiCookie(addresses::MGM_3_RM3100, gpioIds::MGM_3_RM3100_CS, RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED); - mgmRm3100Handler = new MgmRM3100Handler(objects::MGM_3_RM3100_HANDLER, objects::SPI_MAIN_COM_IF, + auto* mgmRm3100Handler3 = new MgmRM3100Handler(objects::MGM_3_RM3100_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::RM3100_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::MGM_3_RM3100_HANDLER); - mgmRm3100Handler->setCustomFdir(fdir); - assemblyChildren.push_back(*mgmRm3100Handler); + mgmRm3100Handler3->setCustomFdir(fdir); + assemblyChildren.push_back(*mgmRm3100Handler3); #if OBSW_TEST_ACS == 1 mgmRm3100Handler->setStartUpImmediately(); mgmRm3100Handler->setToGoToNormalMode(true); @@ -420,12 +419,11 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI // Gyro 1 Side A spiCookie = new SpiCookie(addresses::GYRO_1_L3G, gpioIds::GYRO_1_L3G_CS, L3GD20H::MAX_BUFFER_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED); - auto gyroL3gHandler = new GyroHandlerL3GD20H( + auto gyroL3gHandler1 = new GyroHandlerL3GD20H( objects::GYRO_1_L3G_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::L3G_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::GYRO_1_L3G_HANDLER); - gyroL3gHandler->setCustomFdir(fdir); - assemblyChildren.push_back(*gyroL3gHandler); - static_cast(gyroL3gHandler); + gyroL3gHandler1->setCustomFdir(fdir); + assemblyChildren.push_back(*gyroL3gHandler1); #if OBSW_TEST_ACS == 1 gyroL3gHandler->setStartUpImmediately(); gyroL3gHandler->setToGoToNormalMode(true); @@ -449,11 +447,11 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI // Gyro 3 Side B spiCookie = new SpiCookie(addresses::GYRO_3_L3G, gpioIds::GYRO_3_L3G_CS, L3GD20H::MAX_BUFFER_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED); - gyroL3gHandler = new GyroHandlerL3GD20H(objects::GYRO_3_L3G_HANDLER, objects::SPI_MAIN_COM_IF, + auto gyroL3gHandler3 = new GyroHandlerL3GD20H(objects::GYRO_3_L3G_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::L3G_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::GYRO_3_L3G_HANDLER); - gyroL3gHandler->setCustomFdir(fdir); - assemblyChildren.push_back(*gyroL3gHandler); + gyroL3gHandler3->setCustomFdir(fdir); + assemblyChildren.push_back(*gyroL3gHandler3); #if OBSW_TEST_ACS == 1 gyroL3gHandler->setStartUpImmediately(); gyroL3gHandler->setToGoToNormalMode(true); @@ -478,9 +476,12 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI new AcsBoardAssembly(objects::ACS_BOARD_ASS, pwrSwitcher, acsBoardHelper, gpioComIF); acsAss->connectModeTreeParent(satsystem::ACS_SUBSYSTEM); static_cast(acsAss); - auto assQueueId = acsAss->getCommandQueue(); for (auto& assChild : assemblyChildren) { - assChild.get().setParentQueue(assQueueId); + ReturnValue_t result = assChild.get().connectModeTreeParent(*acsAss); + if(result != returnvalue::OK) { + sif::error << "Connecting assembly for ACS board component " << + assChild.get().getObjectId() << " failed" << std::endl; + } } #endif /* OBSW_ADD_ACS_HANDLERS == 1 */ } @@ -693,7 +694,13 @@ void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF, RwHelper rwHelper(rwIds); auto* rwAss = new RwAssembly(objects::RW_ASS, objects::NO_OBJECT, pwrSwitcher, pcdu::Switches::PDU2_CH2_RW_5V, rwHelper); - static_cast(rwAss); + for (uint8_t idx = 0; idx < rws.size(); idx++) { + ReturnValue_t result = rws[idx]->connectModeTreeParent(*rwAss); + if(result != returnvalue::OK) { + sif::error << "Connecting RW " << static_cast(idx) << " to RW assembly failed" + << std::endl; + } + } #endif /* OBSW_ADD_RW == 1 */ } diff --git a/fsfw b/fsfw index f8240048..10dd8552 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit f824004897e29bf90c2b02578625ba3d51786fdf +Subproject commit 10dd8552446e409e40d830e25fb0eed927995764 diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index 6b0b5e22..e75e62ed 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -167,7 +167,11 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo static_cast(susAss); for (auto& sus : susHandlers) { if (sus != nullptr) { - sus->setParentQueue(susAss->getCommandQueue()); + ReturnValue_t result = sus->connectModeTreeParent(*susAss); + if(result != returnvalue::OK) { + sif::error << "Connecting SUS " << sus->getObjectId() << + " to SUS assembly failed" << std::endl; + } #if OBSW_TEST_SUS == 1 sus->setStartUpImmediately(); sus->setToGoToNormalMode(true); @@ -294,7 +298,11 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF, rtds[idx] = new Max31865EiveHandler(rtdInfos[idx].first, objects::SPI_RTD_COM_IF, rtdLowLevelCookie); rtds[idx]->setDeviceInfo(idx, rtdInfos[idx].second); - rtds[idx]->setParentQueue(tcsBoardAss->getCommandQueue()); + ReturnValue_t result = rtds[idx]->connectModeTreeParent(*tcsBoardAss); + if(result != returnvalue::OK) { + sif::error << "Connecting RTD " << static_cast(idx) << " to RTD Assembly failed" + << std::endl; + } rtdFdir = new RtdFdir(rtdInfos[idx].first); rtds[idx]->setCustomFdir(rtdFdir); #if OBSW_DEBUG_RTD == 1 diff --git a/mission/system/objects/AcsBoardAssembly.cpp b/mission/system/objects/AcsBoardAssembly.cpp index f89f475c..3913ebba 100644 --- a/mission/system/objects/AcsBoardAssembly.cpp +++ b/mission/system/objects/AcsBoardAssembly.cpp @@ -275,42 +275,5 @@ void AcsBoardAssembly::refreshHelperModes() { } ReturnValue_t AcsBoardAssembly::initialize() { - // TODO: Fix this - // ReturnValue_t result = registerChild(helper.gyro0AdisIdSideA); - // if (result != returnvalue::OK) { - // return result; - // } - // result = registerChild(helper.gyro1L3gIdSideA); - // if (result != returnvalue::OK) { - // return result; - // } - // result = registerChild(helper.gyro2AdisIdSideB); - // if (result != returnvalue::OK) { - // return result; - // } - // result = registerChild(helper.gyro3L3gIdSideB); - // if (result != returnvalue::OK) { - // return result; - // } - // result = registerChild(helper.mgm0Lis3IdSideA); - // if (result != returnvalue::OK) { - // return result; - // } - // result = registerChild(helper.mgm1Rm3100IdSideA); - // if (result != returnvalue::OK) { - // return result; - // } - // result = registerChild(helper.mgm2Lis3IdSideB); - // if (result != returnvalue::OK) { - // return result; - // } - // result = registerChild(helper.mgm3Rm3100IdSideB); - // if (result != returnvalue::OK) { - // return result; - // } - // result = registerChild(helper.gpsId); - // if (result != returnvalue::OK) { - // return result; - // } return AssemblyBase::initialize(); } diff --git a/mission/system/objects/RwAssembly.cpp b/mission/system/objects/RwAssembly.cpp index df8a54ce..0438ff03 100644 --- a/mission/system/objects/RwAssembly.cpp +++ b/mission/system/objects/RwAssembly.cpp @@ -168,14 +168,6 @@ bool RwAssembly::isUseable(object_id_t object, Mode_t mode) { } ReturnValue_t RwAssembly::initialize() { - ReturnValue_t result = returnvalue::OK; - // TODO: Fix this - // for (const auto& obj : helper.rwIds) { - // result = registerChild(obj); - // if (result != returnvalue::OK) { - // return result; - // } - // } return SubsystemBase::initialize(); } diff --git a/mission/system/objects/SusAssembly.cpp b/mission/system/objects/SusAssembly.cpp index b81c6b0d..842b4eae 100644 --- a/mission/system/objects/SusAssembly.cpp +++ b/mission/system/objects/SusAssembly.cpp @@ -121,14 +121,6 @@ ReturnValue_t SusAssembly::checkChildrenStateOn(Mode_t wantedMode, Submode_t wan } ReturnValue_t SusAssembly::initialize() { - ReturnValue_t result = returnvalue::OK; - // TODO: Fix this - // for (const auto& id : helper.susIds) { - // result = registerChild(id); - // if (result != returnvalue::OK) { - // return result; - // } - // } return AssemblyBase::initialize(); } From 57d37f14f375dddb45ef98d6bfd4ccb92a44b23c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 30 Sep 2022 14:14:59 +0200 Subject: [PATCH 27/43] fixed some bugs --- bsp_q7s/core/ObjectFactory.cpp | 5 +++-- fsfw | 2 +- linux/devices/GPSHyperionLinuxController.cpp | 2 +- mission/system/objects/RwAssembly.cpp | 4 ++-- mission/system/objects/RwAssembly.h | 2 +- mission/system/objects/TcsBoardAssembly.cpp | 10 +--------- tmtc | 2 +- 7 files changed, 10 insertions(+), 17 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 59388646..b33df028 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -474,7 +474,6 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI objects::GYRO_2_ADIS_HANDLER, objects::GYRO_3_L3G_HANDLER, objects::GPS_CONTROLLER); auto acsAss = new AcsBoardAssembly(objects::ACS_BOARD_ASS, pwrSwitcher, acsBoardHelper, gpioComIF); - acsAss->connectModeTreeParent(satsystem::ACS_SUBSYSTEM); static_cast(acsAss); for (auto& assChild : assemblyChildren) { ReturnValue_t result = assChild.get().connectModeTreeParent(*acsAss); @@ -483,6 +482,8 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI assChild.get().getObjectId() << " failed" << std::endl; } } + gpsCtrl->connectModeTreeParent(*acsAss); + acsAss->connectModeTreeParent(satsystem::ACS_SUBSYSTEM); #endif /* OBSW_ADD_ACS_HANDLERS == 1 */ } @@ -692,7 +693,7 @@ void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF, } RwHelper rwHelper(rwIds); - auto* rwAss = new RwAssembly(objects::RW_ASS, objects::NO_OBJECT, pwrSwitcher, + auto* rwAss = new RwAssembly(objects::RW_ASS, pwrSwitcher, pcdu::Switches::PDU2_CH2_RW_5V, rwHelper); for (uint8_t idx = 0; idx < rws.size(); idx++) { ReturnValue_t result = rws[idx]->connectModeTreeParent(*rwAss); diff --git a/fsfw b/fsfw index 10dd8552..acab5f6b 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 10dd8552446e409e40d830e25fb0eed927995764 +Subproject commit acab5f6bceef581fae64d1c16af19482ec72abcb diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index 84200baf..a72f671c 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -18,7 +18,7 @@ GPSHyperionLinuxController::GPSHyperionLinuxController(object_id_t objectId, object_id_t parentId, bool debugHyperionGps) - : ExtendedControllerBase(objectId, objects::NO_OBJECT), + : ExtendedControllerBase(objectId), gpsSet(this), debugHyperionGps(debugHyperionGps) { timeUpdateCd.resetTimer(); diff --git a/mission/system/objects/RwAssembly.cpp b/mission/system/objects/RwAssembly.cpp index 0438ff03..8d86bed8 100644 --- a/mission/system/objects/RwAssembly.cpp +++ b/mission/system/objects/RwAssembly.cpp @@ -1,8 +1,8 @@ #include "RwAssembly.h" -RwAssembly::RwAssembly(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher, +RwAssembly::RwAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher, power::Switch_t switcher, RwHelper helper) - : AssemblyBase(objectId, parentId), helper(helper), switcher(pwrSwitcher, switcher) { + : AssemblyBase(objectId), helper(helper), switcher(pwrSwitcher, switcher) { ModeListEntry entry; for (uint8_t idx = 0; idx < NUMBER_RWS; idx++) { entry.setObject(helper.rwIds[idx]); diff --git a/mission/system/objects/RwAssembly.h b/mission/system/objects/RwAssembly.h index 482a18a3..5db6b7d6 100644 --- a/mission/system/objects/RwAssembly.h +++ b/mission/system/objects/RwAssembly.h @@ -12,7 +12,7 @@ struct RwHelper { class RwAssembly : public AssemblyBase { public: - RwAssembly(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher, + RwAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher, power::Switch_t switcher, RwHelper helper); private: diff --git a/mission/system/objects/TcsBoardAssembly.cpp b/mission/system/objects/TcsBoardAssembly.cpp index 23a202be..5c419390 100644 --- a/mission/system/objects/TcsBoardAssembly.cpp +++ b/mission/system/objects/TcsBoardAssembly.cpp @@ -90,15 +90,7 @@ ReturnValue_t TcsBoardAssembly::isModeCombinationValid(Mode_t mode, Submode_t su } ReturnValue_t TcsBoardAssembly::initialize() { - ReturnValue_t result = returnvalue::OK; - // TODO: Fix this - // for (const auto& obj : helper.rtdInfos) { - // result = registerChild(obj.first); - // if (result != returnvalue::OK) { - // return result; - // } - // } - return SubsystemBase::initialize(); + return AssemblyBase::initialize(); } void TcsBoardAssembly::startTransition(Mode_t mode, Submode_t submode) { diff --git a/tmtc b/tmtc index c8eaf180..8c48255e 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit c8eaf180dc724ccd8eab54a66109d861ce14a2d1 +Subproject commit 8c48255eb34bb26f7626b53474a1af7e71717c5d From f0e4d5a61e4594ca5fbd16800fd932722c3f3331 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 30 Sep 2022 14:22:23 +0200 Subject: [PATCH 28/43] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 8c48255e..b73f2fa4 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 8c48255eb34bb26f7626b53474a1af7e71717c5d +Subproject commit b73f2fa4e6c393a6e5215e10d7df73d87b947303 From 66c6f084473801f9af021d33205203b150207bc8 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 30 Sep 2022 14:30:30 +0200 Subject: [PATCH 29/43] connect acs ctrl to subsystem --- bsp_q7s/core/ObjectFactory.cpp | 31 ++++++++++---------- bsp_q7s/fmObjectFactory.cpp | 2 +- linux/ObjectFactory.cpp | 20 ++++++++----- linux/ObjectFactory.h | 2 +- linux/devices/GPSHyperionLinuxController.cpp | 4 +-- mission/system/objects/AcsBoardAssembly.cpp | 4 +-- mission/system/objects/RwAssembly.cpp | 8 ++--- mission/system/objects/RwAssembly.h | 4 +-- mission/system/objects/SusAssembly.cpp | 4 +-- mission/system/objects/TcsBoardAssembly.cpp | 4 +-- 10 files changed, 40 insertions(+), 43 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index b33df028..86f4bd7b 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -340,8 +340,8 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI SpiCookie* spiCookie = new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED); - auto mgmLis3Handler0 = new MgmLIS3MDLHandler(objects::MGM_0_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, - spiCookie, spi::LIS3_TRANSITION_DELAY); + auto mgmLis3Handler0 = new MgmLIS3MDLHandler( + objects::MGM_0_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::LIS3_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::MGM_0_LIS3_HANDLER); mgmLis3Handler0->setCustomFdir(fdir); assemblyChildren.push_back(*mgmLis3Handler0); @@ -371,8 +371,8 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI spiCookie = new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED); - auto* mgmLis3Handler2 = new MgmLIS3MDLHandler(objects::MGM_2_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, - spiCookie, spi::LIS3_TRANSITION_DELAY); + auto* mgmLis3Handler2 = new MgmLIS3MDLHandler( + objects::MGM_2_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::LIS3_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::MGM_2_LIS3_HANDLER); mgmLis3Handler2->setCustomFdir(fdir); assemblyChildren.push_back(*mgmLis3Handler2); @@ -386,8 +386,9 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI spiCookie = new SpiCookie(addresses::MGM_3_RM3100, gpioIds::MGM_3_RM3100_CS, RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED); - auto* mgmRm3100Handler3 = new MgmRM3100Handler(objects::MGM_3_RM3100_HANDLER, objects::SPI_MAIN_COM_IF, - spiCookie, spi::RM3100_TRANSITION_DELAY); + auto* mgmRm3100Handler3 = + new MgmRM3100Handler(objects::MGM_3_RM3100_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, + spi::RM3100_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::MGM_3_RM3100_HANDLER); mgmRm3100Handler3->setCustomFdir(fdir); assemblyChildren.push_back(*mgmRm3100Handler3); @@ -447,8 +448,8 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI // Gyro 3 Side B spiCookie = new SpiCookie(addresses::GYRO_3_L3G, gpioIds::GYRO_3_L3G_CS, L3GD20H::MAX_BUFFER_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED); - auto gyroL3gHandler3 = new GyroHandlerL3GD20H(objects::GYRO_3_L3G_HANDLER, objects::SPI_MAIN_COM_IF, - spiCookie, spi::L3G_TRANSITION_DELAY); + auto gyroL3gHandler3 = new GyroHandlerL3GD20H( + objects::GYRO_3_L3G_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::L3G_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::GYRO_3_L3G_HANDLER); gyroL3gHandler3->setCustomFdir(fdir); assemblyChildren.push_back(*gyroL3gHandler3); @@ -477,9 +478,9 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI static_cast(acsAss); for (auto& assChild : assemblyChildren) { ReturnValue_t result = assChild.get().connectModeTreeParent(*acsAss); - if(result != returnvalue::OK) { - sif::error << "Connecting assembly for ACS board component " << - assChild.get().getObjectId() << " failed" << std::endl; + if (result != returnvalue::OK) { + sif::error << "Connecting assembly for ACS board component " << assChild.get().getObjectId() + << " failed" << std::endl; } } gpsCtrl->connectModeTreeParent(*acsAss); @@ -693,13 +694,13 @@ void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF, } RwHelper rwHelper(rwIds); - auto* rwAss = new RwAssembly(objects::RW_ASS, pwrSwitcher, - pcdu::Switches::PDU2_CH2_RW_5V, rwHelper); + auto* rwAss = + new RwAssembly(objects::RW_ASS, pwrSwitcher, pcdu::Switches::PDU2_CH2_RW_5V, rwHelper); for (uint8_t idx = 0; idx < rws.size(); idx++) { ReturnValue_t result = rws[idx]->connectModeTreeParent(*rwAss); - if(result != returnvalue::OK) { + if (result != returnvalue::OK) { sif::error << "Connecting RW " << static_cast(idx) << " to RW assembly failed" - << std::endl; + << std::endl; } } #endif /* OBSW_ADD_RW == 1 */ diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index 2aabe8c3..0ce612cf 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -64,6 +64,6 @@ void ObjectFactory::produce(void* args) { createMiscComponents(); createThermalController(); - createAcsController(); + createAcsController(true); satsystem::initAcsSubsystem(objects::NO_OBJECT); } diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index e75e62ed..5373e8ec 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -1,6 +1,7 @@ #include "ObjectFactory.h" #include +#include #include #include #include @@ -22,6 +23,7 @@ #include "devConf.h" #include "devices/addresses.h" #include "devices/gpioIds.h" +#include "mission/system/tree/acsModeTree.h" void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiComIF, PowerSwitchIF* pwrSwitcher, std::string spiDev) { @@ -168,9 +170,9 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo for (auto& sus : susHandlers) { if (sus != nullptr) { ReturnValue_t result = sus->connectModeTreeParent(*susAss); - if(result != returnvalue::OK) { - sif::error << "Connecting SUS " << sus->getObjectId() << - " to SUS assembly failed" << std::endl; + if (result != returnvalue::OK) { + sif::error << "Connecting SUS " << sus->getObjectId() << " to SUS assembly failed" + << std::endl; } #if OBSW_TEST_SUS == 1 sus->setStartUpImmediately(); @@ -299,9 +301,9 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF, new Max31865EiveHandler(rtdInfos[idx].first, objects::SPI_RTD_COM_IF, rtdLowLevelCookie); rtds[idx]->setDeviceInfo(idx, rtdInfos[idx].second); ReturnValue_t result = rtds[idx]->connectModeTreeParent(*tcsBoardAss); - if(result != returnvalue::OK) { + if (result != returnvalue::OK) { sif::error << "Connecting RTD " << static_cast(idx) << " to RTD Assembly failed" - << std::endl; + << std::endl; } rtdFdir = new RtdFdir(rtdInfos[idx].first); rtds[idx]->setCustomFdir(rtdFdir); @@ -321,8 +323,12 @@ void ObjectFactory::createThermalController() { new ThermalController(objects::THERMAL_CONTROLLER); } -AcsController* ObjectFactory::createAcsController() { - return new AcsController(objects::ACS_CONTROLLER); +AcsController* ObjectFactory::createAcsController(bool connectSubsystem) { + auto acsCtrl = new AcsController(objects::ACS_CONTROLLER); + if (connectSubsystem) { + acsCtrl->connectModeTreeParent(satsystem::ACS_SUBSYSTEM); + } + return acsCtrl; } void ObjectFactory::gpioChecker(ReturnValue_t result, std::string output) { diff --git a/linux/ObjectFactory.h b/linux/ObjectFactory.h index dc3766b8..f2e81ed9 100644 --- a/linux/ObjectFactory.h +++ b/linux/ObjectFactory.h @@ -20,6 +20,6 @@ void createRtdComponents(std::string spiDev, GpioIF* gpioComIF, PowerSwitchIF* p void gpioChecker(ReturnValue_t result, std::string output); void createThermalController(); -AcsController* createAcsController(); +AcsController* createAcsController(bool connectSubsystem); } // namespace ObjectFactory diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index a72f671c..1799ef4a 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -18,9 +18,7 @@ GPSHyperionLinuxController::GPSHyperionLinuxController(object_id_t objectId, object_id_t parentId, bool debugHyperionGps) - : ExtendedControllerBase(objectId), - gpsSet(this), - debugHyperionGps(debugHyperionGps) { + : ExtendedControllerBase(objectId), gpsSet(this), debugHyperionGps(debugHyperionGps) { timeUpdateCd.resetTimer(); } diff --git a/mission/system/objects/AcsBoardAssembly.cpp b/mission/system/objects/AcsBoardAssembly.cpp index 3913ebba..bcc2eb7a 100644 --- a/mission/system/objects/AcsBoardAssembly.cpp +++ b/mission/system/objects/AcsBoardAssembly.cpp @@ -274,6 +274,4 @@ void AcsBoardAssembly::refreshHelperModes() { } } -ReturnValue_t AcsBoardAssembly::initialize() { - return AssemblyBase::initialize(); -} +ReturnValue_t AcsBoardAssembly::initialize() { return AssemblyBase::initialize(); } diff --git a/mission/system/objects/RwAssembly.cpp b/mission/system/objects/RwAssembly.cpp index 8d86bed8..6e1c86ae 100644 --- a/mission/system/objects/RwAssembly.cpp +++ b/mission/system/objects/RwAssembly.cpp @@ -1,7 +1,7 @@ #include "RwAssembly.h" -RwAssembly::RwAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher, - power::Switch_t switcher, RwHelper helper) +RwAssembly::RwAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher, power::Switch_t switcher, + RwHelper helper) : AssemblyBase(objectId), helper(helper), switcher(pwrSwitcher, switcher) { ModeListEntry entry; for (uint8_t idx = 0; idx < NUMBER_RWS; idx++) { @@ -167,9 +167,7 @@ bool RwAssembly::isUseable(object_id_t object, Mode_t mode) { return false; } -ReturnValue_t RwAssembly::initialize() { - return SubsystemBase::initialize(); -} +ReturnValue_t RwAssembly::initialize() { return SubsystemBase::initialize(); } void RwAssembly::handleModeTransitionFailed(ReturnValue_t result) { if (targetMode == MODE_OFF) { diff --git a/mission/system/objects/RwAssembly.h b/mission/system/objects/RwAssembly.h index 5db6b7d6..0eb0b59f 100644 --- a/mission/system/objects/RwAssembly.h +++ b/mission/system/objects/RwAssembly.h @@ -12,8 +12,8 @@ struct RwHelper { class RwAssembly : public AssemblyBase { public: - RwAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher, - power::Switch_t switcher, RwHelper helper); + RwAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher, power::Switch_t switcher, + RwHelper helper); private: static constexpr uint8_t NUMBER_RWS = 4; diff --git a/mission/system/objects/SusAssembly.cpp b/mission/system/objects/SusAssembly.cpp index 842b4eae..3f75a369 100644 --- a/mission/system/objects/SusAssembly.cpp +++ b/mission/system/objects/SusAssembly.cpp @@ -120,9 +120,7 @@ ReturnValue_t SusAssembly::checkChildrenStateOn(Mode_t wantedMode, Submode_t wan return returnvalue::OK; } -ReturnValue_t SusAssembly::initialize() { - return AssemblyBase::initialize(); -} +ReturnValue_t SusAssembly::initialize() { return AssemblyBase::initialize(); } bool SusAssembly::isUseable(object_id_t object, Mode_t mode) { if (healthHelper.healthTable->isFaulty(object)) { diff --git a/mission/system/objects/TcsBoardAssembly.cpp b/mission/system/objects/TcsBoardAssembly.cpp index 5c419390..88075fdc 100644 --- a/mission/system/objects/TcsBoardAssembly.cpp +++ b/mission/system/objects/TcsBoardAssembly.cpp @@ -89,9 +89,7 @@ ReturnValue_t TcsBoardAssembly::isModeCombinationValid(Mode_t mode, Submode_t su return HasModesIF::INVALID_MODE; } -ReturnValue_t TcsBoardAssembly::initialize() { - return AssemblyBase::initialize(); -} +ReturnValue_t TcsBoardAssembly::initialize() { return AssemblyBase::initialize(); } void TcsBoardAssembly::startTransition(Mode_t mode, Submode_t submode) { if (mode != MODE_OFF) { From 470b23600889eb34570eec05627e55e13a796077 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 30 Sep 2022 15:05:48 +0200 Subject: [PATCH 30/43] fixed some of the acs ss code --- bsp_q7s/core/ObjectFactory.cpp | 3 +++ fsfw | 2 +- linux/ObjectFactory.cpp | 2 +- mission/system/tree/acsModeTree.cpp | 9 +++++++-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 86f4bd7b..412ce598 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -703,6 +703,7 @@ void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF, << std::endl; } } + rwAss->connectModeTreeParent(satsystem::ACS_SUBSYSTEM); #endif /* OBSW_ADD_RW == 1 */ } @@ -894,6 +895,7 @@ void ObjectFactory::createStrComponents(PowerSwitchIF* pwrSwitcher) { new StarTrackerHandler(objects::STAR_TRACKER, objects::UART_COM_IF, starTrackerCookie, strHelper, pcdu::PDU1_CH2_STAR_TRACKER_5V); starTracker->setPowerSwitcher(pwrSwitcher); + starTracker->connectModeTreeParent(satsystem::ACS_SUBSYSTEM); } void ObjectFactory::createImtqComponents(PowerSwitchIF* pwrSwitcher) { @@ -902,6 +904,7 @@ void ObjectFactory::createImtqComponents(PowerSwitchIF* pwrSwitcher) { auto imtqHandler = new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie, pcdu::Switches::PDU1_CH3_MGT_5V); imtqHandler->setPowerSwitcher(pwrSwitcher); + imtqHandler->connectModeTreeParent(satsystem::ACS_SUBSYSTEM); static_cast(imtqHandler); #if OBSW_TEST_IMTQ == 1 imtqHandler->setStartUpImmediately(); diff --git a/fsfw b/fsfw index acab5f6b..1eceef46 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit acab5f6bceef581fae64d1c16af19482ec72abcb +Subproject commit 1eceef4645b5a052dbdcd964e7840e7121c57909 diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index 5373e8ec..ea909a9e 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -166,7 +166,6 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo objects::SUS_10_N_LOC_XMYBZF_PT_ZF, objects::SUS_11_R_LOC_XBYMZB_PT_ZB}; SusAssHelper susAssHelper = SusAssHelper(susIds); auto susAss = new SusAssembly(objects::SUS_BOARD_ASS, pwrSwitcher, susAssHelper); - static_cast(susAss); for (auto& sus : susHandlers) { if (sus != nullptr) { ReturnValue_t result = sus->connectModeTreeParent(*susAss); @@ -183,6 +182,7 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo #endif } } + susAss->connectModeTreeParent(satsystem::ACS_SUBSYSTEM); #endif /* OBSW_ADD_SUN_SENSORS == 1 */ } diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index fe541d31..3dcd380f 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -1,3 +1,4 @@ +#include #include "acsModeTree.h" #include @@ -69,7 +70,7 @@ auto ACS_TABLE_IDLE_CHRG_TRANS_1 = std::make_pair( auto ACS_SEQUENCE_TARGET_PT = std::make_pair(acs::CtrlModes::TARGET_PT, FixedArrayList()); auto ACS_TABLE_TARGET_PT_TGT = - std::make_pair((acs::CtrlModes::TARGET_PT << 24) | 1, FixedArrayList()); + std::make_pair((acs::CtrlModes::TARGET_PT << 24) | 1, FixedArrayList()); auto ACS_TABLE_TARGET_PT_TRANS_0 = std::make_pair((acs::CtrlModes::TARGET_PT << 24) | 2, FixedArrayList()); auto ACS_TABLE_TARGET_PT_TRANS_1 = @@ -149,7 +150,7 @@ void buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_SAFE_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TGT.second); iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TGT.second); - check(ss->addTable(&ACS_TABLE_SAFE_TGT.second, ACS_TABLE_OFF_TGT.first, false, true), ctxc); + check(ss->addTable(&ACS_TABLE_SAFE_TGT.second, ACS_TABLE_SAFE_TGT.first, false, true), ctxc); // Build SAFE transition 0 iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_SAFE_TRANS_0.second); @@ -384,6 +385,10 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { void checkInsert(ReturnValue_t result, const char* ctx) { if (result != returnvalue::OK) { + if(result == mapdefs::KEY_ALREADY_EXISTS) { + sif::warning << "satsystem::checkInsert: Insertion failed at " << ctx << ", key already exists" << + ctx << std::endl; + } sif::warning << "satsystem::checkInsert: Insertion failed at " << ctx << std::endl; } } From a562d7e4ca2ccf7be84aed8c654a4e3386a67114 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 30 Sep 2022 15:07:20 +0200 Subject: [PATCH 31/43] improved retval checker --- mission/system/tree/acsModeTree.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index 3dcd380f..a336f640 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -385,10 +385,13 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { void checkInsert(ReturnValue_t result, const char* ctx) { if (result != returnvalue::OK) { + sif::warning << "satsystem::checkInsert: Insertion failed at " << ctx; if(result == mapdefs::KEY_ALREADY_EXISTS) { - sif::warning << "satsystem::checkInsert: Insertion failed at " << ctx << ", key already exists" << - ctx << std::endl; + sif::warning << ": Key already exists" << std::endl; + } else if(result == mapdefs::MAP_FULL) { + sif::warning << ": Map full" << std::endl; + } else { + sif::warning << std::endl; } - sif::warning << "satsystem::checkInsert: Insertion failed at " << ctx << std::endl; } } From 54a3d31c00ce91e21462684334f00282abca553d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 30 Sep 2022 15:30:31 +0200 Subject: [PATCH 32/43] TCS ctrl bugfix --- bsp_hosted/ObjectFactory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsp_hosted/ObjectFactory.cpp b/bsp_hosted/ObjectFactory.cpp index 6c85b04d..98b3dc26 100644 --- a/bsp_hosted/ObjectFactory.cpp +++ b/bsp_hosted/ObjectFactory.cpp @@ -86,7 +86,7 @@ void ObjectFactory::produce(void* args) { new PlPcduDummy(objects::PLPCDU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); new TemperatureSensorsDummy(); new SusDummy(); - new ThermalController(objects::THERMAL_CONTROLLER, objects::NO_OBJECT); + new ThermalController(objects::THERMAL_CONTROLLER); // new TestTask(objects::TEST_TASK); } From 353cda832d98e81854d289b8ebc87cf09bd3dcf9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 30 Sep 2022 15:32:46 +0200 Subject: [PATCH 33/43] unittest fix --- unittest/controller/testThermalController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unittest/controller/testThermalController.cpp b/unittest/controller/testThermalController.cpp index a65ec69b..eec65639 100644 --- a/unittest/controller/testThermalController.cpp +++ b/unittest/controller/testThermalController.cpp @@ -17,7 +17,7 @@ TEST_CASE("Thermal Controller", "[ThermalController]") { testEnvironment::initialize(); - ThermalController controller(THERMAL_CONTROLLER_ID, objects::NO_OBJECT); + ThermalController controller(THERMAL_CONTROLLER_ID); ReturnValue_t result = controller.initialize(); REQUIRE(result == returnvalue::OK); From 797ed9200f6a897fd561e392adc53faec9c72c4b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 4 Oct 2022 13:34:15 +0200 Subject: [PATCH 34/43] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index b73f2fa4..9cc079d7 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit b73f2fa4e6c393a6e5215e10d7df73d87b947303 +Subproject commit 9cc079d71c96301e9200b6076f392e0733d14a53 From 3f12d3500e606776658e450c800fbda1d324d225 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 4 Oct 2022 14:51:15 +0200 Subject: [PATCH 35/43] re-generate csvs --- generators/bsp_q7s_events.csv | 18 ++++++++--------- generators/bsp_q7s_objects.csv | 6 ++++-- generators/events/translateEvents.cpp | 2 +- generators/objects/translateObjects.cpp | 20 ++++++++++++------- linux/fsfwconfig/events/translateEvents.cpp | 2 +- linux/fsfwconfig/objects/translateObjects.cpp | 20 ++++++++++++------- tmtc | 2 +- 7 files changed, 42 insertions(+), 28 deletions(-) diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index 17361ebb..b3e09906 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -174,15 +174,15 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 12709;0x31a5;I_MPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h 12710;0x31a6;U_HPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h 12711;0x31a7;I_HPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h -12800;0x3200;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission/system/AcsBoardAssembly.h -12801;0x3201;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission/system/AcsBoardAssembly.h -12802;0x3202;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission/system/AcsBoardAssembly.h -12803;0x3203;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission/system/AcsBoardAssembly.h -12900;0x3264;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission/system/SusAssembly.h -12901;0x3265;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission/system/SusAssembly.h -12902;0x3266;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission/system/SusAssembly.h -12903;0x3267;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission/system/SusAssembly.h -13000;0x32c8;CHILDREN_LOST_MODE;MEDIUM;;mission/system/TcsBoardAssembly.h +12800;0x3200;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission/system/objects/AcsBoardAssembly.h +12801;0x3201;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission/system/objects/AcsBoardAssembly.h +12802;0x3202;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission/system/objects/AcsBoardAssembly.h +12803;0x3203;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission/system/objects/AcsBoardAssembly.h +12900;0x3264;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission/system/objects/SusAssembly.h +12901;0x3265;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission/system/objects/SusAssembly.h +12902;0x3266;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission/system/objects/SusAssembly.h +12903;0x3267;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission/system/objects/SusAssembly.h +13000;0x32c8;CHILDREN_LOST_MODE;MEDIUM;;mission/system/objects/TcsBoardAssembly.h 13100;0x332c;GPS_FIX_CHANGE;INFO;Fix has changed. P1: Old fix. P2: New fix 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix;mission/devices/devicedefinitions/GPSDefinitions.h 13200;0x3390;P60_BOOT_COUNT;INFO;P60 boot count is broadcasted once at SW startup. P1: Boot count;mission/devices/P60DockHandler.h 13201;0x3391;BATT_MODE;INFO;Battery mode is broadcasted at startup. P1: Mode;mission/devices/P60DockHandler.h diff --git a/generators/bsp_q7s_objects.csv b/generators/bsp_q7s_objects.csv index 924ae0a0..b6d6643c 100644 --- a/generators/bsp_q7s_objects.csv +++ b/generators/bsp_q7s_objects.csv @@ -128,8 +128,10 @@ 0x73000002;SUS_BOARD_ASS 0x73000003;TCS_BOARD_ASS 0x73000004;RW_ASS -0x73000005;CFDP_HANDLER -0x73000006;CFDP_DISTRIBUTOR 0x73000100;TM_FUNNEL +0x73010000;EIVE_SYSTEM +0x73010001;ACS_SUBSYSTEM +0x7302000;CFDP_HANDLER +0x73020001;CFDP_DISTRIBUTOR 0x73500000;CCSDS_IP_CORE_BRIDGE 0xFFFFFFFF;NO_OBJECT diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 290a5e2f..ee08e1d7 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 217 translations. * @details - * Generated on: 2022-09-29 14:06:18 + * Generated on: 2022-10-04 14:50:21 */ #include "translateEvents.h" diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index ea771fbd..e7184b1d 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -1,8 +1,8 @@ /** * @brief Auto-generated object translation file. * @details - * Contains 135 translations. - * Generated on: 2022-09-29 14:06:18 + * Contains 137 translations. + * Generated on: 2022-10-04 14:50:21 */ #include "translateObjects.h" @@ -136,9 +136,11 @@ const char *ACS_BOARD_ASS_STRING = "ACS_BOARD_ASS"; const char *SUS_BOARD_ASS_STRING = "SUS_BOARD_ASS"; const char *TCS_BOARD_ASS_STRING = "TCS_BOARD_ASS"; const char *RW_ASS_STRING = "RW_ASS"; +const char *TM_FUNNEL_STRING = "TM_FUNNEL"; +const char *EIVE_SYSTEM_STRING = "EIVE_SYSTEM"; +const char *ACS_SUBSYSTEM_STRING = "ACS_SUBSYSTEM"; const char *CFDP_HANDLER_STRING = "CFDP_HANDLER"; const char *CFDP_DISTRIBUTOR_STRING = "CFDP_DISTRIBUTOR"; -const char *TM_FUNNEL_STRING = "TM_FUNNEL"; const char *CCSDS_IP_CORE_BRIDGE_STRING = "CCSDS_IP_CORE_BRIDGE"; const char *NO_OBJECT_STRING = "NO_OBJECT"; @@ -404,12 +406,16 @@ const char *translateObject(object_id_t object) { return TCS_BOARD_ASS_STRING; case 0x73000004: return RW_ASS_STRING; - case 0x73000005: - return CFDP_HANDLER_STRING; - case 0x73000006: - return CFDP_DISTRIBUTOR_STRING; case 0x73000100: return TM_FUNNEL_STRING; + case 0x73010000: + return EIVE_SYSTEM_STRING; + case 0x73010001: + return ACS_SUBSYSTEM_STRING; + case 0x7302000: + return CFDP_HANDLER_STRING; + case 0x73020001: + return CFDP_DISTRIBUTOR_STRING; case 0x73500000: return CCSDS_IP_CORE_BRIDGE_STRING; case 0xFFFFFFFF: diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 290a5e2f..ee08e1d7 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 217 translations. * @details - * Generated on: 2022-09-29 14:06:18 + * Generated on: 2022-10-04 14:50:21 */ #include "translateEvents.h" diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index ea771fbd..e7184b1d 100644 --- a/linux/fsfwconfig/objects/translateObjects.cpp +++ b/linux/fsfwconfig/objects/translateObjects.cpp @@ -1,8 +1,8 @@ /** * @brief Auto-generated object translation file. * @details - * Contains 135 translations. - * Generated on: 2022-09-29 14:06:18 + * Contains 137 translations. + * Generated on: 2022-10-04 14:50:21 */ #include "translateObjects.h" @@ -136,9 +136,11 @@ const char *ACS_BOARD_ASS_STRING = "ACS_BOARD_ASS"; const char *SUS_BOARD_ASS_STRING = "SUS_BOARD_ASS"; const char *TCS_BOARD_ASS_STRING = "TCS_BOARD_ASS"; const char *RW_ASS_STRING = "RW_ASS"; +const char *TM_FUNNEL_STRING = "TM_FUNNEL"; +const char *EIVE_SYSTEM_STRING = "EIVE_SYSTEM"; +const char *ACS_SUBSYSTEM_STRING = "ACS_SUBSYSTEM"; const char *CFDP_HANDLER_STRING = "CFDP_HANDLER"; const char *CFDP_DISTRIBUTOR_STRING = "CFDP_DISTRIBUTOR"; -const char *TM_FUNNEL_STRING = "TM_FUNNEL"; const char *CCSDS_IP_CORE_BRIDGE_STRING = "CCSDS_IP_CORE_BRIDGE"; const char *NO_OBJECT_STRING = "NO_OBJECT"; @@ -404,12 +406,16 @@ const char *translateObject(object_id_t object) { return TCS_BOARD_ASS_STRING; case 0x73000004: return RW_ASS_STRING; - case 0x73000005: - return CFDP_HANDLER_STRING; - case 0x73000006: - return CFDP_DISTRIBUTOR_STRING; case 0x73000100: return TM_FUNNEL_STRING; + case 0x73010000: + return EIVE_SYSTEM_STRING; + case 0x73010001: + return ACS_SUBSYSTEM_STRING; + case 0x7302000: + return CFDP_HANDLER_STRING; + case 0x73020001: + return CFDP_DISTRIBUTOR_STRING; case 0x73500000: return CCSDS_IP_CORE_BRIDGE_STRING; case 0xFFFFFFFF: diff --git a/tmtc b/tmtc index 9cc079d7..d39b79b2 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 9cc079d71c96301e9200b6076f392e0733d14a53 +Subproject commit d39b79b2ac57bf9c0b83092276aa57895f4e3faa From 763fc548552616274c5b50ee7b4dd33c340ba468 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 4 Oct 2022 14:54:39 +0200 Subject: [PATCH 36/43] bump changelog --- CHANGELOG.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8dc574f..12c91f21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,10 @@ list yields a list of all related PRs for each release. # [unreleased] -# [v1.14.0] +# [v1.13.0] +- Add ACS Subsystem TMTC commands + PR: https://egit.irs.uni-stuttgart.de/eive/eive-tmtc/pulls/117 - Provide full SW update capability for the OBSW. This includes very basic CFDP integration, a software update procedure specified in detail in the README and some high level @@ -27,9 +29,6 @@ list yields a list of all related PRs for each release. - Increase number of allowed consescutive action commands from 3 to 16 PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/294 - Fix for EM SW: Always create ACS Task - -# [v1.13.0] 24.08.2022 - - Added first version of ACS Controller with gathers MGM data in a set - Some tweaks for IMTQ handler From 8e9a91f32aef5ddb3684abbbbef6894ded1da7f4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 10 Oct 2022 10:29:47 +0200 Subject: [PATCH 37/43] bump fsfw --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 1eceef46..7f180ac1 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 1eceef4645b5a052dbdcd964e7840e7121c57909 +Subproject commit 7f180ac1faef4fff270fe0e6c22a4c7af3112cde From d8757ede0ebdac6ae313c2bc051b58caf3f8848d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 10 Oct 2022 11:09:28 +0200 Subject: [PATCH 38/43] bump submodules --- fsfw | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fsfw b/fsfw index 7f180ac1..1d6ccfe5 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 7f180ac1faef4fff270fe0e6c22a4c7af3112cde +Subproject commit 1d6ccfe5ab63c268e1b62a731eb55d35eac88492 diff --git a/tmtc b/tmtc index 6ccf8c8c..72fa0ae1 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 6ccf8c8cb900c5bbba85e6c23a92ff7366cf2ee3 +Subproject commit 72fa0ae15a2312247e1d47cac1183382cc3e0c9c From 0f57810a9a7ee7059921d876c35ecb4b6e48721c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 10 Oct 2022 17:40:30 +0200 Subject: [PATCH 39/43] re-run afmt --- bsp_hosted/ObjectFactory.cpp | 1 + bsp_q7s/core/InitMission.cpp | 2 +- bsp_q7s/core/ObjectFactory.cpp | 5 ++--- linux/ObjectFactory.cpp | 2 +- mission/system/tree/acsModeTree.cpp | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bsp_hosted/ObjectFactory.cpp b/bsp_hosted/ObjectFactory.cpp index cbfe8776..c5af74e4 100644 --- a/bsp_hosted/ObjectFactory.cpp +++ b/bsp_hosted/ObjectFactory.cpp @@ -43,6 +43,7 @@ #include #include #include + #include "dummies/helpers.h" #include "mission/utility/GlobalConfigHandler.h" diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index ab16e5b3..690267d2 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -222,7 +222,7 @@ void initmission::initTasks() { #if OBSW_ADD_TCS_CTRL == 1 tcsTask->addComponent(objects::THERMAL_CONTROLLER); #endif - + #if OBSW_ADD_STAR_TRACKER == 1 PeriodicTaskIF* strHelperTask = factory->createPeriodicTask( "STR_HELPER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc); diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index a30f9c37..b0b784ec 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -1,8 +1,5 @@ #include "ObjectFactory.h" -#include "mission/system/objects/AcsSubsystem.h" -#include "linux/devices/ScexUartReader.h" - #include "OBSWConfig.h" #include "bsp_q7s/boardtest/Q7STestTask.h" #include "bsp_q7s/callbacks/gnssCallback.h" @@ -24,6 +21,7 @@ #include "linux/callbacks/gpioCallbacks.h" #include "linux/csp/CspComIF.h" #include "linux/devices/GPSHyperionLinuxController.h" +#include "linux/devices/ScexUartReader.h" #include "linux/devices/devicedefinitions/PlocMPSoCDefinitions.h" #include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" #include "linux/devices/ploc/PlocMPSoCHandler.h" @@ -43,6 +41,7 @@ #include "mission/system/fdir/RtdFdir.h" #include "mission/system/fdir/SusFdir.h" #include "mission/system/fdir/SyrlinksFdir.h" +#include "mission/system/objects/AcsSubsystem.h" #include "mission/system/objects/RwAssembly.h" #include "mission/system/objects/TcsBoardAssembly.h" #include "mission/system/tree/acsModeTree.h" diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index 1d90ee0c..d6e80dc1 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -326,7 +326,7 @@ void ObjectFactory::createScexComponents(std::string uartDev, PowerSwitchIF* pwr std::optional switchId) { auto* cookie = new UartCookie(objects::SCEX, uartDev, uart::SCEX_BAUD, 4096); cookie->setTwoStopBits(); - //cookie->setParityEven(); + // cookie->setParityEven(); auto scexUartReader = new ScexUartReader(objects::SCEX_UART_READER); auto scexHandler = new ScexDeviceHandler(objects::SCEX, *scexUartReader, cookie, mountedIF); if (onImmediately) { diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index a336f640..0b434c45 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -1,6 +1,6 @@ -#include #include "acsModeTree.h" +#include #include #include #include @@ -386,9 +386,9 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { void checkInsert(ReturnValue_t result, const char* ctx) { if (result != returnvalue::OK) { sif::warning << "satsystem::checkInsert: Insertion failed at " << ctx; - if(result == mapdefs::KEY_ALREADY_EXISTS) { + if (result == mapdefs::KEY_ALREADY_EXISTS) { sif::warning << ": Key already exists" << std::endl; - } else if(result == mapdefs::MAP_FULL) { + } else if (result == mapdefs::MAP_FULL) { sif::warning << ": Map full" << std::endl; } else { sif::warning << std::endl; From 3d1d31c0208145665d8979b5967b526017a985cb Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 10 Oct 2022 17:44:28 +0200 Subject: [PATCH 40/43] update changelog --- CHANGELOG.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 917bf8c2..7a7cf362 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,10 +10,8 @@ list yields a list of all related PRs for each release. # [unreleased] -# [v1.13.0] +# [v1.14.0] -- Add ACS Subsystem TMTC commands - PR: https://egit.irs.uni-stuttgart.de/eive/eive-tmtc/pulls/117 - Provide full SW update capability for the OBSW. This includes very basic CFDP integration, a software update procedure specified in detail in the README and some high level @@ -31,6 +29,10 @@ list yields a list of all related PRs for each release. - Fix for EM SW: Always create ACS Task - Added Scex device handler and Scex uart reader PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/303 +- ACS Subsystem. PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/228 + +# [v1.13.0] 24.08.2022 + - Added first version of ACS Controller with gathers MGM data in a set - Some tweaks for IMTQ handler @@ -102,7 +104,6 @@ list yields a list of all related PRs for each release. ## Added -- ACS Subsystem. PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/228 - Custom Syrlinks FDIR which disabled most of the default FDIR functionality PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/232 - Custom Gomspace FDIR which disabled most of the default FDIR functionality From 1780a09dc5243126ef0e134922816955b6416853 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 10 Oct 2022 18:01:09 +0200 Subject: [PATCH 41/43] bump deps --- fsfw | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fsfw b/fsfw index a8fb83df..1d6ccfe5 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit a8fb83dfcedb5391ac942d6bcffa64f0cbca38c5 +Subproject commit 1d6ccfe5ab63c268e1b62a731eb55d35eac88492 diff --git a/tmtc b/tmtc index a4a228c4..ebb0ddf3 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit a4a228c42a7a8385bd26f893a4fa0cffd4fa934a +Subproject commit ebb0ddf3993480e2193c00dbabea0f5f7952231f From f5adbea923a7c2279d84e281dd07104f2809d007 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 11 Oct 2022 15:19:03 +0200 Subject: [PATCH 42/43] safe mode is now callback sequence --- mission/system/tree/acsModeTree.cpp | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index 0b434c45..0d0bd524 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -170,7 +170,7 @@ void buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TGT.first, 0, true); ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TRANS_0.first, 0, false); ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TRANS_1.first, 0, false); - check(ss->addSequence(&ACS_SEQUENCE_SAFE.second, ACS_SEQUENCE_SAFE.first, ACS_SEQUENCE_OFF.first, + check(ss->addSequence(&ACS_SEQUENCE_SAFE.second, ACS_SEQUENCE_SAFE.first, ACS_SEQUENCE_SAFE.first, false, true), ctxc); } diff --git a/tmtc b/tmtc index ebb0ddf3..3d2dee8c 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit ebb0ddf3993480e2193c00dbabea0f5f7952231f +Subproject commit 3d2dee8c9c6265162579d363eeed6e55d03f36b9 From ed7bba2cf5abc06181788f8ff33ceb4670db7e95 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 17 Oct 2022 10:34:57 +0200 Subject: [PATCH 43/43] renaming --- bsp_q7s/core/InitMission.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index 79d08a69..cfcef53c 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -182,7 +182,7 @@ void initmission::initTasks() { initmission::printAddObjectError("SUS_BOARD_ASS", objects::SUS_BOARD_ASS); } #endif - result = sysTask->addComponent(objects::ACS_SUBSYSTEM); + result = acsSysTask->addComponent(objects::ACS_SUBSYSTEM); if (result != returnvalue::OK) { initmission::printAddObjectError("ACS_SUBSYSTEM", objects::ACS_SUBSYSTEM); }