first version of safe mode solar vector for leop
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
Marius Eggert 2023-01-12 14:49:37 +01:00
parent 4090941c3e
commit 5e557d2d46
2 changed files with 14 additions and 9 deletions

View File

@ -13,6 +13,8 @@
#include <fsfw/globalfunctions/math/VectorOperations.h> #include <fsfw/globalfunctions/math/VectorOperations.h>
#include <math.h> #include <math.h>
#include <filesystem>
#include "string.h" #include "string.h"
#include "util/CholeskyDecomposition.h" #include "util/CholeskyDecomposition.h"
#include "util/MathOperations.h" #include "util/MathOperations.h"
@ -22,16 +24,16 @@ Guidance::Guidance(AcsParameters *acsParameters_) { acsParameters = *acsParamete
Guidance::~Guidance() {} Guidance::~Guidance() {}
void Guidance::getTargetParamsSafe(double sunTargetSafe[3], double satRateSafe[3]) { void Guidance::getTargetParamsSafe(double sunTargetSafe[3], double satRateSafe[3]) {
for (int i = 0; i < 3; i++) { if (not std::filesystem::exists(SD_0_SKEWED_PTG_FILE) or
if (false) { // ToDo: if file does not exist anymore not std::filesystem::exists(SD_1_SKEWED_PTG_FILE)) { // ToDo: if file does not exist anymore
sunTargetSafe[i] = acsParameters.safeModeControllerParameters.sunTargetDir[i]; std::memcpy(sunTargetSafe, acsParameters.safeModeControllerParameters.sunTargetDir,
3 * sizeof(double));
} else { } else {
sunTargetSafe[i] = acsParameters.safeModeControllerParameters.sunTargetDirLeop[i]; std::memcpy(sunTargetSafe, acsParameters.safeModeControllerParameters.sunTargetDirLeop,
3 * sizeof(double));
} }
satRateSafe[i] = acsParameters.safeModeControllerParameters.satRateRef[i]; std::memcpy(satRateSafe, acsParameters.safeModeControllerParameters.satRateRef,
} 3 * sizeof(double));
// memcpy(sunTargetSafe, acsParameters.safeModeControllerParameters.sunTargetDir, 24);
} }
void Guidance::targetQuatPtgSingleAxis(ACS::SensorValues *sensorValues, acsctrl::MekfData *mekfData, void Guidance::targetQuatPtgSingleAxis(ACS::SensorValues *sensorValues, acsctrl::MekfData *mekfData,

View File

@ -73,6 +73,9 @@ class Guidance {
timeval timeSavedQuaternionNadir; timeval timeSavedQuaternionNadir;
double savedQuaternionNadir[4] = {0, 0, 0, 0}; double savedQuaternionNadir[4] = {0, 0, 0, 0};
double omegaRefSavedNadir[3] = {0, 0, 0}; double omegaRefSavedNadir[3] = {0, 0, 0};
static constexpr char SD_0_SKEWED_PTG_FILE[] = "/mnt/sd0/conf/deployment";
static constexpr char SD_1_SKEWED_PTG_FILE[] = "/mnt/sd1/conf/deployment";
}; };
#endif /* ACS_GUIDANCE_H_ */ #endif /* ACS_GUIDANCE_H_ */