From 0466622a16c8eec8478384f895143027e0d9d6ed Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 22 Feb 2023 18:07:15 +0100 Subject: [PATCH 1/2] tweaks for ACS scheduling --- bsp_q7s/core/scheduling.cpp | 2 +- common/config/eive/definitions.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index 3c3695dd..db6f3c91 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -404,7 +404,7 @@ void scheduling::createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction #ifdef RELEASE_BUILD static constexpr float acsPstPeriod = 0.4; #else - static constexpr float acsPstPeriod = 0.8; + static constexpr float acsPstPeriod = 0.4; #endif FixedTimeslotTaskIF* acsTcsPst = factory.createFixedTimeslotTask( "ACS_TCS_PST", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, acsPstPeriod, missedDeadlineFunc); diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index c87c89ff..edeb3765 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -62,7 +62,8 @@ static constexpr uint32_t SCHED_BLOCK_2_SENSOR_READ_MS = 30; static constexpr uint32_t SCHED_BLOCK_3_READ_IMTQ_MGM_MS = 42; static constexpr uint32_t SCHED_BLOCK_4_ACS_CTRL_MS = 45; static constexpr uint32_t SCHED_BLOCK_5_ACTUATOR_MS = 50; -static constexpr uint32_t SCHED_BLOCK_6_IMTQ_BLOCK_2_MS = 75; +static constexpr uint32_t SCHED_BLOCK_6_IMTQ_BLOCK_2_MS = 90; +static constexpr uint32_t SCHED_BLOCK_RTD = 150; static constexpr uint32_t SCHED_BLOCK_7_RW_READ_MS = 300; // 15 ms for FM @@ -76,6 +77,7 @@ static constexpr float SCHED_BLOCK_5_PERIOD = static_cast(SCHED_BLOCK_5_A static constexpr float SCHED_BLOCK_6_PERIOD = static_cast(SCHED_BLOCK_6_IMTQ_BLOCK_2_MS) / 400.0; static constexpr float SCHED_BLOCK_7_PERIOD = static_cast(SCHED_BLOCK_7_RW_READ_MS) / 400.0; +static constexpr float SCHED_BLOCK_RTD_PERIOD = static_cast(SCHED_BLOCK_RTD) / 400.0; } // namespace acs From bd60255220ab958a67fa971bf1329dab5d2b6ac4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 23 Feb 2023 11:57:12 +0100 Subject: [PATCH 2/2] interior structure changes, use new sched block --- CHANGELOG.md | 2 ++ bsp_q7s/core/scheduling.cpp | 2 +- bsp_q7s/core/scheduling.h | 3 +-- fsfw | 2 +- linux/devices/CMakeLists.txt | 5 +++-- linux/fsfwconfig/CMakeLists.txt | 3 +-- mission/controller/acs/Guidance.cpp | 3 +-- mission/controller/acs/MultiplicativeKalmanFilter.cpp | 7 +++---- mission/core/CMakeLists.txt | 3 ++- .../core/pollingSeqTables.cpp | 4 ++-- .../core/pollingSeqTables.h | 0 mission/devices/ImtqHandler.cpp | 2 +- mission/tmtc/CfdpTmFunnel.cpp | 2 +- mission/tmtc/PusTmFunnel.cpp | 2 +- mission/tmtc/VirtualChannel.cpp | 2 +- 15 files changed, 21 insertions(+), 21 deletions(-) rename linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp => mission/core/pollingSeqTables.cpp (99%) rename linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h => mission/core/pollingSeqTables.h (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a29477a..2fdfa306 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,8 @@ will consitute of a breaking change warranting a new major release: - All `targetQuat` functions in `Guidance` now return the target quaternion (target in ECI frame), which is passed on to `CtrlValData`. +- Moved polling sequence table definitions and source code to `mission/core` folder. + PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/395 ## Added diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index db6f3c91..6dc7fceb 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -17,10 +17,10 @@ #include "fsfw/tasks/FixedTimeslotTaskIF.h" #include "fsfw/tasks/PeriodicTaskIF.h" #include "fsfw/tasks/TaskFactory.h" +#include "mission/core/pollingSeqTables.h" #include "mission/core/scheduling.h" #include "mission/devices/devicedefinitions/Max31865Definitions.h" #include "mission/utility/InitMission.h" -#include "pollingsequence/pollingSequenceFactory.h" /* This is configured for linux without CR */ #ifdef PLATFORM_UNIX diff --git a/bsp_q7s/core/scheduling.h b/bsp_q7s/core/scheduling.h index 2241e683..e49ce036 100644 --- a/bsp_q7s/core/scheduling.h +++ b/bsp_q7s/core/scheduling.h @@ -1,11 +1,10 @@ #ifndef BSP_Q7S_INITMISSION_H_ #define BSP_Q7S_INITMISSION_H_ -#include - #include #include "fsfw/tasks/definitions.h" +#include "mission/core/pollingSeqTables.h" using pst::AcsPstCfg; diff --git a/fsfw b/fsfw index 2efff4d2..bd208038 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 2efff4d2c5ef82b5b62567ab1bb0ee53aeed6a5a +Subproject commit bd208038dd85a94dce8c763397ad5ac7eae76402 diff --git a/linux/devices/CMakeLists.txt b/linux/devices/CMakeLists.txt index 17d842ea..22b39840 100644 --- a/linux/devices/CMakeLists.txt +++ b/linux/devices/CMakeLists.txt @@ -3,8 +3,9 @@ if(EIVE_BUILD_GPSD_GPS_HANDLER) endif() target_sources( - ${OBSW_NAME} PRIVATE Max31865RtdPolling.cpp ScexUartReader.cpp ImtqPollingTask.cpp - ScexDleParser.cpp ScexHelper.cpp RwPollingTask.cpp) + ${OBSW_NAME} + PRIVATE Max31865RtdPolling.cpp ScexUartReader.cpp ImtqPollingTask.cpp + ScexDleParser.cpp ScexHelper.cpp RwPollingTask.cpp) add_subdirectory(ploc) diff --git a/linux/fsfwconfig/CMakeLists.txt b/linux/fsfwconfig/CMakeLists.txt index bfede452..d5b5e7e5 100644 --- a/linux/fsfwconfig/CMakeLists.txt +++ b/linux/fsfwconfig/CMakeLists.txt @@ -1,5 +1,4 @@ -target_sources(${OBSW_NAME} PRIVATE ipc/MissionMessageTypes.cpp - pollingsequence/pollingSequenceFactory.cpp) +target_sources(${OBSW_NAME} PRIVATE ipc/MissionMessageTypes.cpp) target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index 2346d18f..031cd384 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -111,8 +111,7 @@ void Guidance::targetQuatPtgSingleAxis(timeval now, double posSatE[3], double ve if (sightAngleSun < critSightAngle) { strBlindAvoidFlag = true; } - } - else { + } else { if (sightAngleSun < blindEnd * exclAngle) { double normBlindRefRate = acsParameters.targetModeControllerParameters.blindRotRate; double blindRefRate[3] = {0, 0, 0}; diff --git a/mission/controller/acs/MultiplicativeKalmanFilter.cpp b/mission/controller/acs/MultiplicativeKalmanFilter.cpp index d90f3f51..5bae4624 100644 --- a/mission/controller/acs/MultiplicativeKalmanFilter.cpp +++ b/mission/controller/acs/MultiplicativeKalmanFilter.cpp @@ -1098,7 +1098,7 @@ void MultiplicativeKalmanFilter::reset(acsctrl::MekfData *mekfData) { } void MultiplicativeKalmanFilter::updateDataSetWithoutData(acsctrl::MekfData *mekfData, - MekfStatus mekfStatus) { + MekfStatus mekfStatus) { { PoolReadGuard pg(mekfData); if (pg.getReadResult() == returnvalue::OK) { @@ -1114,9 +1114,8 @@ void MultiplicativeKalmanFilter::updateDataSetWithoutData(acsctrl::MekfData *mek } } -void MultiplicativeKalmanFilter::updateDataSet(acsctrl::MekfData *mekfData, - MekfStatus mekfStatus, double quat[4], - double satRotRate[3]) { +void MultiplicativeKalmanFilter::updateDataSet(acsctrl::MekfData *mekfData, MekfStatus mekfStatus, + double quat[4], double satRotRate[3]) { { PoolReadGuard pg(mekfData); if (pg.getReadResult() == returnvalue::OK) { diff --git a/mission/core/CMakeLists.txt b/mission/core/CMakeLists.txt index fc6e1cff..ce731219 100644 --- a/mission/core/CMakeLists.txt +++ b/mission/core/CMakeLists.txt @@ -1 +1,2 @@ -target_sources(${LIB_EIVE_MISSION} PRIVATE GenericFactory.cpp scheduling.cpp) +target_sources(${LIB_EIVE_MISSION} PRIVATE GenericFactory.cpp scheduling.cpp + pollingSeqTables.cpp) diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/mission/core/pollingSeqTables.cpp similarity index 99% rename from linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp rename to mission/core/pollingSeqTables.cpp index 1f3e65de..0b134d87 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/mission/core/pollingSeqTables.cpp @@ -1,4 +1,4 @@ -#include "pollingSequenceFactory.h" +#include "pollingSeqTables.h" #include #include @@ -659,7 +659,7 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg DeviceHandlerIF::GET_READ); } - thisSequence->addSlot(objects::SPI_RTD_COM_IF, length * 0.5, 0); + thisSequence->addSlot(objects::SPI_RTD_COM_IF, length * config::acs::SCHED_BLOCK_RTD_PERIOD, 0); return returnvalue::OK; } diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h b/mission/core/pollingSeqTables.h similarity index 100% rename from linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h rename to mission/core/pollingSeqTables.h diff --git a/mission/devices/ImtqHandler.cpp b/mission/devices/ImtqHandler.cpp index 18c002c4..aa935ce5 100644 --- a/mission/devices/ImtqHandler.cpp +++ b/mission/devices/ImtqHandler.cpp @@ -256,7 +256,7 @@ ReturnValue_t ImtqHandler::scanForReply(const uint8_t* start, size_t remainingSi ReturnValue_t ImtqHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8_t* packet) { ReturnValue_t result; ReturnValue_t status = returnvalue::OK; - if(getMode() != MODE_NORMAL) { + if (getMode() != MODE_NORMAL) { // Ignore replies during transitions. return returnvalue::OK; } diff --git a/mission/tmtc/CfdpTmFunnel.cpp b/mission/tmtc/CfdpTmFunnel.cpp index 779e9aa8..32dba7fe 100644 --- a/mission/tmtc/CfdpTmFunnel.cpp +++ b/mission/tmtc/CfdpTmFunnel.cpp @@ -21,7 +21,7 @@ ReturnValue_t CfdpTmFunnel::performOperation(uint8_t) { break; } count++; - if(count == 500) { + if (count == 500) { sif::error << "CfdpTmFunnel: Possible message storm detected" << std::endl; break; } diff --git a/mission/tmtc/PusTmFunnel.cpp b/mission/tmtc/PusTmFunnel.cpp index e239afc9..974cdca0 100644 --- a/mission/tmtc/PusTmFunnel.cpp +++ b/mission/tmtc/PusTmFunnel.cpp @@ -21,7 +21,7 @@ ReturnValue_t PusTmFunnel::performOperation(uint8_t) { break; } count++; - if(count == 500) { + if (count == 500) { sif::error << "PusTmFunnel: Possible message storm detected" << std::endl; break; } diff --git a/mission/tmtc/VirtualChannel.cpp b/mission/tmtc/VirtualChannel.cpp index 64c7b006..6a24cc09 100644 --- a/mission/tmtc/VirtualChannel.cpp +++ b/mission/tmtc/VirtualChannel.cpp @@ -50,7 +50,7 @@ ReturnValue_t VirtualChannel::performOperation() { } count++; - if(count == 500) { + if (count == 500) { sif::error << "VirtualChannel: Possible message storm detected" << std::endl; break; }