From 236916bf67258fe40f60f64f5b7f48ef7477650b Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 29 Feb 2024 16:06:55 +0100 Subject: [PATCH 01/36] this should remove the fix changed spam --- bsp_q7s/core/CoreController.cpp | 3 +-- bsp_q7s/core/CoreController.h | 2 +- linux/acs/GpsHyperionLinuxController.cpp | 28 +++++++++++++++--------- linux/acs/GpsHyperionLinuxController.h | 13 ++++++----- mission/acs/archive/GPSDefinitions.h | 6 ++--- 5 files changed, 30 insertions(+), 22 deletions(-) diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index e1b48fd2..ac5e5292 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -2072,8 +2072,7 @@ ReturnValue_t CoreController::initClockFromTimeFile() { std::string fileName = currMntPrefix + BACKUP_TIME_FILE; std::error_code e; if (sdcMan->isSdCardUsable(std::nullopt) and std::filesystem::exists(fileName, e) and - ((gpsFix == FixMode::UNKNOWN or gpsFix == FixMode::NOT_SEEN) or - not utility::timeSanityCheck())) { + ((gpsFix == FixMode::NOT_SEEN) or not utility::timeSanityCheck())) { ifstream timeFile(fileName); string nextWord; getline(timeFile, nextWord); diff --git a/bsp_q7s/core/CoreController.h b/bsp_q7s/core/CoreController.h index 79224ed2..78925b9c 100644 --- a/bsp_q7s/core/CoreController.h +++ b/bsp_q7s/core/CoreController.h @@ -209,7 +209,7 @@ class CoreController : public ExtendedControllerBase, public ReceivesParameterMe static constexpr MutexIF::TimeoutType TIMEOUT_TYPE = MutexIF::TimeoutType::WAITING; static constexpr uint32_t MUTEX_TIMEOUT = 20; bool enableHkSet = false; - GpsHyperion::FixMode gpsFix = GpsHyperion::FixMode::UNKNOWN; + GpsHyperion::FixMode gpsFix = GpsHyperion::FixMode::NOT_SEEN; // States for SD state machine, which is used in non-blocking mode enum class SdStates { diff --git a/linux/acs/GpsHyperionLinuxController.cpp b/linux/acs/GpsHyperionLinuxController.cpp index a2dbd81b..71967140 100644 --- a/linux/acs/GpsHyperionLinuxController.cpp +++ b/linux/acs/GpsHyperionLinuxController.cpp @@ -58,8 +58,8 @@ ReturnValue_t GpsHyperionLinuxController::checkModeCommand(Mode_t mode, Submode_ PoolReadGuard pg(&gpsSet); gpsSet.setValidity(false, true); // There can't be a fix with a device that is off. - triggerEvent(GpsHyperion::GPS_FIX_CHANGE, gpsSet.fixMode.value, 0); - gpsSet.fixMode.value = 0; + handleFixChangedEvent(GpsHyperion::FixMode::NOT_SEEN); + gpsSet.fixMode.value = GpsHyperion::FixMode::NOT_SEEN; oneShotSwitches.reset(); modeCommanded = false; } @@ -249,11 +249,12 @@ ReturnValue_t GpsHyperionLinuxController::handleCoreTelemetry(bool modeIsSet) { uint8_t newFix = 0; if (modeIsSet) { // 0: Not seen, 1: No fix, 2: 2D-Fix, 3: 3D-Fix - if (gps.fix.mode == 2 or gps.fix.mode == 3) { + if (gps.fix.mode == GpsHyperion::FixMode::FIX_2D or + gps.fix.mode == GpsHyperion::FixMode::FIX_3D) { validFix = true; } newFix = gps.fix.mode; - if (newFix == 0 or newFix == 1) { + if (newFix == GpsHyperion::FixMode::NOT_SEEN or newFix == GpsHyperion::FixMode::NO_FIX) { if (modeCommanded and maxTimeToReachFix.hasTimedOut()) { // We are supposed to be on and functioning, but no fix was found if (mode == MODE_ON or mode == MODE_NORMAL) { @@ -264,9 +265,7 @@ ReturnValue_t GpsHyperionLinuxController::handleCoreTelemetry(bool modeIsSet) { } } if (gpsSet.fixMode.value != newFix) { -#if OBSW_Q7S_EM != 1 - triggerEvent(GpsHyperion::GPS_FIX_CHANGE, gpsSet.fixMode.value, newFix); -#endif + handleFixChangedEvent(newFix); } gpsSet.fixMode = newFix; gpsSet.fixMode.setValid(modeIsSet); @@ -297,7 +296,7 @@ ReturnValue_t GpsHyperionLinuxController::handleCoreTelemetry(bool modeIsSet) { // Negative latitude -> South direction gpsSet.latitude.value = gps.fix.latitude; // As specified in gps.h: Only valid if mode >= 2 - if (gps.fix.mode >= 2) { + if (gps.fix.mode >= GpsHyperion::FixMode::FIX_2D) { latValid = true; } } @@ -306,7 +305,7 @@ ReturnValue_t GpsHyperionLinuxController::handleCoreTelemetry(bool modeIsSet) { // Negative longitude -> West direction gpsSet.longitude.value = gps.fix.longitude; // As specified in gps.h: Only valid if mode >= 2 - if (gps.fix.mode >= 2) { + if (gps.fix.mode >= GpsHyperion::FixMode::FIX_2D) { longValid = true; } } @@ -319,7 +318,7 @@ ReturnValue_t GpsHyperionLinuxController::handleCoreTelemetry(bool modeIsSet) { if (ALTITUDE_SET == (ALTITUDE_SET & gps.set) && std::isfinite(gps.fix.altitude)) { gpsSet.altitude.value = gps.fix.altitude; // As specified in gps.h: Only valid if mode == 3 - if (gps.fix.mode == 3) { + if (gps.fix.mode == GpsHyperion::FixMode::FIX_3D) { altitudeValid = true; } } @@ -430,3 +429,12 @@ void GpsHyperionLinuxController::overwriteTimeIfNotSane(timeval time, bool valid timeInit = true; } } + +void GpsHyperionLinuxController::handleFixChangedEvent(uint8_t newFix) { + if (gainedNewFix.hasTimedOut()) { + triggerEvent(GpsHyperion::GPS_FIX_CHANGE, newFix, fixChangeCounter); + fixChangeCounter = 0; + } + fixChangeCounter++; + gainedNewFix.resetTimer(); +} diff --git a/linux/acs/GpsHyperionLinuxController.h b/linux/acs/GpsHyperionLinuxController.h index 3378ac55..9f63bac5 100644 --- a/linux/acs/GpsHyperionLinuxController.h +++ b/linux/acs/GpsHyperionLinuxController.h @@ -1,14 +1,13 @@ #ifndef MISSION_DEVICES_GPSHYPERIONHANDLER_H_ #define MISSION_DEVICES_GPSHYPERIONHANDLER_H_ +#include +#include +#include +#include #include #include -#include "eive/eventSubsystemIds.h" -#include "fsfw/FSFW.h" -#include "fsfw/controller/ExtendedControllerBase.h" -#include "fsfw/devicehandlers/DeviceHandlerBase.h" - #ifdef FSFW_OSAL_LINUX #include #include @@ -65,6 +64,8 @@ class GpsHyperionLinuxController : public ExtendedControllerBase { const char* currentClientBuf = nullptr; ReadModes readMode = ReadModes::SOCKET; Countdown maxTimeToReachFix = Countdown(MAX_SECONDS_TO_REACH_FIX * 1000); + Countdown gainedNewFix = Countdown(60 * 2 * 1000); + uint32_t fixChangeCounter = 0; bool modeCommanded = false; bool timeInit = false; uint8_t satNotSetCounter = 0; @@ -92,6 +93,8 @@ class GpsHyperionLinuxController : public ExtendedControllerBase { // we set it with the roughly valid time from the GPS. For some reason, NTP might only work // if the time difference between sys time and current time is not too large void overwriteTimeIfNotSane(timeval time, bool validFix); + + void handleFixChangedEvent(uint8_t newFix); }; #endif /* MISSION_DEVICES_GPSHYPERIONHANDLER_H_ */ diff --git a/mission/acs/archive/GPSDefinitions.h b/mission/acs/archive/GPSDefinitions.h index 67169cbc..8feb46a7 100644 --- a/mission/acs/archive/GPSDefinitions.h +++ b/mission/acs/archive/GPSDefinitions.h @@ -7,10 +7,10 @@ namespace GpsHyperion { -enum class FixMode : uint8_t { NOT_SEEN = 0, NO_FIX = 1, FIX_2D = 2, FIX_3D = 3, UNKNOWN = 4 }; +enum FixMode : uint8_t { NOT_SEEN = 0, NO_FIX = 1, FIX_2D = 2, FIX_3D = 3 }; static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::GPS_HANDLER; -//! [EXPORT] : [COMMENT] Fix has changed. P1: Old fix. P2: New fix +//! [EXPORT] : [COMMENT] Fix has changed. P1: New fix. P2: Missed fix changes //! 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix static constexpr Event GPS_FIX_CHANGE = event::makeEvent(SUBSYSTEM_ID, 0, severity::INFO); //! [EXPORT] : [COMMENT] Could not get fix in maximum allowed time. P1: Maximum allowed time @@ -53,8 +53,6 @@ static constexpr uint8_t SKYVIEW_ENTRIES = 6; static constexpr uint8_t MAX_SATELLITES = 30; -enum GpsFixModes : uint8_t { INVALID = 0, NO_FIX = 1, FIX_2D = 2, FIX_3D = 3 }; - } // namespace GpsHyperion class GpsPrimaryDataset : public StaticLocalDataSet { From ffce866ad030e7c52bdc335cebcd757c75861537 Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 29 Feb 2024 16:09:16 +0100 Subject: [PATCH 02/36] small fix --- linux/acs/GpsHyperionLinuxController.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/linux/acs/GpsHyperionLinuxController.cpp b/linux/acs/GpsHyperionLinuxController.cpp index 71967140..982af4f5 100644 --- a/linux/acs/GpsHyperionLinuxController.cpp +++ b/linux/acs/GpsHyperionLinuxController.cpp @@ -58,6 +58,7 @@ ReturnValue_t GpsHyperionLinuxController::checkModeCommand(Mode_t mode, Submode_ PoolReadGuard pg(&gpsSet); gpsSet.setValidity(false, true); // There can't be a fix with a device that is off. + gainedNewFix.timeOut(); handleFixChangedEvent(GpsHyperion::FixMode::NOT_SEEN); gpsSet.fixMode.value = GpsHyperion::FixMode::NOT_SEEN; oneShotSwitches.reset(); From 7e7d8c249e2d43eb12a3736a640bb26e6f5283c6 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 1 Mar 2024 10:09:49 +0100 Subject: [PATCH 03/36] between how many beers was this written --- linux/acs/GpsHyperionLinuxController.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/linux/acs/GpsHyperionLinuxController.cpp b/linux/acs/GpsHyperionLinuxController.cpp index 982af4f5..1822fc2e 100644 --- a/linux/acs/GpsHyperionLinuxController.cpp +++ b/linux/acs/GpsHyperionLinuxController.cpp @@ -76,13 +76,16 @@ ReturnValue_t GpsHyperionLinuxController::executeAction(ActionId_t actionId, PoolReadGuard pg(&gpsSet); // Set HK entries invalid gpsSet.setValidity(false, true); - resetCallback(data, size, resetCallbackArgs); + ReturnValue_t result = resetCallback(data, size, resetCallbackArgs); + if (result != returnvalue::OK) { + return result; + } return HasActionsIF::EXECUTION_FINISHED; } return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED; } } - return returnvalue::OK; + return HasActionsIF::INVALID_ACTION_ID; } ReturnValue_t GpsHyperionLinuxController::initializeLocalDataPool( From 8fe7307a5869424d31100fb9ee82dca01c4f4598 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 1 Mar 2024 10:59:37 +0100 Subject: [PATCH 04/36] remove whatever this is --- linux/acs/GpsHyperionLinuxController.cpp | 20 ++++++-------------- linux/acs/GpsHyperionLinuxController.h | 1 - 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/linux/acs/GpsHyperionLinuxController.cpp b/linux/acs/GpsHyperionLinuxController.cpp index 1822fc2e..d4f04720 100644 --- a/linux/acs/GpsHyperionLinuxController.cpp +++ b/linux/acs/GpsHyperionLinuxController.cpp @@ -44,17 +44,13 @@ LocalPoolDataSetBase *GpsHyperionLinuxController::getDataSetHandle(sid_t sid) { ReturnValue_t GpsHyperionLinuxController::checkModeCommand(Mode_t mode, Submode_t submode, uint32_t *msToReachTheMode) { - if (not modeCommanded) { - if (mode == MODE_ON or mode == MODE_OFF) { - // 5h time to reach fix - *msToReachTheMode = MAX_SECONDS_TO_REACH_FIX; - maxTimeToReachFix.resetTimer(); - modeCommanded = true; - } else if (mode == MODE_NORMAL) { - return HasModesIF::INVALID_MODE; - } + if (mode == MODE_ON) { + maxTimeToReachFix.resetTimer(); + } else if (mode == MODE_NORMAL) { + return HasModesIF::INVALID_MODE; } if (mode == MODE_OFF) { + maxTimeToReachFix.timeOut(); PoolReadGuard pg(&gpsSet); gpsSet.setValidity(false, true); // There can't be a fix with a device that is off. @@ -62,7 +58,6 @@ ReturnValue_t GpsHyperionLinuxController::checkModeCommand(Mode_t mode, Submode_ handleFixChangedEvent(GpsHyperion::FixMode::NOT_SEEN); gpsSet.fixMode.value = GpsHyperion::FixMode::NOT_SEEN; oneShotSwitches.reset(); - modeCommanded = false; } return returnvalue::OK; } @@ -261,10 +256,7 @@ ReturnValue_t GpsHyperionLinuxController::handleCoreTelemetry(bool modeIsSet) { if (newFix == GpsHyperion::FixMode::NOT_SEEN or newFix == GpsHyperion::FixMode::NO_FIX) { if (modeCommanded and maxTimeToReachFix.hasTimedOut()) { // We are supposed to be on and functioning, but no fix was found - if (mode == MODE_ON or mode == MODE_NORMAL) { - mode = MODE_OFF; - } - modeCommanded = false; + // ToDo:: maybe pull reset pins here } } } diff --git a/linux/acs/GpsHyperionLinuxController.h b/linux/acs/GpsHyperionLinuxController.h index 9f63bac5..f9039bbd 100644 --- a/linux/acs/GpsHyperionLinuxController.h +++ b/linux/acs/GpsHyperionLinuxController.h @@ -66,7 +66,6 @@ class GpsHyperionLinuxController : public ExtendedControllerBase { Countdown maxTimeToReachFix = Countdown(MAX_SECONDS_TO_REACH_FIX * 1000); Countdown gainedNewFix = Countdown(60 * 2 * 1000); uint32_t fixChangeCounter = 0; - bool modeCommanded = false; bool timeInit = false; uint8_t satNotSetCounter = 0; From b7bf9272880fe75e8507b13aa1092a47a0a184d3 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 1 Mar 2024 11:31:01 +0100 Subject: [PATCH 05/36] boop --- linux/acs/GpsHyperionLinuxController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/acs/GpsHyperionLinuxController.cpp b/linux/acs/GpsHyperionLinuxController.cpp index d4f04720..c108a828 100644 --- a/linux/acs/GpsHyperionLinuxController.cpp +++ b/linux/acs/GpsHyperionLinuxController.cpp @@ -51,10 +51,10 @@ ReturnValue_t GpsHyperionLinuxController::checkModeCommand(Mode_t mode, Submode_ } if (mode == MODE_OFF) { maxTimeToReachFix.timeOut(); + gainedNewFix.timeOut(); PoolReadGuard pg(&gpsSet); gpsSet.setValidity(false, true); // There can't be a fix with a device that is off. - gainedNewFix.timeOut(); handleFixChangedEvent(GpsHyperion::FixMode::NOT_SEEN); gpsSet.fixMode.value = GpsHyperion::FixMode::NOT_SEEN; oneShotSwitches.reset(); From 8374a02ae28379413c8d56e80c0d66de758dcf42 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 13 Mar 2024 13:54:49 +0100 Subject: [PATCH 06/36] lets wait a bit longer --- bsp_q7s/objectFactory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsp_q7s/objectFactory.cpp b/bsp_q7s/objectFactory.cpp index c0dc489a..ee83636c 100644 --- a/bsp_q7s/objectFactory.cpp +++ b/bsp_q7s/objectFactory.cpp @@ -510,7 +510,7 @@ void ObjectFactory::createAcsBoardComponents(SpiComIF& spiComIF, LinuxLibgpioIF* debugGps = true; #endif RESET_ARGS_GNSS.gpioComIF = gpioComIF; - RESET_ARGS_GNSS.waitPeriodMs = 5; + RESET_ARGS_GNSS.waitPeriodMs = 10 * 1e6; auto gpsCtrl = new GpsHyperionLinuxController(objects::GPS_CONTROLLER, objects::NO_OBJECT, enableHkSets, debugGps); gpsCtrl->setResetPinTriggerFunction(gps::triggerGpioResetPin, &RESET_ARGS_GNSS); From 3c869e521505a11aae2bc9215c7568f77ecf8228 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 13 Mar 2024 16:08:21 +0100 Subject: [PATCH 07/36] idk what i am doing here --- linux/acs/GpsHyperionLinuxController.cpp | 20 +++++++++++++++++++- mission/acs/archive/GPSDefinitions.h | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/linux/acs/GpsHyperionLinuxController.cpp b/linux/acs/GpsHyperionLinuxController.cpp index c108a828..a9381ce4 100644 --- a/linux/acs/GpsHyperionLinuxController.cpp +++ b/linux/acs/GpsHyperionLinuxController.cpp @@ -254,9 +254,27 @@ ReturnValue_t GpsHyperionLinuxController::handleCoreTelemetry(bool modeIsSet) { } newFix = gps.fix.mode; if (newFix == GpsHyperion::FixMode::NOT_SEEN or newFix == GpsHyperion::FixMode::NO_FIX) { - if (modeCommanded and maxTimeToReachFix.hasTimedOut()) { + if (maxTimeToReachFix.hasTimedOut()) { // We are supposed to be on and functioning, but no fix was found // ToDo:: maybe pull reset pins here + if (resetCallback != nullptr) { + PoolReadGuard pg(&gpsSet); + // Set HK entries invalid + gpsSet.setValidity(false, true); + ReturnValue_t result = resetCallback(0, 1, resetCallbackArgs); + if (result != returnvalue::OK) { + return result; + } + } + if (resetCallback != nullptr) { + PoolReadGuard pg(&gpsSet); + // Set HK entries invalid + gpsSet.setValidity(false, true); + ReturnValue_t result = resetCallback(1, 1, resetCallbackArgs); + if (result != returnvalue::OK) { + return result; + } + } } } } diff --git a/mission/acs/archive/GPSDefinitions.h b/mission/acs/archive/GPSDefinitions.h index 8feb46a7..0f597397 100644 --- a/mission/acs/archive/GPSDefinitions.h +++ b/mission/acs/archive/GPSDefinitions.h @@ -15,7 +15,7 @@ static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::GPS_HANDLER; static constexpr Event GPS_FIX_CHANGE = event::makeEvent(SUBSYSTEM_ID, 0, severity::INFO); //! [EXPORT] : [COMMENT] Could not get fix in maximum allowed time. P1: Maximum allowed time //! to get a fix after the GPS was switched on. -static constexpr Event CANT_GET_FIX = event::makeEvent(SUBSYSTEM_ID, 1, severity::LOW); +static constexpr Event CANT_GET_FIX = event::makeEvent(SUBSYSTEM_ID, 1, severity::MEDIUM); static constexpr DeviceCommandId_t GPS_REPLY = 0; static constexpr DeviceCommandId_t TRIGGER_RESET_PIN_GNSS = 5; From 7a43e1bc67ef960228e207e299d1bc142bb34161 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 15 Mar 2024 14:54:16 +0100 Subject: [PATCH 08/36] better but still not fixed --- linux/acs/GpsHyperionLinuxController.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/linux/acs/GpsHyperionLinuxController.cpp b/linux/acs/GpsHyperionLinuxController.cpp index a9381ce4..8031ba46 100644 --- a/linux/acs/GpsHyperionLinuxController.cpp +++ b/linux/acs/GpsHyperionLinuxController.cpp @@ -256,23 +256,17 @@ ReturnValue_t GpsHyperionLinuxController::handleCoreTelemetry(bool modeIsSet) { if (newFix == GpsHyperion::FixMode::NOT_SEEN or newFix == GpsHyperion::FixMode::NO_FIX) { if (maxTimeToReachFix.hasTimedOut()) { // We are supposed to be on and functioning, but no fix was found - // ToDo:: maybe pull reset pins here + // Set HK entries invalid + PoolReadGuard pg(&gpsSet); + gpsSet.setValidity(false, true); if (resetCallback != nullptr) { - PoolReadGuard pg(&gpsSet); - // Set HK entries invalid - gpsSet.setValidity(false, true); ReturnValue_t result = resetCallback(0, 1, resetCallbackArgs); if (result != returnvalue::OK) { - return result; + // ToDo: Trigger Event } - } - if (resetCallback != nullptr) { - PoolReadGuard pg(&gpsSet); - // Set HK entries invalid - gpsSet.setValidity(false, true); - ReturnValue_t result = resetCallback(1, 1, resetCallbackArgs); + result = resetCallback(1, 1, resetCallbackArgs); if (result != returnvalue::OK) { - return result; + // ToDo: Trigger Event } } } From 18d3c8fa91d805b6edf81bd98c37620eb489fd40 Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 18 Mar 2024 17:20:40 +0100 Subject: [PATCH 09/36] not sure why this was ever archived --- {mission/acs/archive => linux/acs}/GPSDefinitions.h | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {mission/acs/archive => linux/acs}/GPSDefinitions.h (100%) diff --git a/mission/acs/archive/GPSDefinitions.h b/linux/acs/GPSDefinitions.h similarity index 100% rename from mission/acs/archive/GPSDefinitions.h rename to linux/acs/GPSDefinitions.h From 0cbac07f15c1f4fda85897399652558027cf0e4a Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 18 Mar 2024 17:20:55 +0100 Subject: [PATCH 10/36] this might work --- linux/acs/GpsHyperionLinuxController.cpp | 11 ++++++----- linux/acs/GpsHyperionLinuxController.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/linux/acs/GpsHyperionLinuxController.cpp b/linux/acs/GpsHyperionLinuxController.cpp index 8031ba46..5fa2d344 100644 --- a/linux/acs/GpsHyperionLinuxController.cpp +++ b/linux/acs/GpsHyperionLinuxController.cpp @@ -257,16 +257,17 @@ ReturnValue_t GpsHyperionLinuxController::handleCoreTelemetry(bool modeIsSet) { if (maxTimeToReachFix.hasTimedOut()) { // We are supposed to be on and functioning, but no fix was found // Set HK entries invalid - PoolReadGuard pg(&gpsSet); gpsSet.setValidity(false, true); if (resetCallback != nullptr) { - ReturnValue_t result = resetCallback(0, 1, resetCallbackArgs); + uint8_t chip = GpsHyperion::GnssChip::A_SIDE; + ReturnValue_t result = resetCallback(&chip, 1, resetCallbackArgs); if (result != returnvalue::OK) { - // ToDo: Trigger Event + triggerEvent(GpsHyperion::RESET_FAIL, chip); } - result = resetCallback(1, 1, resetCallbackArgs); + chip = GpsHyperion::GnssChip::B_SIDE; + result = resetCallback(&chip, 1, resetCallbackArgs); if (result != returnvalue::OK) { - // ToDo: Trigger Event + triggerEvent(GpsHyperion::RESET_FAIL, chip); } } } diff --git a/linux/acs/GpsHyperionLinuxController.h b/linux/acs/GpsHyperionLinuxController.h index f9039bbd..00a8218f 100644 --- a/linux/acs/GpsHyperionLinuxController.h +++ b/linux/acs/GpsHyperionLinuxController.h @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #ifdef FSFW_OSAL_LINUX From f2f856e2275980d2685e82877e191027ed29325e Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 18 Mar 2024 17:21:08 +0100 Subject: [PATCH 11/36] cleanup --- bsp_q7s/core/CoreController.h | 2 +- dummies/GpsCtrlDummy.h | 2 +- dummies/GpsDhbDummy.cpp | 2 +- linux/acs/GPSDefinitions.h | 4 ++++ mission/controller/acs/SensorValues.h | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bsp_q7s/core/CoreController.h b/bsp_q7s/core/CoreController.h index 9c053008..6827a392 100644 --- a/bsp_q7s/core/CoreController.h +++ b/bsp_q7s/core/CoreController.h @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include diff --git a/dummies/GpsCtrlDummy.h b/dummies/GpsCtrlDummy.h index 18b990fb..b64647b1 100644 --- a/dummies/GpsCtrlDummy.h +++ b/dummies/GpsCtrlDummy.h @@ -2,7 +2,7 @@ #define DUMMIES_GPSCTRLDUMMY_H_ #include -#include +#include class GpsCtrlDummy : public ExtendedControllerBase { public: diff --git a/dummies/GpsDhbDummy.cpp b/dummies/GpsDhbDummy.cpp index 4e385ec5..73addb3c 100644 --- a/dummies/GpsDhbDummy.cpp +++ b/dummies/GpsDhbDummy.cpp @@ -1,5 +1,5 @@ #include -#include +#include GpsDhbDummy::GpsDhbDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie) : DeviceHandlerBase(objectId, comif, comCookie) {} diff --git a/linux/acs/GPSDefinitions.h b/linux/acs/GPSDefinitions.h index 0f597397..9fb9e31d 100644 --- a/linux/acs/GPSDefinitions.h +++ b/linux/acs/GPSDefinitions.h @@ -9,6 +9,8 @@ namespace GpsHyperion { enum FixMode : uint8_t { NOT_SEEN = 0, NO_FIX = 1, FIX_2D = 2, FIX_3D = 3 }; +enum GnssChip : uint8_t { A_SIDE = 0, B_SIDE = 1 }; + static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::GPS_HANDLER; //! [EXPORT] : [COMMENT] Fix has changed. P1: New fix. P2: Missed fix changes //! 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix @@ -16,6 +18,8 @@ static constexpr Event GPS_FIX_CHANGE = event::makeEvent(SUBSYSTEM_ID, 0, severi //! [EXPORT] : [COMMENT] Could not get fix in maximum allowed time. P1: Maximum allowed time //! to get a fix after the GPS was switched on. static constexpr Event CANT_GET_FIX = event::makeEvent(SUBSYSTEM_ID, 1, severity::MEDIUM); +//! [EXPORT] : [COMMENT] Failed to reset an GNNS Device. P1: Board-Side. +static constexpr Event RESET_FAIL = event::makeEvent(SUBSYSTEM_ID, 2, severity::HIGH); static constexpr DeviceCommandId_t GPS_REPLY = 0; static constexpr DeviceCommandId_t TRIGGER_RESET_PIN_GNSS = 5; diff --git a/mission/controller/acs/SensorValues.h b/mission/controller/acs/SensorValues.h index d7da66c0..69761666 100644 --- a/mission/controller/acs/SensorValues.h +++ b/mission/controller/acs/SensorValues.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include #include From 4193a565a42971d9680dc35083bbed3d326357bc Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 22 Mar 2024 11:39:18 +0100 Subject: [PATCH 12/36] i hate this --- mission/controller/acs/Guidance.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index 2c1b3c63..07730e09 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -303,9 +303,9 @@ void Guidance::comparePtg(double currentQuat[4], double currentSatRotRate[3], do // First calculate error quaternion between current and target orientation without reference // quaternion double errorQuatWoRef[4] = {0, 0, 0, 0}; - QuaternionOperations::multiply(currentQuat, targetQuat, errorQuatWoRef); + QuaternionOperations::multiply(targetQuat, currentQuat, errorQuatWoRef); // Then add rotation from reference quaternion - QuaternionOperations::multiply(refQuat, errorQuatWoRef, errorQuat); + QuaternionOperations::multiply(errorQuatWoRef, refQuat, errorQuat); // Keep scalar part of quaternion positive if (errorQuat[3] < 0) { VectorOperations::mulScalar(errorQuat, -1, errorQuat, 4); From 9f033411089ba7c7cf537fa2fb69bb8a05c4313e Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 22 Mar 2024 11:40:00 +0100 Subject: [PATCH 13/36] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 649cf44f..6510f227 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +## Fixed + +- Fixed wrong order in quaternion multiplication for computation of the error quaternion. + # [v7.7.4] 2024-03-21 ## Changed From 539221a4581917b0461a7045e0481c8b992ccdbe Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 27 Mar 2024 09:24:41 +0100 Subject: [PATCH 14/36] updated limits within the pwr ctrl --- CHANGELOG.md | 4 ++++ mission/controller/PowerController.h | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 649cf44f..e0962860 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +## Changed + +- Changed limits in `PWR Controller`. + # [v7.7.4] 2024-03-21 ## Changed diff --git a/mission/controller/PowerController.h b/mission/controller/PowerController.h index 6df60732..db3fcedf 100644 --- a/mission/controller/PowerController.h +++ b/mission/controller/PowerController.h @@ -57,9 +57,9 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM float batteryMaximumCapacity = 2.6 * 2; // [Ah] float coulombCounterVoltageUpperThreshold = 16.2; // [V] double maxAllowedTimeDiff = 1.5; // [s] - float payloadOpLimitOn = 0.90; // [%] - float payloadOpLimitLow = 0.75; // [%] - float higherModesLimit = 0.6; // [%] + float payloadOpLimitOn = 0.80; // [%] + float payloadOpLimitLow = 0.65; // [%] + float higherModesLimit = 0.60; // [%] // OCV Look-up-Table {[Ah],[V]} static constexpr uint8_t LOOK_UP_TABLE_MAX_IDX = 99; From 76d00ddd37330292bb1e877fb9025e2e576a4236 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 3 Apr 2024 12:48:12 +0200 Subject: [PATCH 15/36] bump fsfw --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 43ea29cb..203c0bac 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 43ea29cb845d4a7d190c87df490eb53c4992618b +Subproject commit 203c0bac5cd5a1ec3df87a569d769077efc23110 From 56512fae0d5ac7ee2fc94618a1a8c6de3a0b7d6a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 3 Apr 2024 12:52:40 +0200 Subject: [PATCH 16/36] bump fsfw again --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 203c0bac..c5159fb6 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 203c0bac5cd5a1ec3df87a569d769077efc23110 +Subproject commit c5159fb64559a69a71470cf921b75b9a0b900ea3 From 43de0978125944da764914aa2a42851b32e70fe3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 3 Apr 2024 15:06:37 +0200 Subject: [PATCH 17/36] changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 649cf44f..34dedd86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,12 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +## Fixed + +- Re-worked some FDIR logic in the FSFW. The former logic prevented events with a severity + higher than INFO if the device was in EXTERNAL CONTROL. The new logic will allow to trigger + events but still inhibit FDIR reactions if the device is in EXTERNAL CONTROL. + # [v7.7.4] 2024-03-21 ## Changed From 2057ab9c10b148f3a84de9d62fe3f2e5cc6f5ccc Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 9 Apr 2024 09:58:05 +0200 Subject: [PATCH 18/36] some cleanup --- linux/acs/GpsHyperionLinuxController.cpp | 96 +++++++++++++----------- 1 file changed, 53 insertions(+), 43 deletions(-) diff --git a/linux/acs/GpsHyperionLinuxController.cpp b/linux/acs/GpsHyperionLinuxController.cpp index 5fa2d344..058c68ed 100644 --- a/linux/acs/GpsHyperionLinuxController.cpp +++ b/linux/acs/GpsHyperionLinuxController.cpp @@ -54,7 +54,7 @@ ReturnValue_t GpsHyperionLinuxController::checkModeCommand(Mode_t mode, Submode_ gainedNewFix.timeOut(); PoolReadGuard pg(&gpsSet); gpsSet.setValidity(false, true); - // There can't be a fix with a device that is off. + // The ctrl is off, so it cannot detect the data from the devices. handleFixChangedEvent(GpsHyperion::FixMode::NOT_SEEN); gpsSet.fixMode.value = GpsHyperion::FixMode::NOT_SEEN; oneShotSwitches.reset(); @@ -215,15 +215,9 @@ ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() { bool modeIsSet = true; if (MODE_SET != (MODE_SET & gps.set)) { if (mode != MODE_OFF) { - if (maxTimeToReachFix.hasTimedOut() and oneShotSwitches.cantGetFixSwitch) { - sif::warning << "GpsHyperionLinuxController: No mode could be set in allowed " - << maxTimeToReachFix.getTimeoutMs() / 1000 << " seconds" << std::endl; - triggerEvent(GpsHyperion::CANT_GET_FIX, maxTimeToReachFix.getTimeoutMs()); - oneShotSwitches.cantGetFixSwitch = false; - } modeIsSet = false; } else { - // GPS device is off anyway, so do other handling + // GPS ctrl is off anyway, so do other handling return returnvalue::FAILED; } } @@ -253,21 +247,28 @@ ReturnValue_t GpsHyperionLinuxController::handleCoreTelemetry(bool modeIsSet) { validFix = true; } newFix = gps.fix.mode; - if (newFix == GpsHyperion::FixMode::NOT_SEEN or newFix == GpsHyperion::FixMode::NO_FIX) { + if (not validFix) { if (maxTimeToReachFix.hasTimedOut()) { // We are supposed to be on and functioning, but no fix was found // Set HK entries invalid gpsSet.setValidity(false, true); - if (resetCallback != nullptr) { - uint8_t chip = GpsHyperion::GnssChip::A_SIDE; - ReturnValue_t result = resetCallback(&chip, 1, resetCallbackArgs); - if (result != returnvalue::OK) { - triggerEvent(GpsHyperion::RESET_FAIL, chip); - } - chip = GpsHyperion::GnssChip::B_SIDE; - result = resetCallback(&chip, 1, resetCallbackArgs); - if (result != returnvalue::OK) { - triggerEvent(GpsHyperion::RESET_FAIL, chip); + if (oneShotSwitches.cantGetFixSwitch) { + sif::warning << "GpsHyperionLinuxController: No fix detected in allowed " + << maxTimeToReachFix.getTimeoutMs() / 1000 << " seconds" << std::endl; + triggerEvent(GpsHyperion::CANT_GET_FIX, maxTimeToReachFix.getTimeoutMs()); + oneShotSwitches.cantGetFixSwitch = false; + // Try resetting the devices + if (resetCallback != nullptr) { + uint8_t chip = GpsHyperion::GnssChip::A_SIDE; + ReturnValue_t result = resetCallback(&chip, 1, resetCallbackArgs); + if (result != returnvalue::OK) { + triggerEvent(GpsHyperion::RESET_FAIL, chip); + } + chip = GpsHyperion::GnssChip::B_SIDE; + result = resetCallback(&chip, 1, resetCallbackArgs); + if (result != returnvalue::OK) { + triggerEvent(GpsHyperion::RESET_FAIL, chip); + } } } } @@ -290,9 +291,12 @@ ReturnValue_t GpsHyperionLinuxController::handleCoreTelemetry(bool modeIsSet) { } satNotSetCounter = 0; } else { - satNotSetCounter++; - if (gpsSet.satInUse.isValid() and satNotSetCounter >= 10) { + if (satNotSetCounter < 10) { + satNotSetCounter++; + } else { + gpsSet.satInUse.value = 0; gpsSet.satInUse.setValid(false); + gpsSet.satInView.value = 0; gpsSet.satInView.setValid(false); } } @@ -300,22 +304,24 @@ ReturnValue_t GpsHyperionLinuxController::handleCoreTelemetry(bool modeIsSet) { // LATLON is set for every message, no need for a counter bool latValid = false; bool longValid = false; - if (LATLON_SET == (LATLON_SET & gps.set)) { - if (std::isfinite(gps.fix.latitude)) { - // Negative latitude -> South direction - gpsSet.latitude.value = gps.fix.latitude; - // As specified in gps.h: Only valid if mode >= 2 - if (gps.fix.mode >= GpsHyperion::FixMode::FIX_2D) { - latValid = true; + if (modeIsSet) { + if (LATLON_SET == (LATLON_SET & gps.set)) { + if (std::isfinite(gps.fix.latitude)) { + // Negative latitude -> South direction + gpsSet.latitude.value = gps.fix.latitude; + // As specified in gps.h: Only valid if mode >= 2 + if (gps.fix.mode >= GpsHyperion::FixMode::FIX_2D) { + latValid = true; + } } - } - if (std::isfinite(gps.fix.longitude)) { - // Negative longitude -> West direction - gpsSet.longitude.value = gps.fix.longitude; - // As specified in gps.h: Only valid if mode >= 2 - if (gps.fix.mode >= GpsHyperion::FixMode::FIX_2D) { - longValid = true; + if (std::isfinite(gps.fix.longitude)) { + // Negative longitude -> West direction + gpsSet.longitude.value = gps.fix.longitude; + // As specified in gps.h: Only valid if mode >= 2 + if (gps.fix.mode >= GpsHyperion::FixMode::FIX_2D) { + longValid = true; + } } } } @@ -324,20 +330,24 @@ ReturnValue_t GpsHyperionLinuxController::handleCoreTelemetry(bool modeIsSet) { // ALTITUDE is set for every message, no need for a counter bool altitudeValid = false; - if (ALTITUDE_SET == (ALTITUDE_SET & gps.set) && std::isfinite(gps.fix.altitude)) { - gpsSet.altitude.value = gps.fix.altitude; - // As specified in gps.h: Only valid if mode == 3 - if (gps.fix.mode == GpsHyperion::FixMode::FIX_3D) { - altitudeValid = true; + if (modeIsSet) { + if (ALTITUDE_SET == (ALTITUDE_SET & gps.set) && std::isfinite(gps.fix.altitude)) { + gpsSet.altitude.value = gps.fix.altitude; + // As specified in gps.h: Only valid if mode == 3 + if (gps.fix.mode == GpsHyperion::FixMode::FIX_3D) { + altitudeValid = true; + } } } gpsSet.altitude.setValid(altitudeValid); // SPEED is set for every message, no need for a counter bool speedValid = false; - if (SPEED_SET == (SPEED_SET & gps.set) && std::isfinite(gps.fix.speed)) { - gpsSet.speed.value = gps.fix.speed; - speedValid = true; + if (modeIsSet) { + if (SPEED_SET == (SPEED_SET & gps.set) && std::isfinite(gps.fix.speed)) { + gpsSet.speed.value = gps.fix.speed; + speedValid = true; + } } gpsSet.speed.setValid(speedValid); From f3d4e09487ca346f1348a4db0865feca34abee70 Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 9 Apr 2024 09:59:21 +0200 Subject: [PATCH 19/36] improved event comment --- linux/acs/GPSDefinitions.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux/acs/GPSDefinitions.h b/linux/acs/GPSDefinitions.h index 9fb9e31d..82025a22 100644 --- a/linux/acs/GPSDefinitions.h +++ b/linux/acs/GPSDefinitions.h @@ -15,8 +15,8 @@ static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::GPS_HANDLER; //! [EXPORT] : [COMMENT] Fix has changed. P1: New fix. P2: Missed fix changes //! 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix static constexpr Event GPS_FIX_CHANGE = event::makeEvent(SUBSYSTEM_ID, 0, severity::INFO); -//! [EXPORT] : [COMMENT] Could not get fix in maximum allowed time. P1: Maximum allowed time -//! to get a fix after the GPS was switched on. +//! [EXPORT] : [COMMENT] Could not get fix in maximum allowed time. Trying to reset both GNSS +//! devices. P1: Maximum allowed time to get a fix after the GPS was switched on. static constexpr Event CANT_GET_FIX = event::makeEvent(SUBSYSTEM_ID, 1, severity::MEDIUM); //! [EXPORT] : [COMMENT] Failed to reset an GNNS Device. P1: Board-Side. static constexpr Event RESET_FAIL = event::makeEvent(SUBSYSTEM_ID, 2, severity::HIGH); From d4eb124cdf52b80e48a02088281a49af063af134 Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 9 Apr 2024 11:26:55 +0200 Subject: [PATCH 20/36] missing reset --- linux/acs/GpsHyperionLinuxController.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/linux/acs/GpsHyperionLinuxController.cpp b/linux/acs/GpsHyperionLinuxController.cpp index 058c68ed..9b93b22b 100644 --- a/linux/acs/GpsHyperionLinuxController.cpp +++ b/linux/acs/GpsHyperionLinuxController.cpp @@ -245,6 +245,7 @@ ReturnValue_t GpsHyperionLinuxController::handleCoreTelemetry(bool modeIsSet) { if (gps.fix.mode == GpsHyperion::FixMode::FIX_2D or gps.fix.mode == GpsHyperion::FixMode::FIX_3D) { validFix = true; + maxTimeToReachFix.resetTimer(); } newFix = gps.fix.mode; if (not validFix) { From 887f1654845ccb4357269ab5d2a2917c1c02a701 Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 9 Apr 2024 13:29:42 +0200 Subject: [PATCH 21/36] ye maybe dont hold the reset pin for 3h --- bsp_q7s/objectFactory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsp_q7s/objectFactory.cpp b/bsp_q7s/objectFactory.cpp index ee83636c..0f61a51d 100644 --- a/bsp_q7s/objectFactory.cpp +++ b/bsp_q7s/objectFactory.cpp @@ -510,7 +510,7 @@ void ObjectFactory::createAcsBoardComponents(SpiComIF& spiComIF, LinuxLibgpioIF* debugGps = true; #endif RESET_ARGS_GNSS.gpioComIF = gpioComIF; - RESET_ARGS_GNSS.waitPeriodMs = 10 * 1e6; + RESET_ARGS_GNSS.waitPeriodMs = 10 * 1e3; auto gpsCtrl = new GpsHyperionLinuxController(objects::GPS_CONTROLLER, objects::NO_OBJECT, enableHkSets, debugGps); gpsCtrl->setResetPinTriggerFunction(gps::triggerGpioResetPin, &RESET_ARGS_GNSS); From 0f3eeb42d638d4e8e6811c06a2180fb7070bf05d Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 9 Apr 2024 13:30:22 +0200 Subject: [PATCH 22/36] 15 should be enough --- linux/acs/GpsHyperionLinuxController.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux/acs/GpsHyperionLinuxController.h b/linux/acs/GpsHyperionLinuxController.h index 00a8218f..b8c3ed7a 100644 --- a/linux/acs/GpsHyperionLinuxController.h +++ b/linux/acs/GpsHyperionLinuxController.h @@ -23,8 +23,8 @@ */ class GpsHyperionLinuxController : public ExtendedControllerBase { public: - // 30 minutes - static constexpr uint32_t MAX_SECONDS_TO_REACH_FIX = 60 * 30; + // 15 minutes + static constexpr uint32_t MAX_SECONDS_TO_REACH_FIX = 60 * 15; enum ReadModes { SHM = 0, SOCKET = 1 }; From 1c36f36b1fec206bd30a1abb91443c1338563af5 Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 9 Apr 2024 13:31:27 +0200 Subject: [PATCH 23/36] this seems better --- linux/acs/GpsHyperionLinuxController.cpp | 52 ++++++++++++------------ 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/linux/acs/GpsHyperionLinuxController.cpp b/linux/acs/GpsHyperionLinuxController.cpp index 9b93b22b..4015ee4f 100644 --- a/linux/acs/GpsHyperionLinuxController.cpp +++ b/linux/acs/GpsHyperionLinuxController.cpp @@ -248,38 +248,38 @@ ReturnValue_t GpsHyperionLinuxController::handleCoreTelemetry(bool modeIsSet) { maxTimeToReachFix.resetTimer(); } newFix = gps.fix.mode; - if (not validFix) { - if (maxTimeToReachFix.hasTimedOut()) { - // We are supposed to be on and functioning, but no fix was found - // Set HK entries invalid - gpsSet.setValidity(false, true); - if (oneShotSwitches.cantGetFixSwitch) { - sif::warning << "GpsHyperionLinuxController: No fix detected in allowed " - << maxTimeToReachFix.getTimeoutMs() / 1000 << " seconds" << std::endl; - triggerEvent(GpsHyperion::CANT_GET_FIX, maxTimeToReachFix.getTimeoutMs()); - oneShotSwitches.cantGetFixSwitch = false; - // Try resetting the devices - if (resetCallback != nullptr) { - uint8_t chip = GpsHyperion::GnssChip::A_SIDE; - ReturnValue_t result = resetCallback(&chip, 1, resetCallbackArgs); - if (result != returnvalue::OK) { - triggerEvent(GpsHyperion::RESET_FAIL, chip); - } - chip = GpsHyperion::GnssChip::B_SIDE; - result = resetCallback(&chip, 1, resetCallbackArgs); - if (result != returnvalue::OK) { - triggerEvent(GpsHyperion::RESET_FAIL, chip); - } - } - } - } - } } if (gpsSet.fixMode.value != newFix) { handleFixChangedEvent(newFix); } gpsSet.fixMode = newFix; gpsSet.fixMode.setValid(modeIsSet); + // We are supposed to be on and functioning, but no fix was found + if (not validFix) { + if (maxTimeToReachFix.hasTimedOut()) { + // Set HK entries invalid + gpsSet.setValidity(false, true); + if (oneShotSwitches.cantGetFixSwitch) { + sif::warning << "GpsHyperionLinuxController: No fix detected in allowed " + << maxTimeToReachFix.getTimeoutMs() / 1000 << " seconds" << std::endl; + triggerEvent(GpsHyperion::CANT_GET_FIX, maxTimeToReachFix.getTimeoutMs()); + oneShotSwitches.cantGetFixSwitch = false; + // Try resetting the devices + if (resetCallback != nullptr) { + uint8_t chip = GpsHyperion::GnssChip::A_SIDE; + ReturnValue_t result = resetCallback(&chip, 1, resetCallbackArgs); + if (result != returnvalue::OK) { + triggerEvent(GpsHyperion::RESET_FAIL, chip); + } + chip = GpsHyperion::GnssChip::B_SIDE; + result = resetCallback(&chip, 1, resetCallbackArgs); + if (result != returnvalue::OK) { + triggerEvent(GpsHyperion::RESET_FAIL, chip); + } + } + } + } + } // Only set on specific messages, so only set a valid flag to invalid // if not set for more than a full message set (10 messages here) From 427c53df8c8074be79eb6d740fc531087af6ae16 Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 9 Apr 2024 14:04:20 +0200 Subject: [PATCH 24/36] better --- linux/acs/GpsHyperionLinuxController.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linux/acs/GpsHyperionLinuxController.cpp b/linux/acs/GpsHyperionLinuxController.cpp index 4015ee4f..946c5c0a 100644 --- a/linux/acs/GpsHyperionLinuxController.cpp +++ b/linux/acs/GpsHyperionLinuxController.cpp @@ -454,6 +454,8 @@ void GpsHyperionLinuxController::handleFixChangedEvent(uint8_t newFix) { if (gainedNewFix.hasTimedOut()) { triggerEvent(GpsHyperion::GPS_FIX_CHANGE, newFix, fixChangeCounter); fixChangeCounter = 0; + gainedNewFix.resetTimer(); + return; } fixChangeCounter++; gainedNewFix.resetTimer(); From b01d4f63631aa953f001d7469588cf1a01ca2fb0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 9 Apr 2024 14:30:11 +0200 Subject: [PATCH 25/36] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 5a0edbef..33cf7b16 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 5a0edbefa8449f4796d7d0976822c8fda139c598 +Subproject commit 33cf7b1613a11c28cd14e4057f6e47144309b0c0 From c4340c3515dcf38d509157d9470f145d2bb30560 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 9 Apr 2024 14:33:02 +0200 Subject: [PATCH 26/36] re-point tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 33cf7b16..96636d59 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 33cf7b1613a11c28cd14e4057f6e47144309b0c0 +Subproject commit 96636d59e9b0e3f35947f2d0e73d2a8ab1a58c5c From 7a12c1c8fef7fc671470b1345708613f49050fa4 Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 9 Apr 2024 14:43:47 +0200 Subject: [PATCH 27/36] the first fix should trigger an event --- linux/acs/GpsHyperionLinuxController.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/linux/acs/GpsHyperionLinuxController.cpp b/linux/acs/GpsHyperionLinuxController.cpp index 946c5c0a..54198ca9 100644 --- a/linux/acs/GpsHyperionLinuxController.cpp +++ b/linux/acs/GpsHyperionLinuxController.cpp @@ -46,6 +46,7 @@ ReturnValue_t GpsHyperionLinuxController::checkModeCommand(Mode_t mode, Submode_ uint32_t *msToReachTheMode) { if (mode == MODE_ON) { maxTimeToReachFix.resetTimer(); + gainedNewFix.timeOut(); } else if (mode == MODE_NORMAL) { return HasModesIF::INVALID_MODE; } From 7b53275d61cd2c895d53303f3b126d176c86bb60 Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 9 Apr 2024 15:06:23 +0200 Subject: [PATCH 28/36] changelog --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a79f1cf9..4505af87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,17 @@ will consitute of a breaking change warranting a new major release: - Reverted lower OP limit of `PLOC` to -10°C. - All pointing laws are now allowed to use the `MEKF` per default. +- The `GPS Controller` does not set itself to `OFF` anymore, if it has not detected a valid fix for + some time. Instead it attempts to reset both GNSS devices once. +- The maximum time to reach a fix is shortened from 30min to 15min. +- The time the reset pin of the GNSS devices is pulled is prolonged from 5ms to 10s. +- A `GPS FIX HAS CHANGED` is now only triggered if no fix change has been detected within the past + 2min. This means, this event might be thrown with a 2min delay. It is instantly thrown, if the mode + of the controller is changed. As arguments it now displays the new fix and the numer of fix changes + missed. +- The number of satellites seen and used is reset to 0, in case they are set to invalid. +- Altitude, latitude and longitude messages are not checked anymore, in case the mode message was + already invalid. # [v7.7.4] 2024-03-21 From 53376fd9edff135f23fc19ec1ded6a3e5dc6d979 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 10 Apr 2024 11:43:06 +0200 Subject: [PATCH 29/36] fix changelog --- CHANGELOG.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6347370..e6c6bbd4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,12 +16,6 @@ will consitute of a breaking change warranting a new major release: # [unreleased] -## Fixed - -- Re-worked some FDIR logic in the FSFW. The former logic prevented events with a severity - higher than INFO if the device was in EXTERNAL CONTROL. The new logic will allow to trigger - events but still inhibit FDIR reactions if the device is in EXTERNAL CONTROL. - ## Changed - Reverted lower OP limit of `PLOC` to -10°C. @@ -47,6 +41,9 @@ will consitute of a breaking change warranting a new major release: ## Fixed - Fixed wrong order in quaternion multiplication for computation of the error quaternion. +- Re-worked some FDIR logic in the FSFW. The former logic prevented events with a severity + higher than INFO if the device was in EXTERNAL CONTROL. The new logic will allow to trigger + events but still inhibit FDIR reactions if the device is in EXTERNAL CONTROL. # [v7.7.4] 2024-03-21 From fcd3b7815c4d5a201aa4e24e93dc6c052be44461 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 10 Apr 2024 11:53:21 +0200 Subject: [PATCH 30/36] reran gens --- bsp_hosted/fsfwconfig/events/translateEvents.cpp | 13 +++++++++++-- bsp_hosted/fsfwconfig/objects/translateObjects.cpp | 2 +- generators/bsp_hosted_events.csv | 7 +++++-- generators/bsp_q7s_events.csv | 7 +++++-- generators/events/translateEvents.cpp | 13 +++++++++++-- generators/objects/translateObjects.cpp | 2 +- linux/fsfwconfig/events/translateEvents.cpp | 13 +++++++++++-- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- 8 files changed, 46 insertions(+), 13 deletions(-) diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index a787b609..0e05842a 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 321 translations. + * @brief Auto-generated event translation file. Contains 324 translations. * @details - * Generated on: 2024-04-08 13:37:59 + * Generated on: 2024-04-10 11:49:35 */ #include "translateEvents.h" @@ -85,6 +85,8 @@ const char *CLOCK_SET_STRING = "CLOCK_SET"; const char *CLOCK_DUMP_LEGACY_STRING = "CLOCK_DUMP_LEGACY"; const char *CLOCK_SET_FAILURE_STRING = "CLOCK_SET_FAILURE"; const char *CLOCK_DUMP_STRING = "CLOCK_DUMP"; +const char *CLOCK_DUMP_BEFORE_SETTING_TIME_STRING = "CLOCK_DUMP_BEFORE_SETTING_TIME"; +const char *CLOCK_DUMP_AFTER_SETTING_TIME_STRING = "CLOCK_DUMP_AFTER_SETTING_TIME"; const char *TC_DELETION_FAILED_STRING = "TC_DELETION_FAILED"; const char *TEST_STRING = "TEST"; const char *CHANGE_OF_SETUP_PARAMETER_STRING = "CHANGE_OF_SETUP_PARAMETER"; @@ -242,6 +244,7 @@ const char *SIDE_SWITCH_TRANSITION_NOT_ALLOWED_12903_STRING = "SIDE_SWITCH_TRANS const char *CHILDREN_LOST_MODE_STRING = "CHILDREN_LOST_MODE"; const char *GPS_FIX_CHANGE_STRING = "GPS_FIX_CHANGE"; const char *CANT_GET_FIX_STRING = "CANT_GET_FIX"; +const char *RESET_FAIL_STRING = "RESET_FAIL"; const char *P60_BOOT_COUNT_STRING = "P60_BOOT_COUNT"; const char *BATT_MODE_STRING = "BATT_MODE"; const char *BATT_MODE_CHANGED_STRING = "BATT_MODE_CHANGED"; @@ -489,6 +492,10 @@ const char *translateEvents(Event event) { return CLOCK_SET_FAILURE_STRING; case (8903): return CLOCK_DUMP_STRING; + case (8904): + return CLOCK_DUMP_BEFORE_SETTING_TIME_STRING; + case (8905): + return CLOCK_DUMP_AFTER_SETTING_TIME_STRING; case (9100): return TC_DELETION_FAILED_STRING; case (9700): @@ -803,6 +810,8 @@ const char *translateEvents(Event event) { return GPS_FIX_CHANGE_STRING; case (13101): return CANT_GET_FIX_STRING; + case (13102): + return RESET_FAIL_STRING; case (13200): return P60_BOOT_COUNT_STRING; case (13201): diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index 3af7f2d3..37068dd1 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 175 translations. - * Generated on: 2024-04-08 13:37:59 + * Generated on: 2024-04-10 11:49:35 */ #include "translateObjects.h" diff --git a/generators/bsp_hosted_events.csv b/generators/bsp_hosted_events.csv index 34aa9343..3c05a3c2 100644 --- a/generators/bsp_hosted_events.csv +++ b/generators/bsp_hosted_events.csv @@ -79,6 +79,8 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 8901;0x22c5;CLOCK_DUMP_LEGACY;INFO;Clock dump event. P1: timeval seconds P2: timeval milliseconds.;fsfw/src/fsfw/pus/Service9TimeManagement.h 8902;0x22c6;CLOCK_SET_FAILURE;LOW;Clock could not be set. P1: Returncode.;fsfw/src/fsfw/pus/Service9TimeManagement.h 8903;0x22c7;CLOCK_DUMP;INFO;Clock dump event. P1: timeval seconds P2: timeval microseconds.;fsfw/src/fsfw/pus/Service9TimeManagement.h +8904;0x22c8;CLOCK_DUMP_BEFORE_SETTING_TIME;INFO;No description;fsfw/src/fsfw/pus/Service9TimeManagement.h +8905;0x22c9;CLOCK_DUMP_AFTER_SETTING_TIME;INFO;No description;fsfw/src/fsfw/pus/Service9TimeManagement.h 9100;0x238c;TC_DELETION_FAILED;MEDIUM;Deletion of a TC from the map failed. P1: First 32 bit of request ID, P2. Last 32 bit of Request ID;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 9700;0x25e4;TEST;INFO;No description;fsfw/src/fsfw/pus/Service17Test.h 10600;0x2968;CHANGE_OF_SETUP_PARAMETER;LOW;No description;fsfw/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h @@ -234,8 +236,9 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 12902;0x3266;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;No description;mission/system/acs/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/acs/SusAssembly.h 13000;0x32c8;CHILDREN_LOST_MODE;MEDIUM;No description;mission/system/tcs/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/acs/archive/GPSDefinitions.h -13101;0x332d;CANT_GET_FIX;LOW;Could not get fix in maximum allowed time. P1: Maximum allowed time to get a fix after the GPS was switched on.;mission/acs/archive/GPSDefinitions.h +13100;0x332c;GPS_FIX_CHANGE;INFO;Fix has changed. P1: New fix. P2: Missed fix changes 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix;linux/acs/GPSDefinitions.h +13101;0x332d;CANT_GET_FIX;MEDIUM;Could not get fix in maximum allowed time. Trying to reset both GNSS devices. P1: Maximum allowed time to get a fix after the GPS was switched on.;linux/acs/GPSDefinitions.h +13102;0x332e;RESET_FAIL;HIGH;Failed to reset an GNNS Device. P1: Board-Side.;linux/acs/GPSDefinitions.h 13200;0x3390;P60_BOOT_COUNT;INFO;P60 boot count is broadcasted once at SW startup. P1: Boot count;mission/power/P60DockHandler.h 13201;0x3391;BATT_MODE;INFO;Battery mode is broadcasted at startup. P1: Mode;mission/power/P60DockHandler.h 13202;0x3392;BATT_MODE_CHANGED;MEDIUM;Battery mode has changed. P1: Old mode. P2: New mode;mission/power/P60DockHandler.h diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index 34aa9343..3c05a3c2 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -79,6 +79,8 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 8901;0x22c5;CLOCK_DUMP_LEGACY;INFO;Clock dump event. P1: timeval seconds P2: timeval milliseconds.;fsfw/src/fsfw/pus/Service9TimeManagement.h 8902;0x22c6;CLOCK_SET_FAILURE;LOW;Clock could not be set. P1: Returncode.;fsfw/src/fsfw/pus/Service9TimeManagement.h 8903;0x22c7;CLOCK_DUMP;INFO;Clock dump event. P1: timeval seconds P2: timeval microseconds.;fsfw/src/fsfw/pus/Service9TimeManagement.h +8904;0x22c8;CLOCK_DUMP_BEFORE_SETTING_TIME;INFO;No description;fsfw/src/fsfw/pus/Service9TimeManagement.h +8905;0x22c9;CLOCK_DUMP_AFTER_SETTING_TIME;INFO;No description;fsfw/src/fsfw/pus/Service9TimeManagement.h 9100;0x238c;TC_DELETION_FAILED;MEDIUM;Deletion of a TC from the map failed. P1: First 32 bit of request ID, P2. Last 32 bit of Request ID;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 9700;0x25e4;TEST;INFO;No description;fsfw/src/fsfw/pus/Service17Test.h 10600;0x2968;CHANGE_OF_SETUP_PARAMETER;LOW;No description;fsfw/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h @@ -234,8 +236,9 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 12902;0x3266;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;No description;mission/system/acs/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/acs/SusAssembly.h 13000;0x32c8;CHILDREN_LOST_MODE;MEDIUM;No description;mission/system/tcs/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/acs/archive/GPSDefinitions.h -13101;0x332d;CANT_GET_FIX;LOW;Could not get fix in maximum allowed time. P1: Maximum allowed time to get a fix after the GPS was switched on.;mission/acs/archive/GPSDefinitions.h +13100;0x332c;GPS_FIX_CHANGE;INFO;Fix has changed. P1: New fix. P2: Missed fix changes 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix;linux/acs/GPSDefinitions.h +13101;0x332d;CANT_GET_FIX;MEDIUM;Could not get fix in maximum allowed time. Trying to reset both GNSS devices. P1: Maximum allowed time to get a fix after the GPS was switched on.;linux/acs/GPSDefinitions.h +13102;0x332e;RESET_FAIL;HIGH;Failed to reset an GNNS Device. P1: Board-Side.;linux/acs/GPSDefinitions.h 13200;0x3390;P60_BOOT_COUNT;INFO;P60 boot count is broadcasted once at SW startup. P1: Boot count;mission/power/P60DockHandler.h 13201;0x3391;BATT_MODE;INFO;Battery mode is broadcasted at startup. P1: Mode;mission/power/P60DockHandler.h 13202;0x3392;BATT_MODE_CHANGED;MEDIUM;Battery mode has changed. P1: Old mode. P2: New mode;mission/power/P60DockHandler.h diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index a787b609..0e05842a 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 321 translations. + * @brief Auto-generated event translation file. Contains 324 translations. * @details - * Generated on: 2024-04-08 13:37:59 + * Generated on: 2024-04-10 11:49:35 */ #include "translateEvents.h" @@ -85,6 +85,8 @@ const char *CLOCK_SET_STRING = "CLOCK_SET"; const char *CLOCK_DUMP_LEGACY_STRING = "CLOCK_DUMP_LEGACY"; const char *CLOCK_SET_FAILURE_STRING = "CLOCK_SET_FAILURE"; const char *CLOCK_DUMP_STRING = "CLOCK_DUMP"; +const char *CLOCK_DUMP_BEFORE_SETTING_TIME_STRING = "CLOCK_DUMP_BEFORE_SETTING_TIME"; +const char *CLOCK_DUMP_AFTER_SETTING_TIME_STRING = "CLOCK_DUMP_AFTER_SETTING_TIME"; const char *TC_DELETION_FAILED_STRING = "TC_DELETION_FAILED"; const char *TEST_STRING = "TEST"; const char *CHANGE_OF_SETUP_PARAMETER_STRING = "CHANGE_OF_SETUP_PARAMETER"; @@ -242,6 +244,7 @@ const char *SIDE_SWITCH_TRANSITION_NOT_ALLOWED_12903_STRING = "SIDE_SWITCH_TRANS const char *CHILDREN_LOST_MODE_STRING = "CHILDREN_LOST_MODE"; const char *GPS_FIX_CHANGE_STRING = "GPS_FIX_CHANGE"; const char *CANT_GET_FIX_STRING = "CANT_GET_FIX"; +const char *RESET_FAIL_STRING = "RESET_FAIL"; const char *P60_BOOT_COUNT_STRING = "P60_BOOT_COUNT"; const char *BATT_MODE_STRING = "BATT_MODE"; const char *BATT_MODE_CHANGED_STRING = "BATT_MODE_CHANGED"; @@ -489,6 +492,10 @@ const char *translateEvents(Event event) { return CLOCK_SET_FAILURE_STRING; case (8903): return CLOCK_DUMP_STRING; + case (8904): + return CLOCK_DUMP_BEFORE_SETTING_TIME_STRING; + case (8905): + return CLOCK_DUMP_AFTER_SETTING_TIME_STRING; case (9100): return TC_DELETION_FAILED_STRING; case (9700): @@ -803,6 +810,8 @@ const char *translateEvents(Event event) { return GPS_FIX_CHANGE_STRING; case (13101): return CANT_GET_FIX_STRING; + case (13102): + return RESET_FAIL_STRING; case (13200): return P60_BOOT_COUNT_STRING; case (13201): diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 110c5c62..7632605f 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 179 translations. - * Generated on: 2024-04-08 13:37:59 + * Generated on: 2024-04-10 11:49:35 */ #include "translateObjects.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index a787b609..0e05842a 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 321 translations. + * @brief Auto-generated event translation file. Contains 324 translations. * @details - * Generated on: 2024-04-08 13:37:59 + * Generated on: 2024-04-10 11:49:35 */ #include "translateEvents.h" @@ -85,6 +85,8 @@ const char *CLOCK_SET_STRING = "CLOCK_SET"; const char *CLOCK_DUMP_LEGACY_STRING = "CLOCK_DUMP_LEGACY"; const char *CLOCK_SET_FAILURE_STRING = "CLOCK_SET_FAILURE"; const char *CLOCK_DUMP_STRING = "CLOCK_DUMP"; +const char *CLOCK_DUMP_BEFORE_SETTING_TIME_STRING = "CLOCK_DUMP_BEFORE_SETTING_TIME"; +const char *CLOCK_DUMP_AFTER_SETTING_TIME_STRING = "CLOCK_DUMP_AFTER_SETTING_TIME"; const char *TC_DELETION_FAILED_STRING = "TC_DELETION_FAILED"; const char *TEST_STRING = "TEST"; const char *CHANGE_OF_SETUP_PARAMETER_STRING = "CHANGE_OF_SETUP_PARAMETER"; @@ -242,6 +244,7 @@ const char *SIDE_SWITCH_TRANSITION_NOT_ALLOWED_12903_STRING = "SIDE_SWITCH_TRANS const char *CHILDREN_LOST_MODE_STRING = "CHILDREN_LOST_MODE"; const char *GPS_FIX_CHANGE_STRING = "GPS_FIX_CHANGE"; const char *CANT_GET_FIX_STRING = "CANT_GET_FIX"; +const char *RESET_FAIL_STRING = "RESET_FAIL"; const char *P60_BOOT_COUNT_STRING = "P60_BOOT_COUNT"; const char *BATT_MODE_STRING = "BATT_MODE"; const char *BATT_MODE_CHANGED_STRING = "BATT_MODE_CHANGED"; @@ -489,6 +492,10 @@ const char *translateEvents(Event event) { return CLOCK_SET_FAILURE_STRING; case (8903): return CLOCK_DUMP_STRING; + case (8904): + return CLOCK_DUMP_BEFORE_SETTING_TIME_STRING; + case (8905): + return CLOCK_DUMP_AFTER_SETTING_TIME_STRING; case (9100): return TC_DELETION_FAILED_STRING; case (9700): @@ -803,6 +810,8 @@ const char *translateEvents(Event event) { return GPS_FIX_CHANGE_STRING; case (13101): return CANT_GET_FIX_STRING; + case (13102): + return RESET_FAIL_STRING; case (13200): return P60_BOOT_COUNT_STRING; case (13201): diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 110c5c62..7632605f 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 179 translations. - * Generated on: 2024-04-08 13:37:59 + * Generated on: 2024-04-10 11:49:35 */ #include "translateObjects.h" From ceb21307267629b2ea9c48f06a6609b256941bbd Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 10 Apr 2024 11:54:17 +0200 Subject: [PATCH 31/36] bumped tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 96636d59..a8d0143b 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 96636d59e9b0e3f35947f2d0e73d2a8ab1a58c5c +Subproject commit a8d0143b1ed9a14f7e071ee3344dc4e8f1937c55 From a6422f2d73bd89821838cdd73484990cd4ad4559 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 10 Apr 2024 11:56:19 +0200 Subject: [PATCH 32/36] bump version --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b4314754..04401675 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,8 +10,8 @@ cmake_minimum_required(VERSION 3.13) set(OBSW_VERSION_MAJOR 7) -set(OBSW_VERSION_MINOR 7) -set(OBSW_VERSION_REVISION 4) +set(OBSW_VERSION_MINOR 8) +set(OBSW_VERSION_REVISION 0) # set(CMAKE_VERBOSE TRUE) From e2ee6a492c2428327ee72c604191c0e8573bb395 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 10 Apr 2024 11:57:17 +0200 Subject: [PATCH 33/36] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6c6bbd4..99dd2437 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +# [v7.8.0] 2024-04-10 + ## Changed - Reverted lower OP limit of `PLOC` to -10°C. From eff9116aec3a31d861444c41ca8747045aef9c81 Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 11 Apr 2024 13:57:40 +0200 Subject: [PATCH 34/36] ??? --- mission/controller/acs/Guidance.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index 07730e09..2c1b3c63 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -303,9 +303,9 @@ void Guidance::comparePtg(double currentQuat[4], double currentSatRotRate[3], do // First calculate error quaternion between current and target orientation without reference // quaternion double errorQuatWoRef[4] = {0, 0, 0, 0}; - QuaternionOperations::multiply(targetQuat, currentQuat, errorQuatWoRef); + QuaternionOperations::multiply(currentQuat, targetQuat, errorQuatWoRef); // Then add rotation from reference quaternion - QuaternionOperations::multiply(errorQuatWoRef, refQuat, errorQuat); + QuaternionOperations::multiply(refQuat, errorQuatWoRef, errorQuat); // Keep scalar part of quaternion positive if (errorQuat[3] < 0) { VectorOperations::mulScalar(errorQuat, -1, errorQuat, 4); From 5bb1bd894641eb31456b02eaff4130765a3576f8 Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 11 Apr 2024 13:58:57 +0200 Subject: [PATCH 35/36] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99dd2437..d58be5b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +# [v7.8.1] 2024-04-11 + +- Reverted fix for wrong order in quaternion multiplication for computation of the error quaternion. + # [v7.8.0] 2024-04-10 ## Changed From 675dda8e9eb85ef7254d8d7b590eeb322632ddb6 Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 11 Apr 2024 14:00:30 +0200 Subject: [PATCH 36/36] bump version --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 04401675..3132f5ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ cmake_minimum_required(VERSION 3.13) set(OBSW_VERSION_MAJOR 7) set(OBSW_VERSION_MINOR 8) -set(OBSW_VERSION_REVISION 0) +set(OBSW_VERSION_REVISION 1) # set(CMAKE_VERBOSE TRUE)