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
4 changed files with 8 additions and 5 deletions
Showing only changes of commit cda2a9df33 - Show all commits

View File

@ -69,7 +69,8 @@ void Igrf13Model::magFieldComp(const double longitude, const double gcLatitude,
magFieldModel[1] *= -1; magFieldModel[1] *= -1;
magFieldModel[2] *= (-1 / sin(theta)); magFieldModel[2] *= (-1 / sin(theta));
double JD2000 = TimeSystems::convertUnixToJD2000(timeOfMagMeasurement); double JD2000 = 0;
Clock::convertTimevalToJD2000(timeOfMagMeasurement, &JD2000);
double UT1 = JD2000 / 36525.; double UT1 = JD2000 / 36525.;
double gst = double gst =
@ -93,7 +94,8 @@ void Igrf13Model::magFieldComp(const double longitude, const double gcLatitude,
void Igrf13Model::updateCoeffGH(timeval timeOfMagMeasurement) { void Igrf13Model::updateCoeffGH(timeval timeOfMagMeasurement) {
double JD2000Igrf = (2458850.0 - 2451545); // Begin of IGRF-13 (2020-01-01,00:00:00) in JD2000 double JD2000Igrf = (2458850.0 - 2451545); // Begin of IGRF-13 (2020-01-01,00:00:00) in JD2000
double JD2000 = TimeSystems::convertUnixToJD2000(timeOfMagMeasurement); double JD2000 = 0;
Clock::convertTimevalToJD2000(timeOfMagMeasurement, &JD2000);
double days = ceil(JD2000 - JD2000Igrf); double days = ceil(JD2000 - JD2000Igrf);
for (int i = 0; i <= igrfOrder; i++) { for (int i = 0; i <= igrfOrder; i++) {
for (int j = 0; j <= (igrfOrder - 1); j++) { for (int j = 0; j <= (igrfOrder - 1); j++) {

View File

@ -16,11 +16,11 @@
#ifndef IGRF13MODEL_H_ #ifndef IGRF13MODEL_H_
#define IGRF13MODEL_H_ #define IGRF13MODEL_H_
#include <fsfw/src/fsfw/globalfunctions/TimeSystems.h>
#include <fsfw/src/fsfw/globalfunctions/constants.h> #include <fsfw/src/fsfw/globalfunctions/constants.h>
#include <fsfw/src/fsfw/globalfunctions/math/MatrixOperations.h> #include <fsfw/src/fsfw/globalfunctions/math/MatrixOperations.h>
#include <fsfw/src/fsfw/globalfunctions/math/QuaternionOperations.h> #include <fsfw/src/fsfw/globalfunctions/math/QuaternionOperations.h>
#include <fsfw/src/fsfw/globalfunctions/math/VectorOperations.h> #include <fsfw/src/fsfw/globalfunctions/math/VectorOperations.h>
#include <fsfw/src/fsfw/timemanager/Clock.h>
#include <cmath> #include <cmath>

View File

@ -180,7 +180,8 @@ void SensorProcessing::processSus(
const AcsParameters::SunModelParameters *sunModelParameters, const AcsParameters::SunModelParameters *sunModelParameters,
acsctrl::SusDataProcessed *susDataProcessed) { acsctrl::SusDataProcessed *susDataProcessed) {
/* -------- Sun Model Direction (IJK frame) ------- */ /* -------- Sun Model Direction (IJK frame) ------- */
double JD2000 = TimeSystems::convertUnixToJD2000(timeAbsolute); double JD2000 = 0;
Clock::convertTimevalToJD2000(timeAbsolute, &JD2000);
// Julean Centuries // Julean Centuries
double sunIjkModel[3] = {0.0, 0.0, 0.0}; double sunIjkModel[3] = {0.0, 0.0, 0.0};

View File

@ -4,13 +4,13 @@
#include <common/config/eive/resultClassIds.h> #include <common/config/eive/resultClassIds.h>
#include <fsfw/coordinates/CoordinateTransformations.h> #include <fsfw/coordinates/CoordinateTransformations.h>
#include <fsfw/datapool/PoolReadGuard.h> #include <fsfw/datapool/PoolReadGuard.h>
#include <fsfw/globalfunctions/TimeSystems.h>
#include <fsfw/globalfunctions/constants.h> #include <fsfw/globalfunctions/constants.h>
#include <fsfw/globalfunctions/math/MatrixOperations.h> #include <fsfw/globalfunctions/math/MatrixOperations.h>
#include <fsfw/globalfunctions/math/QuaternionOperations.h> #include <fsfw/globalfunctions/math/QuaternionOperations.h>
#include <fsfw/globalfunctions/math/VectorOperations.h> #include <fsfw/globalfunctions/math/VectorOperations.h>
#include <fsfw/globalfunctions/timevalOperations.h> #include <fsfw/globalfunctions/timevalOperations.h>
#include <fsfw/returnvalues/returnvalue.h> #include <fsfw/returnvalues/returnvalue.h>
#include <fsfw/timemanager/Clock.h>
#include <mission/acs/defs.h> #include <mission/acs/defs.h>
#include <mission/controller/acs/AcsParameters.h> #include <mission/controller/acs/AcsParameters.h>
#include <mission/controller/acs/Igrf13Model.h> #include <mission/controller/acs/Igrf13Model.h>