From 67a14ca6f61963fd350e84853aaedef2bf8bd481 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 22 Feb 2023 15:02:15 +0100 Subject: [PATCH] handle ACS event in AcsSubsystem --- mission/system/objects/AcsSubsystem.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mission/system/objects/AcsSubsystem.cpp b/mission/system/objects/AcsSubsystem.cpp index edb1c6d3..c812394c 100644 --- a/mission/system/objects/AcsSubsystem.cpp +++ b/mission/system/objects/AcsSubsystem.cpp @@ -47,6 +47,11 @@ ReturnValue_t AcsSubsystem::initialize() { if (result != returnvalue::OK) { sif::error << "AcsSubsystem: Subscribing for acs::MULTIPLE_RW_INVALID failed" << std::endl; } + result = manager->subscribeToEvent(eventQueue->getId(), + event::getEventId(acs::MEKF_INVALID_MODE_VIOLATION)); + if (result != returnvalue::OK) { + sif::error << "AcsSubsystem: Subscribing for acs::MULTIPLE_RW_INVALID failed" << std::endl; + } return Subsystem::initialize(); } @@ -71,7 +76,8 @@ void AcsSubsystem::handleEventMessages() { } } if (event.getEvent() == acs::SAFE_RATE_RECOVERY || - event.getEvent() == acs::MULTIPLE_RW_INVALID) { + event.getEvent() == acs::MULTIPLE_RW_INVALID || + event.getEvent() == acs::MEKF_INVALID_MODE_VIOLATION) { CommandMessage msg; ModeMessage::setCmdModeMessage(msg, acs::AcsMode::SAFE, 0); status = commandQueue->sendMessage(commandQueue->getId(), &msg);