From 892d2f5939008bf585264b9d273749aabdacf0bc Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 6 Mar 2023 16:52:58 +0100 Subject: [PATCH 01/20] use flight config for FM --- CMakeLists.txt | 2 ++ bsp_q7s/OBSWConfig.h.in | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 037284ea..6bf2a95a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,11 +71,13 @@ if(EIVE_Q7S_EM) 1 CACHE STRING "Q7S EM configuration") set(INIT_VAL 0) + set(OBSW_STAR_TRACKER_GROUND_CONFIG 1) else() set(OBSW_Q7S_EM 0 CACHE STRING "Q7S EM configuration") set(INIT_VAL 1) + set(OBSW_STAR_TRACKER_GROUND_CONFIG 0) endif() set(OBSW_ADD_MGT ${INIT_VAL} diff --git a/bsp_q7s/OBSWConfig.h.in b/bsp_q7s/OBSWConfig.h.in index 687d9363..1dff8f7f 100644 --- a/bsp_q7s/OBSWConfig.h.in +++ b/bsp_q7s/OBSWConfig.h.in @@ -67,7 +67,7 @@ #define OBSW_PRINT_MISSED_DEADLINES 1 #define OBSW_MPSOC_JTAG_BOOT 0 -#define OBSW_STAR_TRACKER_GROUND_CONFIG 1 +#define OBSW_STAR_TRACKER_GROUND_CONFIG @OBSW_STAR_TRACKER_GROUND_CONFIG@ #define OBSW_SYRLINKS_SIMULATED @OBSW_SYRLINKS_SIMULATED@ #define OBSW_ADD_TEST_CODE 0 #define OBSW_ADD_TEST_TASK 0 From e3389c32a7e680a43c0070f598d4ad611acdc80d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Mar 2023 13:56:51 +0100 Subject: [PATCH 02/20] API change setInheritSubmode --- fsfw | 2 +- mission/system/objects/DualLaneAssemblyBase.h | 1 - mission/system/objects/RwAssembly.cpp | 1 - mission/system/objects/TcsBoardAssembly.cpp | 1 - 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/fsfw b/fsfw index e9d9f446..2745b208 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit e9d9f446053699a91d89250910cc0d59d05fbe6b +Subproject commit 2745b2080dc9c53ef6699c844ba1d000351d07ba diff --git a/mission/system/objects/DualLaneAssemblyBase.h b/mission/system/objects/DualLaneAssemblyBase.h index ca73d53c..a8a2f521 100644 --- a/mission/system/objects/DualLaneAssemblyBase.h +++ b/mission/system/objects/DualLaneAssemblyBase.h @@ -96,7 +96,6 @@ inline void DualLaneAssemblyBase::initModeTableEntry( entry.setObject(id); entry.setMode(MODE_OFF); entry.setSubmode(SUBMODE_NONE); - entry.setInheritSubmode(false); modeTable.insert(entry); } diff --git a/mission/system/objects/RwAssembly.cpp b/mission/system/objects/RwAssembly.cpp index 886ec5ce..ce90f4f5 100644 --- a/mission/system/objects/RwAssembly.cpp +++ b/mission/system/objects/RwAssembly.cpp @@ -8,7 +8,6 @@ RwAssembly::RwAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher, power:: entry.setObject(helper.rwIds[idx]); entry.setMode(MODE_OFF); entry.setSubmode(SUBMODE_NONE); - entry.setInheritSubmode(false); modeTable.insert(entry); } } diff --git a/mission/system/objects/TcsBoardAssembly.cpp b/mission/system/objects/TcsBoardAssembly.cpp index 88075fdc..f3553a38 100644 --- a/mission/system/objects/TcsBoardAssembly.cpp +++ b/mission/system/objects/TcsBoardAssembly.cpp @@ -12,7 +12,6 @@ TcsBoardAssembly::TcsBoardAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitc entry.setObject(helper.rtdInfos[idx].first); entry.setMode(MODE_OFF); entry.setSubmode(SUBMODE_NONE); - entry.setInheritSubmode(false); modeTable.insert(entry); } } From bf7e4b4b8cd2cd3729ec3c86dd39b8ec26a312f9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Mar 2023 14:20:42 +0100 Subject: [PATCH 03/20] changelog --- CHANGELOG.md | 9 +++ mission/system/tree/acsModeTree.cpp | 102 +++++++++++++++++----------- 2 files changed, 72 insertions(+), 39 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b08ae006..3a1b9316 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,15 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +## Fixed + +- Allow arbitrary submodes for dual lane boards to avoid FDIR reactions of subsystem components. + Bump FSFW to allow this. + +## Changed + +- Fast ACS subsystem commanding: Command SUS board consecutively with other devices now + # [v1.35.1] 2023-03-04 ## Fixed diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index a743bb87..adcc0e01 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -6,8 +6,11 @@ #include #include +#include + #include "eive/objects.h" #include "mission/acsDefs.h" +#include "mission/system/objects/definitions.h" #include "util.h" AcsSubsystem satsystem::acs::ACS_SUBSYSTEM(objects::ACS_SUBSYSTEM, 12, 24); @@ -100,16 +103,20 @@ Subsystem& satsystem::acs::init() { ModeListEntry entry; const char* ctxc = "satsystem::acs::init: generic target"; // 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, + bool allowAllSubmodes = false) { entry.setObject(obj); entry.setMode(mode); entry.setSubmode(submode); + if (allowAllSubmodes) { + entry.allowAllSubmodes(); + } check(table.insert(entry), "satsystem::acs::init: generic target"); }; // Build TARGET PT transition 0 iht(objects::IMTQ_ASSY, NML, 0, ACS_TABLE_PTG_TRANS_0.second); - iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TRANS_0.second); - iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TRANS_0.second); + iht(objects::SUS_BOARD_ASS, NML, duallane::A_SIDE, ACS_TABLE_PTG_TRANS_0.second, true); + iht(objects::ACS_BOARD_ASS, NML, duallane::A_SIDE, ACS_TABLE_PTG_TRANS_0.second, true); iht(objects::RW_ASSY, NML, 0, ACS_TABLE_PTG_TRANS_0.second); iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_PTG_TRANS_0.second); check(ACS_SUBSYSTEM.addTable( @@ -117,7 +124,7 @@ Subsystem& satsystem::acs::init() { ctxc); // Build SUS board transition - iht(objects::SUS_BOARD_ASS, NML, 0, SUS_BOARD_NML_TRANS.second); + iht(objects::SUS_BOARD_ASS, NML, duallane::A_SIDE, SUS_BOARD_NML_TRANS.second, true); check(ACS_SUBSYSTEM.addTable(TableEntry(SUS_BOARD_NML_TRANS.first, &SUS_BOARD_NML_TRANS.second)), ctxc); @@ -182,10 +189,13 @@ void 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, bool allowAllSubmodes = false) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); + if (allowAllSubmodes) { + eh.allowAllSubmodes(); + } check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence @@ -199,13 +209,14 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) { // Build SAFE target iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::SAFE, ACS_TABLE_SAFE_TGT.second); iht(objects::IMTQ_ASSY, 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); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TGT.second, true); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TGT.second, true); check(ss.addTable(&ACS_TABLE_SAFE_TGT.second, ACS_TABLE_SAFE_TGT.first, false, true), ctxc); // Build SAFE transition 0 iht(objects::IMTQ_ASSY, NML, 0, ACS_TABLE_SAFE_TRANS_0.second); - iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TRANS_0.second); + iht(objects::ACS_BOARD_ASS, NML, duallane::A_SIDE, ACS_TABLE_SAFE_TRANS_0.second, true); + iht(objects::SUS_BOARD_ASS, NML, duallane::A_SIDE, ACS_TABLE_SAFE_TRANS_0.second, true); iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second); iht(objects::RW_ASSY, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second); check(ss.addTable(&ACS_TABLE_SAFE_TRANS_0.second, ACS_TABLE_SAFE_TRANS_0.first, false, true), @@ -220,7 +231,7 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) { // Build SAFE sequence ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TGT.first, 0, true); - ihs(ACS_SEQUENCE_SAFE.second, SUS_BOARD_NML_TRANS.first, 0, false); + // ihs(ACS_SEQUENCE_SAFE.second, SUS_BOARD_NML_TRANS.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); check(ss.addSequence(&ACS_SEQUENCE_SAFE.second, ACS_SEQUENCE_SAFE.first, ACS_SEQUENCE_SAFE.first, @@ -233,10 +244,13 @@ void 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, bool allowAllSubmodes = false) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); + if (allowAllSubmodes) { + eh.allowAllSubmodes(); + } check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence @@ -250,17 +264,15 @@ void buildDetumbleSequence(Subsystem& ss, ModeListEntry& eh) { // Build DETUMBLE target iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::DETUMBLE, ACS_TABLE_DETUMBLE_TGT.second); iht(objects::IMTQ_ASSY, 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); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second, true); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second, true); check(ss.addTable(&ACS_TABLE_DETUMBLE_TGT.second, ACS_TABLE_DETUMBLE_TGT.first, false, true), ctxc); - // SUS board transition table is defined above - // Build DETUMBLE transition 0 iht(objects::IMTQ_ASSY, 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::ACS_BOARD_ASS, NML, duallane::A_SIDE, ACS_TABLE_DETUMBLE_TRANS_0.second, true); + iht(objects::SUS_BOARD_ASS, NML, duallane::A_SIDE, ACS_TABLE_DETUMBLE_TRANS_0.second, true); iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); iht(objects::RW_ASSY, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); check(ss.addTable(&ACS_TABLE_DETUMBLE_TRANS_0.second, ACS_TABLE_DETUMBLE_TRANS_0.first, false, @@ -275,7 +287,7 @@ void buildDetumbleSequence(Subsystem& ss, ModeListEntry& eh) { // Build DETUMBLE sequence ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TGT.first, 0, true); - ihs(ACS_SEQUENCE_DETUMBLE.second, SUS_BOARD_NML_TRANS.first, 0, false); + // ihs(ACS_SEQUENCE_DETUMBLE.second, SUS_BOARD_NML_TRANS.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); check(ss.addSequence(&ACS_SEQUENCE_DETUMBLE.second, ACS_SEQUENCE_DETUMBLE.first, @@ -288,10 +300,13 @@ void buildIdleSequence(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, bool allowAllSubmodes = false) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); + if (allowAllSubmodes) { + eh.allowAllSubmodes(); + } check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence @@ -306,16 +321,14 @@ void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) { iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::PTG_IDLE, ACS_TABLE_IDLE_TGT.second); iht(objects::IMTQ_ASSY, NML, 0, ACS_TABLE_IDLE_TGT.second); iht(objects::RW_ASSY, 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); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second, true); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second, true); ss.addTable(&ACS_TABLE_IDLE_TGT.second, ACS_TABLE_IDLE_TGT.first, false, true); - // SUS board transition table is built above - // Build IDLE transition 0 iht(objects::IMTQ_ASSY, 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::ACS_BOARD_ASS, NML, duallane::A_SIDE, ACS_TABLE_IDLE_TRANS_0.second, true); + iht(objects::SUS_BOARD_ASS, NML, duallane::A_SIDE, ACS_TABLE_IDLE_TRANS_0.second, true); iht(objects::RW_ASSY, NML, 0, ACS_TABLE_IDLE_TRANS_0.second); iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_IDLE_TRANS_0.second); ss.addTable(&ACS_TABLE_IDLE_TRANS_0.second, ACS_TABLE_IDLE_TRANS_0.first, false, true); @@ -326,7 +339,7 @@ void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) { // Build IDLE sequence ihs(ACS_SEQUENCE_IDLE.second, ACS_TABLE_IDLE_TGT.first, 0, true); - ihs(ACS_SEQUENCE_IDLE.second, SUS_BOARD_NML_TRANS.first, 0, true); + // ihs(ACS_SEQUENCE_IDLE.second, SUS_BOARD_NML_TRANS.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, true); ss.addSequence(&ACS_SEQUENCE_IDLE.second, ACS_SEQUENCE_IDLE.first, ACS_SEQUENCE_SAFE.first, false, @@ -338,10 +351,13 @@ void 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, bool allowAllSubmodes = false) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); + if (allowAllSubmodes) { + eh.allowAllSubmodes(); + } check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence @@ -356,14 +372,13 @@ void buildTargetPtSequence(Subsystem& ss, ModeListEntry& eh) { // Build TARGET PT table iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::PTG_TARGET, ACS_TABLE_PTG_TARGET_TGT.second); iht(objects::IMTQ_ASSY, NML, 0, ACS_TABLE_PTG_TARGET_TGT.second); - iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_TGT.second); - iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_TGT.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_TGT.second, true); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_TGT.second, true); iht(objects::RW_ASSY, NML, 0, ACS_TABLE_PTG_TARGET_TGT.second); iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_PTG_TARGET_TGT.second); check(ss.addTable(&ACS_TABLE_PTG_TARGET_TGT.second, ACS_TABLE_PTG_TARGET_TGT.first, false, true), ctxc); - // SUS board transition table is built above // Transition 0 already built // Build TARGET PT transition 1 iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::PTG_TARGET, ACS_TABLE_PTG_TARGET_TRANS_1.second); @@ -373,7 +388,7 @@ void buildTargetPtSequence(Subsystem& ss, ModeListEntry& eh) { // Build IDLE sequence ihs(ACS_SEQUENCE_PTG_TARGET.second, ACS_TABLE_PTG_TARGET_TGT.first, 0, true); - ihs(ACS_SEQUENCE_PTG_TARGET.second, SUS_BOARD_NML_TRANS.first, 0, true); + // ihs(ACS_SEQUENCE_PTG_TARGET.second, SUS_BOARD_NML_TRANS.first, 0, true); ihs(ACS_SEQUENCE_PTG_TARGET.second, ACS_TABLE_PTG_TRANS_0.first, 0, true); ihs(ACS_SEQUENCE_PTG_TARGET.second, ACS_TABLE_PTG_TARGET_TRANS_1.first, 0, true); check(ss.addSequence(&ACS_SEQUENCE_PTG_TARGET.second, ACS_SEQUENCE_PTG_TARGET.first, @@ -386,10 +401,13 @@ void buildTargetPtNadirSequence(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, bool allowAllSubmodes = false) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); + if (allowAllSubmodes) { + eh.allowAllSubmodes(); + } check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence @@ -405,8 +423,8 @@ void buildTargetPtNadirSequence(Subsystem& ss, ModeListEntry& eh) { iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::PTG_TARGET, ACS_TABLE_PTG_TARGET_NADIR_TGT.second); iht(objects::IMTQ_ASSY, NML, 0, ACS_TABLE_PTG_TARGET_NADIR_TGT.second); - iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_NADIR_TGT.second); - iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_NADIR_TGT.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_NADIR_TGT.second, true); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_NADIR_TGT.second, true); iht(objects::RW_ASSY, NML, 0, ACS_TABLE_PTG_TARGET_NADIR_TGT.second); iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_PTG_TARGET_NADIR_TGT.second); check(ss.addTable(TableEntry(ACS_TABLE_PTG_TARGET_NADIR_TGT.first, @@ -437,10 +455,13 @@ void buildTargetPtGsSequence(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, bool allowAllSubmodes = false) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); + if (allowAllSubmodes) { + eh.allowAllSubmodes(); + } check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence @@ -456,8 +477,8 @@ void buildTargetPtGsSequence(Subsystem& ss, ModeListEntry& eh) { iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::PTG_TARGET_GS, ACS_TABLE_PTG_TARGET_GS_TGT.second); iht(objects::IMTQ_ASSY, NML, 0, ACS_TABLE_PTG_TARGET_GS_TGT.second); - iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_GS_TGT.second); - iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_GS_TGT.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_GS_TGT.second, true); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_GS_TGT.second, true); iht(objects::RW_ASSY, NML, 0, ACS_TABLE_PTG_TARGET_GS_TGT.second); iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_PTG_TARGET_GS_TGT.second); check(ss.addTable( @@ -487,10 +508,13 @@ void buildTargetPtInertialSequence(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, bool allowAllSubmodes) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); + if (allowAllSubmodes) { + eh.allowAllSubmodes(); + } check(sequence.insert(eh), ctxc); }; // Insert Helper Sequence @@ -506,8 +530,8 @@ void buildTargetPtInertialSequence(Subsystem& ss, ModeListEntry& eh) { iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::PTG_INERTIAL, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second); iht(objects::IMTQ_ASSY, NML, 0, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second); - iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second); - iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second, true); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second, true); iht(objects::RW_ASSY, NML, 0, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second); iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second); check(ss.addTable(TableEntry(ACS_TABLE_PTG_TARGET_INERTIAL_TGT.first, From 5de7653600ba0451dae752d4fa37fc8b757fabcf Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Mar 2023 15:34:08 +0100 Subject: [PATCH 04/20] TM store bugfixes --- CHANGELOG.md | 4 ++++ bsp_q7s/core/scheduling.cpp | 4 ++++ mission/tmtc/PersistentTmStore.cpp | 29 ----------------------------- 3 files changed, 8 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b08ae006..2a47cd83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +## Changed + +- Persistent TM stores will now create new files on each reboot. + # [v1.35.1] 2023-03-04 ## Fixed diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index f1837333..3098bb14 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -527,6 +527,10 @@ void scheduling::createPusTasks(TaskFactory& factory, TaskDeadlineMissedFunction if (result != returnvalue::OK) { scheduling::printAddObjectError("PUS_8", objects::PUS_SERVICE_8_FUNCTION_MGMT); } + result = pusMedPrio->addComponent(objects::PUS_SERVICE_15_TM_STORAGE); + if (result != returnvalue::OK) { + scheduling::printAddObjectError("PUS_15", objects::PUS_SERVICE_15_TM_STORAGE); + } result = pusMedPrio->addComponent(objects::PUS_SERVICE_11_TC_SCHEDULER); if (result != returnvalue::OK) { scheduling::printAddObjectError("PUS_11", objects::PUS_SERVICE_11_TC_SCHEDULER); diff --git a/mission/tmtc/PersistentTmStore.cpp b/mission/tmtc/PersistentTmStore.cpp index 2e7da6f6..91a87248 100644 --- a/mission/tmtc/PersistentTmStore.cpp +++ b/mission/tmtc/PersistentTmStore.cpp @@ -28,35 +28,6 @@ PersistentTmStore::PersistentTmStore(object_id_t objectId, const char* baseDir, } ReturnValue_t PersistentTmStore::assignAndOrCreateMostRecentFile() { - using namespace std::filesystem; - for (auto const& file : directory_iterator(basePath)) { - if (file.is_directory()) { - continue; - } - auto pathStr = file.path().string(); - if (pathStr.find(baseName) == std::string::npos) { - continue; - } - unsigned int underscorePos = pathStr.find_last_of('_'); - std::string stampStr = pathStr.substr(underscorePos + 1); - struct tm time {}; - if (nullptr == strptime(stampStr.c_str(), FILE_DATE_FORMAT, &time)) { - sif::error << "PersistentTmStore::assignOrCreateMostRecentFile: Error reading timestamp" - << std::endl; - // Delete the file and re-create it. - activeFile = std::nullopt; - std::filesystem::remove(file.path()); - break; - } - time_t fileEpoch = timegm(&time); - // There is still a file within the active time window, so re-use that file for new TMs to - // store. - if (fileEpoch + static_cast(rolloverDiffSeconds) > currentTv.tv_sec) { - activeFileTv.tv_sec = fileEpoch; - activeFile = file.path(); - break; - } - } if (not activeFile.has_value()) { return createMostRecentFile(std::nullopt); } From 112cfa3ee73c5858c33017417de9cab184845faf Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Mar 2023 15:34:34 +0100 Subject: [PATCH 05/20] changelog update --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a47cd83..e2d3d82a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,10 @@ will consitute of a breaking change warranting a new major release: - Persistent TM stores will now create new files on each reboot. +## Fixed + +- PUS 15 was not scheduled + # [v1.35.1] 2023-03-04 ## Fixed From 51317782c3c55ac9d66d9162febeeef037da745e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Mar 2023 16:03:47 +0100 Subject: [PATCH 06/20] small bugfix --- fsfw | 2 +- mission/system/tree/acsModeTree.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fsfw b/fsfw index 2745b208..4c486681 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 2745b2080dc9c53ef6699c844ba1d000351d07ba +Subproject commit 4c48668125de7a43cb42b8513cada73c2fe3ffbd diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index adcc0e01..d767b617 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -508,7 +508,7 @@ void buildTargetPtInertialSequence(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, bool allowAllSubmodes) { + ArrayList& sequence, bool allowAllSubmodes = false) { eh.setObject(obj); eh.setMode(mode); eh.setSubmode(submode); From cb43688f3818a9032f486b6630447c1a91ae37ae Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Mar 2023 16:09:44 +0100 Subject: [PATCH 07/20] higher SD card lock timeout --- bsp_q7s/fs/SdCardManager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsp_q7s/fs/SdCardManager.h b/bsp_q7s/fs/SdCardManager.h index 76a55ec6..e489e6e7 100644 --- a/bsp_q7s/fs/SdCardManager.h +++ b/bsp_q7s/fs/SdCardManager.h @@ -225,7 +225,7 @@ class SdCardManager : public SystemObject, public SdCardMountedIF { bool markedUnusable = false; MutexIF* sdLock = nullptr; static constexpr MutexIF::TimeoutType LOCK_TYPE = MutexIF::TimeoutType::WAITING; - static constexpr uint32_t LOCK_TIMEOUT = 150; + static constexpr uint32_t LOCK_TIMEOUT = 200; static constexpr char LOCK_CTX[] = "SdCardManager"; SdCardManager(); From 1f8f62457d6656a5b3c236d73164f0217d1e8a4b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Mar 2023 16:10:17 +0100 Subject: [PATCH 08/20] remove stopwatch --- bsp_q7s/core/CoreController.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index 106c95c0..940c9991 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -77,7 +77,6 @@ void CoreController::performControlOperation() { #if OBSW_THREAD_TRACING == 1 trace::threadTrace(opCounter, "CORE CTRL"); #endif - Stopwatch watch; EventMessage event; for (ReturnValue_t result = eventQueue->receiveMessage(&event); result == returnvalue::OK; result = eventQueue->receiveMessage(&event)) { From 23c9e8eed769df2c483d796f00ac11050a1a2325 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Mar 2023 16:18:24 +0100 Subject: [PATCH 09/20] remove old code --- mission/system/tree/acsModeTree.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index d767b617..8b74ae18 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -231,7 +231,6 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) { // Build SAFE sequence ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TGT.first, 0, true); - // ihs(ACS_SEQUENCE_SAFE.second, SUS_BOARD_NML_TRANS.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); check(ss.addSequence(&ACS_SEQUENCE_SAFE.second, ACS_SEQUENCE_SAFE.first, ACS_SEQUENCE_SAFE.first, @@ -287,7 +286,6 @@ void buildDetumbleSequence(Subsystem& ss, ModeListEntry& eh) { // Build DETUMBLE sequence ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TGT.first, 0, true); - // ihs(ACS_SEQUENCE_DETUMBLE.second, SUS_BOARD_NML_TRANS.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); check(ss.addSequence(&ACS_SEQUENCE_DETUMBLE.second, ACS_SEQUENCE_DETUMBLE.first, @@ -339,7 +337,6 @@ void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) { // Build IDLE sequence ihs(ACS_SEQUENCE_IDLE.second, ACS_TABLE_IDLE_TGT.first, 0, true); - // ihs(ACS_SEQUENCE_IDLE.second, SUS_BOARD_NML_TRANS.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, true); ss.addSequence(&ACS_SEQUENCE_IDLE.second, ACS_SEQUENCE_IDLE.first, ACS_SEQUENCE_SAFE.first, false, @@ -388,7 +385,6 @@ void buildTargetPtSequence(Subsystem& ss, ModeListEntry& eh) { // Build IDLE sequence ihs(ACS_SEQUENCE_PTG_TARGET.second, ACS_TABLE_PTG_TARGET_TGT.first, 0, true); - // ihs(ACS_SEQUENCE_PTG_TARGET.second, SUS_BOARD_NML_TRANS.first, 0, true); ihs(ACS_SEQUENCE_PTG_TARGET.second, ACS_TABLE_PTG_TRANS_0.first, 0, true); ihs(ACS_SEQUENCE_PTG_TARGET.second, ACS_TABLE_PTG_TARGET_TRANS_1.first, 0, true); check(ss.addSequence(&ACS_SEQUENCE_PTG_TARGET.second, ACS_SEQUENCE_PTG_TARGET.first, From a2fd590280774749e2d2f95ceb65ba7705695763 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Mar 2023 16:29:19 +0100 Subject: [PATCH 10/20] bump fsfw for possible bugfix --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 4c486681..af58c414 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 4c48668125de7a43cb42b8513cada73c2fe3ffbd +Subproject commit af58c414fc40f6151ecb3df3803f9820290e5399 From 888ade0bfb37f1f622ffef09fb7113107e8170b7 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Mar 2023 17:05:34 +0100 Subject: [PATCH 11/20] bump fsfw --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index af58c414..d9a139e1 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit af58c414fc40f6151ecb3df3803f9820290e5399 +Subproject commit d9a139e1efc2bb178b55fc26ecd5b0e1a9d147e4 From 7476f33905f3463e3313825ad9fabd59c8795d95 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Mar 2023 17:22:08 +0100 Subject: [PATCH 12/20] bump tmtc and fsfw --- fsfw | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fsfw b/fsfw index d9a139e1..7f6ba5f4 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit d9a139e1efc2bb178b55fc26ecd5b0e1a9d147e4 +Subproject commit 7f6ba5f40b47bc32802efdc4ed41b4bad4b8071b diff --git a/tmtc b/tmtc index 9462a6e2..e74e7511 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 9462a6e2459e11ac03c2bb9694772959ac228cd0 +Subproject commit e74e751142e46c801852a110bef11510cc7c7bfa From 1b00029202bce4f196621b974ff43aaf70d06b22 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Mar 2023 18:16:35 +0100 Subject: [PATCH 13/20] move those json thingies into the header --- linux/devices/startracker/StarTrackerHandler.cpp | 16 ++-------------- linux/devices/startracker/StarTrackerHandler.h | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/linux/devices/startracker/StarTrackerHandler.cpp b/linux/devices/startracker/StarTrackerHandler.cpp index a868a22b..77ff9156 100644 --- a/linux/devices/startracker/StarTrackerHandler.cpp +++ b/linux/devices/startracker/StarTrackerHandler.cpp @@ -1,6 +1,7 @@ #include "StarTrackerHandler.h" #include +#include #include @@ -419,7 +420,6 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi return returnvalue::OK; } case (startracker::SUBSCRIPTION): { - Subscription subscription; result = prepareParamCommand(commandData, commandDataLen, subscription); return returnvalue::OK; } @@ -436,67 +436,54 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi return returnvalue::OK; } case (startracker::LIMITS): { - Limits limits; result = prepareParamCommand(commandData, commandDataLen, limits); return result; } case (startracker::MOUNTING): { - Mounting mounting; result = prepareParamCommand(commandData, commandDataLen, mounting); return result; } case (startracker::IMAGE_PROCESSOR): { - ImageProcessor imageProcessor; result = prepareParamCommand(commandData, commandDataLen, imageProcessor); return result; } case (startracker::CAMERA): { - Camera camera; result = prepareParamCommand(commandData, commandDataLen, camera); return result; } case (startracker::CENTROIDING): { - Centroiding centroiding; result = prepareParamCommand(commandData, commandDataLen, centroiding); return result; } case (startracker::LISA): { - Lisa lisa; result = prepareParamCommand(commandData, commandDataLen, lisa); return result; } case (startracker::MATCHING): { - Matching matching; result = prepareParamCommand(commandData, commandDataLen, matching); return result; } case (startracker::VALIDATION): { - Validation validation; result = prepareParamCommand(commandData, commandDataLen, validation); return result; } case (startracker::ALGO): { - Algo algo; result = prepareParamCommand(commandData, commandDataLen, algo); return result; } case (startracker::TRACKING): { - Tracking tracking; result = prepareParamCommand(commandData, commandDataLen, tracking); return result; } case (startracker::LOGLEVEL): { - LogLevel logLevel; result = prepareParamCommand(commandData, commandDataLen, logLevel); return result; } case (startracker::LOGSUBSCRIPTION): { - LogSubscription logSubscription; result = prepareParamCommand(commandData, commandDataLen, logSubscription); return result; } case (startracker::DEBUG_CAMERA): { - DebugCamera debugCamera; result = prepareParamCommand(commandData, commandDataLen, debugCamera); return result; } @@ -1650,6 +1637,7 @@ void StarTrackerHandler::prepareHistogramRequest() { ReturnValue_t StarTrackerHandler::prepareParamCommand(const uint8_t* commandData, size_t commandDataLen, ArcsecJsonParamBase& paramSet) { + Stopwatch watch; ReturnValue_t result = returnvalue::OK; if (commandDataLen > MAX_PATH_SIZE) { return FILE_PATH_TOO_LONG; diff --git a/linux/devices/startracker/StarTrackerHandler.h b/linux/devices/startracker/StarTrackerHandler.h index 3ed81047..e2b474fa 100644 --- a/linux/devices/startracker/StarTrackerHandler.h +++ b/linux/devices/startracker/StarTrackerHandler.h @@ -2,6 +2,7 @@ #define MISSION_DEVICES_STARTRACKERHANDLER_H_ #include +#include #include "ArcsecDatalinkLayer.h" #include "ArcsecJsonParamBase.h" @@ -216,6 +217,21 @@ class StarTrackerHandler : public DeviceHandlerBase { // Loading firmware requires some time and the command will not trigger a reply when executed Countdown bootCountdown; + Tracking tracking; + LogLevel logLevel; + LogSubscription logSubscription; + DebugCamera debugCamera; + Algo algo; + Validation validation; + Matching matching; + Lisa lisa; + Centroiding centroiding; + Camera camera; + ImageProcessor imageProcessor; + Mounting mounting; + Limits limits; + Subscription subscription; + #ifdef EGSE std::string paramJsonFile = "/home/pi/arcsec/json/flight-config.json"; #else From fd62efcae265396fef8fc57972114079aa483460 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Mar 2023 18:47:16 +0100 Subject: [PATCH 14/20] move json init somewhere else --- bsp_q7s/core/ObjectFactory.cpp | 16 +++++++++- .../startracker/ArcsecJsonParamBase.cpp | 31 +++++++++++-------- .../devices/startracker/ArcsecJsonParamBase.h | 22 ++++++------- .../startracker/StarTrackerHandler.cpp | 22 ++++++++++++- .../devices/startracker/StarTrackerHandler.h | 12 ++----- 5 files changed, 67 insertions(+), 36 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index eaa63c72..0fb7c75c 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -908,9 +908,23 @@ void ObjectFactory::createStrComponents(PowerSwitchIF* pwrSwitcher) { startracker::MAX_FRAME_SIZE * 2 + 2, UartModes::NON_CANONICAL); starTrackerCookie->setNoFixedSizeReply(); StrHelper* strHelper = new StrHelper(objects::STR_HELPER); + + const char* paramJsonFile = nullptr; +#ifdef EGSE + paramJsonFile = "/home/pi/arcsec/json/flight-config.json"; +#else +#if OBSW_STAR_TRACKER_GROUND_CONFIG == 1 + paramJsonFile = "/mnt/sd0/startracker/ground-config.json"; +#else + paramJsonFile = "/mnt/sd0/startracker/flight-config.json"; +#endif +#endif + if (paramJsonFile == nullptr) { + sif::error << "No valid Star Tracker parameter JSON file" << std::endl; + } auto starTracker = new StarTrackerHandler(objects::STAR_TRACKER, objects::UART_COM_IF, starTrackerCookie, - strHelper, pcdu::PDU1_CH2_STAR_TRACKER_5V); + paramJsonFile, strHelper, pcdu::PDU1_CH2_STAR_TRACKER_5V); starTracker->setPowerSwitcher(pwrSwitcher); starTracker->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); } diff --git a/linux/devices/startracker/ArcsecJsonParamBase.cpp b/linux/devices/startracker/ArcsecJsonParamBase.cpp index 05864a3f..a63025f1 100644 --- a/linux/devices/startracker/ArcsecJsonParamBase.cpp +++ b/linux/devices/startracker/ArcsecJsonParamBase.cpp @@ -5,14 +5,14 @@ ArcsecJsonParamBase::ArcsecJsonParamBase(std::string setName) : setName(setName) {} ReturnValue_t ArcsecJsonParamBase::create(std::string fullname, uint8_t* buffer) { - ReturnValue_t result = returnvalue::OK; - result = init(fullname); - if (result != returnvalue::OK) { - sif::warning << "ArcsecJsonParamBase::create: Failed to init parameter command for set " - << setName << std::endl; - return result; - } - result = createCommand(buffer); + // ReturnValue_t result = returnvalue::OK; + // result = init(fullname); + // if (result != returnvalue::OK) { + // sif::warning << "ArcsecJsonParamBase::create: Failed to init parameter command for set " + // << setName << std::endl; + // return result; + // } + ReturnValue_t result = createCommand(buffer); if (result != returnvalue::OK) { sif::warning << "ArcsecJsonParamBase::create: Failed to create parameter command for set " << setName << std::endl; @@ -74,12 +74,17 @@ ReturnValue_t ArcsecJsonParamBase::init(const std::string filename) { << std::endl; return JSON_FILE_NOT_EXISTS; } - createJsonObject(filename); - result = initSet(); - if (result != returnvalue::OK) { - return result; + try { + createJsonObject(filename); + result = initSet(); + if (result != returnvalue::OK) { + return result; + } + return returnvalue::OK; + } catch (json::exception& e) { + // TODO: Re-create json file from backup here. + return returnvalue::FAILED; } - return returnvalue::OK; } void ArcsecJsonParamBase::createJsonObject(const std::string fullname) { diff --git a/linux/devices/startracker/ArcsecJsonParamBase.h b/linux/devices/startracker/ArcsecJsonParamBase.h index a7a4f421..49d0dbba 100644 --- a/linux/devices/startracker/ArcsecJsonParamBase.h +++ b/linux/devices/startracker/ArcsecJsonParamBase.h @@ -41,6 +41,17 @@ class ArcsecJsonParamBase { */ ArcsecJsonParamBase(std::string setName); + /** + * @brief Initializes the properties json object and the set json object + * + * @param fullname Name including absolute path to json file + * @param setName The name of the set to work on + * + * @param return JSON_FILE_NOT_EXISTS if specified file does not exist, otherwise + * returnvalue::OK + */ + ReturnValue_t init(const std::string filename); + /** * @brief Fills a buffer with a parameter set * @@ -124,17 +135,6 @@ class ArcsecJsonParamBase { */ virtual ReturnValue_t createCommand(uint8_t* buffer) = 0; - /** - * @brief Initializes the properties json object and the set json object - * - * @param fullname Name including absolute path to json file - * @param setName The name of the set to work on - * - * @param return JSON_FILE_NOT_EXISTS if specified file does not exist, otherwise - * returnvalue::OK - */ - ReturnValue_t init(const std::string filename); - void createJsonObject(const std::string fullname); /** diff --git a/linux/devices/startracker/StarTrackerHandler.cpp b/linux/devices/startracker/StarTrackerHandler.cpp index 77ff9156..18be03e4 100644 --- a/linux/devices/startracker/StarTrackerHandler.cpp +++ b/linux/devices/startracker/StarTrackerHandler.cpp @@ -16,7 +16,8 @@ extern "C" { } StarTrackerHandler::StarTrackerHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, - StrHelper* strHelper, power::Switch_t powerSwitch) + const char* jsonFileStr, StrHelper* strHelper, + power::Switch_t powerSwitch) : DeviceHandlerBase(objectId, comIF, comCookie), temperatureSet(this), versionSet(this), @@ -41,6 +42,7 @@ StarTrackerHandler::StarTrackerHandler(object_id_t objectId, object_id_t comIF, logSubscriptionSet(this), debugCameraSet(this), strHelper(strHelper), + paramJsonFile(jsonFileStr), powerSwitch(powerSwitch) { if (comCookie == nullptr) { sif::error << "StarTrackerHandler: Invalid com cookie" << std::endl; @@ -60,6 +62,24 @@ ReturnValue_t StarTrackerHandler::initialize() { return result; } + // TODO: This takes ages. Move it into a separate thread, use a mutexed boolean + // to check whether init was done. Or move it into the helper class.. + // Also move update of these classes into the helper class. + tracking.init(paramJsonFile); + logLevel.init(paramJsonFile); + logSubscription.init(paramJsonFile); + debugCamera.init(paramJsonFile); + algo.init(paramJsonFile); + validation.init(paramJsonFile); + matching.init(paramJsonFile); + lisa.init(paramJsonFile); + centroiding.init(paramJsonFile); + camera.init(paramJsonFile); + imageProcessor.init(paramJsonFile); + mounting.init(paramJsonFile); + limits.init(paramJsonFile); + subscription.init(paramJsonFile); + EventManagerIF* manager = ObjectManager::instance()->get(objects::EVENT_MANAGER); if (manager == nullptr) { #if FSFW_CPP_OSTREAM_ENABLED == 1 diff --git a/linux/devices/startracker/StarTrackerHandler.h b/linux/devices/startracker/StarTrackerHandler.h index e2b474fa..09088cbb 100644 --- a/linux/devices/startracker/StarTrackerHandler.h +++ b/linux/devices/startracker/StarTrackerHandler.h @@ -36,7 +36,7 @@ class StarTrackerHandler : public DeviceHandlerBase { * to high to enable the device. */ StarTrackerHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, - StrHelper* strHelper, power::Switch_t powerSwitch); + const char* jsonFileStr, StrHelper* strHelper, power::Switch_t powerSwitch); virtual ~StarTrackerHandler(); ReturnValue_t initialize() override; @@ -232,15 +232,7 @@ class StarTrackerHandler : public DeviceHandlerBase { Limits limits; Subscription subscription; -#ifdef EGSE - std::string paramJsonFile = "/home/pi/arcsec/json/flight-config.json"; -#else -#if OBSW_STAR_TRACKER_GROUND_CONFIG == 1 - std::string paramJsonFile = "/mnt/sd0/startracker/ground-config.json"; -#else - std::string paramJsonFile = "/mnt/sd0/startracker/flight-config.json"; -#endif -#endif + std::string paramJsonFile; enum class NormalState { TEMPERATURE_REQUEST, SOLUTION_REQUEST }; From 72ae6aee94b99fcdeeeb16ea78c92752f63fbd43 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Mar 2023 18:55:11 +0100 Subject: [PATCH 15/20] changelog update --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4af541aa..ff9b3511 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ will consitute of a breaking change warranting a new major release: - Persistent TM stores will now create new files on each reboot. - Fast ACS subsystem commanding: Command SUS board consecutively with other devices now +- Star Tracker: Use ground confguration for EM and flight config for FM by default. ## Fixed From 70e2a3f5f8cac6690ec210d320e8bc56459ffced Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Mar 2023 19:02:19 +0100 Subject: [PATCH 16/20] bump arcsec str --- thirdparty/arcsec_star_tracker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thirdparty/arcsec_star_tracker b/thirdparty/arcsec_star_tracker index 93e93965..42907c36 160000 --- a/thirdparty/arcsec_star_tracker +++ b/thirdparty/arcsec_star_tracker @@ -1 +1 @@ -Subproject commit 93e93965e2c6405170b62c523dea1990db02d2ad +Subproject commit 42907c36c58e7133d3d3cbefbf96c1a8e35b60b7 From 45e1e7250b554ba61dd027c67158332785e3767d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Mar 2023 19:13:22 +0100 Subject: [PATCH 17/20] small comment --- linux/devices/startracker/StarTrackerHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/devices/startracker/StarTrackerHandler.cpp b/linux/devices/startracker/StarTrackerHandler.cpp index 18be03e4..749607c1 100644 --- a/linux/devices/startracker/StarTrackerHandler.cpp +++ b/linux/devices/startracker/StarTrackerHandler.cpp @@ -62,7 +62,7 @@ ReturnValue_t StarTrackerHandler::initialize() { return result; } - // TODO: This takes ages. Move it into a separate thread, use a mutexed boolean + // TODO: This takes 200-250ms. Move it into a separate thread, use a mutexed boolean // to check whether init was done. Or move it into the helper class.. // Also move update of these classes into the helper class. tracking.init(paramJsonFile); From c562c4a240cf4491c88527db6d8609fd08ca8f58 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Mar 2023 19:35:46 +0100 Subject: [PATCH 18/20] lets hope this fixes the occasional error --- bsp_q7s/fs/SdCardManager.cpp | 36 +++++++++++++++++++----------------- bsp_q7s/fs/SdCardManager.h | 5 ++++- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/bsp_q7s/fs/SdCardManager.cpp b/bsp_q7s/fs/SdCardManager.cpp index 1663f7cc..d21a373e 100644 --- a/bsp_q7s/fs/SdCardManager.cpp +++ b/bsp_q7s/fs/SdCardManager.cpp @@ -21,15 +21,15 @@ SdCardManager* SdCardManager::INSTANCE = nullptr; SdCardManager::SdCardManager() : SystemObject(objects::SDC_MANAGER), cmdExecutor(256) { sdLock = MutexFactory::instance()->createMutex(); - ReturnValue_t result = sdLock->lockMutex(); - if (result != returnvalue::OK) { + prefLock = MutexFactory::instance()->createMutex(); + defaultLock = MutexFactory::instance()->createMutex(); + + MutexGuard mg(prefLock, LOCK_TYPE, OTHER_TIMEOUT, LOCK_CTX); + if (mg.getLockResult() != returnvalue::OK) { sif::error << "SdCardManager::SdCardManager: Mutex lock failed" << std::endl; } uint8_t prefSdRaw = 0; - result = scratch::readNumber(scratch::PREFERED_SDC_KEY, prefSdRaw); - if (sdLock->unlockMutex() != returnvalue::OK) { - sif::error << "SdCardManager::SdCardManager: Mutex unlock failed" << std::endl; - } + ReturnValue_t result = scratch::readNumber(scratch::PREFERED_SDC_KEY, prefSdRaw); if (result != returnvalue::OK) { if (result == scratch::KEY_NOT_FOUND) { @@ -37,14 +37,16 @@ SdCardManager::SdCardManager() : SystemObject(objects::SDC_MANAGER), cmdExecutor "Preferred SD card not set. Setting to 0" << std::endl; setPreferredSdCard(sd::SdCard::SLOT_0); - sdInfo.pref = sd::SdCard::SLOT_0; + scratch::writeNumber(scratch::PREFERED_SDC_KEY, static_cast(sd::SdCard::SLOT_0)); + prefSdRaw = sd::SdCard::SLOT_0; + } else { // Should not happen. // TODO: Maybe trigger event? sif::error << "SdCardManager::SdCardManager: Reading preferred SD card from scratch" "buffer failed" << std::endl; - sdInfo.pref = sd::SdCard::SLOT_0; + prefSdRaw = sd::SdCard::SLOT_0; } } sdInfo.pref = static_cast(prefSdRaw); @@ -195,7 +197,7 @@ ReturnValue_t SdCardManager::setSdCardState(sd::SdCard sdCard, bool on) { ReturnValue_t SdCardManager::getSdCardsStatus(SdStatePair& active) { using namespace std; - MutexGuard mg(sdLock, LOCK_TYPE, LOCK_TIMEOUT, LOCK_CTX); + MutexGuard mg(sdLock, LOCK_TYPE, SD_LOCK_TIMEOUT, LOCK_CTX); if (not filesystem::exists(SD_STATE_FILE)) { return STATUS_FILE_NEXISTS; } @@ -378,7 +380,7 @@ void SdCardManager::processSdStatusLine(std::pair& act } std::optional SdCardManager::getPreferredSdCard() const { - MutexGuard mg(sdLock, LOCK_TYPE, LOCK_TIMEOUT, LOCK_CTX); + MutexGuard mg(prefLock, LOCK_TYPE, OTHER_TIMEOUT, LOCK_CTX); auto res = mg.getLockResult(); if (res != returnvalue::OK) { sif::error << "SdCardManager::getPreferredSdCard: Lock error" << std::endl; @@ -387,7 +389,7 @@ std::optional SdCardManager::getPreferredSdCard() const { } ReturnValue_t SdCardManager::setPreferredSdCard(sd::SdCard sdCard) { - MutexGuard mg(sdLock, LOCK_TYPE, LOCK_TIMEOUT, LOCK_CTX); + MutexGuard mg(prefLock, LOCK_TYPE, OTHER_TIMEOUT, LOCK_CTX); if (sdCard == sd::SdCard::BOTH) { return returnvalue::FAILED; } @@ -399,7 +401,7 @@ ReturnValue_t SdCardManager::updateSdCardStateFile() { if (cmdExecutor.getCurrentState() == CommandExecutor::States::PENDING) { return CommandExecutor::COMMAND_PENDING; } - MutexGuard mg(sdLock, LOCK_TYPE, LOCK_TIMEOUT, LOCK_CTX); + MutexGuard mg(sdLock, LOCK_TYPE, SD_LOCK_TIMEOUT, LOCK_CTX); // Use q7hw utility and pipe the command output into the state file std::string updateCmd = "q7hw sd info all > " + std::string(SD_STATE_FILE); cmdExecutor.load(updateCmd, blocking, printCmdOutput); @@ -411,7 +413,7 @@ ReturnValue_t SdCardManager::updateSdCardStateFile() { } const char* SdCardManager::getCurrentMountPrefix() const { - MutexGuard mg(sdLock, LOCK_TYPE, LOCK_TIMEOUT, LOCK_CTX); + MutexGuard mg(defaultLock, LOCK_TYPE, OTHER_TIMEOUT, LOCK_CTX); if (currentPrefix.has_value()) { return currentPrefix.value().c_str(); } @@ -464,7 +466,7 @@ void SdCardManager::setPrintCommandOutput(bool print) { this->printCmdOutput = p bool SdCardManager::isSdCardUsable(std::optional sdCard) { { - MutexGuard mg(sdLock, LOCK_TYPE, LOCK_TIMEOUT, LOCK_CTX); + MutexGuard mg(defaultLock, LOCK_TYPE, OTHER_TIMEOUT, LOCK_CTX); if (markedUnusable) { return false; } @@ -560,7 +562,7 @@ ReturnValue_t SdCardManager::performFsck(sd::SdCard sdcard, bool printOutput, in } void SdCardManager::setActiveSdCard(sd::SdCard sdCard) { - MutexGuard mg(sdLock, LOCK_TYPE, LOCK_TIMEOUT, LOCK_CTX); + MutexGuard mg(defaultLock, LOCK_TYPE, OTHER_TIMEOUT, LOCK_CTX); sdInfo.active = sdCard; if (sdInfo.active == sd::SdCard::SLOT_0) { currentPrefix = config::SD_0_MOUNT_POINT; @@ -570,7 +572,7 @@ void SdCardManager::setActiveSdCard(sd::SdCard sdCard) { } std::optional SdCardManager::getActiveSdCard() const { - MutexGuard mg(sdLock, LOCK_TYPE, LOCK_TIMEOUT, LOCK_CTX); + MutexGuard mg(defaultLock, LOCK_TYPE, OTHER_TIMEOUT, LOCK_CTX); if (markedUnusable) { return std::nullopt; } @@ -578,6 +580,6 @@ std::optional SdCardManager::getActiveSdCard() const { } void SdCardManager::markUnusable() { - MutexGuard mg(sdLock, LOCK_TYPE, LOCK_TIMEOUT, LOCK_CTX); + MutexGuard mg(defaultLock, LOCK_TYPE, OTHER_TIMEOUT, LOCK_CTX); markedUnusable = true; } diff --git a/bsp_q7s/fs/SdCardManager.h b/bsp_q7s/fs/SdCardManager.h index e489e6e7..1cd09d7d 100644 --- a/bsp_q7s/fs/SdCardManager.h +++ b/bsp_q7s/fs/SdCardManager.h @@ -224,8 +224,11 @@ class SdCardManager : public SystemObject, public SdCardMountedIF { bool printCmdOutput = true; bool markedUnusable = false; MutexIF* sdLock = nullptr; + MutexIF* prefLock = nullptr; + MutexIF* defaultLock = nullptr; static constexpr MutexIF::TimeoutType LOCK_TYPE = MutexIF::TimeoutType::WAITING; - static constexpr uint32_t LOCK_TIMEOUT = 200; + static constexpr uint32_t SD_LOCK_TIMEOUT = 250; + static constexpr uint32_t OTHER_TIMEOUT = 20; static constexpr char LOCK_CTX[] = "SdCardManager"; SdCardManager(); From 01e97c8381415bafe21292ab153aa2a4cd7f4ddc Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Mar 2023 01:21:18 +0100 Subject: [PATCH 19/20] OFF -> NORMAL transition works now --- fsfw | 2 +- .../startracker/StarTrackerHandler.cpp | 82 ++++++++++++------- .../devices/startracker/StarTrackerHandler.h | 46 +++++++---- 3 files changed, 83 insertions(+), 47 deletions(-) diff --git a/fsfw b/fsfw index 7f6ba5f4..1b7493f9 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 7f6ba5f40b47bc32802efdc4ed41b4bad4b8071b +Subproject commit 1b7493f945302b3785ceba6e7a34a727e3898a13 diff --git a/linux/devices/startracker/StarTrackerHandler.cpp b/linux/devices/startracker/StarTrackerHandler.cpp index 749607c1..ef88ea67 100644 --- a/linux/devices/startracker/StarTrackerHandler.cpp +++ b/linux/devices/startracker/StarTrackerHandler.cpp @@ -3,7 +3,9 @@ #include #include +#include #include +#include #include "OBSWConfig.h" #include "StarTrackerJsonCommands.h" @@ -15,6 +17,8 @@ extern "C" { #include "common/misc.h" } +std::atomic_bool JCFG_DONE(false); + StarTrackerHandler::StarTrackerHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, const char* jsonFileStr, StrHelper* strHelper, power::Switch_t powerSwitch) @@ -62,23 +66,10 @@ ReturnValue_t StarTrackerHandler::initialize() { return result; } - // TODO: This takes 200-250ms. Move it into a separate thread, use a mutexed boolean - // to check whether init was done. Or move it into the helper class.. - // Also move update of these classes into the helper class. - tracking.init(paramJsonFile); - logLevel.init(paramJsonFile); - logSubscription.init(paramJsonFile); - debugCamera.init(paramJsonFile); - algo.init(paramJsonFile); - validation.init(paramJsonFile); - matching.init(paramJsonFile); - lisa.init(paramJsonFile); - centroiding.init(paramJsonFile); - camera.init(paramJsonFile); - imageProcessor.init(paramJsonFile); - mounting.init(paramJsonFile); - limits.init(paramJsonFile); - subscription.init(paramJsonFile); + // Spin up a thread to do the JSON initialization, takes 200-250 ms which would + // delay whole satellite boot process. + jcfgCountdown.resetTimer(); + jsonCfgTask = std::thread{setUpJsonCfgs, std::ref(jcfgs), paramJsonFile.c_str()}; EventManagerIF* manager = ObjectManager::instance()->get(objects::EVENT_MANAGER); if (manager == nullptr) { @@ -261,8 +252,19 @@ void StarTrackerHandler::doStartUp() { // the device handler's submode to the star tracker's mode return; case StartupState::DONE: + if (jcfgCountdown.isBusy()) { + startupState = StartupState::WAIT_JCFG; + return; + } startupState = StartupState::IDLE; break; + case StartupState::WAIT_JCFG: { + if (jcfgCountdown.hasTimedOut()) { + startupState = StartupState::IDLE; + break; + } + return; + } default: return; } @@ -440,7 +442,7 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi return returnvalue::OK; } case (startracker::SUBSCRIPTION): { - result = prepareParamCommand(commandData, commandDataLen, subscription); + result = prepareParamCommand(commandData, commandDataLen, jcfgs.subscription); return returnvalue::OK; } case (startracker::REQ_SOLUTION): { @@ -456,55 +458,55 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi return returnvalue::OK; } case (startracker::LIMITS): { - result = prepareParamCommand(commandData, commandDataLen, limits); + result = prepareParamCommand(commandData, commandDataLen, jcfgs.limits); return result; } case (startracker::MOUNTING): { - result = prepareParamCommand(commandData, commandDataLen, mounting); + result = prepareParamCommand(commandData, commandDataLen, jcfgs.mounting); return result; } case (startracker::IMAGE_PROCESSOR): { - result = prepareParamCommand(commandData, commandDataLen, imageProcessor); + result = prepareParamCommand(commandData, commandDataLen, jcfgs.imageProcessor); return result; } case (startracker::CAMERA): { - result = prepareParamCommand(commandData, commandDataLen, camera); + result = prepareParamCommand(commandData, commandDataLen, jcfgs.camera); return result; } case (startracker::CENTROIDING): { - result = prepareParamCommand(commandData, commandDataLen, centroiding); + result = prepareParamCommand(commandData, commandDataLen, jcfgs.centroiding); return result; } case (startracker::LISA): { - result = prepareParamCommand(commandData, commandDataLen, lisa); + result = prepareParamCommand(commandData, commandDataLen, jcfgs.lisa); return result; } case (startracker::MATCHING): { - result = prepareParamCommand(commandData, commandDataLen, matching); + result = prepareParamCommand(commandData, commandDataLen, jcfgs.matching); return result; } case (startracker::VALIDATION): { - result = prepareParamCommand(commandData, commandDataLen, validation); + result = prepareParamCommand(commandData, commandDataLen, jcfgs.validation); return result; } case (startracker::ALGO): { - result = prepareParamCommand(commandData, commandDataLen, algo); + result = prepareParamCommand(commandData, commandDataLen, jcfgs.algo); return result; } case (startracker::TRACKING): { - result = prepareParamCommand(commandData, commandDataLen, tracking); + result = prepareParamCommand(commandData, commandDataLen, jcfgs.tracking); return result; } case (startracker::LOGLEVEL): { - result = prepareParamCommand(commandData, commandDataLen, logLevel); + result = prepareParamCommand(commandData, commandDataLen, jcfgs.logLevel); return result; } case (startracker::LOGSUBSCRIPTION): { - result = prepareParamCommand(commandData, commandDataLen, logSubscription); + result = prepareParamCommand(commandData, commandDataLen, jcfgs.logSubscription); return result; } case (startracker::DEBUG_CAMERA): { - result = prepareParamCommand(commandData, commandDataLen, debugCamera); + result = prepareParamCommand(commandData, commandDataLen, jcfgs.debugCamera); return result; } case (startracker::CHECKSUM): { @@ -753,6 +755,24 @@ void StarTrackerHandler::bootFirmware(Mode_t toMode) { } } +void StarTrackerHandler::setUpJsonCfgs(JsonConfigs& cfgs, const char* paramJsonFile) { + cfgs.tracking.init(paramJsonFile); + cfgs.logLevel.init(paramJsonFile); + cfgs.logSubscription.init(paramJsonFile); + cfgs.debugCamera.init(paramJsonFile); + cfgs.algo.init(paramJsonFile); + cfgs.validation.init(paramJsonFile); + cfgs.matching.init(paramJsonFile); + cfgs.lisa.init(paramJsonFile); + cfgs.centroiding.init(paramJsonFile); + cfgs.camera.init(paramJsonFile); + cfgs.imageProcessor.init(paramJsonFile); + cfgs.mounting.init(paramJsonFile); + cfgs.limits.init(paramJsonFile); + cfgs.subscription.init(paramJsonFile); + JCFG_DONE = true; +} + void StarTrackerHandler::bootBootloader() { if (internalState == InternalState::IDLE) { internalState = InternalState::BOOT_BOOTLOADER; diff --git a/linux/devices/startracker/StarTrackerHandler.h b/linux/devices/startracker/StarTrackerHandler.h index 09088cbb..11cf7fc3 100644 --- a/linux/devices/startracker/StarTrackerHandler.h +++ b/linux/devices/startracker/StarTrackerHandler.h @@ -4,6 +4,8 @@ #include #include +#include + #include "ArcsecDatalinkLayer.h" #include "ArcsecJsonParamBase.h" #include "OBSWConfig.h" @@ -217,20 +219,27 @@ class StarTrackerHandler : public DeviceHandlerBase { // Loading firmware requires some time and the command will not trigger a reply when executed Countdown bootCountdown; - Tracking tracking; - LogLevel logLevel; - LogSubscription logSubscription; - DebugCamera debugCamera; - Algo algo; - Validation validation; - Matching matching; - Lisa lisa; - Centroiding centroiding; - Camera camera; - ImageProcessor imageProcessor; - Mounting mounting; - Limits limits; - Subscription subscription; + struct JsonConfigs { + Tracking tracking; + LogLevel logLevel; + LogSubscription logSubscription; + DebugCamera debugCamera; + Algo algo; + Validation validation; + Matching matching; + Lisa lisa; + Centroiding centroiding; + Camera camera; + ImageProcessor imageProcessor; + Mounting mounting; + Limits limits; + Subscription subscription; + }; + JsonConfigs jcfgs; + Countdown jcfgCountdown = Countdown(250); + bool commandExecuted = false; + std::thread jsonCfgTask; + static void setUpJsonCfgs(JsonConfigs& cfgs, const char* paramJsonFile); std::string paramJsonFile; @@ -270,7 +279,14 @@ class StarTrackerHandler : public DeviceHandlerBase { InternalState internalState = InternalState::IDLE; - enum class StartupState { IDLE, CHECK_PROGRAM, WAIT_CHECK_PROGRAM, BOOT_BOOTLOADER, DONE }; + enum class StartupState { + IDLE, + CHECK_PROGRAM, + WAIT_CHECK_PROGRAM, + BOOT_BOOTLOADER, + WAIT_JCFG, + DONE + }; StartupState startupState = StartupState::IDLE; From 68f4323d14fff000c94323e1ec0f6e3e6e236a17 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Mar 2023 01:24:41 +0100 Subject: [PATCH 20/20] changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff9b3511..b0e04a6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,11 @@ will consitute of a breaking change warranting a new major release: ## Fixed +- Star Tracker: OFF to NORMAL transition now posssible. Requires FSFW bump which sets + transition source modes properly for those transitions. + FSFW PR: https://egit.irs.uni-stuttgart.de/eive/fsfw/pulls/131 +- Star Tracker JSON initialization is now done during object initization instead of redoing it + when building a command. This avoids missed deadlines issues in the ACS PST. - Allow arbitrary submodes for dual lane boards to avoid FDIR reactions of subsystem components. Bump FSFW to allow this. - PUS 15 was not scheduled