diff --git a/CHANGELOG.md b/CHANGELOG.md index 35890493..e153b91b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,8 @@ will consitute of a breaking change warranting a new major release: ## Changed +- ACS CTRL transition to DETUBMLE is now done in CTRL internally. No + system level handling necessary anymore. - More fixes and improvements for SD card handling. Extend SD card setup in core controller to create full initial state for SD card manager are core controller as early as possible, turn execution of setup file update blocking. This might solve the issue with the SD card manager diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index ed1436e0..26bc5118 100644 --- a/bsp_hosted/fsfwconfig/events/translateEvents.cpp +++ b/bsp_hosted/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 269 translations. * @details - * Generated on: 2023-03-08 16:44:32 + * Generated on: 2023-03-10 15:36:00 */ #include "translateEvents.h" diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index ad419fa0..4faacd00 100644 --- a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp +++ b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 160 translations. - * Generated on: 2023-03-08 16:44:32 + * Generated on: 2023-03-10 15:36:00 */ #include "translateObjects.h" @@ -138,7 +138,7 @@ const char *HEATER_3_OBC_BRD_STRING = "HEATER_3_OBC_BRD"; const char *HEATER_4_CAMERA_STRING = "HEATER_4_CAMERA"; const char *HEATER_5_STR_STRING = "HEATER_5_STR"; const char *HEATER_6_DRO_STRING = "HEATER_6_DRO"; -const char *HEATER_7_HPA_STRING = "HEATER_7_HPA"; +const char *HEATER_7_SYRLINKS_STRING = "HEATER_7_SYRLINKS"; 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"; @@ -434,7 +434,7 @@ const char *translateObject(object_id_t object) { case 0x60000006: return HEATER_6_DRO_STRING; case 0x60000007: - return HEATER_7_HPA_STRING; + return HEATER_7_SYRLINKS_STRING; case 0x73000001: return ACS_BOARD_ASS_STRING; case 0x73000002: diff --git a/generators/bsp_hosted_objects.csv b/generators/bsp_hosted_objects.csv index 254ebe87..0b970626 100644 --- a/generators/bsp_hosted_objects.csv +++ b/generators/bsp_hosted_objects.csv @@ -130,7 +130,7 @@ 0x60000004;HEATER_4_CAMERA 0x60000005;HEATER_5_STR 0x60000006;HEATER_6_DRO -0x60000007;HEATER_7_HPA +0x60000007;HEATER_7_SYRLINKS 0x73000001;ACS_BOARD_ASS 0x73000002;SUS_BOARD_ASS 0x73000003;TCS_BOARD_ASS diff --git a/generators/bsp_q7s_objects.csv b/generators/bsp_q7s_objects.csv index c1171c16..cc893edd 100644 --- a/generators/bsp_q7s_objects.csv +++ b/generators/bsp_q7s_objects.csv @@ -135,7 +135,7 @@ 0x60000004;HEATER_4_CAMERA 0x60000005;HEATER_5_STR 0x60000006;HEATER_6_DRO -0x60000007;HEATER_7_HPA +0x60000007;HEATER_7_SYRLINKS 0x73000001;ACS_BOARD_ASS 0x73000002;SUS_BOARD_ASS 0x73000003;TCS_BOARD_ASS diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index ed1436e0..26bc5118 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 269 translations. * @details - * Generated on: 2023-03-08 16:44:32 + * Generated on: 2023-03-10 15:36:00 */ #include "translateEvents.h" diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 4950a981..647a23bd 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 164 translations. - * Generated on: 2023-03-08 16:44:32 + * Generated on: 2023-03-10 15:36:00 */ #include "translateObjects.h" @@ -143,7 +143,7 @@ const char *HEATER_3_OBC_BRD_STRING = "HEATER_3_OBC_BRD"; const char *HEATER_4_CAMERA_STRING = "HEATER_4_CAMERA"; const char *HEATER_5_STR_STRING = "HEATER_5_STR"; const char *HEATER_6_DRO_STRING = "HEATER_6_DRO"; -const char *HEATER_7_HPA_STRING = "HEATER_7_HPA"; +const char *HEATER_7_SYRLINKS_STRING = "HEATER_7_SYRLINKS"; 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"; @@ -448,7 +448,7 @@ const char *translateObject(object_id_t object) { case 0x60000006: return HEATER_6_DRO_STRING; case 0x60000007: - return HEATER_7_HPA_STRING; + return HEATER_7_SYRLINKS_STRING; case 0x73000001: return ACS_BOARD_ASS_STRING; case 0x73000002: diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index ed1436e0..26bc5118 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 269 translations. * @details - * Generated on: 2023-03-08 16:44:32 + * Generated on: 2023-03-10 15:36:00 */ #include "translateEvents.h" diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 4950a981..647a23bd 100644 --- a/linux/fsfwconfig/objects/translateObjects.cpp +++ b/linux/fsfwconfig/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 164 translations. - * Generated on: 2023-03-08 16:44:32 + * Generated on: 2023-03-10 15:36:00 */ #include "translateObjects.h" @@ -143,7 +143,7 @@ const char *HEATER_3_OBC_BRD_STRING = "HEATER_3_OBC_BRD"; const char *HEATER_4_CAMERA_STRING = "HEATER_4_CAMERA"; const char *HEATER_5_STR_STRING = "HEATER_5_STR"; const char *HEATER_6_DRO_STRING = "HEATER_6_DRO"; -const char *HEATER_7_HPA_STRING = "HEATER_7_HPA"; +const char *HEATER_7_SYRLINKS_STRING = "HEATER_7_SYRLINKS"; 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"; @@ -448,7 +448,7 @@ const char *translateObject(object_id_t object) { case 0x60000006: return HEATER_6_DRO_STRING; case 0x60000007: - return HEATER_7_HPA_STRING; + return HEATER_7_SYRLINKS_STRING; case 0x73000001: return ACS_BOARD_ASS_STRING; case 0x73000002: diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index ff0aa008..2ae2a7bd 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -198,6 +198,7 @@ void AcsController::performSafe() { detumbleCounter = 0; // Triggers detumble mode transition in subsystem triggerEvent(acs::SAFE_RATE_VIOLATION); + startTransition(mode, acs::SafeSubmode::DETUMBLE); } updateCtrlValData(errAng); @@ -245,6 +246,7 @@ void AcsController::performDetumble() { detumbleCounter = 0; // Triggers safe mode transition in subsystem triggerEvent(acs::SAFE_RATE_RECOVERY); + startTransition(mode, acs::SafeSubmode::DEFAULT); } disableCtrlValData(); diff --git a/mission/system/objects/AcsSubsystem.cpp b/mission/system/objects/AcsSubsystem.cpp index d407f2e8..873d88cf 100644 --- a/mission/system/objects/AcsSubsystem.cpp +++ b/mission/system/objects/AcsSubsystem.cpp @@ -8,81 +8,7 @@ AcsSubsystem::AcsSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables) - : Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) { - auto mqArgs = MqArgs(getObjectId(), static_cast(this)); - eventQueue = - QueueFactory::instance()->createMessageQueue(10, EventMessage::EVENT_MESSAGE_SIZE, &mqArgs); -} - -ReturnValue_t AcsSubsystem::initialize() { - EventManagerIF* manager = ObjectManager::instance()->get(objects::EVENT_MANAGER); - if (manager == nullptr) { -#if FSFW_CPP_OSTREAM_ENABLED == 1 - sif::error << "AcsSubsystem::initialize: Invalid event manager" << std::endl; -#endif - return ObjectManagerIF::CHILD_INIT_FAILED; - } - ReturnValue_t result = manager->registerListener(eventQueue->getId()); - if (result != returnvalue::OK) { -#if FSFW_CPP_OSTREAM_ENABLED == 1 - sif::warning << "AcsSubsystem::registerListener: Failed to register as " - "listener" - << std::endl; -#endif - return ObjectManagerIF::CHILD_INIT_FAILED; - ; - } - result = - manager->subscribeToEvent(eventQueue->getId(), event::getEventId(acs::SAFE_RATE_VIOLATION)); - if (result != returnvalue::OK) { - sif::error << "AcsSubsystem: Subscribing for acs::SAFE_RATE_VIOLATION failed" << std::endl; - } - result = - manager->subscribeToEvent(eventQueue->getId(), event::getEventId(acs::SAFE_RATE_RECOVERY)); - if (result != returnvalue::OK) { - sif::error << "AcsSubsystem: Subscribing for acs::SAFE_RATE_RECOVERY failed" << std::endl; - } - return Subsystem::initialize(); -} - -void AcsSubsystem::performChildOperation() { - // sif::debug << "ACS system thread running" << std::endl; - handleEventMessages(); - return Subsystem::performChildOperation(); -} - -void AcsSubsystem::handleEventMessages() { - EventMessage event; - for (ReturnValue_t result = eventQueue->receiveMessage(&event); result == returnvalue::OK; - result = eventQueue->receiveMessage(&event)) { - ReturnValue_t status; - switch (event.getMessageId()) { - case EventMessage::EVENT_MESSAGE: - if (event.getEvent() == acs::SAFE_RATE_VIOLATION) { - CommandMessage msg; - ModeMessage::setCmdModeMessage(msg, acs::AcsMode::SAFE, acs::SafeSubmode::DETUMBLE); - status = commandQueue->sendMessage(commandQueue->getId(), &msg); - if (result != returnvalue::OK) { - sif::error << "AcsSubsystem: sending DETUMBLE mode cmd to self has failed" << std::endl; - } - } - if (event.getEvent() == acs::SAFE_RATE_RECOVERY) { - CommandMessage msg; - ModeMessage::setCmdModeMessage(msg, acs::AcsMode::SAFE, acs::SafeSubmode::DEFAULT); - status = commandQueue->sendMessage(commandQueue->getId(), &msg); - if (status != returnvalue::OK) { - sif::error << "AcsSubsystem: sending SAFE mode cmd to self has failed" << std::endl; - } - } - break; - default: - sif::debug << "AcsSubsystem::performChildOperation: Did not subscribe " - "to this event message" - << std::endl; - break; - } - } -} + : Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) {} void AcsSubsystem::announceMode(bool recursive) { const char* modeStr = acs::getModeStr(static_cast(mode)); diff --git a/mission/system/objects/AcsSubsystem.h b/mission/system/objects/AcsSubsystem.h index c6c77fef..fc6b238e 100644 --- a/mission/system/objects/AcsSubsystem.h +++ b/mission/system/objects/AcsSubsystem.h @@ -8,13 +8,7 @@ class AcsSubsystem : public Subsystem { AcsSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables); private: - ReturnValue_t initialize() override; - void performChildOperation() override; void announceMode(bool recursive) override; - - void handleEventMessages(); - - MessageQueueIF* eventQueue = nullptr; }; #endif /* MISSION_SYSTEM_ACSSUBSYSTEM_H_ */ diff --git a/mission/system/objects/EiveSystem.cpp b/mission/system/objects/EiveSystem.cpp index 65711706..bb2a229d 100644 --- a/mission/system/objects/EiveSystem.cpp +++ b/mission/system/objects/EiveSystem.cpp @@ -1,10 +1,17 @@ #include "EiveSystem.h" +#include +#include +#include #include EiveSystem::EiveSystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables) - : Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) {} + : Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) { + auto mqArgs = MqArgs(getObjectId(), static_cast(this)); + eventQueue = + QueueFactory::instance()->createMessageQueue(10, EventMessage::EVENT_MESSAGE_SIZE, &mqArgs); +} void EiveSystem::announceMode(bool recursive) { const char* modeStr = "UNKNOWN"; @@ -37,3 +44,44 @@ void EiveSystem::announceMode(bool recursive) { sif::info << "EIVE system is now in " << modeStr << " mode" << std::endl; return Subsystem::announceMode(recursive); } + +void EiveSystem::performChildOperation() { + handleEventMessages(); + return Subsystem::performChildOperation(); +} + +ReturnValue_t EiveSystem::initialize() { + EventManagerIF* manager = ObjectManager::instance()->get(objects::EVENT_MANAGER); + if (manager == nullptr) { +#if FSFW_CPP_OSTREAM_ENABLED == 1 + sif::error << "AcsSubsystem::initialize: Invalid event manager" << std::endl; +#endif + return ObjectManagerIF::CHILD_INIT_FAILED; + } + ReturnValue_t result = manager->registerListener(eventQueue->getId()); + if (result != returnvalue::OK) { +#if FSFW_CPP_OSTREAM_ENABLED == 1 + sif::warning << "AcsSubsystem::registerListener: Failed to register as " + "listener" + << std::endl; +#endif + return ObjectManagerIF::CHILD_INIT_FAILED; + } + return Subsystem::initialize(); +} + +void EiveSystem::handleEventMessages() { + EventMessage event; + for (ReturnValue_t result = eventQueue->receiveMessage(&event); result == returnvalue::OK; + result = eventQueue->receiveMessage(&event)) { + switch (event.getMessageId()) { + case EventMessage::EVENT_MESSAGE: + break; + default: + sif::debug << "AcsSubsystem::performChildOperation: Did not subscribe " + "to this event message" + << std::endl; + break; + } + } +} diff --git a/mission/system/objects/EiveSystem.h b/mission/system/objects/EiveSystem.h index 59acf82e..0d75b31a 100644 --- a/mission/system/objects/EiveSystem.h +++ b/mission/system/objects/EiveSystem.h @@ -8,7 +8,12 @@ class EiveSystem : public Subsystem { EiveSystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables); private: + ReturnValue_t initialize() override; + void performChildOperation() override; void announceMode(bool recursive) override; + void handleEventMessages(); + + MessageQueueIF* eventQueue = nullptr; }; #endif /* MISSION_SYSTEM_EIVESYSTEM_H_ */ diff --git a/tmtc b/tmtc index 9f905524..e32a6ded 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 9f905524b6f2b10b1e8bcd9139c21a206cdf8aa3 +Subproject commit e32a6ded6661d450dbc75a7ab0194e8048af3d5c