Fix NaN for Limiting Rotation Rates #872

Merged
meggert merged 17 commits from limit-rot-rate-fix into main 2024-03-06 11:13:02 +01:00
2 changed files with 5 additions and 1 deletions
Showing only changes of commit 7efd48c695 - Show all commits

View File

@ -79,7 +79,6 @@ CoreController::CoreController(object_id_t objectId, bool enableHkSet)
} catch (const std::filesystem::filesystem_error &e) { } catch (const std::filesystem::filesystem_error &e) {
sif::error << "CoreController::CoreController: Failed with exception " << e.what() << std::endl; sif::error << "CoreController::CoreController: Failed with exception " << e.what() << std::endl;
} }
initLeapSeconds();
// Add script folder to path // Add script folder to path

shouldn't this be inside the function above? If this is done, the default value setting needs to be moved to constructor/initialize function so it is always executed..

shouldn't this be inside the function above? If this is done, the default value setting needs to be moved to constructor/initialize function so it is always executed..

the function will initialize the leap seconds, no matter what. it could be up there yes, but a try catch for a function that will definitely do what it needs to be doing seemed unnecessary

the function will initialize the leap seconds, no matter what. it could be up there yes, but a try catch for a function that will definitely do what it needs to be doing seemed unnecessary
char *currentEnvPath = getenv("PATH"); char *currentEnvPath = getenv("PATH");
std::string updatedEnvPath = std::string(currentEnvPath) + ":/home/root/scripts:/usr/local/bin"; std::string updatedEnvPath = std::string(currentEnvPath) + ":/home/root/scripts:/usr/local/bin";
@ -1422,6 +1421,9 @@ void CoreController::performMountedSdCardOperations() {
if (not timeFileInitDone) { if (not timeFileInitDone) {
initClockFromTimeFile(); initClockFromTimeFile();
} }
if (not leapSecondsInitDone) {
initLeapSeconds();
}
performRebootWatchdogHandling(false); performRebootWatchdogHandling(false);
performRebootCountersHandling(false); performRebootCountersHandling(false);
} }
@ -2083,6 +2085,7 @@ void CoreController::initLeapSeconds() {
Clock::setLeapSeconds(config::LEAP_SECONDS); Clock::setLeapSeconds(config::LEAP_SECONDS);
writeLeapSecondsToFile(config::LEAP_SECONDS); writeLeapSecondsToFile(config::LEAP_SECONDS);
} }
leapSecondsInitDone = true;
} }
ReturnValue_t CoreController::initLeapSecondsFromFile() { ReturnValue_t CoreController::initLeapSecondsFromFile() {

View File

@ -298,6 +298,7 @@ class CoreController : public ExtendedControllerBase, public ReceivesParameterMe
std::string currMntPrefix; std::string currMntPrefix;
bool timeFileInitDone = false; bool timeFileInitDone = false;
bool leapSecondsInitDone = false;
bool performOneShotSdCardOpsSwitch = false; bool performOneShotSdCardOpsSwitch = false;
uint8_t shortSdCardCdCounter = 0; uint8_t shortSdCardCdCounter = 0;
#if OBSW_THREAD_TRACING == 1 #if OBSW_THREAD_TRACING == 1