From ffc7a5576332b008015887291fb51eed72494eda Mon Sep 17 00:00:00 2001 From: Robin Marquardt Date: Fri, 21 Oct 2022 14:23:31 +0200 Subject: [PATCH 001/330] added Gps Velocity Calculation --- mission/controller/acs/AcsParameters.h | 1 + mission/controller/acs/Guidance.cpp | 6 ++--- mission/controller/acs/OutputValues.h | 1 + mission/controller/acs/SensorProcessing.cpp | 28 +++++++++++++++++++-- mission/controller/acs/SensorProcessing.h | 10 ++++++-- 5 files changed, 39 insertions(+), 7 deletions(-) diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index 6c72d9e5..d5386909 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -833,6 +833,7 @@ class AcsParameters /*: public HasParametersIF*/ { } strParameters; struct GpsParameters { + double timeDiffVelocityMax = 30; //[s] } gpsParameters; struct GroundStationParameters { diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index f6ebee5f..d8bee4f5 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -111,9 +111,9 @@ void Guidance::targetQuatPtg(ACS::SensorValues *sensorValues, ACS::OutputValues // Calculation of reference rotation rate //------------------------------------------------------------------------------------- double velSatE[3] = {0, 0, 0}; - velSatE[0] = 0.0; // sensorValues->gps0Velocity[0]; - velSatE[1] = 0.0; // sensorValues->gps0Velocity[1]; - velSatE[2] = 0.0; // sensorValues->gps0Velocity[2]; + velSatE[0] = outputValues->gpsVelocity[0]; // sensorValues->gps0Velocity[0]; + velSatE[1] = outputValues->gpsVelocity[1]; // sensorValues->gps0Velocity[1]; + velSatE[2] = outputValues->gpsVelocity[2]; // sensorValues->gps0Velocity[2]; double velSatB[3] = {0, 0, 0}, velSatBPart1[3] = {0, 0, 0}, velSatBPart2[3] = {0, 0, 0}; // Velocity: v_B = dcm_BI * dcmIE * v_E + dcm_BI * DotDcm_IE * v_E MatrixOperations::multiply(*dcmBE, velSatE, velSatBPart1, 3, 3, 1); diff --git a/mission/controller/acs/OutputValues.h b/mission/controller/acs/OutputValues.h index c9fc71f1..0a4fb04f 100644 --- a/mission/controller/acs/OutputValues.h +++ b/mission/controller/acs/OutputValues.h @@ -44,6 +44,7 @@ public: double gcLatitude; // geocentric latitude, radian double gdLongitude; // Radian longitude + double gpsVelocity[3]; //earth fixed frame }; } diff --git a/mission/controller/acs/SensorProcessing.cpp b/mission/controller/acs/SensorProcessing.cpp index 998927f6..2b78a3e2 100644 --- a/mission/controller/acs/SensorProcessing.cpp +++ b/mission/controller/acs/SensorProcessing.cpp @@ -454,7 +454,9 @@ void SensorProcessing::processGyr( } void SensorProcessing::processGps(const double gps0latitude, const double gps0longitude, - const bool validGps, double *gcLatitude, double *gdLongitude) { + const double gps0altitude, const uint32_t gps0UnixSeconds, + const bool validGps, const AcsParameters::GpsParameters *gpsParameters, + double *gcLatitude, double *gdLongitude, double *gpsVelocityE) { // name to convert not process if (validGps) { // Transforming from Degree to Radians and calculation geocentric lattitude from geodetic @@ -464,6 +466,25 @@ void SensorProcessing::processGps(const double gps0latitude, const double gps0lo double factor = 1 - pow(eccentricityWgs84, 2); *gcLatitude = atan(factor * tan(latitudeRad)); validGcLatitude = true; + + // Calculation of the satellite velocity in earth fixed frame + double posSatE[3] = {0, 0, 0}, deltaDistance[3] = {0, 0, 0}; + // RADIANS OR DEGREE ? Function needs rad as input + MathOperations::cartesianFromLatLongAlt(gps0latitude, gps0longitude, gps0altitude, posSatE); + if (validSavedPosSatE && (gps0UnixSeconds - timeOfSavedPosSatE) < (gpsParameters->timeDiffVelocityMax)) { + VectorOperations::subtract(posSatE, savedPosSatE, deltaDistance, 3); + double timeDiffGpsMeas = gps0UnixSeconds - timeOfSavedPosSatE; + VectorOperations::mulScalar(deltaDistance, 1/timeDiffGpsMeas, gpsVelocityE, 3); + } + savedPosSatE[0] = posSatE[0]; + savedPosSatE[1] = posSatE[1]; + savedPosSatE[2] = posSatE[2]; + + timeOfSavedPosSatE = gps0UnixSeconds; + validSavedPosSatE = true; + } + else { + validGcLatitude = false; } } @@ -472,7 +493,10 @@ void SensorProcessing::process(timeval now, ACS::SensorValues *sensorValues, const AcsParameters *acsParameters) { sensorValues->update(); processGps(sensorValues->gpsSet.latitude.value, sensorValues->gpsSet.longitude.value, - sensorValues->gpsSet.isValid(), &outputValues->gcLatitude, &outputValues->gdLongitude); + sensorValues->gpsSet.altitude.value, sensorValues->gpsSet.unixSeconds.value, + sensorValues->gpsSet.isValid(), &acsParameters->gpsParameters, + &outputValues->gcLatitude, &outputValues->gdLongitude, + &outputValues->gpsVelocity); outputValues->mgmUpdated = processMgm( sensorValues->mgm0Lis3Set.fieldStrengths.value, diff --git a/mission/controller/acs/SensorProcessing.h b/mission/controller/acs/SensorProcessing.h index 50b78238..81b7e6da 100644 --- a/mission/controller/acs/SensorProcessing.h +++ b/mission/controller/acs/SensorProcessing.h @@ -65,8 +65,10 @@ class SensorProcessing { void processStr(); - void processGps(const double gps0latitude, const double gps0longitude, const bool validGps, - double *gcLatitude, double *gdLongitude); + void processGps(const double gps0latitude, const double gps0longitude, + const double gps0altitude, const uint32_t gps0UnixSeconds, + const bool validGps, const AcsParameters::GpsParameters *gpsParameters, + double *gcLatitude, double *gdLongitude, double *gpsVelocityE); double savedMagFieldEst[3]; timeval timeOfSavedMagFieldEst; @@ -75,6 +77,10 @@ class SensorProcessing { bool validMagField; bool validGcLatitude; + double savedPosSatE[3]; + uint32_t timeOfSavedPosSatE; + bool validSavedPosSatE; + SusConverter susConverter; AcsParameters acsParameters; }; From e87221a8a3efb90e0b840f2fabcf81d622e121cb Mon Sep 17 00:00:00 2001 From: Robin Marquardt Date: Fri, 21 Oct 2022 16:46:09 +0200 Subject: [PATCH 002/330] added gyro detumble --- mission/controller/acs/control/Detumble.cpp | 14 ++++++++++++++ mission/controller/acs/control/Detumble.h | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/mission/controller/acs/control/Detumble.cpp b/mission/controller/acs/control/Detumble.cpp index 67903c7c..f12d5962 100644 --- a/mission/controller/acs/control/Detumble.cpp +++ b/mission/controller/acs/control/Detumble.cpp @@ -63,3 +63,17 @@ ReturnValue_t Detumble::bangbangLaw(const double *magRate, const bool *magRateVa return returnvalue::OK; } + +ReturnValue_t Detumble::bDotLawGyro(const double *satRate, const bool *satRateValid, + const double *magField, const bool *magFieldValid, + double *magMom) { + + if (!satRateValid || !magFieldValid) { + return DETUMBLE_NO_SENSORDATA; + } + double gain = detumbleCtrlParameters->gainD; + double factor = -gain / pow(VectorOperations::norm(magField,3),2); + VectorOperations::mulScalar(satRate, factor, magMom, 3); + return returnvalue::OK; + +} diff --git a/mission/controller/acs/control/Detumble.h b/mission/controller/acs/control/Detumble.h index b85aaf86..e49c88ac 100644 --- a/mission/controller/acs/control/Detumble.h +++ b/mission/controller/acs/control/Detumble.h @@ -38,6 +38,10 @@ public: ReturnValue_t bangbangLaw(const double *magRate, const bool *magRateValid, double *magMom); + ReturnValue_t bDotLawGyro(const double *satRate, const bool *satRateValid, + const double *magField, const bool *magFieldValid, + double *magMom); + private: AcsParameters::DetumbleCtrlParameters* detumbleCtrlParameters; AcsParameters::MagnetorquesParameter* magnetorquesParameter; From ba541300caf65b9abe29ffd7b12153f7698f7169 Mon Sep 17 00:00:00 2001 From: Robin Marquardt Date: Fri, 28 Oct 2022 18:18:28 +0200 Subject: [PATCH 003/330] updated AcsParams, added class function to get quaternion for sun pointing (guidance) --- mission/controller/acs/AcsParameters.h | 93 +++++++++++--------- mission/controller/acs/Guidance.cpp | 60 ++++++++++++- mission/controller/acs/Guidance.h | 4 + mission/controller/acs/SensorProcessing.cpp | 2 +- mission/controller/acs/control/Detumble.cpp | 6 +- mission/controller/acs/control/Detumble.h | 2 +- mission/controller/acs/control/PtgCtrl.cpp | 1 + mission/controller/acs/control/PtgCtrl.h | 2 +- mission/controller/acs/util/MathOperations.h | 24 +++-- 9 files changed, 133 insertions(+), 61 deletions(-) diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index d5386909..b67a484d 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -22,12 +22,22 @@ class AcsParameters /*: public HasParametersIF*/ { const ParameterWrapper *newValues, uint16_t startAtIndex); */ struct OnBoardParams { - double sampleTime = 0.1; // [s] + double sampleTime = 0.4; // [s] } onBoardParams; struct InertiaEIVE { - double inertiaMatrix[3][3] = {{1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.5, 1.0}}; - double inertiaMatrixInverse[3][3]; + double inertiaMatrix[3][3] = {{0.1539829, -0.0001821456, -0.0050135}, + {-0.0001821456, 0.1701302, 0.0004748963}, + {-0.0050135, 0.0004748963, 0.08374296}}; //19.11.2021 + double inertiaMatrixNoPanel[3][3] = {{0.122485, -0.0001798426, -0.005008}, + {-0.0001798426, 0.162240, 0.000475596}, + {-0.005008, 0.000475596, 0.060136}}; //19.11.2021 + double inertiaMatrixPanel1[3][3] = {{0.13823347, -0.0001836122, -0.00501207}, + {-0.0001836122, 0.16619787, 0.0083537}, + {-0.00501207, 0.0083537, 0.07192588}}; //19.11.2021 + double inertiaMatrixPanel3[3][3] = {{0.13823487, -0.000178376, -0.005009767}, + {-0.000178376, 0.166172, -0.007403}, + {-0.005009767, -0.007403, 0.07195314}}; //19.11.2021 } inertiaEIVE; struct MgmHandlingParameters { @@ -768,41 +778,50 @@ class AcsParameters /*: public HasParametersIF*/ { double alignmentMatrix[3][4] = {{0.9205, 0.0000, -0.9205, 0.0000}, {0.0000, -0.9205, 0.0000, 0.9205}, {0.3907, 0.3907, 0.3907, 0.3907}}; - double pseudoInverse[4][3] = {{0.4434, -0.2845, 0.3597}, - {0.2136, -0.3317, 1.0123}, - {-0.8672, -0.1406, 0.1778}, - {0.6426, 0.4794, 1.3603}}; - double without0[4][3]; - double without1[4][3]; - double without2[4][3]; - double without3[4][3]; - double nullspace[4] = {-0.7358, 0.5469, -0.3637, -0.1649}; +// double pseudoInverse[4][3] = {{0.4434, -0.2845, 0.3597}, +// {0.2136, -0.3317, 1.0123}, +// {-0.8672, -0.1406, 0.1778}, +// {0.6426, 0.4794, 1.3603}}; +// where does the first pseudo inverse come frome - matlab gives result below + double pseudoInverse[4][3] = {{0.5432, 0, 0.6398}, + {0, -0.5432, 0.6398}, + {-0.5432, 0, 0.6398}, + {0, 0.5432, 0.6398}}; + double without0[4][3] = {{0, 0, 0}, + {0.5432, -0.5432, 1.2797}, + {-1.0864, 0, 0}, + {0.5432, 0.5432, 1.2797}}; + double without1[4][3] = {{0.5432, -0.5432, 1.2797}, + {0, 0, 0}, + {-0.5432, -0.5432, 1.2797}, + {0, 1.0864, 0}}; + double without2[4][3] = {{1.0864, 0, 0}, + {-0.5432, -0.5432, 1.2797}, + {0, 0, 0}, + {-0.5432, 0.5432, 1.2797}}; + double without3[4][3] = {{0.5432, 0.5432, 1.2797}, + {0, -1.0864, 0}, + {-0.5432, 0.5432, 1.2797}, + {0, 0, 0}}; + double nullspace[4] = {-0.5000, 0.5000, -0.5000, 0.5000}; } rwMatrices; struct SafeModeControllerParameters { double k_rate_mekf = 0.00059437; double k_align_mekf = 0.000056875; - double k_rate_no_mekf; - double k_align_no_mekf; - double sunMagAngleMin; + double k_rate_no_mekf = 0.00059437;; + double k_align_no_mekf = 0.000056875;; + double sunMagAngleMin; // ??? - double sunTargetDir[3] = {1, 0, 0}; // Body frame - double satRateRef[3]; // Body frame + double sunTargetDir[3] = {0, 0, 1}; // Geometry Frame + double satRateRef[3] = {0, 0, 0}; // Geometry Frame } safeModeControllerParameters; - struct DetumbleCtrlParameters { - double gainD = pow(10.0, -3.3); - - } detumbleCtrlParameters; - // ToDo: mutiple structs for different pointing mode controllers? struct PointingModeControllerParameters { - double updtFlag; - double A_rw[3][12]; - - double refDirection[3] = {1, 0, 0}; + double refDirection[3] = {1, 0, 0}; //Antenna double refRotRate[3] = {0, 0, 0}; double quatRef[4] = {0, 0, 0, 1}; bool avoidBlindStr = true; @@ -811,9 +830,7 @@ class AcsParameters /*: public HasParametersIF*/ { double blindRotRate = 1 * M_PI / 180; double zeta = 0.3; - double zetaLow; double om = 0.3; - double omLow; double omMax = 1 * M_PI / 180; double qiMin = 0.1; double gainNullspace = 0.01; @@ -828,8 +845,7 @@ class AcsParameters /*: public HasParametersIF*/ { struct StrParameters { double exclusionAngle = 20 * M_PI / 180; - // double strOrientationMatrix[3][3]; - double boresightAxis[3] = {0.7593, 0.0000, -0.6508}; // in body/geometry frame + double boresightAxis[3] = {0.7593, 0.0000, -0.6508}; // geometry frame } strParameters; struct GpsParameters { @@ -840,13 +856,9 @@ class AcsParameters /*: public HasParametersIF*/ { double latitudeGs = 48.7495 * M_PI / 180.; // [rad] Latitude double longitudeGs = 9.10384 * M_PI / 180.; // [rad] Longitude double altitudeGs = 500; // [m] Altitude - double earthRadiusEquat = 6378137; // [m] - double earthRadiusPolar = 6356752.314; // [m] } groundStationParameters; // Stuttgart struct SunModelParameters { - enum UseSunModel { NO = 0, YES = 3 }; - uint8_t useSunModel; float domega = 36000.771; float omega_0 = 282.94 * M_PI / 180.; // RAAN plus argument of perigee float m_0 = 357.5256; // coefficients for mean anomaly @@ -859,12 +871,6 @@ class AcsParameters /*: public HasParametersIF*/ { } sunModelParameters; struct KalmanFilterParameters { - uint8_t activateKalmanFilter; - uint8_t requestResetFlag; - double maxToleratedTimeBetweenKalmanFilterExecutionSteps; - double processNoiseOmega[3]; - double processNoiseQuaternion[4]; - double sensorNoiseSTR = 0.1 * M_PI / 180; double sensorNoiseSS = 8 * M_PI / 180; double sensorNoiseMAG = 4 * M_PI / 180; @@ -885,9 +891,10 @@ class AcsParameters /*: public HasParametersIF*/ { } magnetorquesParameter; struct DetumbleParameter { - uint8_t detumblecounter; - double omegaDetumbleStart; - double omegaDetumbleEnd; + uint8_t detumblecounter = 75; + double omegaDetumbleStart = 2 * M_PI / 180; + double omegaDetumbleEnd = 0.2 * M_PI / 180; + double gainD = pow(10.0, -3.3); } detumbleParameter; }; diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index d8bee4f5..f01deab6 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -45,8 +45,9 @@ void Guidance::targetQuatPtg(ACS::SensorValues *sensorValues, ACS::OutputValues // Position of the satellite in the earth/fixed frame via GPS double posSatE[3] = {0, 0, 0}; - MathOperations::cartesianFromLatLongAlt(sensorValues->gpsSet.latitude.value, - sensorValues->gpsSet.longitude.value, + double geodeticLatRad = (sensorValues->gpsSet.latitude.value)*PI/180; + double longitudeRad = (sensorValues->gpsSet.longitude.value)*PI/180; + MathOperations::cartesianFromLatLongAlt(geodeticLatRad,longitudeRad, sensorValues->gpsSet.altitude.value, posSatE); // Target direction in the ECEF frame @@ -190,6 +191,59 @@ void Guidance::targetQuatPtg(ACS::SensorValues *sensorValues, ACS::OutputValues } } +void Guidance::sunQuatPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, + double targetQuat[4], double refSatRate[3]) { + //------------------------------------------------------------------------------------- + // Calculation of target quaternion to sun + //------------------------------------------------------------------------------------- + double quatBJ[4] = {0, 0, 0, 0}; + double dcmBJ[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + quatBJ[0] = outputValues->quatMekfBJ[0]; + quatBJ[1] = outputValues->quatMekfBJ[1]; + quatBJ[2] = outputValues->quatMekfBJ[2]; + quatBJ[3] = outputValues->quatMekfBJ[3]; + QuaternionOperations::toDcm(quatBJ, dcmBJ); + + double sunDirJ[3] = {0, 0, 0}, sunDir[3] = {0, 0, 0}; + if (outputValues->sunDirModelValid) { + sunDirJ[0] = outputValues->sunDirModel[0]; + sunDirJ[1] = outputValues->sunDirModel[1]; + sunDirJ[2] = outputValues->sunDirModel[2]; + MatrixOperations::multiply(*dcmBJ, sunDirJ, sunDir, 3, 3, 1); + } + + else { + sunDir[0] = outputValues->sunDirEst[0]; + sunDir[1] = outputValues->sunDirEst[1]; + sunDir[2] = outputValues->sunDirEst[2]; + } + + double sunRef[3] = {0, 0, 0}; + sunRef[0] = acsParameters.safeModeControllerParameters.sunTargetDir[0]; + sunRef[1] = acsParameters.safeModeControllerParameters.sunTargetDir[1]; + sunRef[2] = acsParameters.safeModeControllerParameters.sunTargetDir[2]; + + double sunCross[3] = {0, 0, 0}; + VectorOperations::cross(sunDir, sunRef, sunCross); + double normSunDir = VectorOperations::norm(sunDir, 3); + double normSunRef = VectorOperations::norm(sunRef, 3); + double dotSun = VectorOperations::dot(sunDir, sunRef); + + targetQuat[0] = sunCross[0]; + targetQuat[1] = sunCross[1]; + targetQuat[2] = sunCross[2]; + targetQuat[3] = sqrt(pow(normSunDir,2) * pow(normSunRef,2) + dotSun); + + VectorOperations::normalize(targetQuat, targetQuat, 4); + + //------------------------------------------------------------------------------------- + // Calculation of reference rotation rate + //------------------------------------------------------------------------------------- + refSatRate[0] = 0; + refSatRate[1] = 0; + refSatRate[2] = 0; +} + void Guidance::comparePtg(double targetQuat[4], ACS::OutputValues *outputValues, double refSatRate[3], double quatError[3], double deltaRate[3]) { double quatRef[4] = {0, 0, 0, 0}; @@ -310,7 +364,7 @@ void Guidance::getDistributionMatrixRw(ACS::SensorValues *sensorValues, double * // @note: This one takes the normal pseudoInverse of all four raction wheels valid. // Does not make sense, but is implemented that way in MATLAB ?! // Thought: It does not really play a role, because in case there are more then one - // reaction wheel the pointing control is destined to fail. + // reaction wheel invalid the pointing control is destined to fail. rwPseudoInv[0] = acsParameters.rwMatrices.pseudoInverse[0][0]; rwPseudoInv[1] = acsParameters.rwMatrices.pseudoInverse[0][1]; rwPseudoInv[2] = acsParameters.rwMatrices.pseudoInverse[0][2]; diff --git a/mission/controller/acs/Guidance.h b/mission/controller/acs/Guidance.h index bf53d767..7b05a251 100644 --- a/mission/controller/acs/Guidance.h +++ b/mission/controller/acs/Guidance.h @@ -26,6 +26,10 @@ public: void targetQuatPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, double targetQuat[4], double refSatRate[3]); + // Function to get the target quaternion and refence rotation rate for sun pointing after ground station + void sunQuatPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, + double targetQuat[4], double refSatRate[3]); + // @note: compares target Quaternion and reference quaternion, also actual satellite rate and desired void comparePtg( double targetQuat[4], ACS::OutputValues *outputValues, double refSatRate[3], double quatError[3], double deltaRate[3] ); diff --git a/mission/controller/acs/SensorProcessing.cpp b/mission/controller/acs/SensorProcessing.cpp index 2b78a3e2..1a8b02d9 100644 --- a/mission/controller/acs/SensorProcessing.cpp +++ b/mission/controller/acs/SensorProcessing.cpp @@ -496,7 +496,7 @@ void SensorProcessing::process(timeval now, ACS::SensorValues *sensorValues, sensorValues->gpsSet.altitude.value, sensorValues->gpsSet.unixSeconds.value, sensorValues->gpsSet.isValid(), &acsParameters->gpsParameters, &outputValues->gcLatitude, &outputValues->gdLongitude, - &outputValues->gpsVelocity); + outputValues->gpsVelocity); outputValues->mgmUpdated = processMgm( sensorValues->mgm0Lis3Set.fieldStrengths.value, diff --git a/mission/controller/acs/control/Detumble.cpp b/mission/controller/acs/control/Detumble.cpp index f12d5962..9f99de5b 100644 --- a/mission/controller/acs/control/Detumble.cpp +++ b/mission/controller/acs/control/Detumble.cpp @@ -27,7 +27,7 @@ Detumble::~Detumble(){ void Detumble::loadAcsParameters(AcsParameters *acsParameters_){ - detumbleCtrlParameters = &(acsParameters_->detumbleCtrlParameters); + detumbleParameter = &(acsParameters_->detumbleParameter); magnetorquesParameter = &(acsParameters_->magnetorquesParameter); } @@ -40,7 +40,7 @@ ReturnValue_t Detumble::bDotLaw(const double *magRate, const bool *magRateValid, if (!magRateValid || !magFieldValid) { return DETUMBLE_NO_SENSORDATA; } - double gain = detumbleCtrlParameters->gainD; + double gain = detumbleParameter->gainD; double factor = -gain / pow(VectorOperations::norm(magField,3),2); VectorOperations::mulScalar(magRate, factor, magMom, 3); return returnvalue::OK; @@ -71,7 +71,7 @@ ReturnValue_t Detumble::bDotLawGyro(const double *satRate, const bool *satRateVa if (!satRateValid || !magFieldValid) { return DETUMBLE_NO_SENSORDATA; } - double gain = detumbleCtrlParameters->gainD; + double gain = detumbleParameter->gainD; double factor = -gain / pow(VectorOperations::norm(magField,3),2); VectorOperations::mulScalar(satRate, factor, magMom, 3); return returnvalue::OK; diff --git a/mission/controller/acs/control/Detumble.h b/mission/controller/acs/control/Detumble.h index e49c88ac..34f7c312 100644 --- a/mission/controller/acs/control/Detumble.h +++ b/mission/controller/acs/control/Detumble.h @@ -43,7 +43,7 @@ public: double *magMom); private: - AcsParameters::DetumbleCtrlParameters* detumbleCtrlParameters; + AcsParameters::DetumbleParameter* detumbleParameter; AcsParameters::MagnetorquesParameter* magnetorquesParameter; }; diff --git a/mission/controller/acs/control/PtgCtrl.cpp b/mission/controller/acs/control/PtgCtrl.cpp index 6201a32a..211bc50e 100644 --- a/mission/controller/acs/control/PtgCtrl.cpp +++ b/mission/controller/acs/control/PtgCtrl.cpp @@ -109,6 +109,7 @@ void PtgCtrl::ptgGroundstation(const double mode, const double *qError, const do double torque[3] = {0, 0, 0}; VectorOperations::add(torqueRate, torqueQuat, torque, 3); MatrixOperations::multiply(rwPseudoInv, torque, torqueRws, 4, 3, 1); + VectorOperations::mulScalar(torqueRws, -1, torqueRws, 4); } diff --git a/mission/controller/acs/control/PtgCtrl.h b/mission/controller/acs/control/PtgCtrl.h index be67187d..b537681e 100644 --- a/mission/controller/acs/control/PtgCtrl.h +++ b/mission/controller/acs/control/PtgCtrl.h @@ -34,7 +34,7 @@ class PtgCtrl { static const uint8_t INTERFACE_ID = CLASS_ID::PTG; static const ReturnValue_t PTGCTRL_MEKF_INPUT_INVALID = MAKE_RETURN_CODE(0x01); - /* @brief: Load AcsParameters für this class + /* @brief: Load AcsParameters for this class * @param: acsParameters_ Pointer to object which defines the ACS configuration parameters */ void loadAcsParameters(AcsParameters *acsParameters_); diff --git a/mission/controller/acs/util/MathOperations.h b/mission/controller/acs/util/MathOperations.h index 6a534880..7a20e9e2 100644 --- a/mission/controller/acs/util/MathOperations.h +++ b/mission/controller/acs/util/MathOperations.h @@ -104,9 +104,16 @@ public: } static void cartesianFromLatLongAlt(const T1 lat, const T1 longi, const T1 alt, T2 *cartesianOutput){ - - double radiusPolar = 6378137; - double radiusEqua = 6356752.314; + /* @brief: cartesianFromLatLongAlt() - calculates cartesian coordinates in ECEF from latitude, + * longitude and altitude + * @param: lat geodetic latitude [rad] + * longi longitude [rad] + * alt altitude [m] + * cartesianOutput Cartesian Coordinates in ECEF (3x1) + * @source: Fundamentals of Spacecraft Attitude Determination and Control, P.34ff + * Landis Markley and John L. Crassidis*/ + double radiusPolar = 6356752.314; + double radiusEqua = 6378137; double eccentricity = sqrt(1 - pow(radiusPolar,2) / pow(radiusEqua,2)); double auxRadius = radiusEqua / sqrt(1 - pow(eccentricity,2) * pow(sin(lat),2)); @@ -117,13 +124,12 @@ public: } - /* @brief: dcmEJ() - calculates the transformation matrix between ECEF and ECI frame - * @param: time Current time - * outputDcmEJ Transformation matrix from ECI (J) to ECEF (E) [3][3] - * @source: Fundamentals of Spacecraft Attitude Determination and Control, P.32ff - * Landis Markley and John L. Crassidis*/ static void dcmEJ(timeval time, T1 * outputDcmEJ){ - + /* @brief: dcmEJ() - calculates the transformation matrix between ECEF and ECI frame + * @param: time Current time + * outputDcmEJ Transformation matrix from ECI (J) to ECEF (E) [3][3] + * @source: Fundamentals of Spacecraft Attitude Determination and Control, P.32ff + * Landis Markley and John L. Crassidis*/ double JD2000Floor = 0; double JD2000 = convertUnixToJD2000(time); // Getting Julian Century from Day start : JD (Y,M,D,0,0,0) From 75ab11fc35d44c394dd1dc4d93555ace44338f66 Mon Sep 17 00:00:00 2001 From: Robin Marquardt Date: Fri, 4 Nov 2022 17:21:17 +0100 Subject: [PATCH 004/330] updated AcsParameters. change DCM_EJ calc to with precission and nutation --- mission/controller/AcsController.cpp | 39 +++++++++++++++++++- mission/controller/AcsController.h | 2 + mission/controller/acs/AcsParameters.h | 14 ++++--- mission/controller/acs/Guidance.cpp | 16 ++------ mission/controller/acs/control/PtgCtrl.cpp | 2 +- mission/controller/acs/control/PtgCtrl.h | 2 +- mission/controller/acs/util/MathOperations.h | 13 ++++++- 7 files changed, 66 insertions(+), 22 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 856a0034..9199e1d4 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -45,6 +45,9 @@ void AcsController::performControlOperation() { case SUBMODE_PTG_GS: performPointingCtrl(); break; + case SUBMODE_PTG_SUN: + performPointingCtrlSun(); + break; } } break; @@ -124,7 +127,41 @@ void AcsController::performPointingCtrl() { double rwPseudoInv[4][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; guidance.getDistributionMatrixRw(&sensorValues, *rwPseudoInv); double torquePtgRws[4] = {0, 0, 0, 0}, mode = 0; - ptgCtrl.ptgGroundstation(mode, quatError, deltaRate, *rwPseudoInv, torquePtgRws); + ptgCtrl.ptgLaw(mode, quatError, deltaRate, *rwPseudoInv, torquePtgRws); + double rwTrqNs[4] = {0, 0, 0, 0}; + ptgCtrl.ptgNullspace( + &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), + &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), rwTrqNs); + double cmdSpeedRws[4] = {0, 0, 0, 0}; // Should be given to the actuator reaction wheel as input + actuatorCmd.cmdSpeedToRws( + &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), + &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), torquePtgRws, + rwTrqNs, cmdSpeedRws); + double mgtDpDes[3] = {0, 0, 0}, dipolUnits[3] = {0, 0, 0}; // Desaturation Dipol + ptgCtrl.ptgDesaturation( + outputValues.magFieldEst, &outputValues.magFieldEstValid, outputValues.satRateMekf, + &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), + &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), mgtDpDes); + actuatorCmd.cmdDipolMtq(mgtDpDes, dipolUnits); +} + +void AcsController::performPointingCtrlSun() { + ACS::SensorValues sensorValues; + ACS::OutputValues outputValues; + + timeval now; // Übergabe ? + + sensorProcessing.process(now, &sensorValues, &outputValues, &acsParameters); + ReturnValue_t validMekf; + navigation.useMekf(&sensorValues, &outputValues, &validMekf); + double targetQuat[4] = {0, 0, 0, 0}, refSatRate[3] = {0, 0, 0}; + guidance.sunQuatPtg(&sensorValues, &outputValues, targetQuat, refSatRate); + double quatError[3] = {0, 0, 0}, deltaRate[3] = {0, 0, 0}; + guidance.comparePtg(targetQuat, &outputValues, refSatRate, quatError, deltaRate); + double rwPseudoInv[4][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + guidance.getDistributionMatrixRw(&sensorValues, *rwPseudoInv); + double torquePtgRws[4] = {0, 0, 0, 0}, mode = 0; + ptgCtrl.ptgLaw(mode, quatError, deltaRate, *rwPseudoInv, torquePtgRws); double rwTrqNs[4] = {0, 0, 0, 0}; ptgCtrl.ptgNullspace( &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index c23adfc1..fda3f0ec 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -27,12 +27,14 @@ class AcsController : public ExtendedControllerBase { static const Submode_t SUBMODE_DETUMBLE = 3; static const Submode_t SUBMODE_PTG_GS = 4; static const Submode_t SUBMODE_PTG_NADIR = 5; + static const Submode_t SUBMODE_PTG_SUN = 6; protected: void performSafe(); void performDetumble(); void performPointingCtrl(); + void performPointingCtrlSun(); private: AcsParameters acsParameters; diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index b67a484d..fe8654f5 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -29,7 +29,11 @@ class AcsParameters /*: public HasParametersIF*/ { double inertiaMatrix[3][3] = {{0.1539829, -0.0001821456, -0.0050135}, {-0.0001821456, 0.1701302, 0.0004748963}, {-0.0050135, 0.0004748963, 0.08374296}}; //19.11.2021 - double inertiaMatrixNoPanel[3][3] = {{0.122485, -0.0001798426, -0.005008}, + // Possible inertia matrices + double inertiaMatrixDeployed[3][3] = {{0.1539829, -0.0001821456, -0.0050135}, + {-0.0001821456, 0.1701302, 0.0004748963}, + {-0.0050135, 0.0004748963, 0.08374296}}; //19.11.2021 + double inertiaMatrixUndeployed[3][3] = {{0.122485, -0.0001798426, -0.005008}, {-0.0001798426, 0.162240, 0.000475596}, {-0.005008, 0.000475596, 0.060136}}; //19.11.2021 double inertiaMatrixPanel1[3][3] = {{0.13823347, -0.0001836122, -0.00501207}, @@ -37,7 +41,7 @@ class AcsParameters /*: public HasParametersIF*/ { {-0.00501207, 0.0083537, 0.07192588}}; //19.11.2021 double inertiaMatrixPanel3[3][3] = {{0.13823487, -0.000178376, -0.005009767}, {-0.000178376, 0.166172, -0.007403}, - {-0.005009767, -0.007403, 0.07195314}}; //19.11.2021 + {-0.005009767, -0.007403, 0.07195314}}; } inertiaEIVE; struct MgmHandlingParameters { @@ -821,7 +825,7 @@ class AcsParameters /*: public HasParametersIF*/ { // ToDo: mutiple structs for different pointing mode controllers? struct PointingModeControllerParameters { - double refDirection[3] = {1, 0, 0}; //Antenna + double refDirection[3] = {-1, 0, 0}; //Antenna double refRotRate[3] = {0, 0, 0}; double quatRef[4] = {0, 0, 0, 1}; bool avoidBlindStr = true; @@ -891,9 +895,9 @@ class AcsParameters /*: public HasParametersIF*/ { } magnetorquesParameter; struct DetumbleParameter { - uint8_t detumblecounter = 75; + uint8_t detumblecounter = 75; // 30 s double omegaDetumbleStart = 2 * M_PI / 180; - double omegaDetumbleEnd = 0.2 * M_PI / 180; + double omegaDetumbleEnd = 0.4 * M_PI / 180; double gainD = pow(10.0, -3.3); } detumbleParameter; }; diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index f01deab6..ce6abf48 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -57,21 +57,11 @@ void Guidance::targetQuatPtg(ACS::SensorValues *sensorValues, ACS::OutputValues // Transformation between ECEF and IJK frame double dcmEJ[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; double dcmJE[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; - MathOperations::dcmEJ(now, *dcmEJ); - MathOperations::inverseMatrixDimThree(*dcmEJ, *dcmJE); - // Derivative of dmcEJ WITHOUT PRECISSION AND NUTATION double dcmEJDot[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + MathOperations::ecfToEciWithNutPre(now, *dcmEJ, *dcmEJDot); + MathOperations::inverseMatrixDimThree(*dcmEJ, *dcmJE); + double dcmJEDot[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; - double dcmDot[3][3] = {{0, 1, 0}, {-1, 0, 0}, {0, 0, 0}}; - double omegaEarth = acsParameters.targetModeControllerParameters.omegaEarth; - - // TEST SECTION ! - // double dcmTEST[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; - // MatrixOperations::multiply(&acsParameters.magnetorquesParameter.mtq0orientationMatrix, - // dcmTEST, dcmTEST, 3, 3, 3); - - MatrixOperations::multiply(*dcmDot, *dcmEJ, *dcmEJDot, 3, 3, 3); - MatrixOperations::multiplyScalar(*dcmEJDot, omegaEarth, *dcmEJDot, 3, 3); MathOperations::inverseMatrixDimThree(*dcmEJDot, *dcmJEDot); // Transformation between ECEF and Body frame diff --git a/mission/controller/acs/control/PtgCtrl.cpp b/mission/controller/acs/control/PtgCtrl.cpp index 211bc50e..a412982d 100644 --- a/mission/controller/acs/control/PtgCtrl.cpp +++ b/mission/controller/acs/control/PtgCtrl.cpp @@ -31,7 +31,7 @@ void PtgCtrl::loadAcsParameters(AcsParameters *acsParameters_){ rwMatrices =&(acsParameters_->rwMatrices); } -void PtgCtrl::ptgGroundstation(const double mode, const double *qError, const double *deltaRate,const double *rwPseudoInv, double *torqueRws){ +void PtgCtrl::ptgLaw(const double mode, const double *qError, const double *deltaRate,const double *rwPseudoInv, double *torqueRws){ //------------------------------------------------------------------------------------------------ // Compute gain matrix K and P matrix diff --git a/mission/controller/acs/control/PtgCtrl.h b/mission/controller/acs/control/PtgCtrl.h index b537681e..2c92a7e3 100644 --- a/mission/controller/acs/control/PtgCtrl.h +++ b/mission/controller/acs/control/PtgCtrl.h @@ -42,7 +42,7 @@ class PtgCtrl { /* @brief: Calculates the needed torque for the pointing control mechanism * @param: acsParameters_ Pointer to object which defines the ACS configuration parameters */ - void ptgGroundstation(const double mode, const double *qError, const double *deltaRate, + void ptgLaw(const double mode, const double *qError, const double *deltaRate, const double *rwPseudoInv, double *torqueRws); void ptgDesaturation(double *magFieldEst, bool *magFieldEstValid, double *satRate, diff --git a/mission/controller/acs/util/MathOperations.h b/mission/controller/acs/util/MathOperations.h index 7a20e9e2..899e199c 100644 --- a/mission/controller/acs/util/MathOperations.h +++ b/mission/controller/acs/util/MathOperations.h @@ -124,10 +124,11 @@ public: } - static void dcmEJ(timeval time, T1 * outputDcmEJ){ + static void dcmEJ(timeval time, T1 * outputDcmEJ, T1 * outputDotDcmEJ){ /* @brief: dcmEJ() - calculates the transformation matrix between ECEF and ECI frame * @param: time Current time * outputDcmEJ Transformation matrix from ECI (J) to ECEF (E) [3][3] + * outputDotDcmEJ Derivative of transformation matrix [3][3] * @source: Fundamentals of Spacecraft Attitude Determination and Control, P.32ff * Landis Markley and John L. Crassidis*/ double JD2000Floor = 0; @@ -162,6 +163,16 @@ public: outputDcmEJ[7] = 0; outputDcmEJ[8] = 1; + // Derivative of dmcEJ WITHOUT PRECISSION AND NUTATION + double dcmEJCalc[3][3] = {{outputDcmEJ[0], outputDcmEJ[1], outputDcmEJ[2]}, + {outputDcmEJ[3], outputDcmEJ[4], outputDcmEJ[5]}, + {outputDcmEJ[6], outputDcmEJ[7], outputDcmEJ[8]}}; + double dcmDot[3][3] = {{0, 1, 0}, {-1, 0, 0}, {0, 0, 0}}; + double omegaEarth = 0.000072921158553; + double dotDcmEJ[3][3] = {{0,0,0},{0,0,0},{0,0,0}}; + MatrixOperations::multiply(*dcmDot, *dcmEJCalc, *dotDcmEJ, 3, 3, 3); + MatrixOperations::multiplyScalar(*dotDcmEJ, omegaEarth, outputDotDcmEJ, 3, 3); + } /* @brief: ecfToEciWithNutPre() - calculates the transformation matrix between ECEF and ECI frame From 20936faec6f7e2465b833dbc6225d32cf5940093 Mon Sep 17 00:00:00 2001 From: Robin Marquardt Date: Tue, 8 Nov 2022 13:48:50 +0100 Subject: [PATCH 005/330] added Antistiction, added Nadir Pointing, added performSafe() --- mission/controller/AcsController.cpp | 108 +++++++++++++-------- mission/controller/AcsController.h | 3 +- mission/controller/acs/AcsParameters.h | 7 +- mission/controller/acs/ActuatorCmd.cpp | 23 ++--- mission/controller/acs/ActuatorCmd.h | 12 ++- mission/controller/acs/Guidance.cpp | 67 +++++++++++++ mission/controller/acs/Guidance.h | 4 + mission/controller/acs/control/PtgCtrl.cpp | 35 ++++++- mission/controller/acs/control/PtgCtrl.h | 11 +++ 9 files changed, 213 insertions(+), 57 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 9199e1d4..d2bd0510 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -8,6 +8,7 @@ AcsController::AcsController(object_id_t objectId) navigation(&acsParameters), actuatorCmd(&acsParameters), guidance(&acsParameters), + safeCtrl(&acsParameters), detumble(&acsParameters), ptgCtrl(&acsParameters), detumbleCounter{0}, @@ -35,7 +36,7 @@ void AcsController::performControlOperation() { if (mode != MODE_OFF) { switch (submode) { case SUBMODE_SAFE: - // performSafe(); + performSafe(); break; case SUBMODE_DETUMBLE: @@ -45,9 +46,14 @@ void AcsController::performControlOperation() { case SUBMODE_PTG_GS: performPointingCtrl(); break; + case SUBMODE_PTG_SUN: - performPointingCtrlSun(); - break; + performPointingCtrl(); + break; + + case SUBMODE_PTG_NADIR: + performPointingCtrl(); + break; } } break; @@ -75,7 +81,40 @@ void AcsController::performControlOperation() { // DEBUG END } -void AcsController::performSafe() {} +void AcsController::performSafe() { + ACS::SensorValues sensorValues; + ACS::OutputValues outputValues; + + timeval now; + Clock::getClock_timeval(&now); + + sensorProcessing.process(now, &sensorValues, &outputValues, &acsParameters); + ReturnValue_t validMekf; + navigation.useMekf(&sensorValues, &outputValues, &validMekf); + // Give desired satellite rate and sun direction to align + double satRateSafe[3] = {0, 0, 0}, sunTargetDir[3] = {0, 0, 0}; + guidance.getTargetParamsSafe(sunTargetDir, satRateSafe); +// IF MEKF is working + double magMomMtq[3] = {0, 0, 0}; + bool magMomMtqValid = false; + if ( !validMekf ) { // Valid = 0, Failed = 1 + safeCtrl.safeMekf(now, (outputValues.quatMekfBJ), &(outputValues.quatMekfBJValid), + (outputValues.magFieldModel), &(outputValues.magFieldModelValid), + (outputValues.sunDirModel), &(outputValues.sunDirModelValid), + (outputValues.satRateMekf), &(outputValues.satRateMekfValid), + sunTargetDir, satRateSafe, magMomMtq, &magMomMtqValid); + } + else { + + safeCtrl.safeNoMekf(now, outputValues.sunDirEst, &outputValues.sunDirEstValid, + outputValues.sunVectorDerivative, &(outputValues.sunVectorDerivativeValid), + outputValues.magFieldEst, &(outputValues.magFieldEstValid), + outputValues.magneticFieldVectorDerivative, &(outputValues.magneticFieldVectorDerivativeValid), + sunTargetDir, satRateSafe, magMomMtq, &magMomMtqValid); + + } + +} void AcsController::performDetumble() { ACS::SensorValues sensorValues; @@ -121,7 +160,18 @@ void AcsController::performPointingCtrl() { ReturnValue_t validMekf; navigation.useMekf(&sensorValues, &outputValues, &validMekf); double targetQuat[4] = {0, 0, 0, 0}, refSatRate[3] = {0, 0, 0}; - guidance.targetQuatPtg(&sensorValues, &outputValues, now, targetQuat, refSatRate); + + switch (submode) { + case SUBMODE_PTG_GS: + guidance.targetQuatPtg(&sensorValues, &outputValues, now, targetQuat, refSatRate); + break; + case SUBMODE_PTG_SUN: + guidance.sunQuatPtg(&sensorValues, &outputValues, targetQuat, refSatRate); + break; + case SUBMODE_PTG_NADIR: + guidance.targetQuatNadirPtg(&sensorValues, &outputValues, now, targetQuat, refSatRate); + break; + } double quatError[3] = {0, 0, 0}, deltaRate[3] = {0, 0, 0}; guidance.comparePtg(targetQuat, &outputValues, refSatRate, quatError, deltaRate); double rwPseudoInv[4][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; @@ -132,45 +182,21 @@ void AcsController::performPointingCtrl() { ptgCtrl.ptgNullspace( &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), rwTrqNs); + double torqueRws[4] = {0, 0, 0, 0}, torqueRwsScaled[4] = {0, 0, 0, 0}; + VectorOperations::add(torquePtgRws, rwTrqNs, torqueRws, 4); + actuatorCmd.scalingTorqueRws(torqueRws, torqueRwsScaled); + + if (acsParameters.pointingModeControllerParameters.enableAntiStiction) { + bool rwAvailable[4] = {true, true, true, true}; // WHICH INPUT SENSOR SET? + double rwSpeed[4] = {&(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), + &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value)}; + ptgCtrl.rwAntistiction(rwAvailable, rwSpeed, torqueRwsScaled); + } + double cmdSpeedRws[4] = {0, 0, 0, 0}; // Should be given to the actuator reaction wheel as input actuatorCmd.cmdSpeedToRws( &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), - &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), torquePtgRws, - rwTrqNs, cmdSpeedRws); - double mgtDpDes[3] = {0, 0, 0}, dipolUnits[3] = {0, 0, 0}; // Desaturation Dipol - ptgCtrl.ptgDesaturation( - outputValues.magFieldEst, &outputValues.magFieldEstValid, outputValues.satRateMekf, - &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), - &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), mgtDpDes); - actuatorCmd.cmdDipolMtq(mgtDpDes, dipolUnits); -} - -void AcsController::performPointingCtrlSun() { - ACS::SensorValues sensorValues; - ACS::OutputValues outputValues; - - timeval now; // Übergabe ? - - sensorProcessing.process(now, &sensorValues, &outputValues, &acsParameters); - ReturnValue_t validMekf; - navigation.useMekf(&sensorValues, &outputValues, &validMekf); - double targetQuat[4] = {0, 0, 0, 0}, refSatRate[3] = {0, 0, 0}; - guidance.sunQuatPtg(&sensorValues, &outputValues, targetQuat, refSatRate); - double quatError[3] = {0, 0, 0}, deltaRate[3] = {0, 0, 0}; - guidance.comparePtg(targetQuat, &outputValues, refSatRate, quatError, deltaRate); - double rwPseudoInv[4][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; - guidance.getDistributionMatrixRw(&sensorValues, *rwPseudoInv); - double torquePtgRws[4] = {0, 0, 0, 0}, mode = 0; - ptgCtrl.ptgLaw(mode, quatError, deltaRate, *rwPseudoInv, torquePtgRws); - double rwTrqNs[4] = {0, 0, 0, 0}; - ptgCtrl.ptgNullspace( - &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), - &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), rwTrqNs); - double cmdSpeedRws[4] = {0, 0, 0, 0}; // Should be given to the actuator reaction wheel as input - actuatorCmd.cmdSpeedToRws( - &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), - &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), torquePtgRws, - rwTrqNs, cmdSpeedRws); + &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), torqueRwsScaled, cmdSpeedRws); double mgtDpDes[3] = {0, 0, 0}, dipolUnits[3] = {0, 0, 0}; // Desaturation Dipol ptgCtrl.ptgDesaturation( outputValues.magFieldEst, &outputValues.magFieldEstValid, outputValues.satRateMekf, diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index fda3f0ec..21a0c86d 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -9,6 +9,7 @@ #include "acs/Guidance.h" #include "acs/Navigation.h" #include "acs/SensorProcessing.h" +#include "acs/control/SafeCtrl.h" #include "acs/control/Detumble.h" #include "acs/control/PtgCtrl.h" #include "controllerdefinitions/AcsCtrlDefinitions.h" @@ -34,7 +35,6 @@ class AcsController : public ExtendedControllerBase { void performSafe(); void performDetumble(); void performPointingCtrl(); - void performPointingCtrlSun(); private: AcsParameters acsParameters; @@ -43,6 +43,7 @@ class AcsController : public ExtendedControllerBase { ActuatorCmd actuatorCmd; Guidance guidance; + SafeCtrl safeCtrl; Detumble detumble; PtgCtrl ptgCtrl; diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index fe8654f5..ec535b75 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -776,6 +776,9 @@ class AcsParameters /*: public HasParametersIF*/ { double rw3orientationMatrix[3][3]; double inertiaWheel = 0.000028198; double maxTrq = 0.0032; // 3.2 [mNm] + double stictionSpeed = 80; //RPM + double stictionReleaseSpeed = 120; //RPM + double stictionTorque = 0.0006; } rwHandlingParameters; struct RwMatrices { @@ -842,10 +845,12 @@ class AcsParameters /*: public HasParametersIF*/ { double desatMomentumRef[3] = {0, 0, 0}; double deSatGainFactor = 1000; bool desatOn = true; + bool enableAntiStiction = true; double omegaEarth = 0.000072921158553; - } inertialModeControllerParameters, nadirModeControllerParameters, targetModeControllerParameters; + double nadirRefDirection[3] = {-1, 0, 0}; //Camera + } pointingModeControllerParameters, inertialModeControllerParameters, nadirModeControllerParameters, targetModeControllerParameters; struct StrParameters { double exclusionAngle = 20 * M_PI / 180; diff --git a/mission/controller/acs/ActuatorCmd.cpp b/mission/controller/acs/ActuatorCmd.cpp index 920989ed..00f36d24 100644 --- a/mission/controller/acs/ActuatorCmd.cpp +++ b/mission/controller/acs/ActuatorCmd.cpp @@ -23,26 +23,27 @@ ActuatorCmd::~ActuatorCmd(){ } -void ActuatorCmd::cmdSpeedToRws(const int32_t *speedRw0, const int32_t *speedRw1, - const int32_t *speedRw2, const int32_t *speedRw3, - const double *rwTrqIn, const double *rwTrqNS, double *rwCmdSpeed) { - using namespace Math; +void ActuatorCmd::scalingTorqueRws(const double *rwTrq, double *rwTrqScaled) { // Scaling the commanded torque to a maximum value - double torque[4] = {0, 0, 0, 0}; double maxTrq = acsParameters.rwHandlingParameters.maxTrq; - VectorOperations::add(rwTrqIn, rwTrqNS, torque, 4); double maxValue = 0; for (int i = 0; i < 4; i++) { // size of torque, always 4 ? - if (abs(torque[i]) > maxValue) { - maxValue = abs(torque[i]); + if (abs(rwTrq[i]) > maxValue) { + maxValue = abs(rwTrq[i]); } } if (maxValue > maxTrq) { - double scalingFactor = maxTrq / maxValue; - VectorOperations::mulScalar(torque, scalingFactor, torque, 4); + double scalingFactor = maxTrq / maxValue; + VectorOperations::mulScalar(rwTrq, scalingFactor, rwTrqScaled, 4); } +} + +void ActuatorCmd::cmdSpeedToRws(const int32_t *speedRw0, const int32_t *speedRw1, + const int32_t *speedRw2, const int32_t *speedRw3, + const double *rwTorque, double *rwCmdSpeed) { + using namespace Math; // Calculating the commanded speed in RPM for every reaction wheel double speedRws[4] = {*speedRw0, *speedRw1, *speedRw2, *speedRw3}; @@ -52,7 +53,7 @@ void ActuatorCmd::cmdSpeedToRws(const int32_t *speedRw0, const int32_t *speedRw1 double radToRpm = 60 / (2 * PI); // factor for conversion to RPM // W_RW = Torque_RW / I_RW * delta t [rad/s] double factor = commandTime / inertiaWheel * radToRpm; - VectorOperations::mulScalar(torque, factor, deltaSpeed, 4); + VectorOperations::mulScalar(rwTorque, factor, deltaSpeed, 4); VectorOperations::add(speedRws, deltaSpeed, rwCmdSpeed, 4); } diff --git a/mission/controller/acs/ActuatorCmd.h b/mission/controller/acs/ActuatorCmd.h index 1da2c89a..95d492c1 100644 --- a/mission/controller/acs/ActuatorCmd.h +++ b/mission/controller/acs/ActuatorCmd.h @@ -20,6 +20,14 @@ public: ActuatorCmd(AcsParameters *acsParameters_); //Input mode ? virtual ~ActuatorCmd(); + /* + * @brief: scalingTorqueRws() scales the torque via maximum part in case this part is higher + * then the maximum torque + * @param: rwTrq given torque for reaction wheels + * rwTrqScaled possible scaled torque + */ + void scalingTorqueRws(const double *rwTrq, double *rwTrqScaled); + /* * @brief: cmdSpeedToRws() will set the maximum possible torque for the reaction wheels, also * will calculate the needed revolutions per minute for the RWs, which will be given @@ -29,8 +37,8 @@ public: * rwCmdSpeed output revolutions per minute for every reaction wheel */ void cmdSpeedToRws(const int32_t *speedRw0, const int32_t *speedRw1, - const int32_t *speedRw2, const int32_t *speedRw3, const double *rwTrqIn, - const double *rwTrqNS, double *rwCmdSpeed); + const int32_t *speedRw2, const int32_t *speedRw3, const double *rwTorque, + double *rwCmdSpeed); /* * @brief: cmdDipolMtq() gives the commanded dipol moment for the magnetorques diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index ce6abf48..bd7ccf6c 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -234,6 +234,73 @@ void Guidance::sunQuatPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *ou refSatRate[2] = 0; } +void Guidance::targetQuatNadirPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, + double targetQuat[4], double refSatRate[3]) { + //------------------------------------------------------------------------------------- + // Calculation of target quaternion for Nadir pointing + //------------------------------------------------------------------------------------- + // Position of the satellite in the earth/fixed frame via GPS + double posSatE[3] = {0, 0, 0}; + double geodeticLatRad = (sensorValues->gpsSet.latitude.value)*PI/180; + double longitudeRad = (sensorValues->gpsSet.longitude.value)*PI/180; + MathOperations::cartesianFromLatLongAlt(geodeticLatRad,longitudeRad, + sensorValues->gpsSet.altitude.value, posSatE); + double targetDirE[3] = {0, 0, 0}; + VectorOperations::mulScalar(posSatE, -1, targetDirE, 3); + + // Transformation between ECEF and IJK frame + double dcmEJ[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + double dcmJE[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + double dcmEJDot[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + MathOperations::ecfToEciWithNutPre(now, *dcmEJ, *dcmEJDot); + MathOperations::inverseMatrixDimThree(*dcmEJ, *dcmJE); + + double dcmJEDot[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + MathOperations::inverseMatrixDimThree(*dcmEJDot, *dcmJEDot); + + // Transformation between ECEF and Body frame + double dcmBJ[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + double dcmBE[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + double quatBJ[4] = {0, 0, 0, 0}; + quatBJ[0] = outputValues->quatMekfBJ[0]; + quatBJ[1] = outputValues->quatMekfBJ[1]; + quatBJ[2] = outputValues->quatMekfBJ[2]; + quatBJ[3] = outputValues->quatMekfBJ[3]; + QuaternionOperations::toDcm(quatBJ, dcmBJ); + MatrixOperations::multiply(*dcmBJ, *dcmJE, *dcmBE, 3, 3, 3); + + // Target Direction in the body frame + double targetDirB[3] = {0, 0, 0}; + MatrixOperations::multiply(*dcmBE, targetDirE, targetDirB, 3, 3, 1); + + // rotation quaternion from two vectors + double refDir[3] = {0, 0, 0}; + refDir[0] = acsParameters.targetModeControllerParameters.nadirRefDirection[0]; + refDir[1] = acsParameters.targetModeControllerParameters.nadirRefDirection[1]; + refDir[2] = acsParameters.targetModeControllerParameters.nadirRefDirection[2]; + double noramlizedTargetDirB[3] = {0, 0, 0}; + VectorOperations::normalize(targetDirB, noramlizedTargetDirB, 3); + VectorOperations::normalize(refDir, refDir, 3); + double normTargetDirB = VectorOperations::norm(noramlizedTargetDirB, 3); + double normRefDir = VectorOperations::norm(refDir, 3); + double crossDir[3] = {0, 0, 0}; + double dotDirections = VectorOperations::dot(noramlizedTargetDirB, refDir); + VectorOperations::cross(noramlizedTargetDirB, refDir, crossDir); + targetQuat[0] = crossDir[0]; + targetQuat[1] = crossDir[1]; + targetQuat[2] = crossDir[2]; + targetQuat[3] = sqrt(pow(normTargetDirB, 2) * pow(normRefDir, 2) + dotDirections); + VectorOperations::normalize(targetQuat, targetQuat, 4); + + //------------------------------------------------------------------------------------- + // Calculation of reference rotation rate + //------------------------------------------------------------------------------------- + refSatRate[0] = 0; + refSatRate[1] = 0; + refSatRate[2] = 0; + +} + void Guidance::comparePtg(double targetQuat[4], ACS::OutputValues *outputValues, double refSatRate[3], double quatError[3], double deltaRate[3]) { double quatRef[4] = {0, 0, 0, 0}; diff --git a/mission/controller/acs/Guidance.h b/mission/controller/acs/Guidance.h index 7b05a251..eb58daf8 100644 --- a/mission/controller/acs/Guidance.h +++ b/mission/controller/acs/Guidance.h @@ -30,6 +30,10 @@ public: void sunQuatPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, double targetQuat[4], double refSatRate[3]); + // Function to get the target quaternion and refence rotation rate from gps position for Nadir pointing + void targetQuatNadirPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, + double targetQuat[4], double refSatRate[3]); + // @note: compares target Quaternion and reference quaternion, also actual satellite rate and desired void comparePtg( double targetQuat[4], ACS::OutputValues *outputValues, double refSatRate[3], double quatError[3], double deltaRate[3] ); diff --git a/mission/controller/acs/control/PtgCtrl.cpp b/mission/controller/acs/control/PtgCtrl.cpp index a412982d..337a8d8f 100644 --- a/mission/controller/acs/control/PtgCtrl.cpp +++ b/mission/controller/acs/control/PtgCtrl.cpp @@ -16,7 +16,7 @@ #include #include -PtgCtrl::PtgCtrl(AcsParameters *acsParameters_){ +PtgCtrl::PtgCtrl(AcsParameters *acsParameters_): torqueMemory {0, 0, 0, 0}, omegaMemory {0, 0, 0, 0} { loadAcsParameters(acsParameters_); } @@ -164,3 +164,36 @@ void PtgCtrl::ptgNullspace(const int32_t *speedRw0, const int32_t *speedRw1, VectorOperations::mulScalar(rwTrqNs, gainNs, rwTrqNs, 4); VectorOperations::mulScalar(rwTrqNs, -1, rwTrqNs, 4); } + +void PtgCtrl::rwAntistiction(const bool* rwAvailable, const double* omegaRw, + double* torqueCommand) { + for (uint8_t i = 0; i < 4; i++) { + if (rwAvailable[i]) { + if (torqueMemory[i] != 0) { + if ((omegaRw[i] * torqueMemory[i]) + > rwHandlingParameters->stictionReleaseSpeed) { + torqueMemory[i] = 0; + } else { + torqueCommand[i] = torqueMemory[i] + * rwHandlingParameters->stictionTorque; + } + } else { + if ((omegaRw[i] < rwHandlingParameters->stictionSpeed) + && (omegaRw[i] > -rwHandlingParameters->stictionSpeed)) { + if (omegaRw[i] < omegaMemory[i]) { + torqueMemory[i] = -1; + } else { + torqueMemory[i] = 1; + } + + torqueCommand[i] = torqueMemory[i] + * rwHandlingParameters->stictionTorque; + } + } + } else { + torqueMemory[i] = 0; + } + omegaMemory[i] = omegaRw[i]; + } + } +} diff --git a/mission/controller/acs/control/PtgCtrl.h b/mission/controller/acs/control/PtgCtrl.h index 2c92a7e3..2a3bde5c 100644 --- a/mission/controller/acs/control/PtgCtrl.h +++ b/mission/controller/acs/control/PtgCtrl.h @@ -52,11 +52,22 @@ class PtgCtrl { void ptgNullspace(const int32_t *speedRw0, const int32_t *speedRw1, const int32_t *speedRw2, const int32_t *speedRw3, double *rwTrqNs); + /* @brief: Commands the stiction torque in case wheel speed is to low + * @param: rwAvailable Boolean Flag for all reaction wheels + * omegaRw current wheel speed of reaction wheels + * torqueCommand modified torque after antistiction + */ + void rwAntistiction(const bool* rwAvailable, const double* omegaRw, + double* torqueCommand); + private: AcsParameters::PointingModeControllerParameters *pointingModeControllerParameters; AcsParameters::RwHandlingParameters *rwHandlingParameters; AcsParameters::InertiaEIVE *inertiaEIVE; AcsParameters::RwMatrices *rwMatrices; + + double torqueMemory[4]; + double omegaMemory[4]; }; #endif /* ACS_CONTROL_PTGCTRL_H_ */ From 55dec574c5bd23825fbbd1f12dbb6d01c62c86c5 Mon Sep 17 00:00:00 2001 From: Robin Marquardt Date: Mon, 14 Nov 2022 17:16:47 +0100 Subject: [PATCH 006/330] added inertial pointing --- mission/controller/AcsController.cpp | 19 ++++++++++++------- mission/controller/AcsController.h | 3 ++- mission/controller/acs/AcsParameters.h | 10 ++++++---- mission/controller/acs/Guidance.cpp | 15 ++++++++++++--- mission/controller/acs/Guidance.h | 5 ++++- mission/controller/acs/control/PtgCtrl.cpp | 3 +-- mission/controller/acs/control/PtgCtrl.h | 2 +- 7 files changed, 38 insertions(+), 19 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index d2bd0510..6e5e4473 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -43,7 +43,7 @@ void AcsController::performControlOperation() { performDetumble(); break; - case SUBMODE_PTG_GS: + case SUBMODE_PTG_TARGET: performPointingCtrl(); break; @@ -113,7 +113,8 @@ void AcsController::performSafe() { sunTargetDir, satRateSafe, magMomMtq, &magMomMtqValid); } - + double dipolCmdUnits[3] = {0, 0, 0}; + actuatorCmd.cmdDipolMtq(magMomMtq, dipolCmdUnits); } void AcsController::performDetumble() { @@ -154,7 +155,8 @@ void AcsController::performPointingCtrl() { ACS::SensorValues sensorValues; ACS::OutputValues outputValues; - timeval now; // Übergabe ? + timeval now; + Clock::getClock_timeval(&now); sensorProcessing.process(now, &sensorValues, &outputValues, &acsParameters); ReturnValue_t validMekf; @@ -162,14 +164,17 @@ void AcsController::performPointingCtrl() { double targetQuat[4] = {0, 0, 0, 0}, refSatRate[3] = {0, 0, 0}; switch (submode) { - case SUBMODE_PTG_GS: + case SUBMODE_PTG_TARGET: guidance.targetQuatPtg(&sensorValues, &outputValues, now, targetQuat, refSatRate); break; case SUBMODE_PTG_SUN: guidance.sunQuatPtg(&sensorValues, &outputValues, targetQuat, refSatRate); break; case SUBMODE_PTG_NADIR: - guidance.targetQuatNadirPtg(&sensorValues, &outputValues, now, targetQuat, refSatRate); + guidance.quatNadirPtg(&sensorValues, &outputValues, now, targetQuat, refSatRate); + break; + case SUBMODE_PTG_INERTIAL: + guidance.inertialQuatPtg(targetQuat, refSatRate); break; } double quatError[3] = {0, 0, 0}, deltaRate[3] = {0, 0, 0}; @@ -188,8 +193,8 @@ void AcsController::performPointingCtrl() { if (acsParameters.pointingModeControllerParameters.enableAntiStiction) { bool rwAvailable[4] = {true, true, true, true}; // WHICH INPUT SENSOR SET? - double rwSpeed[4] = {&(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), - &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value)}; + int32_t rwSpeed[4] = {(sensorValues.rw1Set.currSpeed.value), (sensorValues.rw2Set.currSpeed.value), + (sensorValues.rw3Set.currSpeed.value), (sensorValues.rw4Set.currSpeed.value)}; ptgCtrl.rwAntistiction(rwAvailable, rwSpeed, torqueRwsScaled); } diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index 21a0c86d..4e9d435a 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -26,9 +26,10 @@ class AcsController : public ExtendedControllerBase { static const Submode_t SUBMODE_SAFE = 2; static const Submode_t SUBMODE_DETUMBLE = 3; - static const Submode_t SUBMODE_PTG_GS = 4; + static const Submode_t SUBMODE_PTG_TARGET = 4; static const Submode_t SUBMODE_PTG_NADIR = 5; static const Submode_t SUBMODE_PTG_SUN = 6; + static const Submode_t SUBMODE_PTG_INERTIAL = 7; protected: diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index ec535b75..953f50db 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -45,10 +45,10 @@ class AcsParameters /*: public HasParametersIF*/ { } inertiaEIVE; struct MgmHandlingParameters { - float mgm0orientationMatrix[3][3] = {{0, 0, -1}, {0, 1, 0}, {1, 0, 0}}; - float mgm1orientationMatrix[3][3] = {{0, 0, 1}, {0, -1, 0}, {1, 0, 0}}; - float mgm2orientationMatrix[3][3] = {{0, 0, -1}, {0, 1, 0}, {1, 0, 0}}; - float mgm3orientationMatrix[3][3] = {{0, 0, 1}, {0, -1, 0}, {1, 0, 0}}; + float mgm0orientationMatrix[3][3] = {{0, 0, -1}, {0, 1, 0}, {1, 0, 0}}; // Documentation not consistent + float mgm1orientationMatrix[3][3] = {{0, 0, 1}, {0, -1, 0}, {1, 0, 0}}; // Documentation not consistent + float mgm2orientationMatrix[3][3] = {{0, 0, -1}, {0, 1, 0}, {1, 0, 0}}; // Documentation not consistent + float mgm3orientationMatrix[3][3] = {{0, 0, 1}, {0, -1, 0}, {1, 0, 0}}; // Documentation not consistent float mgm4orientationMatrix[3][3] = {{0, 0, -1}, {-1, 0, 0}, {0, 1, 0}}; float mgm0hardIronOffset[3] = {19.89364, -29.94111, -31.07508}; @@ -850,6 +850,8 @@ class AcsParameters /*: public HasParametersIF*/ { double omegaEarth = 0.000072921158553; double nadirRefDirection[3] = {-1, 0, 0}; //Camera + double refQuatInertial[4] = {0, 0, 0, 1}; + double refRotRateInertial[3] = {0, 0, 0}; } pointingModeControllerParameters, inertialModeControllerParameters, nadirModeControllerParameters, targetModeControllerParameters; struct StrParameters { diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index bd7ccf6c..b2f47953 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -32,9 +32,9 @@ void Guidance::getTargetParamsSafe(double sunTargetSafe[3], double satRateSafe[3 void Guidance::targetQuatPtg(ACS::SensorValues *sensorValues, ACS::OutputValues *outputValues, timeval now, double targetQuat[4], double refSatRate[3]) { //------------------------------------------------------------------------------------- - // Calculation of target quaternion to groundstation + // Calculation of target quaternion to groundstation or given latitude, longitude and altitude //------------------------------------------------------------------------------------- - // Transform longitude, latitude and altitude of groundstation to cartesian coordiantes (earth + // Transform longitude, latitude and altitude to cartesian coordiantes (earth // fixed/centered frame) double groundStationCart[3] = {0, 0, 0}; @@ -234,7 +234,7 @@ void Guidance::sunQuatPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *ou refSatRate[2] = 0; } -void Guidance::targetQuatNadirPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, +void Guidance::quatNadirPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, double targetQuat[4], double refSatRate[3]) { //------------------------------------------------------------------------------------- // Calculation of target quaternion for Nadir pointing @@ -301,6 +301,15 @@ void Guidance::targetQuatNadirPtg(ACS::SensorValues* sensorValues, ACS::OutputVa } +void Guidance::inertialQuatPtg(double targetQuat[4], double refSatRate[3]) { + for (int i = 0; i < 4; i++) { + targetQuat[i] = acsParameters.inertialModeControllerParameters.refQuatInertial[i]; + } + for (int i = 0; i < 3; i++) { + refSatRate[i] = acsParameters.inertialModeControllerParameters.refRotRateInertial[i]; + } +} + void Guidance::comparePtg(double targetQuat[4], ACS::OutputValues *outputValues, double refSatRate[3], double quatError[3], double deltaRate[3]) { double quatRef[4] = {0, 0, 0, 0}; diff --git a/mission/controller/acs/Guidance.h b/mission/controller/acs/Guidance.h index eb58daf8..6b0759fb 100644 --- a/mission/controller/acs/Guidance.h +++ b/mission/controller/acs/Guidance.h @@ -31,9 +31,12 @@ public: double targetQuat[4], double refSatRate[3]); // Function to get the target quaternion and refence rotation rate from gps position for Nadir pointing - void targetQuatNadirPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, + void quatNadirPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, double targetQuat[4], double refSatRate[3]); + // Function to get the target quaternion and refence rotation rate from parameters for inertial pointing + void inertialQuatPtg(double targetQuat[4], double refSatRate[3]); + // @note: compares target Quaternion and reference quaternion, also actual satellite rate and desired void comparePtg( double targetQuat[4], ACS::OutputValues *outputValues, double refSatRate[3], double quatError[3], double deltaRate[3] ); diff --git a/mission/controller/acs/control/PtgCtrl.cpp b/mission/controller/acs/control/PtgCtrl.cpp index 337a8d8f..fd9dd9eb 100644 --- a/mission/controller/acs/control/PtgCtrl.cpp +++ b/mission/controller/acs/control/PtgCtrl.cpp @@ -165,7 +165,7 @@ void PtgCtrl::ptgNullspace(const int32_t *speedRw0, const int32_t *speedRw1, VectorOperations::mulScalar(rwTrqNs, -1, rwTrqNs, 4); } -void PtgCtrl::rwAntistiction(const bool* rwAvailable, const double* omegaRw, +void PtgCtrl::rwAntistiction(const bool* rwAvailable, const int32_t* omegaRw, double* torqueCommand) { for (uint8_t i = 0; i < 4; i++) { if (rwAvailable[i]) { @@ -196,4 +196,3 @@ void PtgCtrl::rwAntistiction(const bool* rwAvailable, const double* omegaRw, omegaMemory[i] = omegaRw[i]; } } -} diff --git a/mission/controller/acs/control/PtgCtrl.h b/mission/controller/acs/control/PtgCtrl.h index 2a3bde5c..8cacd556 100644 --- a/mission/controller/acs/control/PtgCtrl.h +++ b/mission/controller/acs/control/PtgCtrl.h @@ -57,7 +57,7 @@ class PtgCtrl { * omegaRw current wheel speed of reaction wheels * torqueCommand modified torque after antistiction */ - void rwAntistiction(const bool* rwAvailable, const double* omegaRw, + void rwAntistiction(const bool* rwAvailable, const int32_t* omegaRw, double* torqueCommand); private: From 311d03e6800baa0fef86c14ccd467875a7b8e477 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 16 Nov 2022 16:36:59 +0100 Subject: [PATCH 007/330] basic changes for heater handler --- mission/devices/HeaterHandler.cpp | 4 ++++ mission/devices/HeaterHandler.h | 3 +++ tmtc | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/mission/devices/HeaterHandler.cpp b/mission/devices/HeaterHandler.cpp index 3c25eb6a..17bdf640 100644 --- a/mission/devices/HeaterHandler.cpp +++ b/mission/devices/HeaterHandler.cpp @@ -321,6 +321,10 @@ HeaterHandler::SwitchState HeaterHandler::checkSwitchState(heater::Switchers swi return heaterVec.at(switchNr).switchState; } +ReturnValue_t HeaterHandler::switchHeater(heater::Switchers heater, ReturnValue_t onOff) { + return sendSwitchCommand(heater, onOff); +} + bool HeaterHandler::allSwitchesOff() { bool allSwitchesOrd = false; MutexGuard mg(heaterMutex); diff --git a/mission/devices/HeaterHandler.h b/mission/devices/HeaterHandler.h index b63f4dfe..dce6454a 100644 --- a/mission/devices/HeaterHandler.h +++ b/mission/devices/HeaterHandler.h @@ -40,6 +40,7 @@ class HeaterHandler : public ExecutableObjectIF, public PowerSwitchIF, public SystemObject, public HasActionsIF { + friend class ThermalController; public: static const uint8_t INTERFACE_ID = CLASS_ID::HEATER_HANDLER; @@ -59,6 +60,8 @@ class HeaterHandler : public ExecutableObjectIF, virtual ~HeaterHandler(); +protected: + ReturnValue_t switchHeater(heater::Switchers heater, ReturnValue_t onOff); ReturnValue_t performOperation(uint8_t operationCode = 0) override; ReturnValue_t sendSwitchCommand(uint8_t switchNr, ReturnValue_t onOff) override; diff --git a/tmtc b/tmtc index 66a1362e..d5813e1a 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 66a1362e7e977e427a66fd3176a9e7b6bc1b5998 +Subproject commit d5813e1a422beae7d0cb092a885e0956e9f1ddc1 From 33bd5cb63a276dad101c53af730c49120f07616f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 16 Nov 2022 17:33:19 +0100 Subject: [PATCH 008/330] this is going to be annoying --- dummies/TemperatureSensorsDummy.cpp | 28 +++++++++++-------- dummies/TemperatureSensorsDummy.h | 3 +- mission/controller/ThermalController.cpp | 2 ++ mission/controller/ThermalController.h | 8 ++++++ .../ThermalControllerDefinitions.h | 7 +++-- mission/devices/HeaterHandler.cpp | 2 +- mission/devices/HeaterHandler.h | 5 ++-- 7 files changed, 36 insertions(+), 19 deletions(-) diff --git a/dummies/TemperatureSensorsDummy.cpp b/dummies/TemperatureSensorsDummy.cpp index 52190ee8..ccf3f0a7 100644 --- a/dummies/TemperatureSensorsDummy.cpp +++ b/dummies/TemperatureSensorsDummy.cpp @@ -7,7 +7,8 @@ TemperatureSensorsDummy::TemperatureSensorsDummy() : ExtendedControllerBase(objects::RTD_0_IC3_PLOC_HEATSPREADER), - max31865Set(this, MAX31865::MAX31865_SET_ID) { + max31865PlocHeatspreaderSet(objects::RTD_0_IC3_PLOC_HEATSPREADER, MAX31865::MAX31865_SET_ID), + max31865PlocMissionboardSet(objects::RTD_1_IC4_PLOC_MISSIONBOARD, MAX31865::MAX31865_SET_ID) { ObjectManager::instance()->insert(objects::RTD_1_IC4_PLOC_MISSIONBOARD, this); ObjectManager::instance()->insert(objects::RTD_2_IC5_4K_CAMERA, this); ObjectManager::instance()->insert(objects::RTD_3_IC6_DAC_HEATSPREADER, this); @@ -37,6 +38,8 @@ ReturnValue_t TemperatureSensorsDummy::initialize() { } } + max31865PlocHeatspreaderSet.temperatureCelcius = 20.0; + max31865PlocMissionboardSet.temperatureCelcius = 20.0; return returnvalue::OK; } @@ -48,18 +51,18 @@ void TemperatureSensorsDummy::performControlOperation() { iteration++; value = sin(iteration / 80. * M_PI) * 10; - ReturnValue_t result = max31865Set.read(); + ReturnValue_t result = max31865PlocHeatspreaderSet.read(); if (result != returnvalue::OK) { sif::warning << "Failed to read temperature from MAX31865 dataset" << std::endl; } - max31865Set.rtdValue = value - 5; - max31865Set.temperatureCelcius = value; + max31865PlocHeatspreaderSet.rtdValue = value - 5; + max31865PlocHeatspreaderSet.temperatureCelcius = value; if ((iteration % 100) < 20) { - max31865Set.setValidity(false, true); + max31865PlocHeatspreaderSet.setValidity(false, true); } else { - max31865Set.setValidity(true, true); + max31865PlocHeatspreaderSet.setValidity(true, true); } - max31865Set.commit(); + max31865PlocHeatspreaderSet.commit(); } ReturnValue_t TemperatureSensorsDummy::initializeLocalDataPool( @@ -78,11 +81,12 @@ ReturnValue_t TemperatureSensorsDummy::initializeLocalDataPool( LocalPoolDataSetBase* TemperatureSensorsDummy::getDataSetHandle(sid_t sid) { sif::debug << "getHandle" << std::endl; - switch (sid.ownerSetId) { - case MAX31865::MAX31865_SET_ID: - return &max31865Set; - default: - return nullptr; + if (sid.objectId == objects::RTD_0_IC3_PLOC_HEATSPREADER) { + return &max31865PlocHeatspreaderSet; + } else if (sid.objectId == objects::RTD_1_IC4_PLOC_MISSIONBOARD) { + return &max31865PlocMissionboardSet; + } else { + return nullptr; } } diff --git a/dummies/TemperatureSensorsDummy.h b/dummies/TemperatureSensorsDummy.h index e41a9af0..0fcdfadb 100644 --- a/dummies/TemperatureSensorsDummy.h +++ b/dummies/TemperatureSensorsDummy.h @@ -23,7 +23,8 @@ class TemperatureSensorsDummy : public ExtendedControllerBase { private: int iteration = 0; float value = 0; - MAX31865::Max31865Set max31865Set; + MAX31865::Max31865Set max31865PlocHeatspreaderSet; + MAX31865::Max31865Set max31865PlocMissionboardSet; void noise(); }; diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 45f26f8b..3e228ad5 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -102,6 +102,8 @@ void ThermalController::performControlOperation() { copyDevices(); deviceTemperatures.commit(); } + + // TODO: Heater control } ReturnValue_t ThermalController::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 5071d811..d401c5b5 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -8,6 +8,12 @@ #include #include +struct TempLimits { + TempLimits(float lowerLimit, float upperLimit) : lowerLimit(lowerLimit), upperLimit(upperLimit) {} + float lowerLimit; + float upperLimit; +}; + class ThermalController : public ExtendedControllerBase { public: static const uint16_t INVALID_TEMPERATURE = 999; @@ -75,6 +81,8 @@ class ThermalController : public ExtendedControllerBase { SUS::SusDataset susSet10; SUS::SusDataset susSet11; + TempLimits eBandLimits = TempLimits(10.0, 20.0); + // Initial delay to make sure all pool variables have been initialized their owners Countdown initialCountdown = Countdown(DELAY); diff --git a/mission/controller/controllerdefinitions/ThermalControllerDefinitions.h b/mission/controller/controllerdefinitions/ThermalControllerDefinitions.h index 9f800bec..0c16d3ea 100644 --- a/mission/controller/controllerdefinitions/ThermalControllerDefinitions.h +++ b/mission/controller/controllerdefinitions/ThermalControllerDefinitions.h @@ -102,12 +102,13 @@ class SensorTemperatures : public StaticLocalDataSet sensor_startracker = lp_var_t(sid.objectId, PoolIds::SENSOR_STARTRACKER, this); lp_var_t sensor_rw1 = lp_var_t(sid.objectId, PoolIds::SENSOR_RW1, this); - lp_var_t sensor_dro = lp_var_t(sid.objectId, PoolIds::SENSOR_DRO, this); lp_var_t sensor_scex = lp_var_t(sid.objectId, PoolIds::SENSOR_SCEX, this); + lp_var_t sensor_tx_modul = lp_var_t(sid.objectId, PoolIds::SENSOR_TX_MODUL, this); + // E-Band module + lp_var_t sensor_dro = lp_var_t(sid.objectId, PoolIds::SENSOR_DRO, this); + lp_var_t sensor_mpa = lp_var_t(sid.objectId, PoolIds::SENSOR_MPA, this); lp_var_t sensor_x8 = lp_var_t(sid.objectId, PoolIds::SENSOR_X8, this); lp_var_t sensor_hpa = lp_var_t(sid.objectId, PoolIds::SENSOR_HPA, this); - lp_var_t sensor_tx_modul = lp_var_t(sid.objectId, PoolIds::SENSOR_TX_MODUL, this); - lp_var_t sensor_mpa = lp_var_t(sid.objectId, PoolIds::SENSOR_MPA, this); lp_var_t sensor_acu = lp_var_t(sid.objectId, PoolIds::SENSOR_ACU, this); lp_var_t sensor_plpcdu_heatspreader = lp_var_t(sid.objectId, PoolIds::SENSOR_PLPCDU_HEATSPREADER, this); diff --git a/mission/devices/HeaterHandler.cpp b/mission/devices/HeaterHandler.cpp index 17bdf640..61a44de6 100644 --- a/mission/devices/HeaterHandler.cpp +++ b/mission/devices/HeaterHandler.cpp @@ -322,7 +322,7 @@ HeaterHandler::SwitchState HeaterHandler::checkSwitchState(heater::Switchers swi } ReturnValue_t HeaterHandler::switchHeater(heater::Switchers heater, ReturnValue_t onOff) { - return sendSwitchCommand(heater, onOff); + return sendSwitchCommand(heater, onOff); } bool HeaterHandler::allSwitchesOff() { diff --git a/mission/devices/HeaterHandler.h b/mission/devices/HeaterHandler.h index dce6454a..271e1bd1 100644 --- a/mission/devices/HeaterHandler.h +++ b/mission/devices/HeaterHandler.h @@ -40,7 +40,8 @@ class HeaterHandler : public ExecutableObjectIF, public PowerSwitchIF, public SystemObject, public HasActionsIF { - friend class ThermalController; + friend class ThermalController; + public: static const uint8_t INTERFACE_ID = CLASS_ID::HEATER_HANDLER; @@ -60,7 +61,7 @@ class HeaterHandler : public ExecutableObjectIF, virtual ~HeaterHandler(); -protected: + protected: ReturnValue_t switchHeater(heater::Switchers heater, ReturnValue_t onOff); ReturnValue_t performOperation(uint8_t operationCode = 0) override; From 609d429161129e18581a62575327efc92b8dd482 Mon Sep 17 00:00:00 2001 From: Robin Marquardt Date: Tue, 22 Nov 2022 21:10:05 +0100 Subject: [PATCH 009/330] added Nadir FLP version --- mission/controller/AcsController.cpp | 2 +- mission/controller/acs/AcsParameters.h | 1 + mission/controller/acs/Guidance.cpp | 94 +++++++++++++++++++++++++- mission/controller/acs/Guidance.h | 6 ++ 4 files changed, 101 insertions(+), 2 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 6e5e4473..7ef85399 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -171,7 +171,7 @@ void AcsController::performPointingCtrl() { guidance.sunQuatPtg(&sensorValues, &outputValues, targetQuat, refSatRate); break; case SUBMODE_PTG_NADIR: - guidance.quatNadirPtg(&sensorValues, &outputValues, now, targetQuat, refSatRate); + guidance.quatNadirPtgFLPVersion(&sensorValues, &outputValues, now, targetQuat, refSatRate); break; case SUBMODE_PTG_INERTIAL: guidance.inertialQuatPtg(targetQuat, refSatRate); diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index 953f50db..3566d3fb 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -852,6 +852,7 @@ class AcsParameters /*: public HasParametersIF*/ { double nadirRefDirection[3] = {-1, 0, 0}; //Camera double refQuatInertial[4] = {0, 0, 0, 1}; double refRotRateInertial[3] = {0, 0, 0}; + int8_t nadirTimeElapsedMax = 10; } pointingModeControllerParameters, inertialModeControllerParameters, nadirModeControllerParameters, targetModeControllerParameters; struct StrParameters { diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index b2f47953..0d0022fc 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -125,10 +125,10 @@ void Guidance::targetQuatPtg(ACS::SensorValues *sensorValues, ACS::OutputValues // Calculation of reference rotation rate in case of star tracker blinding //------------------------------------------------------------------------------------- if (acsParameters.targetModeControllerParameters.avoidBlindStr) { - double sunDirJ[3] = {0, 0, 0}; double sunDirB[3] = {0, 0, 0}; if (outputValues->sunDirModelValid) { + double sunDirJ[3] = {0, 0, 0}; sunDirJ[0] = outputValues->sunDirModel[0]; sunDirJ[1] = outputValues->sunDirModel[1]; sunDirJ[2] = outputValues->sunDirModel[2]; @@ -301,6 +301,98 @@ void Guidance::quatNadirPtg(ACS::SensorValues* sensorValues, ACS::OutputValues * } +void Guidance::quatNadirPtgFLPVersion(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, + double targetQuat[4], double refSatRate[3]) { + + //------------------------------------------------------------------------------------- + // Calculation of target quaternion for Nadir pointing + //------------------------------------------------------------------------------------- + // Position of the satellite in the earth/fixed frame via GPS + double posSatE[3] = {0, 0, 0}; + double geodeticLatRad = (sensorValues->gpsSet.latitude.value)*PI/180; + double longitudeRad = (sensorValues->gpsSet.longitude.value)*PI/180; + MathOperations::cartesianFromLatLongAlt(geodeticLatRad,longitudeRad, + sensorValues->gpsSet.altitude.value, posSatE); + double targetDirE[3] = {0, 0, 0}; + VectorOperations::mulScalar(posSatE, -1, targetDirE, 3); + + // Transformation between ECEF and IJK frame + double dcmEJ[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + double dcmJE[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + double dcmEJDot[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + MathOperations::ecfToEciWithNutPre(now, *dcmEJ, *dcmEJDot); + MathOperations::inverseMatrixDimThree(*dcmEJ, *dcmJE); + + double dcmJEDot[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + MathOperations::inverseMatrixDimThree(*dcmEJDot, *dcmJEDot); + + // Target Direction in the body frame + double targetDirJ[3] = {0, 0, 0}; + MatrixOperations::multiply(*dcmJE, targetDirE, targetDirJ, 3, 3, 1); + + // negative x-Axis aligned with target (Camera position) + double xAxis[3] = {0, 0, 0}; + VectorOperations::normalize(targetDirJ, xAxis, 3); + VectorOperations::mulScalar(xAxis, -1, xAxis, 3); + + // z-Axis parallel to long side of picture resolution + double zAxis[3] = {0, 0, 0}; + double velocityE[3] = {outputValues->gpsVelocity[0], outputValues->gpsVelocity[1], outputValues->gpsVelocity[2]}; + double velocityJ[3] = {0, 0, 0}, velPart1[3] = {0, 0, 0}, velPart2[3] = {0, 0, 0}; + MatrixOperations::multiply(*dcmJE, velocityE, velPart1, 3, 3, 1); + MatrixOperations::multiply(*dcmJEDot, posSatE, velPart2, 3, 3, 1); + VectorOperations::add(velPart1, velPart2, velocityJ, 3); + VectorOperations::cross(xAxis, velocityJ, zAxis); + VectorOperations::normalize(zAxis, zAxis, 3); + + // y-Axis completes RHS + double yAxis[3] = {0, 0, 0}; + VectorOperations::cross(zAxis, xAxis, yAxis); + + //Complete transformation matrix + double dcmTgt[3][3] = {{xAxis[0], yAxis[0], zAxis[0]}, {xAxis[1], yAxis[1], zAxis[1]}, {xAxis[2], yAxis[2], zAxis[2]}}; + QuaternionOperations::fromDcm(dcmTgt,targetQuat); + + //------------------------------------------------------------------------------------- + // Calculation of reference rotation rate + //------------------------------------------------------------------------------------- + double timeElapsed = now.tv_sec + now.tv_usec * pow(10,-6) - (timeSavedQuaternionNadir.tv_sec + + timeSavedQuaternionNadir.tv_usec * pow(timeSavedQuaternionNadir.tv_usec,-6)); + if (timeElapsed < acsParameters.pointingModeControllerParameters.nadirTimeElapsedMax) { + double qDiff[4] = {0, 0, 0, 0}; + VectorOperations::subtract(targetQuat, savedQuaternionNadir, qDiff, 4); + VectorOperations::mulScalar(qDiff, 1/timeElapsed, qDiff, 4); + + double tgtQuatVec[3] = {targetQuat[0], targetQuat[1], targetQuat[2]}, + qDiffVec[3] = {qDiff[0], qDiff[1], qDiff[2]}; + double sum1[3] = {0, 0, 0}, sum2[3] = {0, 0, 0}, sum3[3] = {0, 0, 0}, sum[3] = {0, 0, 0}; + VectorOperations::cross(targetQuat, qDiff, sum1); + VectorOperations::mulScalar(tgtQuatVec, qDiff[3], sum2, 3); + VectorOperations::mulScalar(qDiffVec, targetQuat[3], sum3, 3); + VectorOperations::add(sum1, sum2, sum, 3); + VectorOperations::subtract(sum, sum3, sum, 3); + double omegaRefNew[3] = {0, 0, 0}; + VectorOperations::mulScalar(sum, -2, omegaRefNew, 3); + + VectorOperations::mulScalar(omegaRefNew, 2, refSatRate, 3); + VectorOperations::subtract(refSatRate, omegaRefSavedNadir, refSatRate, 3); + omegaRefSavedNadir[0] = omegaRefNew[0]; + omegaRefSavedNadir[1] = omegaRefNew[1]; + omegaRefSavedNadir[2] = omegaRefNew[2]; + } + else { + refSatRate[0] = 0; + refSatRate[1] = 0; + refSatRate[2] = 0; + } + + timeSavedQuaternionNadir = now; + savedQuaternionNadir[0] = targetQuat[0]; + savedQuaternionNadir[1] = targetQuat[1]; + savedQuaternionNadir[2] = targetQuat[2]; + savedQuaternionNadir[3] = targetQuat[3]; +} + void Guidance::inertialQuatPtg(double targetQuat[4], double refSatRate[3]) { for (int i = 0; i < 4; i++) { targetQuat[i] = acsParameters.inertialModeControllerParameters.refQuatInertial[i]; diff --git a/mission/controller/acs/Guidance.h b/mission/controller/acs/Guidance.h index 6b0759fb..80ef6cf4 100644 --- a/mission/controller/acs/Guidance.h +++ b/mission/controller/acs/Guidance.h @@ -34,6 +34,9 @@ public: void quatNadirPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, double targetQuat[4], double refSatRate[3]); + void quatNadirPtgFLPVersion(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, + double targetQuat[4], double refSatRate[3]); + // Function to get the target quaternion and refence rotation rate from parameters for inertial pointing void inertialQuatPtg(double targetQuat[4], double refSatRate[3]); @@ -48,6 +51,9 @@ public: private: AcsParameters acsParameters; bool strBlindAvoidFlag = false; + timeval timeSavedQuaternionNadir; + double savedQuaternionNadir[4] = {0, 0, 0, 0}; + double omegaRefSavedNadir[3] = {0, 0, 0}; }; #endif /* ACS_GUIDANCE_H_ */ From d980c0404c8d4c7558365fd3b2c7a72817060bd9 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Wed, 23 Nov 2022 19:38:30 +0100 Subject: [PATCH 010/330] thermalcontroller constructor added --- mission/controller/ThermalController.cpp | 3 ++- mission/controller/ThermalController.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 3e228ad5..10a14b15 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -14,8 +14,9 @@ #include #include -ThermalController::ThermalController(object_id_t objectId) +ThermalController::ThermalController(object_id_t objectId, HeaterHandler& heater) : ExtendedControllerBase(objectId), + heater(heater), sensorTemperatures(this), susTemperatures(this), deviceTemperatures(this), diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index d401c5b5..03024542 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -18,7 +18,7 @@ class ThermalController : public ExtendedControllerBase { public: static const uint16_t INVALID_TEMPERATURE = 999; - ThermalController(object_id_t objectId); + ThermalController(object_id_t objectId, HeaterHandler& heater); ReturnValue_t initialize() override; From f35ed8101a9c4f6e80c82d2ca91819f4dce445c2 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Wed, 23 Nov 2022 19:45:37 +0100 Subject: [PATCH 011/330] renamed heater_7_s_band --- common/config/devices/heaterSwitcherList.h | 2 +- mission/controller/ThermalController.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/common/config/devices/heaterSwitcherList.h b/common/config/devices/heaterSwitcherList.h index 68034117..8f91385d 100644 --- a/common/config/devices/heaterSwitcherList.h +++ b/common/config/devices/heaterSwitcherList.h @@ -12,7 +12,7 @@ enum Switchers : uint8_t { HEATER_4_CAMERA, HEATER_5_STR, HEATER_6_DRO, - HEATER_7_HPA, + HEATER_7_S_BAND, NUMBER_OF_SWITCHES }; } diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 03024542..d69bc4cc 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -12,6 +12,8 @@ struct TempLimits { TempLimits(float lowerLimit, float upperLimit) : lowerLimit(lowerLimit), upperLimit(upperLimit) {} float lowerLimit; float upperLimit; + //TODO define limits + }; class ThermalController : public ExtendedControllerBase { From 92b732a189a344fdff408df1145d99fc41fb8d34 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Thu, 24 Nov 2022 11:35:05 +0100 Subject: [PATCH 012/330] existing TempLimits defined --- mission/controller/ThermalController.h | 27 ++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index d69bc4cc..9ab14d87 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -9,9 +9,11 @@ #include struct TempLimits { - TempLimits(float lowerLimit, float upperLimit) : lowerLimit(lowerLimit), upperLimit(upperLimit) {} - float lowerLimit; - float upperLimit; + TempLimits(float opLowerLimit, float opUpperLimit, float nopLowerLimit, float nsopUpperLimit) : opLowerLimit(opLowerLimit), opUpperLimit(opUpperLimit), nopLowerLimit(nopLowerLimit), nopUpperLimit(nopUpperLimit) {} + float opLowerLimit; + float opUpperLimit; + float nopLowerLimit; + float nopUpperLimit; //TODO define limits }; @@ -83,7 +85,24 @@ class ThermalController : public ExtendedControllerBase { SUS::SusDataset susSet10; SUS::SusDataset susSet11; - TempLimits eBandLimits = TempLimits(10.0, 20.0); + //TempLimits + //TempLimits plocHeatspreaderLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); + //TempLimits plocMissionBoardLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); + TempLimits cameraLimits = TempLimits(-30.0, 65.0, -40.0, 85.0); + TempLimits dacHeatspreaderLimits = TempLimits(-40.0, 118.0, -65.0, 150.0); + TempLimits strLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); + TempLimits rw1Limits = TempLimits(-40.0, 85.0, -40.0, 85.0); + //TempLimits droLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); + TempLimits scexLimits = TempLimits(-40.0, 85.0, -60.0, 150.0); + //TempLimits x8Limits = TempLimits(-20.0, 70.0, -30.0, 80.0); + //TempLimits hpaLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); + //TempLimits txModuleLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); + //TempLimits mpaLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); + TempLimits acuLimits = TempLimits(-35.0, 85.0, -55.0, 150.0); //TODO nopLimits + TempLimits plpcduHeatspreaderLimits = TempLimits(-40.0, 85.0, -65.0, 125.0); //TODO check + TempLimits tcsBoardLimits = TempLimits(-40.0, 85.0, -60.0, 130.0); + TempLimits magnettorquerLimits = TempLimits(-40.0, 70.0, -30.0, 80.0); //TODO nopLimits + // Initial delay to make sure all pool variables have been initialized their owners Countdown initialCountdown = Countdown(DELAY); From 8d1cbd9f8b64f00c9e40571efffb5eda3753dc72 Mon Sep 17 00:00:00 2001 From: Robin Marquardt Date: Thu, 24 Nov 2022 13:40:55 +0100 Subject: [PATCH 013/330] changed calculation of quaternion for target and sun pointing --- mission/controller/AcsController.cpp | 4 +- mission/controller/acs/AcsParameters.h | 4 +- mission/controller/acs/Guidance.cpp | 238 ++++++++++++++++++++++--- mission/controller/acs/Guidance.h | 8 +- 4 files changed, 221 insertions(+), 33 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 7ef85399..211bea30 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -168,10 +168,10 @@ void AcsController::performPointingCtrl() { guidance.targetQuatPtg(&sensorValues, &outputValues, now, targetQuat, refSatRate); break; case SUBMODE_PTG_SUN: - guidance.sunQuatPtg(&sensorValues, &outputValues, targetQuat, refSatRate); + guidance.sunQuatPtg(&sensorValues, &outputValues, now, targetQuat, refSatRate); break; case SUBMODE_PTG_NADIR: - guidance.quatNadirPtgFLPVersion(&sensorValues, &outputValues, now, targetQuat, refSatRate); + guidance.quatNadirPtg(&sensorValues, &outputValues, now, targetQuat, refSatRate); break; case SUBMODE_PTG_INERTIAL: guidance.inertialQuatPtg(targetQuat, refSatRate); diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index 3566d3fb..24018ad9 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -850,8 +850,8 @@ class AcsParameters /*: public HasParametersIF*/ { double omegaEarth = 0.000072921158553; double nadirRefDirection[3] = {-1, 0, 0}; //Camera - double refQuatInertial[4] = {0, 0, 0, 1}; - double refRotRateInertial[3] = {0, 0, 0}; + double tgtQuatInertial[4] = {0, 0, 0, 1}; + double tgtRotRateInertial[3] = {0, 0, 0}; int8_t nadirTimeElapsedMax = 10; } pointingModeControllerParameters, inertialModeControllerParameters, nadirModeControllerParameters, targetModeControllerParameters; diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index 0d0022fc..d1799d60 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -29,7 +29,7 @@ void Guidance::getTargetParamsSafe(double sunTargetSafe[3], double satRateSafe[3 // memcpy(sunTargetSafe, acsParameters.safeModeControllerParameters.sunTargetDir, 24); } -void Guidance::targetQuatPtg(ACS::SensorValues *sensorValues, ACS::OutputValues *outputValues, +void Guidance::targetQuatPtgOldVersion(ACS::SensorValues *sensorValues, ACS::OutputValues *outputValues, timeval now, double targetQuat[4], double refSatRate[3]) { //------------------------------------------------------------------------------------- // Calculation of target quaternion to groundstation or given latitude, longitude and altitude @@ -181,7 +181,124 @@ void Guidance::targetQuatPtg(ACS::SensorValues *sensorValues, ACS::OutputValues } } -void Guidance::sunQuatPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, +void Guidance::targetQuatPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, + double targetQuat[4], double refSatRate[3]) { + + //------------------------------------------------------------------------------------- + // Calculation of target quaternion for target pointing + //------------------------------------------------------------------------------------- + // Transform longitude, latitude and altitude to cartesian coordiantes (earth + // fixed/centered frame) + double groundStationCart[3] = {0, 0, 0}; + + MathOperations::cartesianFromLatLongAlt(acsParameters.groundStationParameters.latitudeGs, + acsParameters.groundStationParameters.longitudeGs, + acsParameters.groundStationParameters.altitudeGs, + groundStationCart); + // Position of the satellite in the earth/fixed frame via GPS + double posSatE[3] = {0, 0, 0}; + double geodeticLatRad = (sensorValues->gpsSet.latitude.value)*PI/180; + double longitudeRad = (sensorValues->gpsSet.longitude.value)*PI/180; + MathOperations::cartesianFromLatLongAlt(geodeticLatRad,longitudeRad, + sensorValues->gpsSet.altitude.value, posSatE); + double targetDirE[3] = {0, 0, 0}; + VectorOperations::subtract(groundStationCart, posSatE, targetDirE, 3); + + // Transformation between ECEF and IJK frame + double dcmEJ[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + double dcmJE[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + double dcmEJDot[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + MathOperations::ecfToEciWithNutPre(now, *dcmEJ, *dcmEJDot); + MathOperations::inverseMatrixDimThree(*dcmEJ, *dcmJE); + + double dcmJEDot[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + MathOperations::inverseMatrixDimThree(*dcmEJDot, *dcmJEDot); + + // Target Direction and position vector in the inertial frame + double targetDirJ[3] = {0, 0, 0}, posSatJ[3] = {0, 0, 0}; + MatrixOperations::multiply(*dcmJE, targetDirE, targetDirJ, 3, 3, 1); + MatrixOperations::multiply(*dcmJE, posSatE, posSatJ, 3, 3, 1); + + // negative x-Axis aligned with target (Camera/E-band transmitter position) + double xAxis[3] = {0, 0, 0}; + VectorOperations::normalize(targetDirJ, xAxis, 3); + VectorOperations::mulScalar(xAxis, -1, xAxis, 3); + + // Transform velocity into inertial frame + double velocityE[3] = {outputValues->gpsVelocity[0], outputValues->gpsVelocity[1], outputValues->gpsVelocity[2]}; + double velocityJ[3] = {0, 0, 0}, velPart1[3] = {0, 0, 0}, velPart2[3] = {0, 0, 0}; + MatrixOperations::multiply(*dcmJE, velocityE, velPart1, 3, 3, 1); + MatrixOperations::multiply(*dcmJEDot, posSatE, velPart2, 3, 3, 1); + VectorOperations::add(velPart1, velPart2, velocityJ, 3); + + // orbital normal vector + double orbitalNormalJ[3] = {0, 0, 0}; + VectorOperations::cross(posSatJ, velocityJ, orbitalNormalJ); + VectorOperations::normalize(orbitalNormalJ, orbitalNormalJ, 3); + + // y-Axis of satellite in orbit plane so that z-axis parallel to long side of picture resolution + double yAxis[3] = {0, 0, 0}; + VectorOperations::cross(orbitalNormalJ, xAxis, yAxis); + VectorOperations::normalize(yAxis, yAxis, 3); + + // z-Axis completes RHS + double zAxis[3] = {0, 0, 0}; + VectorOperations::cross(xAxis, yAxis, zAxis); + + //Complete transformation matrix + double dcmTgt[3][3] = {{xAxis[0], yAxis[0], zAxis[0]}, {xAxis[1], yAxis[1], zAxis[1]}, {xAxis[2], yAxis[2], zAxis[2]}}; + double quatInertialTarget[4] = {0, 0, 0, 0}; + QuaternionOperations::fromDcm(dcmTgt,quatInertialTarget); + + //------------------------------------------------------------------------------------- + // Calculation of reference rotation rate + //------------------------------------------------------------------------------------- + double timeElapsed = now.tv_sec + now.tv_usec * pow(10,-6) - (timeSavedQuaternionNadir.tv_sec + + timeSavedQuaternionNadir.tv_usec * pow(timeSavedQuaternionNadir.tv_usec,-6)); + if (timeElapsed < acsParameters.pointingModeControllerParameters.nadirTimeElapsedMax) { + double qDiff[4] = {0, 0, 0, 0}; + VectorOperations::subtract(quatInertialTarget, savedQuaternionNadir, qDiff, 4); + VectorOperations::mulScalar(qDiff, 1/timeElapsed, qDiff, 4); + + double tgtQuatVec[3] = {quatInertialTarget[0], quatInertialTarget[1], quatInertialTarget[2]}, + qDiffVec[3] = {qDiff[0], qDiff[1], qDiff[2]}; + double sum1[3] = {0, 0, 0}, sum2[3] = {0, 0, 0}, sum3[3] = {0, 0, 0}, sum[3] = {0, 0, 0}; + VectorOperations::cross(quatInertialTarget, qDiff, sum1); + VectorOperations::mulScalar(tgtQuatVec, qDiff[3], sum2, 3); + VectorOperations::mulScalar(qDiffVec, quatInertialTarget[3], sum3, 3); + VectorOperations::add(sum1, sum2, sum, 3); + VectorOperations::subtract(sum, sum3, sum, 3); + double omegaRefNew[3] = {0, 0, 0}; + VectorOperations::mulScalar(sum, -2, omegaRefNew, 3); + + VectorOperations::mulScalar(omegaRefNew, 2, refSatRate, 3); + VectorOperations::subtract(refSatRate, omegaRefSavedNadir, refSatRate, 3); + omegaRefSavedNadir[0] = omegaRefNew[0]; + omegaRefSavedNadir[1] = omegaRefNew[1]; + omegaRefSavedNadir[2] = omegaRefNew[2]; + } + else { + refSatRate[0] = 0; + refSatRate[1] = 0; + refSatRate[2] = 0; + } + + timeSavedQuaternionNadir = now; + savedQuaternionNadir[0] = quatInertialTarget[0]; + savedQuaternionNadir[1] = quatInertialTarget[1]; + savedQuaternionNadir[2] = quatInertialTarget[2]; + savedQuaternionNadir[3] = quatInertialTarget[3]; + + // Transform in system relative to satellite frame + double quatBJ[4] = {0, 0, 0, 0}; + quatBJ[0] = outputValues->quatMekfBJ[0]; + quatBJ[1] = outputValues->quatMekfBJ[1]; + quatBJ[2] = outputValues->quatMekfBJ[2]; + quatBJ[3] = outputValues->quatMekfBJ[3]; + QuaternionOperations::multiply(quatBJ, quatInertialTarget, targetQuat); +} + +void Guidance::sunQuatPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, double targetQuat[4], double refSatRate[3]) { //------------------------------------------------------------------------------------- // Calculation of target quaternion to sun @@ -194,30 +311,34 @@ void Guidance::sunQuatPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *ou quatBJ[3] = outputValues->quatMekfBJ[3]; QuaternionOperations::toDcm(quatBJ, dcmBJ); - double sunDirJ[3] = {0, 0, 0}, sunDir[3] = {0, 0, 0}; + double sunDirJ[3] = {0, 0, 0}, sunDirB[3] = {0, 0, 0}; if (outputValues->sunDirModelValid) { sunDirJ[0] = outputValues->sunDirModel[0]; sunDirJ[1] = outputValues->sunDirModel[1]; sunDirJ[2] = outputValues->sunDirModel[2]; - MatrixOperations::multiply(*dcmBJ, sunDirJ, sunDir, 3, 3, 1); + MatrixOperations::multiply(*dcmBJ, sunDirJ, sunDirB, 3, 3, 1); } else { - sunDir[0] = outputValues->sunDirEst[0]; - sunDir[1] = outputValues->sunDirEst[1]; - sunDir[2] = outputValues->sunDirEst[2]; + sunDirB[0] = outputValues->sunDirEst[0]; + sunDirB[1] = outputValues->sunDirEst[1]; + sunDirB[2] = outputValues->sunDirEst[2]; } + /* + // --------------------------------------------------------------------------- + // Old version of two vector quaternion (only one axis to align) + // --------------------------------------------------------------------------- double sunRef[3] = {0, 0, 0}; sunRef[0] = acsParameters.safeModeControllerParameters.sunTargetDir[0]; sunRef[1] = acsParameters.safeModeControllerParameters.sunTargetDir[1]; sunRef[2] = acsParameters.safeModeControllerParameters.sunTargetDir[2]; double sunCross[3] = {0, 0, 0}; - VectorOperations::cross(sunDir, sunRef, sunCross); - double normSunDir = VectorOperations::norm(sunDir, 3); + VectorOperations::cross(sunDirB, sunRef, sunCross); + double normSunDir = VectorOperations::norm(sunDirB, 3); double normSunRef = VectorOperations::norm(sunRef, 3); - double dotSun = VectorOperations::dot(sunDir, sunRef); + double dotSun = VectorOperations::dot(sunDirB, sunRef); targetQuat[0] = sunCross[0]; targetQuat[1] = sunCross[1]; @@ -225,17 +346,73 @@ void Guidance::sunQuatPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *ou targetQuat[3] = sqrt(pow(normSunDir,2) * pow(normSunRef,2) + dotSun); VectorOperations::normalize(targetQuat, targetQuat, 4); + */ - //------------------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + // New version + //---------------------------------------------------------------------------- + // Transformation between ECEF and IJK frame + double dcmEJ[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + double dcmJE[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + double dcmEJDot[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + MathOperations::ecfToEciWithNutPre(now, *dcmEJ, *dcmEJDot); + MathOperations::inverseMatrixDimThree(*dcmEJ, *dcmJE); + double dcmJEDot[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + MathOperations::inverseMatrixDimThree(*dcmEJDot, *dcmJEDot); + + // positive z-Axis of EIVE in direction of sun + double zAxis[3] = {0 ,0 ,0}; + VectorOperations::normalize(sunDirB, zAxis, 3); + + // Position of the satellite in the earth/fixed frame via GPS and body + // velocity + double posSatE[3] = {0, 0, 0}; + double geodeticLatRad = (sensorValues->gpsSet.latitude.value)*PI/180; + double longitudeRad = (sensorValues->gpsSet.longitude.value)*PI/180; + MathOperations::cartesianFromLatLongAlt(geodeticLatRad,longitudeRad, + sensorValues->gpsSet.altitude.value, posSatE); + double velocityE[3] = {outputValues->gpsVelocity[0], outputValues->gpsVelocity[1], outputValues->gpsVelocity[2]}; + double velocityJ[3] = {0, 0, 0}, velPart1[3] = {0, 0, 0}, velPart2[3] = {0, 0, 0}; + MatrixOperations::multiply(*dcmJE, velocityE, velPart1, 3, 3, 1); + MatrixOperations::multiply(*dcmJEDot, posSatE, velPart2, 3, 3, 1); + VectorOperations::add(velPart1, velPart2, velocityJ, 3); + double velocityB[3] = {0, 0, 0}; + MatrixOperations::multiply(*dcmBJ, velocityJ, velocityB, 3, 3, 1); + + // Normale to velocity and sunDir + double crossVelSun[3] = {0, 0, 0}; + VectorOperations::cross(velocityB, sunDirB, crossVelSun); + + // y- Axis as cross of normal velSun and zAxis + double yAxis[3] = {0, 0, 0}; + VectorOperations::cross(crossVelSun, sunDirB, yAxis); + VectorOperations::normalize(yAxis, yAxis, 3); + + // complete RHS for x-Axis + double xAxis[3] = {0, 0, 0}; + VectorOperations::cross(yAxis, zAxis, xAxis); + + // Transformation matrix to Sun, no further transforamtions, reference is already + // the EIVE body frame + double dcmTgt[3][3] = {{xAxis[0], yAxis[0], zAxis[0]}, {xAxis[1], yAxis[1], zAxis[1]}, {xAxis[2], yAxis[2], zAxis[2]}}; + double quatSun[4] = {0, 0, 0, 0}; + QuaternionOperations::fromDcm(dcmTgt,quatSun); + + targetQuat[0] = quatSun[0]; + targetQuat[1] = quatSun[1]; + targetQuat[2] = quatSun[2]; + targetQuat[3] = quatSun[3]; + + //---------------------------------------------------------------------------- // Calculation of reference rotation rate - //------------------------------------------------------------------------------------- + //---------------------------------------------------------------------------- refSatRate[0] = 0; refSatRate[1] = 0; refSatRate[2] = 0; } -void Guidance::quatNadirPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, - double targetQuat[4], double refSatRate[3]) { +void Guidance::quatNadirPtgOldVersion(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, + double targetQuat[4], double refSatRate[3]) { // old version of Nadir Pointing //------------------------------------------------------------------------------------- // Calculation of target quaternion for Nadir pointing //------------------------------------------------------------------------------------- @@ -301,7 +478,7 @@ void Guidance::quatNadirPtg(ACS::SensorValues* sensorValues, ACS::OutputValues * } -void Guidance::quatNadirPtgFLPVersion(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, +void Guidance::quatNadirPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, double targetQuat[4], double refSatRate[3]) { //------------------------------------------------------------------------------------- @@ -351,7 +528,8 @@ void Guidance::quatNadirPtgFLPVersion(ACS::SensorValues* sensorValues, ACS::Outp //Complete transformation matrix double dcmTgt[3][3] = {{xAxis[0], yAxis[0], zAxis[0]}, {xAxis[1], yAxis[1], zAxis[1]}, {xAxis[2], yAxis[2], zAxis[2]}}; - QuaternionOperations::fromDcm(dcmTgt,targetQuat); + double quatInertialTarget[4] = {0, 0, 0, 0}; + QuaternionOperations::fromDcm(dcmTgt,quatInertialTarget); //------------------------------------------------------------------------------------- // Calculation of reference rotation rate @@ -360,15 +538,15 @@ void Guidance::quatNadirPtgFLPVersion(ACS::SensorValues* sensorValues, ACS::Outp timeSavedQuaternionNadir.tv_usec * pow(timeSavedQuaternionNadir.tv_usec,-6)); if (timeElapsed < acsParameters.pointingModeControllerParameters.nadirTimeElapsedMax) { double qDiff[4] = {0, 0, 0, 0}; - VectorOperations::subtract(targetQuat, savedQuaternionNadir, qDiff, 4); + VectorOperations::subtract(quatInertialTarget, savedQuaternionNadir, qDiff, 4); VectorOperations::mulScalar(qDiff, 1/timeElapsed, qDiff, 4); - double tgtQuatVec[3] = {targetQuat[0], targetQuat[1], targetQuat[2]}, + double tgtQuatVec[3] = {quatInertialTarget[0], quatInertialTarget[1], quatInertialTarget[2]}, qDiffVec[3] = {qDiff[0], qDiff[1], qDiff[2]}; double sum1[3] = {0, 0, 0}, sum2[3] = {0, 0, 0}, sum3[3] = {0, 0, 0}, sum[3] = {0, 0, 0}; - VectorOperations::cross(targetQuat, qDiff, sum1); + VectorOperations::cross(quatInertialTarget, qDiff, sum1); VectorOperations::mulScalar(tgtQuatVec, qDiff[3], sum2, 3); - VectorOperations::mulScalar(qDiffVec, targetQuat[3], sum3, 3); + VectorOperations::mulScalar(qDiffVec, quatInertialTarget[3], sum3, 3); VectorOperations::add(sum1, sum2, sum, 3); VectorOperations::subtract(sum, sum3, sum, 3); double omegaRefNew[3] = {0, 0, 0}; @@ -387,18 +565,26 @@ void Guidance::quatNadirPtgFLPVersion(ACS::SensorValues* sensorValues, ACS::Outp } timeSavedQuaternionNadir = now; - savedQuaternionNadir[0] = targetQuat[0]; - savedQuaternionNadir[1] = targetQuat[1]; - savedQuaternionNadir[2] = targetQuat[2]; - savedQuaternionNadir[3] = targetQuat[3]; + savedQuaternionNadir[0] = quatInertialTarget[0]; + savedQuaternionNadir[1] = quatInertialTarget[1]; + savedQuaternionNadir[2] = quatInertialTarget[2]; + savedQuaternionNadir[3] = quatInertialTarget[3]; + + // Transform in system relative to satellite frame + double quatBJ[4] = {0, 0, 0, 0}; + quatBJ[0] = outputValues->quatMekfBJ[0]; + quatBJ[1] = outputValues->quatMekfBJ[1]; + quatBJ[2] = outputValues->quatMekfBJ[2]; + quatBJ[3] = outputValues->quatMekfBJ[3]; + QuaternionOperations::multiply(quatBJ, quatInertialTarget, targetQuat); } void Guidance::inertialQuatPtg(double targetQuat[4], double refSatRate[3]) { for (int i = 0; i < 4; i++) { - targetQuat[i] = acsParameters.inertialModeControllerParameters.refQuatInertial[i]; + targetQuat[i] = acsParameters.inertialModeControllerParameters.tgtQuatInertial[i]; } for (int i = 0; i < 3; i++) { - refSatRate[i] = acsParameters.inertialModeControllerParameters.refRotRateInertial[i]; + refSatRate[i] = acsParameters.inertialModeControllerParameters.tgtRotRateInertial[i]; } } diff --git a/mission/controller/acs/Guidance.h b/mission/controller/acs/Guidance.h index 80ef6cf4..ba43f395 100644 --- a/mission/controller/acs/Guidance.h +++ b/mission/controller/acs/Guidance.h @@ -23,18 +23,20 @@ public: void getTargetParamsSafe(double sunTargetSafe[3], double satRateRef[3]); // Function to get the target quaternion and refence rotation rate from gps position and position of the ground station + void targetQuatPtgOldVersion(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, + double targetQuat[4], double refSatRate[3]); void targetQuatPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, double targetQuat[4], double refSatRate[3]); // Function to get the target quaternion and refence rotation rate for sun pointing after ground station - void sunQuatPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, + void sunQuatPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, double targetQuat[4], double refSatRate[3]); // Function to get the target quaternion and refence rotation rate from gps position for Nadir pointing - void quatNadirPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, + void quatNadirPtgOldVersion(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, double targetQuat[4], double refSatRate[3]); - void quatNadirPtgFLPVersion(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, + void quatNadirPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, double targetQuat[4], double refSatRate[3]); // Function to get the target quaternion and refence rotation rate from parameters for inertial pointing From b52bade1502f86617f9bbfe432bc857d9568e6d9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 24 Nov 2022 14:50:28 +0100 Subject: [PATCH 014/330] bump submodules --- fsfw | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fsfw b/fsfw index c5f91926..160ff799 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit c5f91926c95a8db0c7921176aa3f62cc2bebef47 +Subproject commit 160ff799ace61e24708dcf1fdeaf5fafdf23a4ca diff --git a/tmtc b/tmtc index d5813e1a..292bafa0 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit d5813e1a422beae7d0cb092a885e0956e9f1ddc1 +Subproject commit 292bafa0918d386e7f64bf9ed0e114a887420899 From 17a336ba0ab5a7fe4489ac05e08f699d8123e28b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 24 Nov 2022 15:51:24 +0100 Subject: [PATCH 015/330] change ctor order --- mission/controller/ThermalController.h | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 9ab14d87..541737ba 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -8,8 +8,14 @@ #include #include +/** + * NOP Limit: Hard limit for device, usually from datasheet. Device damage is possible lif NOP limit + * is exceeded. + * OP Limit: Soft limit. Device should be switched off or TCS controller should take action if the limit + * is exceeded to avoid reaching NOP limit + */ struct TempLimits { - TempLimits(float opLowerLimit, float opUpperLimit, float nopLowerLimit, float nsopUpperLimit) : opLowerLimit(opLowerLimit), opUpperLimit(opUpperLimit), nopLowerLimit(nopLowerLimit), nopUpperLimit(nopUpperLimit) {} + TempLimits(float nopLowerLimit, float opLowerLimit, float opUpperLimit, float nopUpperLimit) : opLowerLimit(opLowerLimit), opUpperLimit(opUpperLimit), nopLowerLimit(nopLowerLimit), nopUpperLimit(nopUpperLimit) {} float opLowerLimit; float opUpperLimit; float nopLowerLimit; @@ -88,20 +94,20 @@ class ThermalController : public ExtendedControllerBase { //TempLimits //TempLimits plocHeatspreaderLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); //TempLimits plocMissionBoardLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); - TempLimits cameraLimits = TempLimits(-30.0, 65.0, -40.0, 85.0); - TempLimits dacHeatspreaderLimits = TempLimits(-40.0, 118.0, -65.0, 150.0); - TempLimits strLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); - TempLimits rw1Limits = TempLimits(-40.0, 85.0, -40.0, 85.0); + TempLimits cameraLimits = TempLimits(-40.0, -30.0, 65.0, 85.0); + TempLimits dacHeatspreaderLimits = TempLimits(-65.0, -40.0, 118.0, 150.0); + TempLimits strLimits = TempLimits(-30.0, -20.0, 70.0, 80.0); + TempLimits rw1Limits = TempLimits(-40.0, -40.0, 85.0, 85.0); //TempLimits droLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); - TempLimits scexLimits = TempLimits(-40.0, 85.0, -60.0, 150.0); + TempLimits scexLimits = TempLimits(-60.0, -40.0, 85.0, 150.0); //TempLimits x8Limits = TempLimits(-20.0, 70.0, -30.0, 80.0); //TempLimits hpaLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); //TempLimits txModuleLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); //TempLimits mpaLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); - TempLimits acuLimits = TempLimits(-35.0, 85.0, -55.0, 150.0); //TODO nopLimits - TempLimits plpcduHeatspreaderLimits = TempLimits(-40.0, 85.0, -65.0, 125.0); //TODO check - TempLimits tcsBoardLimits = TempLimits(-40.0, 85.0, -60.0, 130.0); - TempLimits magnettorquerLimits = TempLimits(-40.0, 70.0, -30.0, 80.0); //TODO nopLimits + TempLimits acuLimits = TempLimits(-55.0, -35.0, 85.0, 150.0); //TODO nopLimits + TempLimits plpcduHeatspreaderLimits = TempLimits(-65.0, -40.0, 85.0, 125.0); //TODO check + TempLimits tcsBoardLimits = TempLimits(-60.0, -40.0, 85.0, 130.0); + TempLimits magnettorquerLimits = TempLimits(-40.0, -30.0, 70.0, 80.0); //TODO nopLimits // Initial delay to make sure all pool variables have been initialized their owners From f932c4c2c5880f5f64e1b63b765f62bbfe31b00c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 24 Nov 2022 16:40:59 +0100 Subject: [PATCH 016/330] we need a dummy heater handler --- bsp_hosted/ObjectFactory.cpp | 2 +- .../fsfwconfig/objects/systemObjectList.h | 3 +- dummies/CMakeLists.txt | 2 +- dummies/TemperatureSensorInserter.cpp | 37 ++++++ dummies/TemperatureSensorInserter.h | 22 ++++ dummies/TemperatureSensorsDummy.cpp | 106 ------------------ dummies/TemperatureSensorsDummy.h | 30 ----- dummies/helpers.cpp | 5 +- mission/controller/ThermalController.cpp | 2 +- mission/controller/ThermalController.h | 40 ++++--- unittest/controller/testThermalController.cpp | 6 +- 11 files changed, 94 insertions(+), 161 deletions(-) create mode 100644 dummies/TemperatureSensorInserter.cpp create mode 100644 dummies/TemperatureSensorInserter.h delete mode 100644 dummies/TemperatureSensorsDummy.cpp delete mode 100644 dummies/TemperatureSensorsDummy.h diff --git a/bsp_hosted/ObjectFactory.cpp b/bsp_hosted/ObjectFactory.cpp index 6db37e93..07e3163b 100644 --- a/bsp_hosted/ObjectFactory.cpp +++ b/bsp_hosted/ObjectFactory.cpp @@ -45,8 +45,8 @@ #include #include #include -#include +#include "../dummies/TemperatureSensorInserter.h" #include "dummies/helpers.h" #include "mission/utility/GlobalConfigHandler.h" diff --git a/bsp_hosted/fsfwconfig/objects/systemObjectList.h b/bsp_hosted/fsfwconfig/objects/systemObjectList.h index 703cd8b8..a1f9c20b 100644 --- a/bsp_hosted/fsfwconfig/objects/systemObjectList.h +++ b/bsp_hosted/fsfwconfig/objects/systemObjectList.h @@ -24,7 +24,8 @@ enum sourceObjects : uint32_t { /* 0x49 ('I') for Communication Interfaces **/ ARDUINO_COM_IF = 0x49000001, - DUMMY_COM_IF = 0x49000002 + DUMMY_COM_IF = 0x49000002, + THERMAL_TEMP_INSERTER = 0x49000003, }; } diff --git a/dummies/CMakeLists.txt b/dummies/CMakeLists.txt index 677120fb..4f486f8a 100644 --- a/dummies/CMakeLists.txt +++ b/dummies/CMakeLists.txt @@ -1,6 +1,6 @@ target_sources( ${LIB_DUMMIES} - PUBLIC TemperatureSensorsDummy.cpp + PUBLIC TemperatureSensorInserter.cpp SusDummy.cpp BpxDummy.cpp ComIFDummy.cpp diff --git a/dummies/TemperatureSensorInserter.cpp b/dummies/TemperatureSensorInserter.cpp new file mode 100644 index 00000000..ed71968c --- /dev/null +++ b/dummies/TemperatureSensorInserter.cpp @@ -0,0 +1,37 @@ +#include "TemperatureSensorInserter.h" + +#include + +#include +#include + +TemperatureSensorInserter::TemperatureSensorInserter(object_id_t objectId) + : SystemObject(objects::THERMAL_CONTROLLER), + max31865PlocHeatspreaderSet(objects::RTD_0_IC3_PLOC_HEATSPREADER, MAX31865::MAX31865_SET_ID), + max31865PlocMissionboardSet(objects::RTD_1_IC4_PLOC_MISSIONBOARD, MAX31865::MAX31865_SET_ID) { +} + +ReturnValue_t TemperatureSensorInserter::initialize() { + max31865PlocHeatspreaderSet.temperatureCelcius = 20.0; + max31865PlocMissionboardSet.temperatureCelcius = 20.0; + return returnvalue::OK; +} + +ReturnValue_t TemperatureSensorInserter::performOperation(uint8_t opCode) { + iteration++; + value = sin(iteration / 80. * M_PI) * 10; + + ReturnValue_t result = max31865PlocHeatspreaderSet.read(); + if (result != returnvalue::OK) { + sif::warning << "Failed to read temperature from MAX31865 dataset" << std::endl; + } + max31865PlocHeatspreaderSet.rtdValue = value - 5; + max31865PlocHeatspreaderSet.temperatureCelcius = value; + if ((iteration % 100) < 20) { + max31865PlocHeatspreaderSet.setValidity(false, true); + } else { + max31865PlocHeatspreaderSet.setValidity(true, true); + } + max31865PlocHeatspreaderSet.commit(); + return returnvalue::OK; +} diff --git a/dummies/TemperatureSensorInserter.h b/dummies/TemperatureSensorInserter.h new file mode 100644 index 00000000..84b1bcdb --- /dev/null +++ b/dummies/TemperatureSensorInserter.h @@ -0,0 +1,22 @@ +#pragma once + +#include +#include + +class TemperatureSensorInserter : public ExecutableObjectIF, public SystemObject { + public: + TemperatureSensorInserter(object_id_t objectId); + + ReturnValue_t initialize() override; + + protected: + ReturnValue_t performOperation(uint8_t opCode) override; + + private: + int iteration = 0; + float value = 0; + MAX31865::Max31865Set max31865PlocHeatspreaderSet; + MAX31865::Max31865Set max31865PlocMissionboardSet; + + void noise(); +}; diff --git a/dummies/TemperatureSensorsDummy.cpp b/dummies/TemperatureSensorsDummy.cpp deleted file mode 100644 index 3f6a4d83..00000000 --- a/dummies/TemperatureSensorsDummy.cpp +++ /dev/null @@ -1,106 +0,0 @@ -#include "TemperatureSensorsDummy.h" - -#include - -#include -#include - -TemperatureSensorsDummy::TemperatureSensorsDummy() - : ExtendedControllerBase(objects::RTD_0_IC3_PLOC_HEATSPREADER), - max31865PlocHeatspreaderSet(objects::RTD_0_IC3_PLOC_HEATSPREADER, MAX31865::MAX31865_SET_ID), - max31865PlocMissionboardSet(objects::RTD_1_IC4_PLOC_MISSIONBOARD, MAX31865::MAX31865_SET_ID) { - ObjectManager::instance()->insert(objects::RTD_1_IC4_PLOC_MISSIONBOARD, this); - ObjectManager::instance()->insert(objects::RTD_2_IC5_4K_CAMERA, this); - ObjectManager::instance()->insert(objects::RTD_3_IC6_DAC_HEATSPREADER, this); - ObjectManager::instance()->insert(objects::RTD_4_IC7_STARTRACKER, this); - ObjectManager::instance()->insert(objects::RTD_5_IC8_RW1_MX_MY, this); - ObjectManager::instance()->insert(objects::RTD_6_IC9_DRO, this); - ObjectManager::instance()->insert(objects::RTD_7_IC10_SCEX, this); - ObjectManager::instance()->insert(objects::RTD_8_IC11_X8, this); - ObjectManager::instance()->insert(objects::RTD_9_IC12_HPA, this); - ObjectManager::instance()->insert(objects::RTD_10_IC13_PL_TX, this); - ObjectManager::instance()->insert(objects::RTD_11_IC14_MPA, this); - ObjectManager::instance()->insert(objects::RTD_12_IC15_ACU, this); - ObjectManager::instance()->insert(objects::RTD_13_IC16_PLPCDU_HEATSPREADER, this); - ObjectManager::instance()->insert(objects::RTD_14_IC17_TCS_BOARD, this); - ObjectManager::instance()->insert(objects::RTD_15_IC18_IMTQ, this); - ObjectManager::instance()->insert(objects::TMP1075_HANDLER_TCS_0, this); - ObjectManager::instance()->insert(objects::TMP1075_HANDLER_TCS_1, this); - - ObjectManager::instance()->insert(objects::TMP1075_HANDLER_PLPCDU_0, this); - ObjectManager::instance()->insert(objects::TMP1075_HANDLER_PLPCDU_1, this); - ObjectManager::instance()->insert(objects::TMP1075_HANDLER_IF_BOARD, this); -} - -ReturnValue_t TemperatureSensorsDummy::initialize() { - static bool done = false; - if (not done) { - done = true; - ReturnValue_t result = ExtendedControllerBase::initialize(); - if (result != returnvalue::OK) { - return result; - } - } - - max31865PlocHeatspreaderSet.temperatureCelcius = 20.0; - max31865PlocMissionboardSet.temperatureCelcius = 20.0; - return returnvalue::OK; -} - -ReturnValue_t TemperatureSensorsDummy::handleCommandMessage(CommandMessage* message) { - return returnvalue::FAILED; -} - -void TemperatureSensorsDummy::performControlOperation() { - iteration++; - value = sin(iteration / 80. * M_PI) * 10; - - ReturnValue_t result = max31865PlocHeatspreaderSet.read(); - if (result != returnvalue::OK) { - sif::warning << "Failed to read temperature from MAX31865 dataset" << std::endl; - } - max31865PlocHeatspreaderSet.rtdValue = value - 5; - max31865PlocHeatspreaderSet.temperatureCelcius = value; - if ((iteration % 100) < 20) { - max31865PlocHeatspreaderSet.setValidity(false, true); - } else { - max31865PlocHeatspreaderSet.setValidity(true, true); - } - max31865PlocHeatspreaderSet.commit(); -} - -ReturnValue_t TemperatureSensorsDummy::initializeLocalDataPool( - localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) { - localDataPoolMap.emplace(static_cast(MAX31865::PoolIds::RTD_VALUE), - new PoolEntry({0})); - localDataPoolMap.emplace(static_cast(MAX31865::PoolIds::TEMPERATURE_C), - new PoolEntry({0})); - localDataPoolMap.emplace(static_cast(MAX31865::PoolIds::LAST_FAULT_BYTE), - new PoolEntry({0})); - localDataPoolMap.emplace(static_cast(MAX31865::PoolIds::FAULT_BYTE), - new PoolEntry({0})); - - return returnvalue::OK; -} - -LocalPoolDataSetBase* TemperatureSensorsDummy::getDataSetHandle(sid_t sid) { - sif::debug << "getHandle" << std::endl; - if (sid.objectId == objects::RTD_0_IC3_PLOC_HEATSPREADER) { - return &max31865PlocHeatspreaderSet; - } else if (sid.objectId == objects::RTD_1_IC4_PLOC_MISSIONBOARD) { - return &max31865PlocMissionboardSet; - } else { - return nullptr; - } -} - -ReturnValue_t TemperatureSensorsDummy::checkModeCommand(Mode_t mode, Submode_t submode, - uint32_t* msToReachTheMode) { - if (submode != SUBMODE_NONE) { - return INVALID_SUBMODE; - } - if ((mode != MODE_OFF) && (mode != MODE_ON) && (mode != MODE_NORMAL)) { - return INVALID_MODE; - } - return returnvalue::OK; -} diff --git a/dummies/TemperatureSensorsDummy.h b/dummies/TemperatureSensorsDummy.h deleted file mode 100644 index 0fcdfadb..00000000 --- a/dummies/TemperatureSensorsDummy.h +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once - -#include -#include - -class TemperatureSensorsDummy : public ExtendedControllerBase { - public: - TemperatureSensorsDummy(); - - ReturnValue_t initialize() override; - - protected: - virtual ReturnValue_t handleCommandMessage(CommandMessage* message) override; - virtual void performControlOperation() override; - virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, - LocalDataPoolManager& poolManager) override; - virtual LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; - - // Mode abstract functions - virtual ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, - uint32_t* msToReachTheMode) override; - - private: - int iteration = 0; - float value = 0; - MAX31865::Max31865Set max31865PlocHeatspreaderSet; - MAX31865::Max31865Set max31865PlocMissionboardSet; - - void noise(); -}; diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index c489d3a0..9d449699 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -18,9 +18,10 @@ #include #include #include -#include #include +#include "TemperatureSensorInserter.h" + using namespace dummy; void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) { @@ -66,7 +67,7 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) { } if (cfg.addTempSensorDummies) { - new TemperatureSensorsDummy(); + new TemperatureSensorInserter(objects::THERMAL_TEMP_INSERTER); } new CamSwitcher(objects::CAM_SWITCHER, pwrSwitch, power::NO_SWITCH); new PlPcduDummy(objects::PLPCDU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 10a14b15..2026e851 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -16,7 +16,7 @@ ThermalController::ThermalController(object_id_t objectId, HeaterHandler& heater) : ExtendedControllerBase(objectId), - heater(heater), + heaterHandler(heater), sensorTemperatures(this), susTemperatures(this), deviceTemperatures(this), diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 541737ba..44e2fb1a 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -8,20 +8,25 @@ #include #include +#include "../devices/HeaterHandler.h" + /** * NOP Limit: Hard limit for device, usually from datasheet. Device damage is possible lif NOP limit * is exceeded. - * OP Limit: Soft limit. Device should be switched off or TCS controller should take action if the limit - * is exceeded to avoid reaching NOP limit + * OP Limit: Soft limit. Device should be switched off or TCS controller should take action if the + * limit is exceeded to avoid reaching NOP limit */ struct TempLimits { - TempLimits(float nopLowerLimit, float opLowerLimit, float opUpperLimit, float nopUpperLimit) : opLowerLimit(opLowerLimit), opUpperLimit(opUpperLimit), nopLowerLimit(nopLowerLimit), nopUpperLimit(nopUpperLimit) {} + TempLimits(float nopLowerLimit, float opLowerLimit, float opUpperLimit, float nopUpperLimit) + : opLowerLimit(opLowerLimit), + opUpperLimit(opUpperLimit), + nopLowerLimit(nopLowerLimit), + nopUpperLimit(nopUpperLimit) {} float opLowerLimit; float opUpperLimit; float nopLowerLimit; float nopUpperLimit; - //TODO define limits - + // TODO define limits }; class ThermalController : public ExtendedControllerBase { @@ -50,6 +55,8 @@ class ThermalController : public ExtendedControllerBase { InternalState internalState = InternalState::STARTUP; + HeaterHandler& heaterHandler; + thermalControllerDefinitions::SensorTemperatures sensorTemperatures; thermalControllerDefinitions::SusTemperatures susTemperatures; thermalControllerDefinitions::DeviceTemperatures deviceTemperatures; @@ -91,24 +98,23 @@ class ThermalController : public ExtendedControllerBase { SUS::SusDataset susSet10; SUS::SusDataset susSet11; - //TempLimits - //TempLimits plocHeatspreaderLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); - //TempLimits plocMissionBoardLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); + // TempLimits + // TempLimits plocHeatspreaderLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); + // TempLimits plocMissionBoardLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); TempLimits cameraLimits = TempLimits(-40.0, -30.0, 65.0, 85.0); TempLimits dacHeatspreaderLimits = TempLimits(-65.0, -40.0, 118.0, 150.0); TempLimits strLimits = TempLimits(-30.0, -20.0, 70.0, 80.0); TempLimits rw1Limits = TempLimits(-40.0, -40.0, 85.0, 85.0); - //TempLimits droLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); + // TempLimits droLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); TempLimits scexLimits = TempLimits(-60.0, -40.0, 85.0, 150.0); - //TempLimits x8Limits = TempLimits(-20.0, 70.0, -30.0, 80.0); - //TempLimits hpaLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); - //TempLimits txModuleLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); - //TempLimits mpaLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); - TempLimits acuLimits = TempLimits(-55.0, -35.0, 85.0, 150.0); //TODO nopLimits - TempLimits plpcduHeatspreaderLimits = TempLimits(-65.0, -40.0, 85.0, 125.0); //TODO check + // TempLimits x8Limits = TempLimits(-20.0, 70.0, -30.0, 80.0); + // TempLimits hpaLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); + // TempLimits txModuleLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); + // TempLimits mpaLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); + TempLimits acuLimits = TempLimits(-55.0, -35.0, 85.0, 150.0); // TODO nopLimits + TempLimits plpcduHeatspreaderLimits = TempLimits(-65.0, -40.0, 85.0, 125.0); // TODO check TempLimits tcsBoardLimits = TempLimits(-60.0, -40.0, 85.0, 130.0); - TempLimits magnettorquerLimits = TempLimits(-40.0, -30.0, 70.0, 80.0); //TODO nopLimits - + TempLimits magnettorquerLimits = TempLimits(-40.0, -30.0, 70.0, 80.0); // TODO nopLimits // Initial delay to make sure all pool variables have been initialized their owners Countdown initialCountdown = Countdown(DELAY); diff --git a/unittest/controller/testThermalController.cpp b/unittest/controller/testThermalController.cpp index 3fac0f4e..976f3c4b 100644 --- a/unittest/controller/testThermalController.cpp +++ b/unittest/controller/testThermalController.cpp @@ -1,5 +1,4 @@ #include -#include #include #include #include @@ -7,12 +6,15 @@ #include +#include "../../dummies/TemperatureSensorInserter.h" #include "../testEnvironment.h" TEST_CASE("Thermal Controller", "[ThermalController]") { const object_id_t THERMAL_CONTROLLER_ID = 0x123; - new TemperatureSensorsDummy(); + new TemperatureSensorInserter(objects::THERMAL_TEMP_INSERTER); + // TODO: Create dummy heater handler + // new HeaterHandler() new SusDummy(); // testEnvironment::initialize(); From ad168f18b3d88d5cfa59c123e507e850921d1f10 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Thu, 24 Nov 2022 19:41:57 +0100 Subject: [PATCH 017/330] bugfixes --- bsp_hosted/ObjectFactory.cpp | 14 ++++++++++---- dummies/CMakeLists.txt | 3 ++- dummies/DummyHeaterHandler.cpp | 6 ++++++ dummies/DummyHeaterHandler.h | 13 +++++++++++++ dummies/TemperatureSensorInserter.cpp | 2 +- fsfw | 2 +- linux/ObjectFactory.cpp | 13 ------------- linux/ObjectFactory.h | 3 ++- mission/core/GenericFactory.cpp | 24 ++++++++++++++++++++++++ mission/core/GenericFactory.h | 6 ++++++ mission/devices/HeaterHandler.h | 3 ++- tmtc | 2 +- 12 files changed, 68 insertions(+), 23 deletions(-) create mode 100644 dummies/DummyHeaterHandler.cpp create mode 100644 dummies/DummyHeaterHandler.h diff --git a/bsp_hosted/ObjectFactory.cpp b/bsp_hosted/ObjectFactory.cpp index 07e3163b..0c62efc2 100644 --- a/bsp_hosted/ObjectFactory.cpp +++ b/bsp_hosted/ObjectFactory.cpp @@ -10,10 +10,8 @@ #include "OBSWConfig.h" #include "devConf.h" -#include "eive/definitions.h" #include "fsfw/platform.h" #include "fsfw_tests/integration/task/TestTask.h" -#include "tmtc/pusIds.h" #if OBSW_USE_TMTC_TCP_BRIDGE == 0 #include "fsfw/osal/common/UdpTcPollingTask.h" @@ -79,7 +77,7 @@ void ObjectFactory::produce(void* args) { CfdpTmFunnel* cfdpFunnel; ObjectFactory::produceGenericObjects(nullptr, &pusFunnel, &cfdpFunnel); - DummyGpioIF* dummyGpioIF = new DummyGpioIF(); + auto* dummyGpioIF = new DummyGpioIF(); auto* dummySwitcher = new DummyPowerSwitcher(objects::PCDU_HANDLER, 18, 0); static_cast(dummyGpioIF); #ifdef PLATFORM_UNIX @@ -109,6 +107,14 @@ void ObjectFactory::produce(void* args) { dummy::DummyCfg cfg; dummy::createDummies(cfg, *dummySwitcher); - new ThermalController(objects::THERMAL_CONTROLLER); + + HeaterHandler* heaterHandler = nullptr; + //new ThermalController(objects::THERMAL_CONTROLLER); + ObjectFactory::createGenericHeaterComponents(*dummyGpioIF, *dummySwitcher, heaterHandler); + if(heaterHandler == nullptr){ + sif::error << "HeaterHandler could not be created" << std::endl; + }else{ + ObjectFactory::createThermalController(*heaterHandler); + } new TestTask(objects::TEST_TASK); } diff --git a/dummies/CMakeLists.txt b/dummies/CMakeLists.txt index 4f486f8a..6b499d7b 100644 --- a/dummies/CMakeLists.txt +++ b/dummies/CMakeLists.txt @@ -19,4 +19,5 @@ target_sources( PlPcduDummy.cpp CoreControllerDummy.cpp helpers.cpp - MgmRm3100Dummy.cpp) + MgmRm3100Dummy.cpp +DummyHeaterHandler.cpp) diff --git a/dummies/DummyHeaterHandler.cpp b/dummies/DummyHeaterHandler.cpp new file mode 100644 index 00000000..d006038e --- /dev/null +++ b/dummies/DummyHeaterHandler.cpp @@ -0,0 +1,6 @@ +// +// Created by irini on 24.11.22. +// +#include "DummyHeaterHandler.h" + + diff --git a/dummies/DummyHeaterHandler.h b/dummies/DummyHeaterHandler.h new file mode 100644 index 00000000..b0628c09 --- /dev/null +++ b/dummies/DummyHeaterHandler.h @@ -0,0 +1,13 @@ +// +// Created by irini on 24.11.22. +// + +#ifndef EIVE_OBSW_DUMMYHEATERHANDLER_H +#define EIVE_OBSW_DUMMYHEATERHANDLER_H + +#include "mission/devices/HeaterHandler.h" +class DummyHeaterHandler: public HeaterHandler{ + public: + //DummyHeaterHandler(); +}; +#endif // EIVE_OBSW_DUMMYHEATERHANDLER_H diff --git a/dummies/TemperatureSensorInserter.cpp b/dummies/TemperatureSensorInserter.cpp index ed71968c..314f7496 100644 --- a/dummies/TemperatureSensorInserter.cpp +++ b/dummies/TemperatureSensorInserter.cpp @@ -6,7 +6,7 @@ #include TemperatureSensorInserter::TemperatureSensorInserter(object_id_t objectId) - : SystemObject(objects::THERMAL_CONTROLLER), + : SystemObject(objects::THERMAL_TEMP_INSERTER), max31865PlocHeatspreaderSet(objects::RTD_0_IC3_PLOC_HEATSPREADER, MAX31865::MAX31865_SET_ID), max31865PlocMissionboardSet(objects::RTD_1_IC4_PLOC_MISSIONBOARD, MAX31865::MAX31865_SET_ID) { } diff --git a/fsfw b/fsfw index 160ff799..c5f91926 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 160ff799ace61e24708dcf1fdeaf5fafdf23a4ca +Subproject commit c5f91926c95a8db0c7921176aa3f62cc2bebef47 diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index e35d7e96..6ca221f1 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -9,23 +9,14 @@ #include #include #include -#include #include -#include -#include -#include #include -#include -#include -#include #include "OBSWConfig.h" #include "devConf.h" #include "devices/addresses.h" #include "devices/gpioIds.h" #include "eive/definitions.h" -#include "mission/system/objects/SusAssembly.h" -#include "mission/system/objects/TcsBoardAssembly.h" #include "mission/system/tree/acsModeTree.h" #include "mission/system/tree/payloadModeTree.h" @@ -340,10 +331,6 @@ void ObjectFactory::createScexComponents(std::string uartDev, PowerSwitchIF* pwr scexHandler->connectModeTreeParent(satsystem::pl::SUBSYSTEM); } -void ObjectFactory::createThermalController() { - new ThermalController(objects::THERMAL_CONTROLLER); -} - AcsController* ObjectFactory::createAcsController(bool connectSubsystem) { auto acsCtrl = new AcsController(objects::ACS_CONTROLLER); if (connectSubsystem) { diff --git a/linux/ObjectFactory.h b/linux/ObjectFactory.h index 3704e9bd..10b70df0 100644 --- a/linux/ObjectFactory.h +++ b/linux/ObjectFactory.h @@ -11,6 +11,8 @@ #include #include +#include "mission/devices/HeaterHandler.h" + class GpioIF; class SpiComIF; class PowerSwitchIF; @@ -29,7 +31,6 @@ void createScexComponents(std::string uartDev, PowerSwitchIF* pwrSwitcher, void gpioChecker(ReturnValue_t result, std::string output); -void createThermalController(); AcsController* createAcsController(bool connectSubsystem); void addTmtcIpCoresToFunnels(CcsdsIpCoreHandler& ipCoreHandler, PusTmFunnel& pusFunnel, diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index 114451b2..c881c3e1 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -36,8 +36,12 @@ #if OBSW_ADD_TCPIP_BRIDGE == 1 #if OBSW_USE_TMTC_TCP_BRIDGE == 0 // UDP server includes +#include "devices/gpioIds.h" #include "fsfw/osal/common/UdpTcPollingTask.h" #include "fsfw/osal/common/UdpTmTcBridge.h" +#include "mission/controller/ThermalController.h" +#include "mission/devices/HeaterHandler.h" +#include "mission/devices/devicedefinitions/GomspaceDefinitions.h" #else // TCP server includes #include "fsfw/osal/common/TcpTmTcBridge.h" @@ -179,3 +183,23 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun ccsdsDistrib->registerApplication(info); #endif } + +void ObjectFactory::createGenericHeaterComponents(GpioIF& gpioIF, PowerSwitchIF& pwrSwitcher, HeaterHandler*& heaterHandler) { + HeaterHelper helper({{ + {new HealthDevice(objects::HEATER_0_PLOC_PROC_BRD, MessageQueueIF::NO_QUEUE), + gpioIds::HEATER_0}, + {new HealthDevice(objects::HEATER_1_PCDU_BRD, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_1}, + {new HealthDevice(objects::HEATER_2_ACS_BRD, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_2}, + {new HealthDevice(objects::HEATER_3_OBC_BRD, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_3}, + {new HealthDevice(objects::HEATER_4_CAMERA, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_4}, + {new HealthDevice(objects::HEATER_5_STR, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_5}, + {new HealthDevice(objects::HEATER_6_DRO, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_6}, + {new HealthDevice(objects::HEATER_7_HPA, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_7}, + }}); + heaterHandler = new HeaterHandler(objects::HEATER_HANDLER, &gpioIF, helper, &pwrSwitcher, + pcdu::Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V); +} + +void ObjectFactory::createThermalController(HeaterHandler& heaterHandler) { + new ThermalController(objects::THERMAL_CONTROLLER, heaterHandler); +} \ No newline at end of file diff --git a/mission/core/GenericFactory.h b/mission/core/GenericFactory.h index 2e2b0748..1704ef11 100644 --- a/mission/core/GenericFactory.h +++ b/mission/core/GenericFactory.h @@ -1,6 +1,10 @@ #ifndef MISSION_CORE_GENERICFACTORY_H_ #define MISSION_CORE_GENERICFACTORY_H_ +#include "fsfw_hal/common/gpio/GpioIF.h" +#include "fsfw/power/PowerSwitchIF.h" + +class HeaterHandler; class HealthTableIF; class PusTmFunnel; class CfdpTmFunnel; @@ -9,7 +13,9 @@ namespace ObjectFactory { void produceGenericObjects(HealthTableIF** healthTable, PusTmFunnel** pusFunnel, CfdpTmFunnel** cfdpFunnel); +void createGenericHeaterComponents(GpioIF& gpioIF, PowerSwitchIF& pwrSwitcher, HeaterHandler*& heaterHandler); +void createThermalController(HeaterHandler& heaterHandler); } #endif /* MISSION_CORE_GENERICFACTORY_H_ */ diff --git a/mission/devices/HeaterHandler.h b/mission/devices/HeaterHandler.h index 271e1bd1..caa90bc4 100644 --- a/mission/devices/HeaterHandler.h +++ b/mission/devices/HeaterHandler.h @@ -15,6 +15,7 @@ #include #include +#include #include #include "devices/heaterSwitcherList.h" @@ -28,7 +29,7 @@ using HeaterPair = std::pair; struct HeaterHelper { public: - HeaterHelper(std::array heaters) : heaters(heaters) {} + HeaterHelper(std::array heaters) : heaters(std::move(heaters)) {} std::array heaters = {}; }; /** diff --git a/tmtc b/tmtc index 292bafa0..d5813e1a 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 292bafa0918d386e7f64bf9ed0e114a887420899 +Subproject commit d5813e1a422beae7d0cb092a885e0956e9f1ddc1 From 1f687ffc38d888dbf72b10cfdc35714d1bb76051 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 25 Nov 2022 09:53:18 +0100 Subject: [PATCH 018/330] bump submodules --- fsfw | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fsfw b/fsfw index c5f91926..160ff799 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit c5f91926c95a8db0c7921176aa3f62cc2bebef47 +Subproject commit 160ff799ace61e24708dcf1fdeaf5fafdf23a4ca diff --git a/tmtc b/tmtc index d5813e1a..a54ae782 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit d5813e1a422beae7d0cb092a885e0956e9f1ddc1 +Subproject commit a54ae782d46f6f405df8e62ab80b556f971df369 From 43ed7d4bc5aae164c4f007f2d4790d4b307c4733 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 25 Nov 2022 10:13:24 +0100 Subject: [PATCH 019/330] create temp sensor dummies --- bsp_hosted/ObjectFactory.cpp | 6 ++-- dummies/CMakeLists.txt | 4 ++- dummies/DummyHeaterHandler.cpp | 2 -- dummies/DummyHeaterHandler.h | 4 +-- dummies/ImtqDummy.cpp | 2 +- dummies/ImtqDummy.h | 2 +- dummies/Max31865Dummy.cpp | 30 +++++++++++++++++ dummies/Max31865Dummy.h | 29 +++++++++++++++++ dummies/TemperatureSensorInserter.h | 4 +-- dummies/Tmp1075Dummy.cpp | 30 +++++++++++++++++ dummies/Tmp1075Dummy.h | 26 +++++++++++++++ mission/controller/ThermalController.h | 32 +++++++++---------- mission/core/GenericFactory.cpp | 5 +-- mission/core/GenericFactory.h | 7 ++-- mission/devices/HeaterHandler.h | 3 +- mission/devices/Max31865EiveHandler.h | 2 +- mission/devices/Max31865PT1000Handler.h | 2 +- .../devicedefinitions/Max31865Definitions.h | 6 ++-- 18 files changed, 157 insertions(+), 39 deletions(-) create mode 100644 dummies/Max31865Dummy.cpp create mode 100644 dummies/Max31865Dummy.h create mode 100644 dummies/Tmp1075Dummy.cpp create mode 100644 dummies/Tmp1075Dummy.h diff --git a/bsp_hosted/ObjectFactory.cpp b/bsp_hosted/ObjectFactory.cpp index 0c62efc2..ce281b09 100644 --- a/bsp_hosted/ObjectFactory.cpp +++ b/bsp_hosted/ObjectFactory.cpp @@ -109,11 +109,11 @@ void ObjectFactory::produce(void* args) { dummy::createDummies(cfg, *dummySwitcher); HeaterHandler* heaterHandler = nullptr; - //new ThermalController(objects::THERMAL_CONTROLLER); + // new ThermalController(objects::THERMAL_CONTROLLER); ObjectFactory::createGenericHeaterComponents(*dummyGpioIF, *dummySwitcher, heaterHandler); - if(heaterHandler == nullptr){ + if (heaterHandler == nullptr) { sif::error << "HeaterHandler could not be created" << std::endl; - }else{ + } else { ObjectFactory::createThermalController(*heaterHandler); } new TestTask(objects::TEST_TASK); diff --git a/dummies/CMakeLists.txt b/dummies/CMakeLists.txt index 6b499d7b..f2aa3e7a 100644 --- a/dummies/CMakeLists.txt +++ b/dummies/CMakeLists.txt @@ -6,6 +6,7 @@ target_sources( ComIFDummy.cpp ComCookieDummy.cpp RwDummy.cpp + Max31865Dummy.cpp StarTrackerDummy.cpp SyrlinksDummy.cpp ImtqDummy.cpp @@ -20,4 +21,5 @@ target_sources( CoreControllerDummy.cpp helpers.cpp MgmRm3100Dummy.cpp -DummyHeaterHandler.cpp) + Tmp1075Dummy.cpp + DummyHeaterHandler.cpp) diff --git a/dummies/DummyHeaterHandler.cpp b/dummies/DummyHeaterHandler.cpp index d006038e..59c49bde 100644 --- a/dummies/DummyHeaterHandler.cpp +++ b/dummies/DummyHeaterHandler.cpp @@ -2,5 +2,3 @@ // Created by irini on 24.11.22. // #include "DummyHeaterHandler.h" - - diff --git a/dummies/DummyHeaterHandler.h b/dummies/DummyHeaterHandler.h index b0628c09..8fb1e80b 100644 --- a/dummies/DummyHeaterHandler.h +++ b/dummies/DummyHeaterHandler.h @@ -6,8 +6,8 @@ #define EIVE_OBSW_DUMMYHEATERHANDLER_H #include "mission/devices/HeaterHandler.h" -class DummyHeaterHandler: public HeaterHandler{ +class DummyHeaterHandler : public HeaterHandler { public: - //DummyHeaterHandler(); + // DummyHeaterHandler(); }; #endif // EIVE_OBSW_DUMMYHEATERHANDLER_H diff --git a/dummies/ImtqDummy.cpp b/dummies/ImtqDummy.cpp index aad1478b..1159290b 100644 --- a/dummies/ImtqDummy.cpp +++ b/dummies/ImtqDummy.cpp @@ -5,7 +5,7 @@ ImtqDummy::ImtqDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie) : DeviceHandlerBase(objectId, comif, comCookie) {} -ImtqDummy::~ImtqDummy() {} +ImtqDummy::~ImtqDummy() = default; void ImtqDummy::doStartUp() {} diff --git a/dummies/ImtqDummy.h b/dummies/ImtqDummy.h index 4b5557ef..0cfdf518 100644 --- a/dummies/ImtqDummy.h +++ b/dummies/ImtqDummy.h @@ -12,7 +12,7 @@ class ImtqDummy : public DeviceHandlerBase { static const uint8_t PERIODIC_REPLY_DATA = 2; ImtqDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie); - virtual ~ImtqDummy(); + ~ImtqDummy() override; protected: void doStartUp() override; diff --git a/dummies/Max31865Dummy.cpp b/dummies/Max31865Dummy.cpp new file mode 100644 index 00000000..7b5f19c3 --- /dev/null +++ b/dummies/Max31865Dummy.cpp @@ -0,0 +1,30 @@ +#include "Max31865Dummy.h" + +using namespace returnvalue; + +Max31865Dummy::Max31865Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie) + : DeviceHandlerBase(objectId, comif, comCookie), set(this, EiveMax31855::EXCHANGE_SET_ID) {} +void Max31865Dummy::doStartUp() { setMode(MODE_ON); } +void Max31865Dummy::doShutDown() { setMode(_MODE_POWER_DOWN); } +ReturnValue_t Max31865Dummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { + return NOTHING_TO_SEND; +} +ReturnValue_t Max31865Dummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) { return OK; } +ReturnValue_t Max31865Dummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand, + const uint8_t *commandData, + size_t commandDataLen) { + return 0; +} +ReturnValue_t Max31865Dummy::scanForReply(const uint8_t *start, size_t len, + DeviceCommandId_t *foundId, size_t *foundLen) { + return 0; +} +ReturnValue_t Max31865Dummy::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) { + return 0; +} +void Max31865Dummy::fillCommandAndReplyMap() {} +uint32_t Max31865Dummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 0; } +ReturnValue_t Max31865Dummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, + LocalDataPoolManager &poolManager) { + return DeviceHandlerBase::initializeLocalDataPool(localDataPoolMap, poolManager); +} diff --git a/dummies/Max31865Dummy.h b/dummies/Max31865Dummy.h new file mode 100644 index 00000000..b10d1667 --- /dev/null +++ b/dummies/Max31865Dummy.h @@ -0,0 +1,29 @@ +#ifndef EIVE_OBSW_MAX31865DUMMY_H +#define EIVE_OBSW_MAX31865DUMMY_H + +#include "fsfw/devicehandlers/DeviceHandlerBase.h" +#include "mission/devices/devicedefinitions/Max31865Definitions.h" + +class Max31865Dummy : public DeviceHandlerBase { + public: + Max31865Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie); + + private: + MAX31865::PrimarySet set; + + void doStartUp() override; + void doShutDown() override; + ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t *id) override; + ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t *id) override; + ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t *commandData, + size_t commandDataLen) override; + ReturnValue_t scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId, + size_t *foundLen) override; + ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) override; + void fillCommandAndReplyMap() override; + uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override; + ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap, + LocalDataPoolManager &poolManager) override; +}; + +#endif // EIVE_OBSW_MAX31865DUMMY_H diff --git a/dummies/TemperatureSensorInserter.h b/dummies/TemperatureSensorInserter.h index 84b1bcdb..74221458 100644 --- a/dummies/TemperatureSensorInserter.h +++ b/dummies/TemperatureSensorInserter.h @@ -15,8 +15,8 @@ class TemperatureSensorInserter : public ExecutableObjectIF, public SystemObject private: int iteration = 0; float value = 0; - MAX31865::Max31865Set max31865PlocHeatspreaderSet; - MAX31865::Max31865Set max31865PlocMissionboardSet; + MAX31865::PrimarySet max31865PlocHeatspreaderSet; + MAX31865::PrimarySet max31865PlocMissionboardSet; void noise(); }; diff --git a/dummies/Tmp1075Dummy.cpp b/dummies/Tmp1075Dummy.cpp new file mode 100644 index 00000000..8c7653b1 --- /dev/null +++ b/dummies/Tmp1075Dummy.cpp @@ -0,0 +1,30 @@ +#include "Tmp1075Dummy.h" + +using namespace returnvalue; + +Tmp1075Dummy::Tmp1075Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie) + : DeviceHandlerBase(objectId, comif, comCookie) {} +void Tmp1075Dummy::doStartUp() { setMode(MODE_ON); } +void Tmp1075Dummy::doShutDown() { setMode(_MODE_POWER_DOWN); } +ReturnValue_t Tmp1075Dummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { + return NOTHING_TO_SEND; +} +ReturnValue_t Tmp1075Dummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) { return OK; } +ReturnValue_t Tmp1075Dummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand, + const uint8_t *commandData, + size_t commandDataLen) { + return 0; +} +ReturnValue_t Tmp1075Dummy::scanForReply(const uint8_t *start, size_t len, + DeviceCommandId_t *foundId, size_t *foundLen) { + return 0; +} +ReturnValue_t Tmp1075Dummy::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) { + return 0; +} +void Tmp1075Dummy::fillCommandAndReplyMap() {} +uint32_t Tmp1075Dummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 0; } +ReturnValue_t Tmp1075Dummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, + LocalDataPoolManager &poolManager) { + return DeviceHandlerBase::initializeLocalDataPool(localDataPoolMap, poolManager); +} diff --git a/dummies/Tmp1075Dummy.h b/dummies/Tmp1075Dummy.h new file mode 100644 index 00000000..ad229aff --- /dev/null +++ b/dummies/Tmp1075Dummy.h @@ -0,0 +1,26 @@ +#ifndef EIVE_OBSW_TMP1075DUMMY_H +#define EIVE_OBSW_TMP1075DUMMY_H + +#include "fsfw/devicehandlers/DeviceHandlerBase.h" + +class Tmp1075Dummy : public DeviceHandlerBase { + public: + Tmp1075Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie); + + private: + void doStartUp() override; + void doShutDown() override; + ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t *id) override; + ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t *id) override; + ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t *commandData, + size_t commandDataLen) override; + ReturnValue_t scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId, + size_t *foundLen) override; + ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) override; + void fillCommandAndReplyMap() override; + uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override; + ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap, + LocalDataPoolManager &poolManager) override; +}; + +#endif // EIVE_OBSW_TMP1075DUMMY_H diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 44e2fb1a..9cbddab1 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -62,22 +62,22 @@ class ThermalController : public ExtendedControllerBase { thermalControllerDefinitions::DeviceTemperatures deviceTemperatures; // Temperature Sensors - MAX31865::Max31865Set max31865Set0; - MAX31865::Max31865Set max31865Set1; - MAX31865::Max31865Set max31865Set2; - MAX31865::Max31865Set max31865Set3; - MAX31865::Max31865Set max31865Set4; - MAX31865::Max31865Set max31865Set5; - MAX31865::Max31865Set max31865Set6; - MAX31865::Max31865Set max31865Set7; - MAX31865::Max31865Set max31865Set8; - MAX31865::Max31865Set max31865Set9; - MAX31865::Max31865Set max31865Set10; - MAX31865::Max31865Set max31865Set11; - MAX31865::Max31865Set max31865Set12; - MAX31865::Max31865Set max31865Set13; - MAX31865::Max31865Set max31865Set14; - MAX31865::Max31865Set max31865Set15; + MAX31865::PrimarySet max31865Set0; + MAX31865::PrimarySet max31865Set1; + MAX31865::PrimarySet max31865Set2; + MAX31865::PrimarySet max31865Set3; + MAX31865::PrimarySet max31865Set4; + MAX31865::PrimarySet max31865Set5; + MAX31865::PrimarySet max31865Set6; + MAX31865::PrimarySet max31865Set7; + MAX31865::PrimarySet max31865Set8; + MAX31865::PrimarySet max31865Set9; + MAX31865::PrimarySet max31865Set10; + MAX31865::PrimarySet max31865Set11; + MAX31865::PrimarySet max31865Set12; + MAX31865::PrimarySet max31865Set13; + MAX31865::PrimarySet max31865Set14; + MAX31865::PrimarySet max31865Set15; TMP1075::Tmp1075Dataset tmp1075SetTcs0; TMP1075::Tmp1075Dataset tmp1075SetTcs1; TMP1075::Tmp1075Dataset tmp1075SetPlPcdu0; diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index c881c3e1..21274009 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -184,7 +184,8 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun #endif } -void ObjectFactory::createGenericHeaterComponents(GpioIF& gpioIF, PowerSwitchIF& pwrSwitcher, HeaterHandler*& heaterHandler) { +void ObjectFactory::createGenericHeaterComponents(GpioIF& gpioIF, PowerSwitchIF& pwrSwitcher, + HeaterHandler*& heaterHandler) { HeaterHelper helper({{ {new HealthDevice(objects::HEATER_0_PLOC_PROC_BRD, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_0}, @@ -197,7 +198,7 @@ void ObjectFactory::createGenericHeaterComponents(GpioIF& gpioIF, PowerSwitchIF& {new HealthDevice(objects::HEATER_7_HPA, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_7}, }}); heaterHandler = new HeaterHandler(objects::HEATER_HANDLER, &gpioIF, helper, &pwrSwitcher, - pcdu::Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V); + pcdu::Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V); } void ObjectFactory::createThermalController(HeaterHandler& heaterHandler) { diff --git a/mission/core/GenericFactory.h b/mission/core/GenericFactory.h index 1704ef11..04802d51 100644 --- a/mission/core/GenericFactory.h +++ b/mission/core/GenericFactory.h @@ -1,8 +1,8 @@ #ifndef MISSION_CORE_GENERICFACTORY_H_ #define MISSION_CORE_GENERICFACTORY_H_ -#include "fsfw_hal/common/gpio/GpioIF.h" #include "fsfw/power/PowerSwitchIF.h" +#include "fsfw_hal/common/gpio/GpioIF.h" class HeaterHandler; class HealthTableIF; @@ -13,9 +13,10 @@ namespace ObjectFactory { void produceGenericObjects(HealthTableIF** healthTable, PusTmFunnel** pusFunnel, CfdpTmFunnel** cfdpFunnel); -void createGenericHeaterComponents(GpioIF& gpioIF, PowerSwitchIF& pwrSwitcher, HeaterHandler*& heaterHandler); +void createGenericHeaterComponents(GpioIF& gpioIF, PowerSwitchIF& pwrSwitcher, + HeaterHandler*& heaterHandler); void createThermalController(HeaterHandler& heaterHandler); -} +} // namespace ObjectFactory #endif /* MISSION_CORE_GENERICFACTORY_H_ */ diff --git a/mission/devices/HeaterHandler.h b/mission/devices/HeaterHandler.h index caa90bc4..18bb7240 100644 --- a/mission/devices/HeaterHandler.h +++ b/mission/devices/HeaterHandler.h @@ -29,7 +29,8 @@ using HeaterPair = std::pair; struct HeaterHelper { public: - HeaterHelper(std::array heaters) : heaters(std::move(heaters)) {} + HeaterHelper(std::array heaters) + : heaters(std::move(heaters)) {} std::array heaters = {}; }; /** diff --git a/mission/devices/Max31865EiveHandler.h b/mission/devices/Max31865EiveHandler.h index 121929e7..6a030718 100644 --- a/mission/devices/Max31865EiveHandler.h +++ b/mission/devices/Max31865EiveHandler.h @@ -38,7 +38,7 @@ class Max31865EiveHandler : public DeviceHandlerBase { bool debugMode = false; size_t structLen = 0; bool instantNormal = false; - MAX31865::Max31865Set sensorDataset; + MAX31865::PrimarySet sensorDataset; PeriodicOperationDivider debugDivider; enum class InternalState { NONE, ON, ACTIVE, INACTIVE } state = InternalState::NONE; bool transitionOk = false; diff --git a/mission/devices/Max31865PT1000Handler.h b/mission/devices/Max31865PT1000Handler.h index 6b136f13..5841c7b1 100644 --- a/mission/devices/Max31865PT1000Handler.h +++ b/mission/devices/Max31865PT1000Handler.h @@ -114,7 +114,7 @@ class Max31865PT1000Handler : public DeviceHandlerBase { uint8_t deviceIdx = 0; std::array commandBuffer{0}; - MAX31865::Max31865Set sensorDataset; + MAX31865::PrimarySet sensorDataset; sid_t sensorDatasetSid; #if OBSW_VERBOSE_LEVEL >= 1 diff --git a/mission/devices/devicedefinitions/Max31865Definitions.h b/mission/devices/devicedefinitions/Max31865Definitions.h index d7d6455d..057b2899 100644 --- a/mission/devices/devicedefinitions/Max31865Definitions.h +++ b/mission/devices/devicedefinitions/Max31865Definitions.h @@ -56,20 +56,20 @@ static constexpr uint8_t CLEAR_FAULT_BIT_VAL = 0b0000'0010; static constexpr size_t MAX_REPLY_SIZE = 5; -class Max31865Set : public StaticLocalDataSet<4> { +class PrimarySet : public StaticLocalDataSet<4> { public: /** * Constructor used by owner and data creators like device handlers. * @param owner * @param setId */ - Max31865Set(HasLocalDataPoolIF* owner, uint32_t setId) : StaticLocalDataSet(owner, setId) {} + PrimarySet(HasLocalDataPoolIF* owner, uint32_t setId) : StaticLocalDataSet(owner, setId) {} /** * Constructor used by data users like controllers. * @param sid */ - Max31865Set(object_id_t objectId, uint32_t setId) : StaticLocalDataSet(sid_t(objectId, setId)) {} + PrimarySet(object_id_t objectId, uint32_t setId) : StaticLocalDataSet(sid_t(objectId, setId)) {} lp_var_t rtdValue = lp_var_t(sid.objectId, static_cast(PoolIds::RTD_VALUE), this); From 4f25bdd121ee80e2c5e4c057899de24b143e8dd9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 25 Nov 2022 10:19:45 +0100 Subject: [PATCH 020/330] map a few things --- dummies/Max31865Dummy.cpp | 7 +++++++ dummies/Max31865Dummy.h | 1 + dummies/Tmp1075Dummy.cpp | 10 +++++++--- dummies/Tmp1075Dummy.h | 6 ++++++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/dummies/Max31865Dummy.cpp b/dummies/Max31865Dummy.cpp index 7b5f19c3..85120650 100644 --- a/dummies/Max31865Dummy.cpp +++ b/dummies/Max31865Dummy.cpp @@ -26,5 +26,12 @@ void Max31865Dummy::fillCommandAndReplyMap() {} uint32_t Max31865Dummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 0; } ReturnValue_t Max31865Dummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { + using namespace MAX31865; + localDataPoolMap.emplace(static_cast(PoolIds::RTD_VALUE), new PoolEntry({0})); + localDataPoolMap.emplace(static_cast(PoolIds::TEMPERATURE_C), new PoolEntry({0})); + localDataPoolMap.emplace(static_cast(PoolIds::LAST_FAULT_BYTE), + new PoolEntry({0})); + localDataPoolMap.emplace(static_cast(PoolIds::FAULT_BYTE), new PoolEntry({0})); return DeviceHandlerBase::initializeLocalDataPool(localDataPoolMap, poolManager); } +LocalPoolDataSetBase *Max31865Dummy::getDataSetHandle(sid_t sid) { return &set; } diff --git a/dummies/Max31865Dummy.h b/dummies/Max31865Dummy.h index b10d1667..e8fce23b 100644 --- a/dummies/Max31865Dummy.h +++ b/dummies/Max31865Dummy.h @@ -24,6 +24,7 @@ class Max31865Dummy : public DeviceHandlerBase { uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override; ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) override; + LocalPoolDataSetBase *getDataSetHandle(sid_t sid) override; }; #endif // EIVE_OBSW_MAX31865DUMMY_H diff --git a/dummies/Tmp1075Dummy.cpp b/dummies/Tmp1075Dummy.cpp index 8c7653b1..9715a346 100644 --- a/dummies/Tmp1075Dummy.cpp +++ b/dummies/Tmp1075Dummy.cpp @@ -1,9 +1,11 @@ #include "Tmp1075Dummy.h" +#include "mission/devices/devicedefinitions/Tmp1075Definitions.h" + using namespace returnvalue; Tmp1075Dummy::Tmp1075Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie) - : DeviceHandlerBase(objectId, comif, comCookie) {} + : DeviceHandlerBase(objectId, comif, comCookie), set(this) {} void Tmp1075Dummy::doStartUp() { setMode(MODE_ON); } void Tmp1075Dummy::doShutDown() { setMode(_MODE_POWER_DOWN); } ReturnValue_t Tmp1075Dummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { @@ -23,8 +25,10 @@ ReturnValue_t Tmp1075Dummy::interpretDeviceReply(DeviceCommandId_t id, const uin return 0; } void Tmp1075Dummy::fillCommandAndReplyMap() {} -uint32_t Tmp1075Dummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 0; } +uint32_t Tmp1075Dummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 1000; } ReturnValue_t Tmp1075Dummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { - return DeviceHandlerBase::initializeLocalDataPool(localDataPoolMap, poolManager); + localDataPoolMap.emplace(TMP1075::TEMPERATURE_C_TMP1075, new PoolEntry({0.0})); + return OK; } +LocalPoolDataSetBase *Tmp1075Dummy::getDataSetHandle(sid_t sid) { return &set; } diff --git a/dummies/Tmp1075Dummy.h b/dummies/Tmp1075Dummy.h index ad229aff..e43ca8e2 100644 --- a/dummies/Tmp1075Dummy.h +++ b/dummies/Tmp1075Dummy.h @@ -2,12 +2,15 @@ #define EIVE_OBSW_TMP1075DUMMY_H #include "fsfw/devicehandlers/DeviceHandlerBase.h" +#include "mission/devices/devicedefinitions/Tmp1075Definitions.h" class Tmp1075Dummy : public DeviceHandlerBase { public: Tmp1075Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie); private: + TMP1075::Tmp1075Dataset set; + void doStartUp() override; void doShutDown() override; ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t *id) override; @@ -21,6 +24,9 @@ class Tmp1075Dummy : public DeviceHandlerBase { uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override; ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) override; + + protected: + LocalPoolDataSetBase *getDataSetHandle(sid_t sid) override; }; #endif // EIVE_OBSW_TMP1075DUMMY_H From 49524abeb74f49e2cc7916f55142f6429721e14d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 25 Nov 2022 10:27:31 +0100 Subject: [PATCH 021/330] create temp sens dummies --- common/config/eive/objects.h | 1 - dummies/Max31865Dummy.cpp | 1 + dummies/Max31865Dummy.h | 1 + dummies/helpers.cpp | 25 ++++++++++++++++++++++++- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/common/config/eive/objects.h b/common/config/eive/objects.h index a8911347..01aa1cf1 100644 --- a/common/config/eive/objects.h +++ b/common/config/eive/objects.h @@ -48,7 +48,6 @@ enum commonObjects : uint32_t { TMP1075_HANDLER_PLPCDU_0 = 0x44420006, TMP1075_HANDLER_PLPCDU_1 = 0x44420007, TMP1075_HANDLER_IF_BOARD = 0x44420008, - TMP1075_HANDLER_OBC_IF_BOARD = 0x44420009, PCDU_HANDLER = 0x442000A1, P60DOCK_HANDLER = 0x44250000, PDU1_HANDLER = 0x44250001, diff --git a/dummies/Max31865Dummy.cpp b/dummies/Max31865Dummy.cpp index 85120650..c86210e7 100644 --- a/dummies/Max31865Dummy.cpp +++ b/dummies/Max31865Dummy.cpp @@ -35,3 +35,4 @@ ReturnValue_t Max31865Dummy::initializeLocalDataPool(localpool::DataPool &localD return DeviceHandlerBase::initializeLocalDataPool(localDataPoolMap, poolManager); } LocalPoolDataSetBase *Max31865Dummy::getDataSetHandle(sid_t sid) { return &set; } +Max31865Dummy::Max31865Dummy(object_id_t objectId, CookieIF* cookie): DeviceHandlerBase(objectId, objects::DUMMY_COM_IF, cookie), set(this, EiveMax31855::EXCHANGE_SET_ID) {} diff --git a/dummies/Max31865Dummy.h b/dummies/Max31865Dummy.h index e8fce23b..70ba3c03 100644 --- a/dummies/Max31865Dummy.h +++ b/dummies/Max31865Dummy.h @@ -7,6 +7,7 @@ class Max31865Dummy : public DeviceHandlerBase { public: Max31865Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie); + Max31865Dummy(object_id_t objectId, CookieIF* comCookie); private: MAX31865::PrimarySet set; diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index 9d449699..50eacec5 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -18,6 +18,8 @@ #include #include #include +#include "dummies/Tmp1075Dummy.h" +#include "dummies/Max31865Dummy.h" #include #include "TemperatureSensorInserter.h" @@ -26,7 +28,7 @@ using namespace dummy; void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) { new ComIFDummy(objects::DUMMY_COM_IF); - ComCookieDummy* comCookieDummy = new ComCookieDummy(); + auto* comCookieDummy = new ComCookieDummy(); new BpxDummy(objects::BPX_BATT_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); if (cfg.addCoreCtrlCfg) { new CoreControllerDummy(objects::CORE_CONTROLLER); @@ -67,6 +69,27 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) { } if (cfg.addTempSensorDummies) { + new Max31865Dummy(objects::RTD_0_IC3_PLOC_HEATSPREADER, objects::DUMMY_COM_IF, comCookieDummy); + new Max31865Dummy(objects::RTD_1_IC4_PLOC_MISSIONBOARD, objects::DUMMY_COM_IF, comCookieDummy); + new Max31865Dummy(objects::RTD_2_IC5_4K_CAMERA, objects::DUMMY_COM_IF, comCookieDummy); + new Max31865Dummy(objects::RTD_3_IC6_DAC_HEATSPREADER, objects::DUMMY_COM_IF, comCookieDummy); + new Max31865Dummy(objects::RTD_4_IC7_STARTRACKER, objects::DUMMY_COM_IF, comCookieDummy); + new Max31865Dummy(objects::RTD_5_IC8_RW1_MX_MY, objects::DUMMY_COM_IF, comCookieDummy); + new Max31865Dummy(objects::RTD_6_IC9_DRO, objects::DUMMY_COM_IF, comCookieDummy); + new Max31865Dummy(objects::RTD_7_IC10_SCEX, objects::DUMMY_COM_IF, comCookieDummy); + new Max31865Dummy(objects::RTD_8_IC11_X8, objects::DUMMY_COM_IF, comCookieDummy); + new Max31865Dummy(objects::RTD_9_IC12_HPA, objects::DUMMY_COM_IF, comCookieDummy); + new Max31865Dummy(objects::RTD_10_IC13_PL_TX, objects::DUMMY_COM_IF, comCookieDummy); + new Max31865Dummy(objects::RTD_11_IC14_MPA, objects::DUMMY_COM_IF, comCookieDummy); + new Max31865Dummy(objects::RTD_12_IC15_ACU, objects::DUMMY_COM_IF, comCookieDummy); + new Max31865Dummy(objects::RTD_13_IC16_PLPCDU_HEATSPREADER, objects::DUMMY_COM_IF, comCookieDummy); + new Max31865Dummy(objects::RTD_14_IC17_TCS_BOARD, objects::DUMMY_COM_IF, comCookieDummy); + new Max31865Dummy(objects::RTD_15_IC18_IMTQ, objects::DUMMY_COM_IF, comCookieDummy); + new Tmp1075Dummy(objects::TMP1075_HANDLER_TCS_0, objects::DUMMY_COM_IF, comCookieDummy); + new Tmp1075Dummy(objects::TMP1075_HANDLER_TCS_1, objects::DUMMY_COM_IF, comCookieDummy); + new Tmp1075Dummy(objects::TMP1075_HANDLER_PLPCDU_0, objects::DUMMY_COM_IF, comCookieDummy); + new Tmp1075Dummy(objects::TMP1075_HANDLER_PLPCDU_1, objects::DUMMY_COM_IF, comCookieDummy); + new Tmp1075Dummy(objects::TMP1075_HANDLER_IF_BOARD, objects::DUMMY_COM_IF, comCookieDummy); new TemperatureSensorInserter(objects::THERMAL_TEMP_INSERTER); } new CamSwitcher(objects::CAM_SWITCHER, pwrSwitch, power::NO_SWITCH); From 5265575186971177216c976654a319d01860b410 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 25 Nov 2022 10:27:47 +0100 Subject: [PATCH 022/330] afmt --- dummies/Max31865Dummy.cpp | 4 +++- dummies/Max31865Dummy.h | 2 +- dummies/helpers.cpp | 7 ++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/dummies/Max31865Dummy.cpp b/dummies/Max31865Dummy.cpp index c86210e7..e8343a4a 100644 --- a/dummies/Max31865Dummy.cpp +++ b/dummies/Max31865Dummy.cpp @@ -35,4 +35,6 @@ ReturnValue_t Max31865Dummy::initializeLocalDataPool(localpool::DataPool &localD return DeviceHandlerBase::initializeLocalDataPool(localDataPoolMap, poolManager); } LocalPoolDataSetBase *Max31865Dummy::getDataSetHandle(sid_t sid) { return &set; } -Max31865Dummy::Max31865Dummy(object_id_t objectId, CookieIF* cookie): DeviceHandlerBase(objectId, objects::DUMMY_COM_IF, cookie), set(this, EiveMax31855::EXCHANGE_SET_ID) {} +Max31865Dummy::Max31865Dummy(object_id_t objectId, CookieIF *cookie) + : DeviceHandlerBase(objectId, objects::DUMMY_COM_IF, cookie), + set(this, EiveMax31855::EXCHANGE_SET_ID) {} diff --git a/dummies/Max31865Dummy.h b/dummies/Max31865Dummy.h index 70ba3c03..011296d6 100644 --- a/dummies/Max31865Dummy.h +++ b/dummies/Max31865Dummy.h @@ -7,7 +7,7 @@ class Max31865Dummy : public DeviceHandlerBase { public: Max31865Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie); - Max31865Dummy(object_id_t objectId, CookieIF* comCookie); + Max31865Dummy(object_id_t objectId, CookieIF *comCookie); private: MAX31865::PrimarySet set; diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index 50eacec5..1b7f705e 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -18,11 +18,11 @@ #include #include #include -#include "dummies/Tmp1075Dummy.h" -#include "dummies/Max31865Dummy.h" #include #include "TemperatureSensorInserter.h" +#include "dummies/Max31865Dummy.h" +#include "dummies/Tmp1075Dummy.h" using namespace dummy; @@ -82,7 +82,8 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) { new Max31865Dummy(objects::RTD_10_IC13_PL_TX, objects::DUMMY_COM_IF, comCookieDummy); new Max31865Dummy(objects::RTD_11_IC14_MPA, objects::DUMMY_COM_IF, comCookieDummy); new Max31865Dummy(objects::RTD_12_IC15_ACU, objects::DUMMY_COM_IF, comCookieDummy); - new Max31865Dummy(objects::RTD_13_IC16_PLPCDU_HEATSPREADER, objects::DUMMY_COM_IF, comCookieDummy); + new Max31865Dummy(objects::RTD_13_IC16_PLPCDU_HEATSPREADER, objects::DUMMY_COM_IF, + comCookieDummy); new Max31865Dummy(objects::RTD_14_IC17_TCS_BOARD, objects::DUMMY_COM_IF, comCookieDummy); new Max31865Dummy(objects::RTD_15_IC18_IMTQ, objects::DUMMY_COM_IF, comCookieDummy); new Tmp1075Dummy(objects::TMP1075_HANDLER_TCS_0, objects::DUMMY_COM_IF, comCookieDummy); From 35cd18240c16c5979b6e61acea3db444c331720c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 25 Nov 2022 10:37:10 +0100 Subject: [PATCH 023/330] generic scheduler function --- bsp_hosted/scheduling.cpp | 6 ++++++ bsp_q7s/core/InitMission.cpp | 28 ++-------------------------- dummies/Max31865Dummy.cpp | 2 +- mission/core/CMakeLists.txt | 2 +- mission/core/scheduling.cpp | 33 +++++++++++++++++++++++++++++++++ mission/core/scheduling.h | 10 ++++++++++ 6 files changed, 53 insertions(+), 28 deletions(-) create mode 100644 mission/core/scheduling.cpp create mode 100644 mission/core/scheduling.h diff --git a/bsp_hosted/scheduling.cpp b/bsp_hosted/scheduling.cpp index 76a8f2e9..6525bde6 100644 --- a/bsp_hosted/scheduling.cpp +++ b/bsp_hosted/scheduling.cpp @@ -14,6 +14,7 @@ #include "OBSWConfig.h" #include "ObjectFactory.h" +#include "mission/core/scheduling.h" #include "scheduling.h" #ifdef LINUX @@ -183,6 +184,10 @@ void scheduling::initTasks() { } #endif /* OBSW_ADD_TEST_CODE == 1 */ + PeriodicTaskIF* tcsTask = factory->createPeriodicTask( + "TCS_TASK", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.5, missedDeadlineFunc); + scheduling::scheduleRtdSensors(tcsTask); + sif::info << "Starting tasks.." << std::endl; tmtcDistributor->startTask(); tmtcPollingTask->startTask(); @@ -195,6 +200,7 @@ void scheduling::initTasks() { pstTask->startTask(); thermalTask->startTask(); + tcsTask->startTask(); #if OBSW_ADD_PLOC_SUPERVISOR == 1 supvHelperTask->startTask(); #endif diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index 3b1eb357..348f85f0 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -16,6 +16,7 @@ #include "fsfw/tasks/FixedTimeslotTaskIF.h" #include "fsfw/tasks/PeriodicTaskIF.h" #include "fsfw/tasks/TaskFactory.h" +#include "mission/core/scheduling.h" #include "mission/devices/devicedefinitions/Max31865Definitions.h" #include "mission/utility/InitMission.h" #include "pollingsequence/pollingSequenceFactory.h" @@ -202,32 +203,7 @@ void initmission::initTasks() { PeriodicTaskIF* tcsTask = factory->createPeriodicTask( "TCS_TASK", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc); - std::array rtdIds = { - objects::RTD_0_IC3_PLOC_HEATSPREADER, - objects::RTD_1_IC4_PLOC_MISSIONBOARD, - objects::RTD_2_IC5_4K_CAMERA, - objects::RTD_3_IC6_DAC_HEATSPREADER, - objects::RTD_4_IC7_STARTRACKER, - objects::RTD_5_IC8_RW1_MX_MY, - objects::RTD_6_IC9_DRO, - objects::RTD_7_IC10_SCEX, - objects::RTD_8_IC11_X8, - objects::RTD_9_IC12_HPA, - objects::RTD_10_IC13_PL_TX, - objects::RTD_11_IC14_MPA, - objects::RTD_12_IC15_ACU, - objects::RTD_13_IC16_PLPCDU_HEATSPREADER, - objects::RTD_14_IC17_TCS_BOARD, - objects::RTD_15_IC18_IMTQ, - }; - - for (const auto& rtd : rtdIds) { - tcsTask->addComponent(rtd, DeviceHandlerIF::PERFORM_OPERATION); - tcsTask->addComponent(rtd, DeviceHandlerIF::SEND_WRITE); - tcsTask->addComponent(rtd, DeviceHandlerIF::GET_WRITE); - tcsTask->addComponent(rtd, DeviceHandlerIF::SEND_READ); - tcsTask->addComponent(rtd, DeviceHandlerIF::GET_READ); - } + scheduling::scheduleTempSensors(tcsTask); #endif PeriodicTaskIF* tcsSystemTask = factory->createPeriodicTask( diff --git a/dummies/Max31865Dummy.cpp b/dummies/Max31865Dummy.cpp index e8343a4a..5cbd1dec 100644 --- a/dummies/Max31865Dummy.cpp +++ b/dummies/Max31865Dummy.cpp @@ -32,7 +32,7 @@ ReturnValue_t Max31865Dummy::initializeLocalDataPool(localpool::DataPool &localD localDataPoolMap.emplace(static_cast(PoolIds::LAST_FAULT_BYTE), new PoolEntry({0})); localDataPoolMap.emplace(static_cast(PoolIds::FAULT_BYTE), new PoolEntry({0})); - return DeviceHandlerBase::initializeLocalDataPool(localDataPoolMap, poolManager); + return OK; } LocalPoolDataSetBase *Max31865Dummy::getDataSetHandle(sid_t sid) { return &set; } Max31865Dummy::Max31865Dummy(object_id_t objectId, CookieIF *cookie) diff --git a/mission/core/CMakeLists.txt b/mission/core/CMakeLists.txt index c7be4ac9..fc6e1cff 100644 --- a/mission/core/CMakeLists.txt +++ b/mission/core/CMakeLists.txt @@ -1 +1 @@ -target_sources(${LIB_EIVE_MISSION} PRIVATE GenericFactory.cpp) +target_sources(${LIB_EIVE_MISSION} PRIVATE GenericFactory.cpp scheduling.cpp) diff --git a/mission/core/scheduling.cpp b/mission/core/scheduling.cpp new file mode 100644 index 00000000..fb119525 --- /dev/null +++ b/mission/core/scheduling.cpp @@ -0,0 +1,33 @@ +#include "scheduling.h" + +#include "fsfw/tasks/PeriodicTaskIF.h" +#include "mission/devices/devicedefinitions/Max31865Definitions.h" + +void scheduling::scheduleRtdSensors(PeriodicTaskIF* tcsTask) { + std::array rtdIds = { + objects::RTD_0_IC3_PLOC_HEATSPREADER, + objects::RTD_1_IC4_PLOC_MISSIONBOARD, + objects::RTD_2_IC5_4K_CAMERA, + objects::RTD_3_IC6_DAC_HEATSPREADER, + objects::RTD_4_IC7_STARTRACKER, + objects::RTD_5_IC8_RW1_MX_MY, + objects::RTD_6_IC9_DRO, + objects::RTD_7_IC10_SCEX, + objects::RTD_8_IC11_X8, + objects::RTD_9_IC12_HPA, + objects::RTD_10_IC13_PL_TX, + objects::RTD_11_IC14_MPA, + objects::RTD_12_IC15_ACU, + objects::RTD_13_IC16_PLPCDU_HEATSPREADER, + objects::RTD_14_IC17_TCS_BOARD, + objects::RTD_15_IC18_IMTQ, + }; + + for (const auto& rtd : rtdIds) { + tcsTask->addComponent(rtd, DeviceHandlerIF::PERFORM_OPERATION); + tcsTask->addComponent(rtd, DeviceHandlerIF::SEND_WRITE); + tcsTask->addComponent(rtd, DeviceHandlerIF::GET_WRITE); + tcsTask->addComponent(rtd, DeviceHandlerIF::SEND_READ); + tcsTask->addComponent(rtd, DeviceHandlerIF::GET_READ); + } +} diff --git a/mission/core/scheduling.h b/mission/core/scheduling.h new file mode 100644 index 00000000..d6f68288 --- /dev/null +++ b/mission/core/scheduling.h @@ -0,0 +1,10 @@ +#ifndef EIVE_OBSW_SCHEDULING_H +#define EIVE_OBSW_SCHEDULING_H + +class PeriodicTaskIF; + +namespace scheduling { +void scheduleRtdSensors(PeriodicTaskIF* periodicTask); + +} +#endif // EIVE_OBSW_SCHEDULING_H From e223a6eac09c8a37820dd8b97f281042436e22ff Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 25 Nov 2022 10:47:23 +0100 Subject: [PATCH 024/330] some dumb warning remaining --- bsp_hosted/scheduling.cpp | 1 + dummies/TemperatureSensorInserter.h | 4 ++-- mission/core/scheduling.cpp | 16 +++++++++++++++- mission/core/scheduling.h | 3 ++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/bsp_hosted/scheduling.cpp b/bsp_hosted/scheduling.cpp index 6525bde6..ef73cdaf 100644 --- a/bsp_hosted/scheduling.cpp +++ b/bsp_hosted/scheduling.cpp @@ -186,6 +186,7 @@ void scheduling::initTasks() { PeriodicTaskIF* tcsTask = factory->createPeriodicTask( "TCS_TASK", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.5, missedDeadlineFunc); + scheduling::scheduleTmpTempSensors(tcsTask); scheduling::scheduleRtdSensors(tcsTask); sif::info << "Starting tasks.." << std::endl; diff --git a/dummies/TemperatureSensorInserter.h b/dummies/TemperatureSensorInserter.h index 74221458..8c87176d 100644 --- a/dummies/TemperatureSensorInserter.h +++ b/dummies/TemperatureSensorInserter.h @@ -5,7 +5,7 @@ class TemperatureSensorInserter : public ExecutableObjectIF, public SystemObject { public: - TemperatureSensorInserter(object_id_t objectId); + explicit TemperatureSensorInserter(object_id_t objectId); ReturnValue_t initialize() override; @@ -18,5 +18,5 @@ class TemperatureSensorInserter : public ExecutableObjectIF, public SystemObject MAX31865::PrimarySet max31865PlocHeatspreaderSet; MAX31865::PrimarySet max31865PlocMissionboardSet; - void noise(); + // void noise(); }; diff --git a/mission/core/scheduling.cpp b/mission/core/scheduling.cpp index fb119525..50b5e473 100644 --- a/mission/core/scheduling.cpp +++ b/mission/core/scheduling.cpp @@ -3,8 +3,22 @@ #include "fsfw/tasks/PeriodicTaskIF.h" #include "mission/devices/devicedefinitions/Max31865Definitions.h" +void scheduling::scheduleTmpTempSensors(PeriodicTaskIF* tmpTask) { + const std::array tmpIds = { + objects::TMP1075_HANDLER_TCS_0, objects::TMP1075_HANDLER_TCS_1, + objects::TMP1075_HANDLER_PLPCDU_0, objects::TMP1075_HANDLER_PLPCDU_1, + objects::TMP1075_HANDLER_IF_BOARD}; + for (const auto& tmpId : tmpIds) { + tmpTask->addComponent(tmpId, DeviceHandlerIF::PERFORM_OPERATION); + tmpTask->addComponent(tmpId, DeviceHandlerIF::SEND_WRITE); + tmpTask->addComponent(tmpId, DeviceHandlerIF::GET_WRITE); + tmpTask->addComponent(tmpId, DeviceHandlerIF::SEND_READ); + tmpTask->addComponent(tmpId, DeviceHandlerIF::GET_READ); + } +} + void scheduling::scheduleRtdSensors(PeriodicTaskIF* tcsTask) { - std::array rtdIds = { + const std::array rtdIds = { objects::RTD_0_IC3_PLOC_HEATSPREADER, objects::RTD_1_IC4_PLOC_MISSIONBOARD, objects::RTD_2_IC5_4K_CAMERA, diff --git a/mission/core/scheduling.h b/mission/core/scheduling.h index d6f68288..6023d5df 100644 --- a/mission/core/scheduling.h +++ b/mission/core/scheduling.h @@ -4,7 +4,8 @@ class PeriodicTaskIF; namespace scheduling { +void scheduleTmpTempSensors(PeriodicTaskIF* tmpSensors); void scheduleRtdSensors(PeriodicTaskIF* periodicTask); -} +} // namespace scheduling #endif // EIVE_OBSW_SCHEDULING_H From f376c01e023ef81074d92233e0acff72bca05e30 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 25 Nov 2022 10:49:25 +0100 Subject: [PATCH 025/330] fix double scheduled components --- bsp_hosted/scheduling.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bsp_hosted/scheduling.cpp b/bsp_hosted/scheduling.cpp index ef73cdaf..5be4429a 100644 --- a/bsp_hosted/scheduling.cpp +++ b/bsp_hosted/scheduling.cpp @@ -139,10 +139,6 @@ void scheduling::initTasks() { PeriodicTaskIF* thermalTask = factory->createPeriodicTask( "THERMAL_CTL_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, missedDeadlineFunc); - result = thermalTask->addComponent(objects::RTD_0_IC3_PLOC_HEATSPREADER); - if (result != returnvalue::OK) { - scheduling::printAddObjectError("RTD_0_dummy", objects::RTD_0_IC3_PLOC_HEATSPREADER); - } result = thermalTask->addComponent(objects::SUS_0_N_LOC_XFYFZM_PT_XF); if (result != returnvalue::OK) { scheduling::printAddObjectError("SUS_0_dummy", objects::SUS_0_N_LOC_XFYFZM_PT_XF); From 41eefda1bc7068b1c171694212bc01c49b64fd88 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 25 Nov 2022 10:53:26 +0100 Subject: [PATCH 026/330] move obj ID --- bsp_hosted/fsfwconfig/objects/systemObjectList.h | 1 - common/config/eive/objects.h | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bsp_hosted/fsfwconfig/objects/systemObjectList.h b/bsp_hosted/fsfwconfig/objects/systemObjectList.h index a1f9c20b..539ef0d9 100644 --- a/bsp_hosted/fsfwconfig/objects/systemObjectList.h +++ b/bsp_hosted/fsfwconfig/objects/systemObjectList.h @@ -25,7 +25,6 @@ enum sourceObjects : uint32_t { ARDUINO_COM_IF = 0x49000001, DUMMY_COM_IF = 0x49000002, - THERMAL_TEMP_INSERTER = 0x49000003, }; } diff --git a/common/config/eive/objects.h b/common/config/eive/objects.h index 01aa1cf1..09bb0fa5 100644 --- a/common/config/eive/objects.h +++ b/common/config/eive/objects.h @@ -143,6 +143,9 @@ enum commonObjects : uint32_t { CFDP_TM_FUNNEL = 0x73000102, CFDP_HANDLER = 0x73000205, CFDP_DISTRIBUTOR = 0x73000206, + + // Other stuff + THERMAL_TEMP_INSERTER = 0x90000003, }; } From 44aae183112cf4578c162fbe77d32adc4f101575 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 25 Nov 2022 11:01:06 +0100 Subject: [PATCH 027/330] q7s compiles again --- bsp_q7s/core/InitMission.cpp | 2 +- bsp_q7s/core/ObjectFactory.cpp | 17 +++-------------- bsp_q7s/core/ObjectFactory.h | 4 +++- bsp_q7s/fmObjectFactory.cpp | 5 +++-- linux/ObjectFactory.cpp | 7 +++++++ mission/core/GenericFactory.cpp | 6 +++++- 6 files changed, 22 insertions(+), 19 deletions(-) diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index 348f85f0..12733ad9 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -203,7 +203,7 @@ void initmission::initTasks() { PeriodicTaskIF* tcsTask = factory->createPeriodicTask( "TCS_TASK", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc); - scheduling::scheduleTempSensors(tcsTask); + scheduling::scheduleRtdSensors(tcsTask); #endif PeriodicTaskIF* tcsSystemTask = factory->createPeriodicTask( diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 85157e66..a3181992 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -496,7 +496,8 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo } void ObjectFactory::createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwitcher, - HealthTableIF* healthTable) { + HealthTableIF* healthTable, + HeaterHandler*& heaterHandler) { using namespace gpio; GpioCookie* heaterGpiosCookie = new GpioCookie; GpiodRegularByLineName* gpio = nullptr; @@ -539,19 +540,7 @@ void ObjectFactory::createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwi gpioIF->addGpios(heaterGpiosCookie); - HeaterHelper helper({{ - {new HealthDevice(objects::HEATER_0_PLOC_PROC_BRD, MessageQueueIF::NO_QUEUE), - gpioIds::HEATER_0}, - {new HealthDevice(objects::HEATER_1_PCDU_BRD, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_1}, - {new HealthDevice(objects::HEATER_2_ACS_BRD, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_2}, - {new HealthDevice(objects::HEATER_3_OBC_BRD, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_3}, - {new HealthDevice(objects::HEATER_4_CAMERA, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_4}, - {new HealthDevice(objects::HEATER_5_STR, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_5}, - {new HealthDevice(objects::HEATER_6_DRO, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_6}, - {new HealthDevice(objects::HEATER_7_HPA, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_7}, - }}); - new HeaterHandler(objects::HEATER_HANDLER, gpioIF, helper, pwrSwitcher, - pcdu::Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V); + ObjectFactory::createGenericHeaterComponents(*gpioIF, *pwrSwitcher, heaterHandler); } void ObjectFactory::createSolarArrayDeploymentComponents(PowerSwitchIF& pwrSwitcher, diff --git a/bsp_q7s/core/ObjectFactory.h b/bsp_q7s/core/ObjectFactory.h index c67353c4..2661805d 100644 --- a/bsp_q7s/core/ObjectFactory.h +++ b/bsp_q7s/core/ObjectFactory.h @@ -2,6 +2,7 @@ #define BSP_Q7S_OBJECTFACTORY_H_ #include +#include #include #include #include @@ -32,7 +33,8 @@ void createTmpComponents(); ReturnValue_t createRadSensorComponent(LinuxLibgpioIF* gpioComIF); void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialComIF* uartComIF, PowerSwitchIF* pwrSwitcher); -void createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwitcher, HealthTableIF* healthTable); +void createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwitcher, HealthTableIF* healthTable, + HeaterHandler*& heaterHandler); void createImtqComponents(PowerSwitchIF* pwrSwitcher); void createBpxBatteryComponent(); void createStrComponents(PowerSwitchIF* pwrSwitcher); diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index c56dcf8d..74c9d02e 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -39,7 +39,8 @@ void ObjectFactory::produce(void* args) { #if OBSW_ADD_ACS_BOARD == 1 createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher); #endif - createHeaterComponents(gpioComIF, pwrSwitcher, healthTable); + HeaterHandler* heaterHandler; + createHeaterComponents(gpioComIF, pwrSwitcher, healthTable, heaterHandler); #if OBSW_ADD_TMP_DEVICES == 1 createTmpComponents(); #endif @@ -81,7 +82,7 @@ void ObjectFactory::produce(void* args) { #endif /* OBSW_ADD_TEST_CODE == 1 */ createMiscComponents(); - createThermalController(); + createThermalController(*heaterHandler); createAcsController(true); satsystem::init(); } diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index 6ca221f1..8ab6979d 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -9,8 +9,15 @@ #include #include #include +#include #include +#include #include +#include +#include +#include +#include +#include #include "OBSWConfig.h" #include "devConf.h" diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index 21274009..5eef0531 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -22,11 +22,15 @@ #include #include #include +#include +#include +#include #include #include #include #include "OBSWConfig.h" +#include "devices/gpioIds.h" #include "eive/definitions.h" #include "fsfw/pus/Service11TelecommandScheduling.h" #include "mission/cfdp/Config.h" @@ -203,4 +207,4 @@ void ObjectFactory::createGenericHeaterComponents(GpioIF& gpioIF, PowerSwitchIF& void ObjectFactory::createThermalController(HeaterHandler& heaterHandler) { new ThermalController(objects::THERMAL_CONTROLLER, heaterHandler); -} \ No newline at end of file +} From 0484daac23910840483c729f2667867a95ad73fb Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Sun, 27 Nov 2022 16:58:57 +0100 Subject: [PATCH 028/330] thermal control first draft --- mission/controller/ThermalController.cpp | 22 ++++++++++++++++++++++ mission/controller/ThermalController.h | 15 +++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 2026e851..f4ada487 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -105,6 +105,28 @@ void ThermalController::performControlOperation() { } // TODO: Heater control + //TODO: Hysterese offset + if(heaterHandler.heaterVec[heater::HEATER_4_CAMERA].switchState == HeaterHandler::SwitchState::OFF){ + if(sensorTemperatures.sensor_4k_camera.value < cameraLimits.opLowerLimit) { + heaterHandler.heaterVec[heater::HEATER_4_CAMERA].cmdActive = true; + heaterHandler.heaterVec[heater::HEATER_4_CAMERA].action = HeaterHandler::SET_SWITCH_ON; + heaterHandler.handleSwitchOnCommand(heater::HEATER_4_CAMERA); + heater4Countdown.resetTimer(); + } + }else if(heaterHandler.heaterVec[heater::HEATER_4_CAMERA].switchState == HeaterHandler::SwitchState::ON){ + if(sensorTemperatures.sensor_4k_camera.value < cameraLimits.opLowerLimit){ + if(heater4Countdown.hasTimedOut()){ + heaterHandler.heaterVec[heater::HEATER_4_CAMERA].cmdActive = true; + heaterHandler.heaterVec[heater::HEATER_4_CAMERA].action = HeaterHandler::SET_SWITCH_OFF; + //triggerEvent(HEATER_TIMEOUT, heater::HEATER_4_CAMERA); + heaterHandler.handleSwitchOffCommand(heater::HEATER_4_CAMERA); + } + }else { + heaterHandler.heaterVec[heater::HEATER_4_CAMERA].cmdActive = true; + heaterHandler.heaterVec[heater::HEATER_4_CAMERA].action = HeaterHandler::SET_SWITCH_OFF; + heaterHandler.handleSwitchOffCommand(heater::HEATER_4_CAMERA); + }; + } } ReturnValue_t ThermalController::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 9cbddab1..ab8eff0a 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -8,6 +8,8 @@ #include #include +#include + #include "../devices/HeaterHandler.h" /** @@ -32,6 +34,7 @@ struct TempLimits { class ThermalController : public ExtendedControllerBase { public: static const uint16_t INVALID_TEMPERATURE = 999; + static const uint8_t NUMBER_OF_SENSORS = 16; ThermalController(object_id_t objectId, HeaterHandler& heater); @@ -50,9 +53,11 @@ class ThermalController : public ExtendedControllerBase { private: static const uint32_t DELAY = 500; + static const uint32_t OP_TIME = 1000; //TODO to be changed enum class InternalState { STARTUP, INITIAL_DELAY, READY }; + InternalState internalState = InternalState::STARTUP; HeaterHandler& heaterHandler; @@ -119,6 +124,16 @@ class ThermalController : public ExtendedControllerBase { // Initial delay to make sure all pool variables have been initialized their owners Countdown initialCountdown = Countdown(DELAY); + // Heater Countdown to make sure heater + Countdown heater0Countdown = Countdown(OP_TIME); + Countdown heater1Countdown = Countdown(OP_TIME); + Countdown heater2Countdown = Countdown(OP_TIME); + Countdown heater3Countdown = Countdown(OP_TIME); + Countdown heater4Countdown = Countdown(OP_TIME); + Countdown heater5Countdown = Countdown(OP_TIME); + Countdown heater6Countdown = Countdown(OP_TIME); + Countdown heater7Countdown = Countdown(OP_TIME); + PoolEntry tmp1075Tcs0 = PoolEntry(10.0); PoolEntry tmp1075Tcs1 = PoolEntry(10.0); PoolEntry tmp1075PlPcdu0 = PoolEntry(10.0); From 868ba0cd0381033f213cabda1d8c382c4ecf29ce Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 28 Nov 2022 08:56:36 +0100 Subject: [PATCH 029/330] improvements for heater handler --- mission/controller/ThermalController.cpp | 18 ++++++++++-------- mission/controller/ThermalController.h | 3 +-- mission/devices/HeaterHandler.cpp | 9 +++++++-- mission/devices/HeaterHandler.h | 8 ++++---- 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index f4ada487..aeaeb209 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -105,23 +105,25 @@ void ThermalController::performControlOperation() { } // TODO: Heater control - //TODO: Hysterese offset - if(heaterHandler.heaterVec[heater::HEATER_4_CAMERA].switchState == HeaterHandler::SwitchState::OFF){ - if(sensorTemperatures.sensor_4k_camera.value < cameraLimits.opLowerLimit) { + // TODO: Hysterese offset + if (heaterHandler.heaterVec[heater::HEATER_4_CAMERA].switchState == + HeaterHandler::SwitchState::OFF) { + if (sensorTemperatures.sensor_4k_camera.value < cameraLimits.opLowerLimit) { heaterHandler.heaterVec[heater::HEATER_4_CAMERA].cmdActive = true; heaterHandler.heaterVec[heater::HEATER_4_CAMERA].action = HeaterHandler::SET_SWITCH_ON; heaterHandler.handleSwitchOnCommand(heater::HEATER_4_CAMERA); heater4Countdown.resetTimer(); } - }else if(heaterHandler.heaterVec[heater::HEATER_4_CAMERA].switchState == HeaterHandler::SwitchState::ON){ - if(sensorTemperatures.sensor_4k_camera.value < cameraLimits.opLowerLimit){ - if(heater4Countdown.hasTimedOut()){ + } else if (heaterHandler.heaterVec[heater::HEATER_4_CAMERA].switchState == + HeaterHandler::SwitchState::ON) { + if (sensorTemperatures.sensor_4k_camera.value < cameraLimits.opLowerLimit) { + if (heater4Countdown.hasTimedOut()) { heaterHandler.heaterVec[heater::HEATER_4_CAMERA].cmdActive = true; heaterHandler.heaterVec[heater::HEATER_4_CAMERA].action = HeaterHandler::SET_SWITCH_OFF; - //triggerEvent(HEATER_TIMEOUT, heater::HEATER_4_CAMERA); + // triggerEvent(HEATER_TIMEOUT, heater::HEATER_4_CAMERA); heaterHandler.handleSwitchOffCommand(heater::HEATER_4_CAMERA); } - }else { + } else { heaterHandler.heaterVec[heater::HEATER_4_CAMERA].cmdActive = true; heaterHandler.heaterVec[heater::HEATER_4_CAMERA].action = HeaterHandler::SET_SWITCH_OFF; heaterHandler.handleSwitchOffCommand(heater::HEATER_4_CAMERA); diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index ab8eff0a..a91e531d 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -53,11 +53,10 @@ class ThermalController : public ExtendedControllerBase { private: static const uint32_t DELAY = 500; - static const uint32_t OP_TIME = 1000; //TODO to be changed + static const uint32_t OP_TIME = 1000; // TODO to be changed enum class InternalState { STARTUP, INITIAL_DELAY, READY }; - InternalState internalState = InternalState::STARTUP; HeaterHandler& heaterHandler; diff --git a/mission/devices/HeaterHandler.cpp b/mission/devices/HeaterHandler.cpp index 61a44de6..a2e4a451 100644 --- a/mission/devices/HeaterHandler.cpp +++ b/mission/devices/HeaterHandler.cpp @@ -321,8 +321,13 @@ HeaterHandler::SwitchState HeaterHandler::checkSwitchState(heater::Switchers swi return heaterVec.at(switchNr).switchState; } -ReturnValue_t HeaterHandler::switchHeater(heater::Switchers heater, ReturnValue_t onOff) { - return sendSwitchCommand(heater, onOff); +ReturnValue_t HeaterHandler::switchHeater(heater::Switchers heater, SwitchState switchState) { + if (switchState == SwitchState::ON) { + return sendSwitchCommand(heater, PowerSwitchIF::SWITCH_ON); + } else if (switchState == SwitchState::OFF) { + return sendSwitchCommand(heater, PowerSwitchIF::SWITCH_OFF); + } + return returnvalue::FAILED; } bool HeaterHandler::allSwitchesOff() { diff --git a/mission/devices/HeaterHandler.h b/mission/devices/HeaterHandler.h index 18bb7240..ede7c422 100644 --- a/mission/devices/HeaterHandler.h +++ b/mission/devices/HeaterHandler.h @@ -64,7 +64,10 @@ class HeaterHandler : public ExecutableObjectIF, virtual ~HeaterHandler(); protected: - ReturnValue_t switchHeater(heater::Switchers heater, ReturnValue_t onOff); + enum SwitchState : bool { ON = true, OFF = false }; + enum SwitchAction : uint8_t { SET_SWITCH_OFF, SET_SWITCH_ON, NONE }; + + ReturnValue_t switchHeater(heater::Switchers heater, SwitchState switchState); ReturnValue_t performOperation(uint8_t operationCode = 0) override; ReturnValue_t sendSwitchCommand(uint8_t switchNr, ReturnValue_t onOff) override; @@ -96,9 +99,6 @@ class HeaterHandler : public ExecutableObjectIF, static const MessageQueueId_t NO_COMMANDER = 0; - enum SwitchState : bool { ON = true, OFF = false }; - enum SwitchAction : uint8_t { SET_SWITCH_OFF, SET_SWITCH_ON, NONE }; - /** * @brief Struct holding information about a heater command to execute. * From 32cda0f58b48b042cc1ef50995342bc175611187 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Mon, 28 Nov 2022 10:06:49 +0100 Subject: [PATCH 030/330] further development thermal controller --- fsfw | 2 +- mission/controller/ThermalController.cpp | 42 +++++++++++++----------- mission/controller/ThermalController.h | 11 +++++-- 3 files changed, 32 insertions(+), 23 deletions(-) diff --git a/fsfw b/fsfw index 46a1c2ba..160ff799 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 46a1c2bacea142994666b2201acf0246ba0fd0b4 +Subproject commit 160ff799ace61e24708dcf1fdeaf5fafdf23a4ca diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index aeaeb209..274be244 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -106,28 +106,30 @@ void ThermalController::performControlOperation() { // TODO: Heater control // TODO: Hysterese offset - if (heaterHandler.heaterVec[heater::HEATER_4_CAMERA].switchState == - HeaterHandler::SwitchState::OFF) { - if (sensorTemperatures.sensor_4k_camera.value < cameraLimits.opLowerLimit) { - heaterHandler.heaterVec[heater::HEATER_4_CAMERA].cmdActive = true; - heaterHandler.heaterVec[heater::HEATER_4_CAMERA].action = HeaterHandler::SET_SWITCH_ON; - heaterHandler.handleSwitchOnCommand(heater::HEATER_4_CAMERA); - heater4Countdown.resetTimer(); - } - } else if (heaterHandler.heaterVec[heater::HEATER_4_CAMERA].switchState == - HeaterHandler::SwitchState::ON) { - if (sensorTemperatures.sensor_4k_camera.value < cameraLimits.opLowerLimit) { - if (heater4Countdown.hasTimedOut()) { - heaterHandler.heaterVec[heater::HEATER_4_CAMERA].cmdActive = true; - heaterHandler.heaterVec[heater::HEATER_4_CAMERA].action = HeaterHandler::SET_SWITCH_OFF; - // triggerEvent(HEATER_TIMEOUT, heater::HEATER_4_CAMERA); - heaterHandler.handleSwitchOffCommand(heater::HEATER_4_CAMERA); + + // 4K Camera - Heater + if (sensorTemperatures.sensor_4k_camera.isValid()) { + if (not heaterHandler.checkSwitchState(heater::HEATER_4_CAMERA)) { + if (sensorTemperatures.sensor_4k_camera.value < cameraLimits.opLowerLimit) { + heaterHandler.switchHeater(heater::HEATER_4_CAMERA, HeaterHandler::SwitchState::ON); + heater4Countdown.resetTimer(); + } + } else if (heaterHandler.checkSwitchState(heater::HEATER_4_CAMERA)) { + if (sensorTemperatures.sensor_4k_camera.value >= cameraLimits.opLowerLimit + TEMP_OFFSET) { + heaterHandler.switchHeater(heater::HEATER_4_CAMERA, HeaterHandler::SwitchState::OFF); } } else { - heaterHandler.heaterVec[heater::HEATER_4_CAMERA].cmdActive = true; - heaterHandler.heaterVec[heater::HEATER_4_CAMERA].action = HeaterHandler::SET_SWITCH_OFF; - heaterHandler.handleSwitchOffCommand(heater::HEATER_4_CAMERA); - }; + if (heater4Countdown.hasTimedOut()) { + // Sensor or heater failure + heaterHandler.switchHeater(heater::HEATER_4_CAMERA, HeaterHandler::SwitchState::OFF); + triggerEvent(HEATER_MAX_BURNTIME_REACHED, heater::HEATER_4_CAMERA); + }; + } + } else { + if (heaterHandler.checkSwitchState(heater::HEATER_4_CAMERA)) { + heaterHandler.switchHeater(heater::HEATER_4_CAMERA, HeaterHandler::SwitchState::OFF); + } + triggerEvent(INVALID_SENSOR_TEMPERATURE, heater::HEATER_4_CAMERA); } } diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index a91e531d..203f779e 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -28,7 +28,6 @@ struct TempLimits { float opUpperLimit; float nopLowerLimit; float nopUpperLimit; - // TODO define limits }; class ThermalController : public ExtendedControllerBase { @@ -52,8 +51,15 @@ class ThermalController : public ExtendedControllerBase { uint32_t* msToReachTheMode) override; private: + static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::HEATER_HANDLER; + static constexpr Event HEATER_MAX_BURNTIME_REACHED = MAKE_EVENT(0, severity::LOW); + static constexpr Event INVALID_SENSOR_TEMPERATURE = MAKE_EVENT(1, severity::LOW); + static const uint32_t DELAY = 500; - static const uint32_t OP_TIME = 1000; // TODO to be changed + + // TODO to be changed + static const uint32_t OP_TIME = 1000; + static const uint32_t TEMP_OFFSET = 10; enum class InternalState { STARTUP, INITIAL_DELAY, READY }; @@ -103,6 +109,7 @@ class ThermalController : public ExtendedControllerBase { SUS::SusDataset susSet11; // TempLimits + // TODO: find missing temperatures // TempLimits plocHeatspreaderLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); // TempLimits plocMissionBoardLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); TempLimits cameraLimits = TempLimits(-40.0, -30.0, 65.0, 85.0); From ad5ee7fa44856cbfac1fc5783bf4a3d0ec7462f6 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 28 Nov 2022 10:39:47 +0100 Subject: [PATCH 031/330] now the unittest should run --- fsfw | 2 +- test/gpio/CMakeLists.txt | 4 +--- test/testtasks/CMakeLists.txt | 4 +--- unittest/controller/testThermalController.cpp | 11 +++++++++-- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/fsfw b/fsfw index 160ff799..46a1c2ba 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 160ff799ace61e24708dcf1fdeaf5fafdf23a4ca +Subproject commit 46a1c2bacea142994666b2201acf0246ba0fd0b4 diff --git a/test/gpio/CMakeLists.txt b/test/gpio/CMakeLists.txt index 4ba24fd5..47ced202 100644 --- a/test/gpio/CMakeLists.txt +++ b/test/gpio/CMakeLists.txt @@ -1,3 +1 @@ -target_sources(${OBSW_NAME} PUBLIC DummyGpioIF.cpp) - -target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_sources(${LIB_EIVE_MISSION} PUBLIC DummyGpioIF.cpp) diff --git a/test/testtasks/CMakeLists.txt b/test/testtasks/CMakeLists.txt index c0d6ed09..a816e7d2 100644 --- a/test/testtasks/CMakeLists.txt +++ b/test/testtasks/CMakeLists.txt @@ -1,3 +1 @@ -target_sources(${OBSW_NAME} PUBLIC TestTask.cpp) - -target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_sources(${LIB_EIVE_MISSION} PUBLIC TestTask.cpp) diff --git a/unittest/controller/testThermalController.cpp b/unittest/controller/testThermalController.cpp index 976f3c4b..e5b0c050 100644 --- a/unittest/controller/testThermalController.cpp +++ b/unittest/controller/testThermalController.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -8,18 +9,24 @@ #include "../../dummies/TemperatureSensorInserter.h" #include "../testEnvironment.h" +#include "mission/core/GenericFactory.h" +#include "test/gpio/DummyGpioIF.h" TEST_CASE("Thermal Controller", "[ThermalController]") { const object_id_t THERMAL_CONTROLLER_ID = 0x123; new TemperatureSensorInserter(objects::THERMAL_TEMP_INSERTER); + auto dummyGpioIF = new DummyGpioIF(); + auto dummySwitcher = new DummyPowerSwitcher(objects::PCDU_HANDLER, 18, 0); // TODO: Create dummy heater handler - // new HeaterHandler() + HeaterHandler* heaterHandler = nullptr; + // new ThermalController(objects::THERMAL_CONTROLLER); + ObjectFactory::createGenericHeaterComponents(*dummyGpioIF, *dummySwitcher, heaterHandler); new SusDummy(); // testEnvironment::initialize(); - ThermalController controller(THERMAL_CONTROLLER_ID); + ThermalController controller(THERMAL_CONTROLLER_ID, *heaterHandler); ReturnValue_t result = controller.initialize(); REQUIRE(result == returnvalue::OK); From f8a5e04dc7a51401fc088e7c48a6b1bed2c2ea88 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 28 Nov 2022 11:33:07 +0100 Subject: [PATCH 032/330] bump deps --- fsfw | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fsfw b/fsfw index 46a1c2ba..8eb869e0 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 46a1c2bacea142994666b2201acf0246ba0fd0b4 +Subproject commit 8eb869e073d99e257c6cc62dbf26b4d99422e9b8 diff --git a/tmtc b/tmtc index a54ae782..a47ca5c9 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit a54ae782d46f6f405df8e62ab80b556f971df369 +Subproject commit a47ca5c901e340f4c07bbb778dd63bb61554dbc4 From 55608f0660ed06f7ef8d10d781766227280d0a56 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 28 Nov 2022 11:35:28 +0100 Subject: [PATCH 033/330] that should now fix it --- linux/boardtest/I2cTestClass.h | 2 +- linux/boardtest/LibgpiodTest.h | 2 +- linux/boardtest/SpiTestClass.h | 2 +- linux/boardtest/UartTestClass.h | 2 +- test/CMakeLists.txt | 2 ++ test/{testtasks => }/TestTask.cpp | 0 test/{testtasks => }/TestTask.h | 0 test/testtasks/CMakeLists.txt | 2 +- 8 files changed, 7 insertions(+), 5 deletions(-) rename test/{testtasks => }/TestTask.cpp (100%) rename test/{testtasks => }/TestTask.h (100%) diff --git a/linux/boardtest/I2cTestClass.h b/linux/boardtest/I2cTestClass.h index 500243c5..1a578363 100644 --- a/linux/boardtest/I2cTestClass.h +++ b/linux/boardtest/I2cTestClass.h @@ -1,7 +1,7 @@ #ifndef LINUX_BOARDTEST_I2CTESTCLASS_H_ #define LINUX_BOARDTEST_I2CTESTCLASS_H_ -#include +#include #include #include diff --git a/linux/boardtest/LibgpiodTest.h b/linux/boardtest/LibgpiodTest.h index 4fcaffdf..f7aada07 100644 --- a/linux/boardtest/LibgpiodTest.h +++ b/linux/boardtest/LibgpiodTest.h @@ -5,7 +5,7 @@ #include #include -#include "TestTask.h" +#include "test/TestTask.h" /** * @brief Test for the GPIO read implementation of the LinuxLibgpioIF. diff --git a/linux/boardtest/SpiTestClass.h b/linux/boardtest/SpiTestClass.h index dad42f4d..cdecd7f8 100644 --- a/linux/boardtest/SpiTestClass.h +++ b/linux/boardtest/SpiTestClass.h @@ -13,7 +13,7 @@ #include #include -#include +#include #include diff --git a/linux/boardtest/UartTestClass.h b/linux/boardtest/UartTestClass.h index 05776bc0..b206de53 100644 --- a/linux/boardtest/UartTestClass.h +++ b/linux/boardtest/UartTestClass.h @@ -12,7 +12,7 @@ #include "lwgps/lwgps.h" #include "mission/devices/devicedefinitions/ScexDefinitions.h" -#include "test/testtasks/TestTask.h" +#include "test/TestTask.h" class ScexUartReader; class ScexDleParser; diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index aea49d86..25f91941 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,2 +1,4 @@ add_subdirectory(testtasks) add_subdirectory(gpio) + +target_sources(${LIB_EIVE_MISSION} PUBLIC TestTask.cpp) diff --git a/test/testtasks/TestTask.cpp b/test/TestTask.cpp similarity index 100% rename from test/testtasks/TestTask.cpp rename to test/TestTask.cpp diff --git a/test/testtasks/TestTask.h b/test/TestTask.h similarity index 100% rename from test/testtasks/TestTask.h rename to test/TestTask.h diff --git a/test/testtasks/CMakeLists.txt b/test/testtasks/CMakeLists.txt index a816e7d2..e48d3e45 100644 --- a/test/testtasks/CMakeLists.txt +++ b/test/testtasks/CMakeLists.txt @@ -1 +1 @@ -target_sources(${LIB_EIVE_MISSION} PUBLIC TestTask.cpp) +target_sources(${LIB_EIVE_MISSION} PUBLIC) From d81ae3c35fc476bcbce4c58789f8da182c7da9ee Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 28 Nov 2022 11:46:06 +0100 Subject: [PATCH 034/330] include fix --- bsp_q7s/boardtest/Q7STestTask.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsp_q7s/boardtest/Q7STestTask.h b/bsp_q7s/boardtest/Q7STestTask.h index dcfc3e96..9ba00c06 100644 --- a/bsp_q7s/boardtest/Q7STestTask.h +++ b/bsp_q7s/boardtest/Q7STestTask.h @@ -3,7 +3,7 @@ #include -#include "test/testtasks/TestTask.h" +#include "test/TestTask.h" class CoreController; From 4a404835c0e344f04e9c4ff013043f8493a13596 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Mon, 28 Nov 2022 17:40:29 +0100 Subject: [PATCH 035/330] further development thermal controller --- mission/controller/ThermalController.cpp | 52 +++++++++++++----------- mission/controller/ThermalController.h | 2 + 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 274be244..fc6a6088 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -106,31 +106,8 @@ void ThermalController::performControlOperation() { // TODO: Heater control // TODO: Hysterese offset + ctrl4KCameraHeater(); - // 4K Camera - Heater - if (sensorTemperatures.sensor_4k_camera.isValid()) { - if (not heaterHandler.checkSwitchState(heater::HEATER_4_CAMERA)) { - if (sensorTemperatures.sensor_4k_camera.value < cameraLimits.opLowerLimit) { - heaterHandler.switchHeater(heater::HEATER_4_CAMERA, HeaterHandler::SwitchState::ON); - heater4Countdown.resetTimer(); - } - } else if (heaterHandler.checkSwitchState(heater::HEATER_4_CAMERA)) { - if (sensorTemperatures.sensor_4k_camera.value >= cameraLimits.opLowerLimit + TEMP_OFFSET) { - heaterHandler.switchHeater(heater::HEATER_4_CAMERA, HeaterHandler::SwitchState::OFF); - } - } else { - if (heater4Countdown.hasTimedOut()) { - // Sensor or heater failure - heaterHandler.switchHeater(heater::HEATER_4_CAMERA, HeaterHandler::SwitchState::OFF); - triggerEvent(HEATER_MAX_BURNTIME_REACHED, heater::HEATER_4_CAMERA); - }; - } - } else { - if (heaterHandler.checkSwitchState(heater::HEATER_4_CAMERA)) { - heaterHandler.switchHeater(heater::HEATER_4_CAMERA, HeaterHandler::SwitchState::OFF); - } - triggerEvent(INVALID_SENSOR_TEMPERATURE, heater::HEATER_4_CAMERA); - } } ReturnValue_t ThermalController::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, @@ -977,3 +954,30 @@ void ThermalController::copyDevices() { } } } + +void ThermalController::ctrl4KCameraHeater(){ + // 4K Camera - Heater + if (sensorTemperatures.sensor_4k_camera.isValid()) { + if (not heaterHandler.checkSwitchState(heater::HEATER_4_CAMERA)) { + if (sensorTemperatures.sensor_4k_camera.value < cameraLimits.opLowerLimit) { + heaterHandler.switchHeater(heater::HEATER_4_CAMERA, HeaterHandler::SwitchState::ON); + heater4Countdown.resetTimer(); + } + } else if (heaterHandler.checkSwitchState(heater::HEATER_4_CAMERA)) { + if (sensorTemperatures.sensor_4k_camera.value >= cameraLimits.opLowerLimit + TEMP_OFFSET) { + heaterHandler.switchHeater(heater::HEATER_4_CAMERA, HeaterHandler::SwitchState::OFF); + } + } else { + if (heater4Countdown.hasTimedOut()) { + // Sensor or heater failure + heaterHandler.switchHeater(heater::HEATER_4_CAMERA, HeaterHandler::SwitchState::OFF); + triggerEvent(HEATER_MAX_BURNTIME_REACHED, heater::HEATER_4_CAMERA); + }; + } + } else { + if (heaterHandler.checkSwitchState(heater::HEATER_4_CAMERA)) { + heaterHandler.switchHeater(heater::HEATER_4_CAMERA, HeaterHandler::SwitchState::OFF); + } + triggerEvent(INVALID_SENSOR_TEMPERATURE, heater::HEATER_4_CAMERA); + } +} diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 203f779e..076956e8 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -150,6 +150,8 @@ class ThermalController : public ExtendedControllerBase { void copySensors(); void copySus(); void copyDevices(); + + void ctrl4KCameraHeater(); }; #endif /* MISSION_CONTROLLER_THERMALCONTROLLER_H_ */ From a0dd3f585b03e4e0faa47437b3dfb26e4d138551 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 2 Dec 2022 16:23:16 +0100 Subject: [PATCH 036/330] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 6e152818..56d0f26c 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 6e152818707c7a12be8900bc239a0073053c0bec +Subproject commit 56d0f26cbffbfbf4e790d3a19858162291104934 From 2b2b14193f0d9da566df66b9cfbdb67a23a07f57 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 2 Dec 2022 18:08:49 +0100 Subject: [PATCH 037/330] fix merge conflicts --- bsp_hosted/scheduling.cpp | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/bsp_hosted/scheduling.cpp b/bsp_hosted/scheduling.cpp index 469d7f38..ba393e3a 100644 --- a/bsp_hosted/scheduling.cpp +++ b/bsp_hosted/scheduling.cpp @@ -185,14 +185,10 @@ void scheduling::initTasks() { } #endif /* OBSW_ADD_TEST_CODE == 1 */ -<<<<<<< HEAD - PeriodicTaskIF* tcsTask = factory->createPeriodicTask( - "TCS_TASK", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.5, missedDeadlineFunc); - scheduling::scheduleTmpTempSensors(tcsTask); - scheduling::scheduleRtdSensors(tcsTask); -======= PeriodicTaskIF* dummyTask = factory->createPeriodicTask( "DUMMY_TASK", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, missedDeadlineFunc); + scheduling::scheduleTmpTempSensors(dummyTask); + scheduling::scheduleRtdSensors(dummyTask); dummyTask->addComponent(objects::SUS_0_N_LOC_XFYFZM_PT_XF); dummyTask->addComponent(objects::SUS_1_N_LOC_XBYFZM_PT_XB); dummyTask->addComponent(objects::SUS_2_N_LOC_XFYBZB_PT_YB); @@ -205,23 +201,6 @@ void scheduling::initTasks() { dummyTask->addComponent(objects::SUS_9_R_LOC_XBYBZB_PT_YF); dummyTask->addComponent(objects::SUS_10_N_LOC_XMYBZF_PT_ZF); dummyTask->addComponent(objects::SUS_11_R_LOC_XBYMZB_PT_ZB); - dummyTask->addComponent(objects::RTD_0_IC3_PLOC_HEATSPREADER); - dummyTask->addComponent(objects::RTD_1_IC4_PLOC_MISSIONBOARD); - dummyTask->addComponent(objects::RTD_2_IC5_4K_CAMERA); - dummyTask->addComponent(objects::RTD_3_IC6_DAC_HEATSPREADER); - dummyTask->addComponent(objects::RTD_4_IC7_STARTRACKER); - dummyTask->addComponent(objects::RTD_5_IC8_RW1_MX_MY); - dummyTask->addComponent(objects::RTD_6_IC9_DRO); - dummyTask->addComponent(objects::RTD_7_IC10_SCEX); - dummyTask->addComponent(objects::RTD_8_IC11_X8); - dummyTask->addComponent(objects::RTD_9_IC12_HPA); - dummyTask->addComponent(objects::RTD_10_IC13_PL_TX); - dummyTask->addComponent(objects::RTD_11_IC14_MPA); - dummyTask->addComponent(objects::RTD_12_IC15_ACU); - dummyTask->addComponent(objects::RTD_13_IC16_PLPCDU_HEATSPREADER); - dummyTask->addComponent(objects::RTD_14_IC17_TCS_BOARD); - dummyTask->addComponent(objects::RTD_15_IC18_IMTQ); ->>>>>>> origin/develop sif::info << "Starting tasks.." << std::endl; tmtcDistributor->startTask(); @@ -236,11 +215,7 @@ void scheduling::initTasks() { pstTask->startTask(); thermalTask->startTask(); -<<<<<<< HEAD - tcsTask->startTask(); -======= dummyTask->startTask(); ->>>>>>> origin/develop #if OBSW_ADD_PLOC_SUPERVISOR == 1 supvHelperTask->startTask(); #endif From 2b445369fd0a66fa5f37ac7b236630817d4b9015 Mon Sep 17 00:00:00 2001 From: Robin Marquardt Date: Mon, 5 Dec 2022 21:31:52 +0100 Subject: [PATCH 038/330] acsParameters in kalman filter added --- mission/controller/acs/AcsParameters.h | 10 +++++----- mission/controller/acs/MultiplicativeKalmanFilter.cpp | 8 +++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index 24018ad9..7fe33814 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -872,8 +872,8 @@ class AcsParameters /*: public HasParametersIF*/ { struct SunModelParameters { float domega = 36000.771; - float omega_0 = 282.94 * M_PI / 180.; // RAAN plus argument of perigee - float m_0 = 357.5256; // coefficients for mean anomaly + float omega_0 = 280.46 * M_PI / 180.; //282.94 * M_PI / 180.; // RAAN plus argument of perigee + float m_0 = 357.5277; //357.5256; // coefficients for mean anomaly float dm = 35999.049; // coefficients for mean anomaly float e = 23.4392911 * M_PI / 180.; // angle of earth's rotation axis float e1 = 0.74508 * M_PI / 180.; @@ -886,10 +886,10 @@ class AcsParameters /*: public HasParametersIF*/ { double sensorNoiseSTR = 0.1 * M_PI / 180; double sensorNoiseSS = 8 * M_PI / 180; double sensorNoiseMAG = 4 * M_PI / 180; - double sensorNoiseRMU[3]; + double sensorNoiseGYR = 0.1 * M_PI / 180; - double sensorNoiseArwRmu; // Angular Random Walk - double sensorNoiseBsRMU; // Bias Stability + double sensorNoiseArwGYR = 3*0.0043*M_PI / sqrt(10) / 180; // Angular Random Walk + double sensorNoiseBsGYR = 3 * M_PI / 180 / 3600; // Bias Stability } kalmanFilterParameters; struct MagnetorquesParameter { diff --git a/mission/controller/acs/MultiplicativeKalmanFilter.cpp b/mission/controller/acs/MultiplicativeKalmanFilter.cpp index 5f7facd2..3d97c880 100644 --- a/mission/controller/acs/MultiplicativeKalmanFilter.cpp +++ b/mission/controller/acs/MultiplicativeKalmanFilter.cpp @@ -51,7 +51,7 @@ void MultiplicativeKalmanFilter::init(const double *magneticField_, const bool * sigmaSun = kalmanFilterParameters->sensorNoiseSS; sigmaMag = kalmanFilterParameters->sensorNoiseMAG; - sigmaGyro = 0.1*3.141/180; // acs parameters + sigmaGyro = kalmanFilterParameters->sensorNoiseGYR; double normMagB[3] = {0,0,0}, normSunB[3] = {0,0,0}, normMagJ[3] = {0,0,0}, normSunJ[3] = {0,0,0}; @@ -980,10 +980,8 @@ ReturnValue_t MultiplicativeKalmanFilter::mekfEst( /* ----------- PROPAGATION ----------*/ - //double sigmaU = kalmanFilterParameters->sensorNoiseBsRMU; - //double sigmaV = kalmanFilterParameters->sensorNoiseArwRmu; - double sigmaU = 3*3.141/180/3600; - double sigmaV = 3*0.0043*3.141/sqrt(10)/180; + double sigmaU = kalmanFilterParameters->sensorNoiseBsGYR; + double sigmaV = kalmanFilterParameters->sensorNoiseArwGYR; double discTimeMatrix[6][6] = {{-1,0,0,0,0,0},{0,-1,0,0,0,0},{0,0,-1,0,0,0}, {0,0,0,1,0,0},{0,0,0,0,1,0},{0,0,0,0,0,1}}; From 72b503bb8f5352dcc2065e0ca04787708c332135 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Tue, 6 Dec 2022 09:21:43 +0100 Subject: [PATCH 039/330] fixed calculation of sun vectore model --- mission/controller/acs/AcsParameters.h | 7 ++++--- mission/controller/acs/SensorProcessing.cpp | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index 828e4495..f7aa2b37 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -857,12 +857,13 @@ class AcsParameters /*: public HasParametersIF*/ { struct SunModelParameters { enum UseSunModel { NO = 0, YES = 3 }; uint8_t useSunModel; - float domega = 36000.771; - float omega_0 = 282.94 * M_PI / 180.; // RAAN plus argument of perigee + float domega = 36000.77005361; // 36000.771; + float omega_0 = + 280.4606184 * M_PI / 180.; // 282.94 * M_PI / 180.; // RAAN plus argument of perigee float m_0 = 357.5256; // coefficients for mean anomaly float dm = 35999.049; // coefficients for mean anomaly float e = 23.4392911 * M_PI / 180.; // angle of earth's rotation axis - float e1 = 0.74508 * M_PI / 180.; + float e1 = 0.013 * M_PI / 180.; // 0.74508 * M_PI / 180.; float p1 = 6892. / 3600. * M_PI / 180.; // some parameter float p2 = 72. / 3600. * M_PI / 180.; // some parameter diff --git a/mission/controller/acs/SensorProcessing.cpp b/mission/controller/acs/SensorProcessing.cpp index 4635e673..c02398ce 100644 --- a/mission/controller/acs/SensorProcessing.cpp +++ b/mission/controller/acs/SensorProcessing.cpp @@ -397,10 +397,10 @@ void SensorProcessing::processSus( // Julean Centuries double sunIjkModel[3] = {0.0, 0.0, 0.0}; - double JC2000 = JD2000 / 36525; + double JC2000 = JD2000 / 36525.; double meanLongitude = - (sunModelParameters->omega_0 + (sunModelParameters->domega) * JC2000) * PI / 180; + sunModelParameters->omega_0 + (sunModelParameters->domega * JC2000) * PI / 180.; double meanAnomaly = (sunModelParameters->m_0 + sunModelParameters->dm * JC2000) * PI / 180.; double eclipticLongitude = meanLongitude + sunModelParameters->p1 * sin(meanAnomaly) + From fac2fc4971b3dfbea6d9bdc2724ce255597e73dc Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Thu, 8 Dec 2022 09:52:42 +0100 Subject: [PATCH 040/330] - fixed IGRF-13 model - fixed GST calculation - fixed conversion ECI - ToDo: remove debug output, check normalization --- mission/controller/acs/Igrf13Model.cpp | 128 ++++++++++++++++++------- mission/controller/acs/Igrf13Model.h | 28 +++++- 2 files changed, 119 insertions(+), 37 deletions(-) diff --git a/mission/controller/acs/Igrf13Model.cpp b/mission/controller/acs/Igrf13Model.cpp index fcd95b68..ec1b3e08 100644 --- a/mission/controller/acs/Igrf13Model.cpp +++ b/mission/controller/acs/Igrf13Model.cpp @@ -1,22 +1,19 @@ -/* - * Igrf13Model.cpp - * - * Created on: 10 Mar 2022 - * Author: Robin Marquardt - */ - #include "Igrf13Model.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include #include #include +#include + +#include #include "util/MathOperations.h" +using namespace Math; + Igrf13Model::Igrf13Model() {} Igrf13Model::~Igrf13Model() {} @@ -25,7 +22,7 @@ void Igrf13Model::magFieldComp(const double longitude, const double gcLatitude, double* magFieldModelInertial) { double phi = longitude, theta = gcLatitude; // geocentric /* Here is the co-latitude needed*/ - theta -= 90 * Math::PI / 180; + theta -= 90 * PI / 180; theta *= (-1); double rE = 6371200.0; // radius earth [m] @@ -43,7 +40,7 @@ void Igrf13Model::magFieldComp(const double longitude, const double gcLatitude, /* Calculation of Legendre Polynoms (normalised) */ if (n == m) { P2 = sin(theta) * P11; - dP2 = sin(theta) * dP11 - cos(theta) * P11; + dP2 = sin(theta) * dP11 + cos(theta) * P11; P11 = P2; P10 = P11; P20 = 0; @@ -70,11 +67,11 @@ void Igrf13Model::magFieldComp(const double longitude, const double gcLatitude, magFieldModel[0] += pow(rE / (altitude + rE), (n + 2)) * (n + 1) * ((updatedG[m][n - 1] * cos(m * phi) + updatedH[m][n - 1] * sin(m * phi)) * P2); - /* gradient of scalar potential towards phi */ + /* gradient of scalar potential towards theta */ magFieldModel[1] += pow(rE / (altitude + rE), (n + 2)) * ((updatedG[m][n - 1] * cos(m * phi) + updatedH[m][n - 1] * sin(m * phi)) * dP2); - /* gradient of scalar potential towards theta */ + /* gradient of scalar potential towards phi */ magFieldModel[2] += pow(rE / (altitude + rE), (n + 2)) * ((-updatedG[m][n - 1] * sin(m * phi) + updatedH[m][n - 1] * cos(m * phi)) * P2 * m); @@ -85,31 +82,51 @@ void Igrf13Model::magFieldComp(const double longitude, const double gcLatitude, magFieldModel[1] *= -1; magFieldModel[2] *= (-1 / sin(theta)); - /* Next step: transform into inertial KOS (IJK)*/ + // std::cout << " X=" << -magFieldModel[1] << " Y=" << magFieldModel[2] + // << " Z=" << -magFieldModel[0] << std::endl; + + /* Next step: transform into inertial RF (IJK)*/ // Julean Centuries - double JD2000Floor = 0; + // double JD2000Floor = 0; + // double JD2000 = MathOperations::convertUnixToJD2000(timeOfMagMeasurement); + // JD2000Floor = floor(JD2000); + // double JC2000 = JD2000Floor / 36525.; + double JD2000 = MathOperations::convertUnixToJD2000(timeOfMagMeasurement); - JD2000Floor = floor(JD2000); - double JC2000 = JD2000Floor / 36525; + double UT1 = JD2000 / 36525.; - double gst = 100.4606184 + 36000.77005361 * JC2000 + 0.00038793 * pow(JC2000, 2) - - 0.000000026 * pow(JC2000, 3); // greenwich sidereal time - gst *= PI / 180; // convert to radians - double sec = - (JD2000 - JD2000Floor) * 86400; // Seconds on this day (Universal time) // FROM GPS ? - double omega0 = 0.00007292115; // mean angular velocity earth [rad/s] - gst += omega0 * sec; + double gst = + 280.46061837 + 360.98564736629 * JD2000 + 0.0003875 * pow(UT1, 2) - 2.6e-8 * pow(UT1, 3); + gst = std::fmod(gst, 360.); + gst *= PI / 180.; + // std::cout << " GMST=" << gst * 180. / Math::PI << std::endl; + // double gst = 100.4606184 + 36000.77005361 * JC2000 + 0.00038793 * pow(JC2000, 2) - + // 0.000000026 * pow(JC2000, 3); // greenwich sidereal time + // gst *= PI / 180; // convert to radians + // double sec = + // (JD2000 - JD2000Floor) * 86400; // Seconds on this day (Universal time) // FROM GPS ? + // double omega0 = 0.00007292115; // mean angular velocity earth [rad/s] + // gst += omega0 * sec; + // std::cout << " GMST=" << gst * 180. / Math::PI << std::endl; double lst = gst + longitude; // local sidereal time [rad] + // std::cout << " LMST=" << lst * 180. / Math::PI << std::endl; - magFieldModelInertial[0] = magFieldModel[0] * cos(theta) + - magFieldModel[1] * sin(theta) * cos(lst) - magFieldModel[1] * sin(lst); - magFieldModelInertial[1] = magFieldModel[0] * cos(theta) + - magFieldModel[1] * sin(theta) * sin(lst) + magFieldModel[1] * cos(lst); - magFieldModelInertial[2] = magFieldModel[0] * sin(theta) + magFieldModel[1] * cos(lst); + magFieldModelInertial[0] = + (magFieldModel[0] * cos(gcLatitude) + magFieldModel[1] * sin(gcLatitude)) * cos(lst) - + magFieldModel[2] * sin(lst); + magFieldModelInertial[1] = + (magFieldModel[0] * cos(gcLatitude) + magFieldModel[1] * sin(gcLatitude)) * sin(lst) + + magFieldModel[2] * cos(lst); + magFieldModelInertial[2] = + magFieldModel[0] * sin(gcLatitude) - magFieldModel[1] * cos(gcLatitude); double normVecMagFieldInert[3] = {0, 0, 0}; VectorOperations::normalize(magFieldModelInertial, normVecMagFieldInert, 3); + + magFieldModel[0] = 0; + magFieldModel[1] = 0; + magFieldModel[2] = 0; } void Igrf13Model::updateCoeffGH(timeval timeOfMagMeasurement) { @@ -123,3 +140,50 @@ void Igrf13Model::updateCoeffGH(timeval timeOfMagMeasurement) { } } } + +void Igrf13Model::schmidtNormalization() { + double kronDelta = 0; + schmidtFactors[0][0] = 1; + // for (int n = 1; n <= igrfOrder; n++) { + // if (n == 1) { + // schmidtFactors[0][n - 1] = 1; + // } else { + // schmidtFactors[0][n - 1] = schmidtFactors[0][n - 2] * (2 * n - 1) / n; + // } + // + // for (int m = 1; m <= igrfOrder; m++) { + // if (m == 1) { + // kronDelta = 1; + // } else { + // kronDelta = 0; + // } + // schmidtFactors[m][n - 1] = + // schmidtFactors[m - 1][n - 1] * sqrt((n - m + 1) * (kronDelta + 1) / (n + m)); + // } + // } + + for (int n = 1; n <= igrfOrder; n++) { + for (int m = 0; m <= n; m++) { + if (m > 1) { + schmidtFactors[m][n - 1] = schmidtFactors[m - 1][n - 1] * pow((n - m + 1) / (n + m), .5); + } else if (m > 0) { + schmidtFactors[m][n - 1] = + schmidtFactors[m - 1][n - 1] * pow(2 * (n - m + 1) / (n + m), .5); + } else if (n == 1) { + schmidtFactors[m][n - 1] = 1; + } else { + schmidtFactors[m][n - 1] = schmidtFactors[0][n - 2] * (2 * n - 1) / (n); + } + } + } + + for (int i = 0; i <= igrfOrder; i++) { + for (int j = 0; j <= (igrfOrder - 1); j++) { + coeffG[i][j] = schmidtFactors[i][j] * coeffG[i][j]; + coeffH[i][j] = schmidtFactors[i][j] * coeffH[i][j]; + + svG[i][j] = schmidtFactors[i][j] * svG[i][j]; + svH[i][j] = schmidtFactors[i][j] * svH[i][j]; + } + } +} diff --git a/mission/controller/acs/Igrf13Model.h b/mission/controller/acs/Igrf13Model.h index aa7e8b73..7abe97cc 100644 --- a/mission/controller/acs/Igrf13Model.h +++ b/mission/controller/acs/Igrf13Model.h @@ -43,14 +43,15 @@ class Igrf13Model /*:public HasParametersIF*/ { * - timeOfMagMeasurement: time of actual measurement [s] * * Outputs: - * - magFieldModelInertial: Magnetic Field Vector in IJK KOS [nT]*/ + * - magFieldModelInertial: Magnetic Field Vector in IJK RF [nT]*/ // Coefficient wary over year, could be updated sometimes. void updateCoeffGH(timeval timeOfMagMeasurement); // Secular variation (SV) double magFieldModel[3]; + void schmidtNormalization(); private: - const double coeffG[14][13] = { + double coeffG[14][13] = { {-29404.8, -2499.6, 1363.2, 903.0, -234.3, 66.0, 80.6, 23.7, 5.0, -1.9, 3.0, -2.0, 0.1}, {-1450.9, 2982.0, -2381.2, 809.5, 363.2, 65.5, -76.7, 9.7, 8.4, -6.2, -1.4, -0.1, -0.9}, {0.0, 1677.0, 1236.2, 86.3, 187.8, 72.9, -8.2, -17.6, 2.9, -0.1, -2.5, 0.5, 0.5}, @@ -66,7 +67,7 @@ class Igrf13Model /*:public HasParametersIF*/ { {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.3, -0.5}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.4}}; // [m][n] in nT - const double coeffH[14][13] = { + double coeffH[14][13] = { {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0}, {4652.5, -2991.6, -82.1, 281.9, 47.7, -19.1, -51.5, 8.4, -23.4, 3.4, 0.0, -1.2, -0.9}, {0.0, -734.6, 241.9, -158.4, 208.3, 25.1, -16.9, -15.3, 11.0, -0.2, 2.5, 0.5, 0.6}, @@ -82,7 +83,7 @@ class Igrf13Model /*:public HasParametersIF*/ { {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, -0.4}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.6}}; // [m][n] in nT - const double svG[14][13] = { + double svG[14][13] = { {5.7, -11.0, 2.2, -1.2, -0.3, -0.5, -0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {7.4, -7.0, -5.9, -1.6, 0.5, -0.3, -0.2, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, -2.1, 3.1, -5.9, -0.6, 0.4, 0.0, -0.1, 0.0, 0.0, 0.0, 0.0, 0.0}, @@ -98,7 +99,7 @@ class Igrf13Model /*:public HasParametersIF*/ { {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}}; // [m][n] in nT - const double svH[14][13] = { + double svH[14][13] = { {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {-25.9, -30.2, 6.0, -0.1, 0.0, 0.0, 0.6, -0.2, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, -22.4, -1.1, 6.5, 2.5, -1.6, 0.6, 0.6, 0.0, 0.0, 0.0, 0.0, 0.0}, @@ -113,6 +114,23 @@ class Igrf13Model /*:public HasParametersIF*/ { {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}}; // [m][n] in nT + + double schmidtFactors[14][13] = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; + ; + bool schmidtNorm = false; double updatedG[14][13]; double updatedH[14][13]; From e9dd0f8f6d943f477f6624b0fd9b32cc1ce06705 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Mon, 12 Dec 2022 11:51:56 +0100 Subject: [PATCH 041/330] reverted to initial smidt normalization --- mission/controller/acs/Igrf13Model.cpp | 54 +++++++++++++------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/mission/controller/acs/Igrf13Model.cpp b/mission/controller/acs/Igrf13Model.cpp index ec1b3e08..960ab462 100644 --- a/mission/controller/acs/Igrf13Model.cpp +++ b/mission/controller/acs/Igrf13Model.cpp @@ -144,39 +144,39 @@ void Igrf13Model::updateCoeffGH(timeval timeOfMagMeasurement) { void Igrf13Model::schmidtNormalization() { double kronDelta = 0; schmidtFactors[0][0] = 1; - // for (int n = 1; n <= igrfOrder; n++) { - // if (n == 1) { - // schmidtFactors[0][n - 1] = 1; - // } else { - // schmidtFactors[0][n - 1] = schmidtFactors[0][n - 2] * (2 * n - 1) / n; - // } - // - // for (int m = 1; m <= igrfOrder; m++) { - // if (m == 1) { - // kronDelta = 1; - // } else { - // kronDelta = 0; - // } - // schmidtFactors[m][n - 1] = - // schmidtFactors[m - 1][n - 1] * sqrt((n - m + 1) * (kronDelta + 1) / (n + m)); - // } - // } - for (int n = 1; n <= igrfOrder; n++) { - for (int m = 0; m <= n; m++) { - if (m > 1) { - schmidtFactors[m][n - 1] = schmidtFactors[m - 1][n - 1] * pow((n - m + 1) / (n + m), .5); - } else if (m > 0) { - schmidtFactors[m][n - 1] = - schmidtFactors[m - 1][n - 1] * pow(2 * (n - m + 1) / (n + m), .5); - } else if (n == 1) { - schmidtFactors[m][n - 1] = 1; + if (n == 1) { + schmidtFactors[0][n - 1] = 1; + } else { + schmidtFactors[0][n - 1] = schmidtFactors[0][n - 2] * (2 * n - 1) / n; + } + for (int m = 1; m <= igrfOrder; m++) { + if (m == 1) { + kronDelta = 1; } else { - schmidtFactors[m][n - 1] = schmidtFactors[0][n - 2] * (2 * n - 1) / (n); + kronDelta = 0; } + schmidtFactors[m][n - 1] = + schmidtFactors[m - 1][n - 1] * sqrt((n - m + 1) * (kronDelta + 1) / (n + m)); } } + // for (int n = 1; n <= igrfOrder; n++) { + // for (int m = 0; m <= n; m++) { + // if (m > 1) { + // schmidtFactors[m][n - 1] = schmidtFactors[m - 1][n - 1] * pow((n - m + 1) / (n + m), + // .5); + // } else if (m > 0) { + // schmidtFactors[m][n - 1] = + // schmidtFactors[m - 1][n - 1] * pow(2 * (n - m + 1) / (n + m), .5); + // } else if (n == 1) { + // schmidtFactors[m][n - 1] = 1; + // } else { + // schmidtFactors[m][n - 1] = schmidtFactors[0][n - 2] * (2 * n - 1) / (n); + // } + // } + // } + for (int i = 0; i <= igrfOrder; i++) { for (int j = 0; j <= (igrfOrder - 1); j++) { coeffG[i][j] = schmidtFactors[i][j] * coeffG[i][j]; From f35c42aeadab0b5119f5fe03e25a7b8f6dc1b382 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Mon, 12 Dec 2022 11:52:46 +0100 Subject: [PATCH 042/330] corrected calculations of Q and Phi --- .../acs/MultiplicativeKalmanFilter.cpp | 300 ++++++++---------- 1 file changed, 139 insertions(+), 161 deletions(-) diff --git a/mission/controller/acs/MultiplicativeKalmanFilter.cpp b/mission/controller/acs/MultiplicativeKalmanFilter.cpp index 199440d5..566ef4ca 100644 --- a/mission/controller/acs/MultiplicativeKalmanFilter.cpp +++ b/mission/controller/acs/MultiplicativeKalmanFilter.cpp @@ -14,6 +14,8 @@ #include #include +#include + #include "util/CholeskyDecomposition.h" #include "util/MathOperations.h" @@ -932,6 +934,10 @@ ReturnValue_t MultiplicativeKalmanFilter::mekfEst( double errStateQuat[3] = {errStateVec[0], errStateVec[1], errStateVec[2]}; double errStateGyroBias[3] = {errStateVec[3], errStateVec[4], errStateVec[5]}; + sif::debug << "errQ=[" << errStateQuat[0] << "," << errStateQuat[1] << "," << errStateQuat[2] + << "]" << std::endl; + sif::debug << "errW_bias=[" << errStateGyroBias[0] << "," << errStateGyroBias[1] << "," + << errStateGyroBias[2] << "]" << std::endl; // State Vector Elements double xi1[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}, @@ -968,179 +974,150 @@ ReturnValue_t MultiplicativeKalmanFilter::mekfEst( double discTimeMatrix[6][6] = {{-1, 0, 0, 0, 0, 0}, {0, -1, 0, 0, 0, 0}, {0, 0, -1, 0, 0, 0}, {0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 1}}; double rotRateEst[3] = {0, 0, 0}; + sif::debug << "MEKF rateGYR= " << rateGYRs_[0] << " " << rateGYRs_[1] << " " << rateGYRs_[2] + << std::endl; + sif::debug << "MEKF bias= " << updatedGyroBias[0] << " " << updatedGyroBias[1] << " " + << updatedGyroBias[2] << std::endl; VectorOperations::subtract(rateGYRs_, updatedGyroBias, rotRateEst, 3); double normRotEst = VectorOperations::norm(rotRateEst, 3); double crossRotEst[3][3] = {{0, -rotRateEst[2], rotRateEst[1]}, {rotRateEst[2], 0, -rotRateEst[0]}, {-rotRateEst[1], rotRateEst[0], 0}}; + // ToDo // Discrete Process Noise Covariance Q double discProcessNoiseCov[6][6] = {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}}; - double covQ1[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}, - covQ2[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}, - covQ3[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}, - transCovQ2[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; - if (normRotEst * sampleTime < 3.141 / 10) { - double fact1 = sampleTime * pow(sigmaV, 2) + pow(sampleTime, 3) * pow(sigmaU, 2 / 3); - MatrixOperations::multiplyScalar(*identityMatrix3, fact1, *covQ1, 3, 3); - double fact2 = -(0.5 * pow(sampleTime, 2) * pow(sigmaU, 2)); - MatrixOperations::multiplyScalar(*identityMatrix3, fact2, *covQ2, 3, 3); - MatrixOperations::transpose(*covQ2, *transCovQ2, 3); - double fact3 = sampleTime * pow(sigmaU, 2); - MatrixOperations::multiplyScalar(*identityMatrix3, fact3, *covQ3, 3, 3); + double covQ11[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}, + covQ12[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}, + covQ22[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}, + covQ12trans[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + if (normRotEst * sampleTime < M_PI / 10) { + double fact11 = pow(sigmaV, 2) * sampleTime + 1. / 3. * pow(sigmaU, 2) * pow(sampleTime, 3); + MatrixOperations::multiplyScalar(*identityMatrix3, fact11, *covQ11, 3, 3); - discProcessNoiseCov[0][0] = covQ1[0][0]; - discProcessNoiseCov[0][1] = covQ1[0][1]; - discProcessNoiseCov[0][2] = covQ1[0][2]; - discProcessNoiseCov[0][3] = covQ2[0][0]; - discProcessNoiseCov[0][4] = covQ2[0][1]; - discProcessNoiseCov[0][5] = covQ2[0][2]; - discProcessNoiseCov[1][0] = covQ1[1][0]; - discProcessNoiseCov[1][1] = covQ1[1][1]; - discProcessNoiseCov[1][2] = covQ1[1][2]; - discProcessNoiseCov[1][3] = covQ2[1][0]; - discProcessNoiseCov[1][4] = covQ2[1][1]; - discProcessNoiseCov[1][5] = covQ2[1][2]; - discProcessNoiseCov[2][0] = covQ1[2][0]; - discProcessNoiseCov[2][1] = covQ1[2][1]; - discProcessNoiseCov[2][2] = covQ1[2][2]; - discProcessNoiseCov[2][3] = covQ2[2][0]; - discProcessNoiseCov[2][4] = covQ2[2][1]; - discProcessNoiseCov[2][5] = covQ2[2][2]; - discProcessNoiseCov[3][0] = transCovQ2[0][0]; - discProcessNoiseCov[3][1] = transCovQ2[0][1]; - discProcessNoiseCov[3][2] = transCovQ2[0][2]; - discProcessNoiseCov[3][3] = covQ3[0][0]; - discProcessNoiseCov[3][4] = covQ3[0][1]; - discProcessNoiseCov[3][5] = covQ3[0][2]; - discProcessNoiseCov[4][0] = transCovQ2[1][0]; - discProcessNoiseCov[4][1] = transCovQ2[1][1]; - discProcessNoiseCov[4][2] = transCovQ2[1][2]; - discProcessNoiseCov[4][3] = covQ3[1][0]; - discProcessNoiseCov[4][4] = covQ3[1][1]; - discProcessNoiseCov[4][5] = covQ3[1][2]; - discProcessNoiseCov[5][0] = transCovQ2[2][0]; - discProcessNoiseCov[5][1] = transCovQ2[2][1]; - discProcessNoiseCov[5][2] = transCovQ2[2][2]; - discProcessNoiseCov[5][3] = covQ3[2][0]; - discProcessNoiseCov[5][4] = covQ3[2][1]; - discProcessNoiseCov[5][5] = covQ3[2][2]; + double fact12 = -(1. / 2. * pow(sigmaU, 2) * pow(sampleTime, 2)); + MatrixOperations::multiplyScalar(*identityMatrix3, fact12, *covQ12, 3, 3); + std::memcpy(*covQ12trans, *covQ12, 3 * 3 * sizeof(double)); + + double fact22 = pow(sigmaU, 2) * sampleTime; + MatrixOperations::multiplyScalar(*identityMatrix3, fact22, *covQ22, 3, 3); } else { - // double fact1 = sampleTime*pow(sigmaV,2); - double covQ11[3][3], covQ12[3][3], covQ13[3][3]; - // MatrixOperations::multiplyScalar(*identityMatrix3, fact1, *covQ1, 3, 3); - double fact1 = (2 * normRotEst + sampleTime - 2 * sin(normRotEst * sampleTime) - - pow(normRotEst, 3) / 3 * pow(sampleTime, 3)) / - pow(normRotEst, 5); - MatrixOperations::multiply(*crossRotEst, *crossRotEst, *covQ11, 3, 3, 3); - MatrixOperations::multiplyScalar(*covQ11, fact1, *covQ11, 3, 3); - double fact2 = pow(sampleTime, 3); - MatrixOperations::multiplyScalar(*identityMatrix3, fact2, *covQ12, 3, 3); - MatrixOperations::subtract(*covQ12, *covQ11, *covQ11, 3, 3); - double fact3 = sampleTime * pow(sigmaV, 2); - MatrixOperations::multiplyScalar(*identityMatrix3, fact3, *covQ13, 3, 3); - MatrixOperations::add(*covQ13, *covQ11, *covQ1, 3, 3); + double fact22 = pow(sigmaU, 2) * sampleTime; + MatrixOperations::multiplyScalar(*identityMatrix3, fact22, *covQ22, 3, 3); - double covQ21[3][3], covQ22[3][3], covQ23[3][3]; - double fact4 = - (0.5 * pow(normRotEst, 2) * pow(sampleTime, 2) + cos(normRotEst * sampleTime) - 1) / + double covQ12_0[3][3], covQ12_1[3][3], covQ12_2[3][3], covQ12_01[3][3]; + double fact12_0 = (normRotEst * sampleTime - sin(normRotEst * sampleTime) / pow(normRotEst, 3)); + MatrixOperations::multiplyScalar(*crossRotEst, fact12_0, *covQ12_0, 3, 3); + double fact12_1 = 1. / 2. * pow(sampleTime, 2); + MatrixOperations::multiplyScalar(*identityMatrix3, fact12_1, *covQ12_1, 3, 3); + double fact12_2 = + (1. / 2. * pow(normRotEst, 2) * pow(sampleTime, 2) + cos(normRotEst * sampleTime) - 1) / pow(normRotEst, 4); - MatrixOperations::multiply(*crossRotEst, *crossRotEst, *covQ21, 3, 3, 3); - MatrixOperations::multiplyScalar(*covQ21, fact4, *covQ21, 3, 3); - double fact5 = 0.5 * pow(sampleTime, 2); - MatrixOperations::multiplyScalar(*identityMatrix3, fact5, *covQ22, 3, 3); - MatrixOperations::add(*covQ22, *covQ21, *covQ21, 3, 3); - double fact6 = normRotEst * sampleTime - sin(normRotEst * sampleTime) / pow(normRotEst, 3); - MatrixOperations::multiplyScalar(*crossRotEst, fact6, *covQ23, 3, 3); - MatrixOperations::subtract(*covQ23, *covQ21, *covQ21, 3, 3); - double fact7 = pow(sigmaU, 2); - MatrixOperations::multiplyScalar(*covQ21, fact7, *covQ2, 3, 3); + MatrixOperations::multiply(*crossRotEst, *crossRotEst, *covQ12_2, 3, 3, 3); + MatrixOperations::multiplyScalar(*covQ12_2, fact12_2, *covQ12_2, 3, 3); + MatrixOperations::subtract(*covQ12_0, *covQ12_1, *covQ12_01, 3, 3); + MatrixOperations::subtract(*covQ12_01, *covQ12_2, *covQ12, 3, 3); + MatrixOperations::multiplyScalar(*covQ12, pow(sigmaU, 2), *covQ12, 3, 3); + MatrixOperations::transpose(*covQ12, *covQ12trans, 3); - MatrixOperations::multiplyScalar(*identityMatrix3, fact7, *covQ3, 3, 3); - - discProcessNoiseCov[0][0] = covQ1[0][0]; - discProcessNoiseCov[0][1] = covQ1[0][1]; - discProcessNoiseCov[0][2] = covQ1[0][2]; - discProcessNoiseCov[0][3] = covQ2[0][0]; - discProcessNoiseCov[0][4] = covQ2[0][1]; - discProcessNoiseCov[0][5] = covQ2[0][2]; - discProcessNoiseCov[1][0] = covQ1[1][0]; - discProcessNoiseCov[1][1] = covQ1[1][1]; - discProcessNoiseCov[1][2] = covQ1[1][2]; - discProcessNoiseCov[1][3] = covQ2[1][0]; - discProcessNoiseCov[1][4] = covQ2[1][1]; - discProcessNoiseCov[1][5] = covQ2[1][2]; - discProcessNoiseCov[2][0] = covQ1[2][0]; - discProcessNoiseCov[2][1] = covQ1[2][1]; - discProcessNoiseCov[2][2] = covQ1[2][2]; - discProcessNoiseCov[2][3] = covQ2[2][0]; - discProcessNoiseCov[2][4] = covQ2[2][1]; - discProcessNoiseCov[2][5] = covQ2[2][2]; - discProcessNoiseCov[3][0] = covQ2[0][0]; - discProcessNoiseCov[3][1] = covQ2[0][1]; - discProcessNoiseCov[3][2] = covQ2[0][2]; - discProcessNoiseCov[3][3] = covQ3[0][0]; - discProcessNoiseCov[3][4] = covQ3[0][1]; - discProcessNoiseCov[3][5] = covQ3[0][2]; - discProcessNoiseCov[4][0] = covQ2[1][0]; - discProcessNoiseCov[4][1] = covQ2[1][1]; - discProcessNoiseCov[4][2] = covQ2[1][2]; - discProcessNoiseCov[4][3] = covQ3[1][0]; - discProcessNoiseCov[4][4] = covQ3[1][1]; - discProcessNoiseCov[4][5] = covQ3[1][2]; - discProcessNoiseCov[5][0] = covQ2[2][0]; - discProcessNoiseCov[5][1] = covQ2[2][1]; - discProcessNoiseCov[5][2] = covQ2[2][2]; - discProcessNoiseCov[5][3] = covQ3[2][0]; - discProcessNoiseCov[5][4] = covQ3[2][1]; - discProcessNoiseCov[5][5] = covQ3[2][2]; + double covQ11_0[3][3], covQ11_1[3][3], covQ11_2[3][3], covQ11_12[3][3]; + double fact11_0 = pow(sigmaV, 2) * sampleTime; + MatrixOperations::multiplyScalar(*identityMatrix3, fact11_0, *covQ11_0, 3, 3); + double fact11_1 = 1. / 3. * pow(sampleTime, 3); + MatrixOperations::multiplyScalar(*identityMatrix3, fact11_1, *covQ11_1, 3, 3); + double fact11_2 = (2 * normRotEst * sampleTime - 2 * sin(normRotEst * sampleTime) - + 1. / 3. * pow(normRotEst, 3) * pow(sampleTime, 3)) / + pow(normRotEst, 5); + MatrixOperations::multiply(*crossRotEst, *crossRotEst, *covQ11_2, 3, 3, 3); + MatrixOperations::multiplyScalar(*covQ11_2, fact11_2, *covQ11_2, 3, 3); + MatrixOperations::subtract(*covQ11_1, *covQ11_2, *covQ11_12, 3, 3); + MatrixOperations::multiplyScalar(*covQ11_12, pow(sigmaU, 2), *covQ11_12, 3, 3); + MatrixOperations::add(*covQ11_0, *covQ11_12, *covQ11, 3, 3); } + discProcessNoiseCov[0][0] = covQ11[0][0]; + discProcessNoiseCov[0][1] = covQ11[0][1]; + discProcessNoiseCov[0][2] = covQ11[0][2]; + discProcessNoiseCov[0][3] = covQ12[0][0]; + discProcessNoiseCov[0][4] = covQ12[0][1]; + discProcessNoiseCov[0][5] = covQ12[0][2]; + discProcessNoiseCov[1][0] = covQ11[1][0]; + discProcessNoiseCov[1][1] = covQ11[1][1]; + discProcessNoiseCov[1][2] = covQ11[1][2]; + discProcessNoiseCov[1][3] = covQ12[1][0]; + discProcessNoiseCov[1][4] = covQ12[1][1]; + discProcessNoiseCov[1][5] = covQ12[1][2]; + discProcessNoiseCov[2][0] = covQ11[2][0]; + discProcessNoiseCov[2][1] = covQ11[2][1]; + discProcessNoiseCov[2][2] = covQ11[2][2]; + discProcessNoiseCov[2][3] = covQ12[2][0]; + discProcessNoiseCov[2][4] = covQ12[2][1]; + discProcessNoiseCov[2][5] = covQ12[2][2]; + discProcessNoiseCov[3][0] = covQ12trans[0][0]; + discProcessNoiseCov[3][1] = covQ12trans[0][1]; + discProcessNoiseCov[3][2] = covQ12trans[0][2]; + discProcessNoiseCov[3][3] = covQ22[0][0]; + discProcessNoiseCov[3][4] = covQ22[0][1]; + discProcessNoiseCov[3][5] = covQ22[0][2]; + discProcessNoiseCov[4][0] = covQ12trans[1][0]; + discProcessNoiseCov[4][1] = covQ12trans[1][1]; + discProcessNoiseCov[4][2] = covQ12trans[1][2]; + discProcessNoiseCov[4][3] = covQ22[1][0]; + discProcessNoiseCov[4][4] = covQ22[1][1]; + discProcessNoiseCov[4][5] = covQ22[1][2]; + discProcessNoiseCov[5][0] = covQ12trans[2][0]; + discProcessNoiseCov[5][1] = covQ12trans[2][1]; + discProcessNoiseCov[5][2] = covQ12trans[2][2]; + discProcessNoiseCov[5][3] = covQ22[2][0]; + discProcessNoiseCov[5][4] = covQ22[2][1]; + discProcessNoiseCov[5][5] = covQ22[2][2]; + // ToDo // State Transition Matrix phi - double phi1[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}, - phi2[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}, + double phi11[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}, + phi12[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}, phi[6][6] = {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 1}}; - double phi11[3][3], phi12[3][3]; - double fact1 = sin(normRotEst * sampleTime); - MatrixOperations::multiplyScalar(*crossRotEst, fact1, *phi11, 3, 3); - double fact2 = (1 - cos(normRotEst * sampleTime)) / pow(normRotEst, 2); - MatrixOperations::multiply(*crossRotEst, *crossRotEst, *phi12, 3, 3, 3); - MatrixOperations::multiplyScalar(*phi12, fact2, *phi12, 3, 3); - MatrixOperations::subtract(*identityMatrix3, *phi11, *phi11, 3, 3); - MatrixOperations::add(*phi11, *phi12, *phi1, 3, 3); + double phi11_1[3][3], phi11_2[3][3], phi11_01[3][3]; + double fact11_1 = sin(normRotEst * sampleTime) / normRotEst; + MatrixOperations::multiplyScalar(*crossRotEst, fact11_1, *phi11_1, 3, 3); + double fact11_2 = (1 - cos(normRotEst * sampleTime)) / pow(normRotEst, 2); + MatrixOperations::multiply(*crossRotEst, *crossRotEst, *phi11_2, 3, 3, 3); + MatrixOperations::multiplyScalar(*phi11_2, fact11_2, *phi11_2, 3, 3); + MatrixOperations::subtract(*identityMatrix3, *phi11_1, *phi11_01, 3, 3); + MatrixOperations::add(*phi11_01, *phi11_2, *phi11, 3, 3); - double phi21[3][3], phi22[3][3]; - MatrixOperations::multiplyScalar(*crossRotEst, fact2, *phi21, 3, 3); - MatrixOperations::multiplyScalar(*identityMatrix3, sampleTime, *phi22, 3, 3); - MatrixOperations::subtract(*phi21, *phi22, *phi21, 3, 3); - double fact3 = (normRotEst * sampleTime - sin(normRotEst * sampleTime) / pow(normRotEst, 3)); - MatrixOperations::multiply(*crossRotEst, *crossRotEst, *phi22, 3, 3, 3); - MatrixOperations::multiplyScalar(*phi22, fact3, *phi22, 3, 3); - MatrixOperations::subtract(*phi21, *phi22, *phi2, 3, 3); + double phi12_0[3][3], phi12_1[3][3], phi12_2[3][3], phi12_01[3][3]; + double fact12_0 = fact11_2; + MatrixOperations::multiplyScalar(*crossRotEst, fact12_0, *phi12_0, 3, 3); + MatrixOperations::multiplyScalar(*identityMatrix3, sampleTime, *phi12_1, 3, 3); + double fact12_2 = (normRotEst * sampleTime - sin(normRotEst * sampleTime) / pow(normRotEst, 3)); + MatrixOperations::multiply(*crossRotEst, *crossRotEst, *phi12_2, 3, 3, 3); + MatrixOperations::multiplyScalar(*phi12_2, fact12_2, *phi12_2, 3, 3); + MatrixOperations::subtract(*phi12_0, *phi12_1, *phi12_01, 3, 3); + MatrixOperations::subtract(*phi12_01, *phi12_2, *phi12, 3, 3); - phi[0][0] = phi1[0][0]; - phi[0][1] = phi1[0][1]; - phi[0][2] = phi1[0][2]; - phi[0][3] = phi2[0][0]; - phi[0][4] = phi2[0][1]; - phi[0][5] = phi2[0][2]; - phi[1][0] = phi1[1][0]; - phi[1][1] = phi1[1][1]; - phi[1][2] = phi1[1][2]; - phi[1][3] = phi2[1][0]; - phi[1][4] = phi2[1][1]; - phi[1][5] = phi2[1][2]; - phi[2][0] = phi1[2][0]; - phi[2][1] = phi1[2][1]; - phi[2][2] = phi1[2][2]; - phi[2][3] = phi2[2][0]; - phi[2][4] = phi2[2][1]; - phi[2][5] = phi2[2][2]; + phi[0][0] = phi11[0][0]; + phi[0][1] = phi11[0][1]; + phi[0][2] = phi11[0][2]; + phi[0][3] = phi12[0][0]; + phi[0][4] = phi12[0][1]; + phi[0][5] = phi12[0][2]; + phi[1][0] = phi11[1][0]; + phi[1][1] = phi11[1][1]; + phi[1][2] = phi11[1][2]; + phi[1][3] = phi12[1][0]; + phi[1][4] = phi12[1][1]; + phi[1][5] = phi12[1][2]; + phi[2][0] = phi11[2][0]; + phi[2][1] = phi11[2][1]; + phi[2][2] = phi11[2][2]; + phi[2][3] = phi12[2][0]; + phi[2][4] = phi12[2][1]; + phi[2][5] = phi12[2][2]; // Propagated Quaternion - double rotSin[3] = {0, 0, 0}, omega1[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + double rotSin[3] = {0, 0, 0}, rotCosMat[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; double rotCos = cos(0.5 * normRotEst * sampleTime); double sinFac = sin(0.5 * normRotEst * sampleTime) / normRotEst; VectorOperations::mulScalar(rotRateEst, sinFac, rotSin, 3); @@ -1148,25 +1125,26 @@ ReturnValue_t MultiplicativeKalmanFilter::mekfEst( double skewSin[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; MathOperations::skewMatrix(rotSin, *skewSin); - MatrixOperations::multiplyScalar(*identityMatrix3, rotCos, *omega1, 3, 3); - MatrixOperations::subtract(*omega1, *skewSin, *omega1, 3, 3); - double omega[4][4] = {{omega1[0][0], omega1[0][1], omega1[0][2], rotSin[0]}, - {omega1[1][0], omega1[1][1], omega1[1][2], rotSin[1]}, - {omega1[2][0], omega1[2][1], omega1[2][2], rotSin[2]}, + MatrixOperations::multiplyScalar(*identityMatrix3, rotCos, *rotCosMat, 3, 3); + double subMatUL[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + MatrixOperations::subtract(*rotCosMat, *skewSin, *subMatUL, 3, 3); + double omega[4][4] = {{subMatUL[0][0], subMatUL[0][1], subMatUL[0][2], rotSin[0]}, + {subMatUL[1][0], subMatUL[1][1], subMatUL[1][2], rotSin[1]}, + {subMatUL[2][0], subMatUL[2][1], subMatUL[2][2], rotSin[2]}, {-rotSin[0], -rotSin[1], -rotSin[2], rotCos}}; MatrixOperations::multiply(*omega, quatBJ, propagatedQuaternion, 4, 4, 1); // Update Covariance Matrix - double cov1[6][6], cov2[6][6], transDiscTimeMatrix[6][6], transPhi[6][6]; + double cov0[6][6], cov1[6][6], transPhi[6][6], transDiscTimeMatrix[6][6]; + MatrixOperations::transpose(*phi, *transPhi, 6); + MatrixOperations::multiply(*covMatPlus, *transPhi, *cov0, 6, 6, 6); + MatrixOperations::multiply(*phi, *cov0, *cov0, 6, 6, 6); + MatrixOperations::transpose(*discTimeMatrix, *transDiscTimeMatrix, 6); MatrixOperations::multiply(*discProcessNoiseCov, *transDiscTimeMatrix, *cov1, 6, 6, 6); MatrixOperations::multiply(*discTimeMatrix, *cov1, *cov1, 6, 6, 6); - MatrixOperations::transpose(*phi, *transPhi, 6); - MatrixOperations::multiply(*covMatPlus, *transPhi, *cov2, 6, 6, 6); - MatrixOperations::multiply(*phi, *cov2, *cov2, 6, 6, 6); - - MatrixOperations::add(*cov2, *cov1, *initialCovarianceMatrix, 6, 6); + MatrixOperations::add(*cov0, *cov1, *initialCovarianceMatrix, 6, 6); validMekf = true; // Discrete Time Step From 5fe3ac09a5b312f8619f768b510749e38c6b86f6 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Mon, 12 Dec 2022 14:30:42 +0100 Subject: [PATCH 043/330] Igrf13Model cleanup --- mission/controller/acs/Igrf13Model.cpp | 37 -------------------------- mission/controller/acs/Igrf13Model.h | 1 - 2 files changed, 38 deletions(-) diff --git a/mission/controller/acs/Igrf13Model.cpp b/mission/controller/acs/Igrf13Model.cpp index 960ab462..63992010 100644 --- a/mission/controller/acs/Igrf13Model.cpp +++ b/mission/controller/acs/Igrf13Model.cpp @@ -82,16 +82,6 @@ void Igrf13Model::magFieldComp(const double longitude, const double gcLatitude, magFieldModel[1] *= -1; magFieldModel[2] *= (-1 / sin(theta)); - // std::cout << " X=" << -magFieldModel[1] << " Y=" << magFieldModel[2] - // << " Z=" << -magFieldModel[0] << std::endl; - - /* Next step: transform into inertial RF (IJK)*/ - // Julean Centuries - // double JD2000Floor = 0; - // double JD2000 = MathOperations::convertUnixToJD2000(timeOfMagMeasurement); - // JD2000Floor = floor(JD2000); - // double JC2000 = JD2000Floor / 36525.; - double JD2000 = MathOperations::convertUnixToJD2000(timeOfMagMeasurement); double UT1 = JD2000 / 36525.; @@ -99,18 +89,7 @@ void Igrf13Model::magFieldComp(const double longitude, const double gcLatitude, 280.46061837 + 360.98564736629 * JD2000 + 0.0003875 * pow(UT1, 2) - 2.6e-8 * pow(UT1, 3); gst = std::fmod(gst, 360.); gst *= PI / 180.; - // std::cout << " GMST=" << gst * 180. / Math::PI << std::endl; - - // double gst = 100.4606184 + 36000.77005361 * JC2000 + 0.00038793 * pow(JC2000, 2) - - // 0.000000026 * pow(JC2000, 3); // greenwich sidereal time - // gst *= PI / 180; // convert to radians - // double sec = - // (JD2000 - JD2000Floor) * 86400; // Seconds on this day (Universal time) // FROM GPS ? - // double omega0 = 0.00007292115; // mean angular velocity earth [rad/s] - // gst += omega0 * sec; - // std::cout << " GMST=" << gst * 180. / Math::PI << std::endl; double lst = gst + longitude; // local sidereal time [rad] - // std::cout << " LMST=" << lst * 180. / Math::PI << std::endl; magFieldModelInertial[0] = (magFieldModel[0] * cos(gcLatitude) + magFieldModel[1] * sin(gcLatitude)) * cos(lst) - @@ -161,22 +140,6 @@ void Igrf13Model::schmidtNormalization() { } } - // for (int n = 1; n <= igrfOrder; n++) { - // for (int m = 0; m <= n; m++) { - // if (m > 1) { - // schmidtFactors[m][n - 1] = schmidtFactors[m - 1][n - 1] * pow((n - m + 1) / (n + m), - // .5); - // } else if (m > 0) { - // schmidtFactors[m][n - 1] = - // schmidtFactors[m - 1][n - 1] * pow(2 * (n - m + 1) / (n + m), .5); - // } else if (n == 1) { - // schmidtFactors[m][n - 1] = 1; - // } else { - // schmidtFactors[m][n - 1] = schmidtFactors[0][n - 2] * (2 * n - 1) / (n); - // } - // } - // } - for (int i = 0; i <= igrfOrder; i++) { for (int j = 0; j <= (igrfOrder - 1); j++) { coeffG[i][j] = schmidtFactors[i][j] * coeffG[i][j]; diff --git a/mission/controller/acs/Igrf13Model.h b/mission/controller/acs/Igrf13Model.h index 7abe97cc..f5cded71 100644 --- a/mission/controller/acs/Igrf13Model.h +++ b/mission/controller/acs/Igrf13Model.h @@ -130,7 +130,6 @@ class Igrf13Model /*:public HasParametersIF*/ { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; ; - bool schmidtNorm = false; double updatedG[14][13]; double updatedH[14][13]; From 46945a8674d3c270b61f2d6cf6dcf12302058a1c Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Mon, 12 Dec 2022 14:45:20 +0100 Subject: [PATCH 044/330] MEKF cleanup --- .../acs/MultiplicativeKalmanFilter.cpp | 35 +++---------------- 1 file changed, 4 insertions(+), 31 deletions(-) diff --git a/mission/controller/acs/MultiplicativeKalmanFilter.cpp b/mission/controller/acs/MultiplicativeKalmanFilter.cpp index 566ef4ca..14c2a2ec 100644 --- a/mission/controller/acs/MultiplicativeKalmanFilter.cpp +++ b/mission/controller/acs/MultiplicativeKalmanFilter.cpp @@ -1,10 +1,3 @@ -/* - * MultiplicativeKalmanFilter.cpp - * - * Created on: 4 Feb 2022 - * Author: rooob - */ - #include "MultiplicativeKalmanFilter.h" #include @@ -31,7 +24,7 @@ MultiplicativeKalmanFilter::~MultiplicativeKalmanFilter() {} void MultiplicativeKalmanFilter::loadAcsParameters(AcsParameters *acsParameters_) { inertiaEIVE = &(acsParameters_->inertiaEIVE); - kalmanFilterParameters = &(acsParameters_->kalmanFilterParameters); /*Sensor noises also here*/ + kalmanFilterParameters = &(acsParameters_->kalmanFilterParameters); } void MultiplicativeKalmanFilter::reset() {} @@ -43,14 +36,11 @@ void MultiplicativeKalmanFilter::init( // check for valid mag/sun if (validMagField_ && validSS && validSSModel && validMagModel) { validInit = true; - // AcsParameters mekfEstParams; - // loadAcsParameters(&mekfEstParams); // QUEST ALGO ----------------------------------------------------------------------- double sigmaSun = 0, sigmaMag = 0, sigmaGyro = 0; sigmaSun = kalmanFilterParameters->sensorNoiseSS; sigmaMag = kalmanFilterParameters->sensorNoiseMAG; - - sigmaGyro = 0.1 * 3.141 / 180; // acs parameters + sigmaGyro = kalmanFilterParameters->sensorNoiseGYR; double normMagB[3] = {0, 0, 0}, normSunB[3] = {0, 0, 0}, normMagJ[3] = {0, 0, 0}, normSunJ[3] = {0, 0, 0}; @@ -138,7 +128,6 @@ void MultiplicativeKalmanFilter::init( matrixMag[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}, matrixSunMag[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}, matrixMagSun[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; - /* vector*transpose(vector)*/ MatrixOperations::multiply(sunEstB, sunEstB, *matrixSun, 3, 1, 3); MatrixOperations::multiply(magEstB, magEstB, *matrixMag, 3, 1, 3); MatrixOperations::multiply(sunEstB, magEstB, *matrixSunMag, 3, 1, 3); @@ -201,8 +190,6 @@ void MultiplicativeKalmanFilter::init( initialCovarianceMatrix[5][3] = initGyroCov[2][0]; initialCovarianceMatrix[5][4] = initGyroCov[2][1]; initialCovarianceMatrix[5][5] = initGyroCov[2][2]; - // initialCovarianceMatrix[][] = {{0,0,0,0,0,0},{0,0,0,0,0,0},{0,0,0,0,0,0}, - //{0,0,0,0,0,0},{0,0,0,0,0,0},{0,0,0,0,0,0}}; } else { // no initialisation possible, no valid measurements validInit = false; @@ -216,8 +203,6 @@ ReturnValue_t MultiplicativeKalmanFilter::mekfEst( const double *sunDir_, const bool validSS, const double *sunDirJ, const bool validSSModel, const double *magFieldJ, const bool validMagModel, acsctrl::MekfData *mekfData) { // Check for GYR Measurements - // AcsParameters mekfEstParams; - // loadAcsParameters(&mekfEstParams); int MDF = 0; // Matrix Dimension Factor if (!validGYRs_) { { @@ -934,10 +919,6 @@ ReturnValue_t MultiplicativeKalmanFilter::mekfEst( double errStateQuat[3] = {errStateVec[0], errStateVec[1], errStateVec[2]}; double errStateGyroBias[3] = {errStateVec[3], errStateVec[4], errStateVec[5]}; - sif::debug << "errQ=[" << errStateQuat[0] << "," << errStateQuat[1] << "," << errStateQuat[2] - << "]" << std::endl; - sif::debug << "errW_bias=[" << errStateGyroBias[0] << "," << errStateGyroBias[1] << "," - << errStateGyroBias[2] << "]" << std::endl; // State Vector Elements double xi1[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}, @@ -966,25 +947,18 @@ ReturnValue_t MultiplicativeKalmanFilter::mekfEst( biasGYR[2] = updatedGyroBias[2]; /* ----------- PROPAGATION ----------*/ - // double sigmaU = kalmanFilterParameters->sensorNoiseBsGYR; - // double sigmaV = kalmanFilterParameters->sensorNoiseArwGYR; - double sigmaU = 3 * 3.141 / 180 / 3600; - double sigmaV = 3 * 0.0043 * 3.141 / sqrt(10) / 180; + double sigmaU = kalmanFilterParameters->sensorNoiseBsGYR; + double sigmaV = kalmanFilterParameters->sensorNoiseArwGYR; double discTimeMatrix[6][6] = {{-1, 0, 0, 0, 0, 0}, {0, -1, 0, 0, 0, 0}, {0, 0, -1, 0, 0, 0}, {0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 1}}; double rotRateEst[3] = {0, 0, 0}; - sif::debug << "MEKF rateGYR= " << rateGYRs_[0] << " " << rateGYRs_[1] << " " << rateGYRs_[2] - << std::endl; - sif::debug << "MEKF bias= " << updatedGyroBias[0] << " " << updatedGyroBias[1] << " " - << updatedGyroBias[2] << std::endl; VectorOperations::subtract(rateGYRs_, updatedGyroBias, rotRateEst, 3); double normRotEst = VectorOperations::norm(rotRateEst, 3); double crossRotEst[3][3] = {{0, -rotRateEst[2], rotRateEst[1]}, {rotRateEst[2], 0, -rotRateEst[0]}, {-rotRateEst[1], rotRateEst[0], 0}}; - // ToDo // Discrete Process Noise Covariance Q double discProcessNoiseCov[6][6] = {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}}; @@ -1072,7 +1046,6 @@ ReturnValue_t MultiplicativeKalmanFilter::mekfEst( discProcessNoiseCov[5][4] = covQ22[2][1]; discProcessNoiseCov[5][5] = covQ22[2][2]; - // ToDo // State Transition Matrix phi double phi11[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}, phi12[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}, From c6e8c40b2c2f4d5176baff1909ea358b04042f0f Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Mon, 12 Dec 2022 14:50:27 +0100 Subject: [PATCH 045/330] added schmidt normalization + cleanup --- mission/controller/acs/SensorProcessing.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mission/controller/acs/SensorProcessing.cpp b/mission/controller/acs/SensorProcessing.cpp index c02398ce..6055b50d 100644 --- a/mission/controller/acs/SensorProcessing.cpp +++ b/mission/controller/acs/SensorProcessing.cpp @@ -139,6 +139,7 @@ void SensorProcessing::processMgm(const float *mgm0Value, bool mgm0valid, const Igrf13Model igrf13; // So the line above should not be done here. Update: Can be done here as long updated coffs // stored in acsParameters ? + igrf13.schmidtNormalization(); igrf13.updateCoeffGH(timeOfMgmMeasurement); // maybe put a condition here, to only update after a full day, this // class function has around 700 steps to perform @@ -550,19 +551,18 @@ void SensorProcessing::processGyr( } } -void SensorProcessing::processGps(const double gps0latitude, const double gps0longitude, +void SensorProcessing::processGps(const double gpsLatitude, const double gpsLongitude, const bool validGps, acsctrl::GpsDataProcessed *gpsDataProcessed) { // name to convert not process double gdLongitude, gcLatitude; if (validGps) { // Transforming from Degree to Radians and calculation geocentric lattitude from geodetic - gdLongitude = gps0longitude * PI / 180; - double latitudeRad = gps0latitude * PI / 180; + gdLongitude = gpsLongitude * PI / 180; + double latitudeRad = gpsLatitude * PI / 180; double eccentricityWgs84 = 0.0818195; double factor = 1 - pow(eccentricityWgs84, 2); gcLatitude = atan(factor * tan(latitudeRad)); - // validGcLatitude = true; } { PoolReadGuard pg(gpsDataProcessed); From 762ae04bb29d524d721585546a7d6692f0c4dc59 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Mon, 12 Dec 2022 20:07:54 +0100 Subject: [PATCH 046/330] missing tempLimits completed --- mission/controller/ThermalController.h | 44 +++++++++++++++----------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 076956e8..2df2097f 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -19,13 +19,15 @@ * limit is exceeded to avoid reaching NOP limit */ struct TempLimits { - TempLimits(float nopLowerLimit, float opLowerLimit, float opUpperLimit, float nopUpperLimit) + TempLimits(float nopLowerLimit, float opLowerLimit, float cutOffLimit, float opUpperLimit, float nopUpperLimit) : opLowerLimit(opLowerLimit), opUpperLimit(opUpperLimit), + cutOffLimit(cutOffLimit), nopLowerLimit(nopLowerLimit), nopUpperLimit(nopUpperLimit) {} float opLowerLimit; float opUpperLimit; + float cutOffLimit; float nopLowerLimit; float nopUpperLimit; }; @@ -109,23 +111,29 @@ class ThermalController : public ExtendedControllerBase { SUS::SusDataset susSet11; // TempLimits - // TODO: find missing temperatures - // TempLimits plocHeatspreaderLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); - // TempLimits plocMissionBoardLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); - TempLimits cameraLimits = TempLimits(-40.0, -30.0, 65.0, 85.0); - TempLimits dacHeatspreaderLimits = TempLimits(-65.0, -40.0, 118.0, 150.0); - TempLimits strLimits = TempLimits(-30.0, -20.0, 70.0, 80.0); - TempLimits rw1Limits = TempLimits(-40.0, -40.0, 85.0, 85.0); - // TempLimits droLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); - TempLimits scexLimits = TempLimits(-60.0, -40.0, 85.0, 150.0); - // TempLimits x8Limits = TempLimits(-20.0, 70.0, -30.0, 80.0); - // TempLimits hpaLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); - // TempLimits txModuleLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); - // TempLimits mpaLimits = TempLimits(-20.0, 70.0, -30.0, 80.0); - TempLimits acuLimits = TempLimits(-55.0, -35.0, 85.0, 150.0); // TODO nopLimits - TempLimits plpcduHeatspreaderLimits = TempLimits(-65.0, -40.0, 85.0, 125.0); // TODO check - TempLimits tcsBoardLimits = TempLimits(-60.0, -40.0, 85.0, 130.0); - TempLimits magnettorquerLimits = TempLimits(-40.0, -30.0, 70.0, 80.0); // TODO nopLimits + TempLimits acsBoardLimits = TempLimits(-40.0, -40.0, 80.0, 85.0, 85.0); + TempLimits mgtLimits = TempLimits(-40.0, -40.0, 65.0, 70.0, 70.0); + TempLimits rwLimits = TempLimits(-40.0, -40.0, 80.0, 85.0, 85.0); + TempLimits strLimits = TempLimits(-30.0, -20.0, 65.0, 70.0, 80.0); + TempLimits ifBoardLimits = TempLimits(-65.0, -40.0, 80.0, 85.0, 150.0); + TempLimits tcsBoardLimits = TempLimits(-60.0, -40.0, 80.0, 85.0, 130.0); + TempLimits obcLimits = TempLimits(-40.0, -40.0, 80.0, 85.0, 85.0); + TempLimits obcIfBoardLimits = TempLimits(-65.0, -40.0, 80.0, 85.0, 125.0); + TempLimits sBandTransceiverLimits = TempLimits(-40.0, -25.0, 35.0, 40.0, 65.0); + TempLimits pcduP60BoardLimits = TempLimits(-35.0, -35.0, 80.0, 85.0, 85.0); + TempLimits pcduAcuLimits = TempLimits(-35.0, -35.0, 80.0, 85.0, 85.0); + TempLimits pcduPduLimits = TempLimits(-35.0, -35.0, 80.0, 85.0, 85.0); + TempLimits plPcduBoardLimits = TempLimits(-55.0, -40.0, 80.0, 85.0, 125.0); + TempLimits plocMissionBoardLimits = TempLimits(-30.0, -10.0, 40.0, 45.0, 60); + TempLimits plocProcessingBoardLimits = TempLimits(-30.0, -10.0, 40.0, 45.0, 60.0); + TempLimits dacLimits = TempLimits(-65.0, -40.0, 113.0, 118.0, 150.0); + TempLimits cameraLimits = TempLimits(-40.0, -30.0, 60.0, 65.0, 85.0); + TempLimits droLimits = TempLimits(-40.0, -30.0, 75.0, 80.0, 90.0); + TempLimits x8Limits = TempLimits(-40.0, -30.0, -75.0, 80.0, 90.0); + TempLimits hpaLimits = TempLimits(-40.0, -30.0, -75.0, 80.0, 90.0); + TempLimits txLimits = TempLimits(-40.0, -30.0, -75.0, 80.0, 90.0); + TempLimits mpaLimits = TempLimits(-40.0, -30.0, -75.0, 80.0, 90.0); + TempLimits scexBoardLimits = TempLimits(-60.0, -40.0, 80.0, 85.0, 150.0); // Initial delay to make sure all pool variables have been initialized their owners Countdown initialCountdown = Countdown(DELAY); From 873bb2f79e8dfaade0531a09ecb2a1fa0822ab77 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Mon, 12 Dec 2022 21:33:12 +0100 Subject: [PATCH 047/330] new design heater control for camera body --- mission/controller/ThermalController.cpp | 50 +++++++++++++----------- mission/controller/ThermalController.h | 18 ++------- 2 files changed, 31 insertions(+), 37 deletions(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index fc6a6088..b2845c69 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -105,8 +105,7 @@ void ThermalController::performControlOperation() { } // TODO: Heater control - // TODO: Hysterese offset - ctrl4KCameraHeater(); + ctrl4KCamera(); } @@ -955,29 +954,36 @@ void ThermalController::copyDevices() { } } -void ThermalController::ctrl4KCameraHeater(){ - // 4K Camera - Heater +void ThermalController::ctrl4KCamera() { + // 4K Camera + float cameraTemp; + bool cameraTempAvailable = true; + if (sensorTemperatures.sensor_4k_camera.isValid()) { - if (not heaterHandler.checkSwitchState(heater::HEATER_4_CAMERA)) { - if (sensorTemperatures.sensor_4k_camera.value < cameraLimits.opLowerLimit) { - heaterHandler.switchHeater(heater::HEATER_4_CAMERA, HeaterHandler::SwitchState::ON); - heater4Countdown.resetTimer(); - } - } else if (heaterHandler.checkSwitchState(heater::HEATER_4_CAMERA)) { - if (sensorTemperatures.sensor_4k_camera.value >= cameraLimits.opLowerLimit + TEMP_OFFSET) { - heaterHandler.switchHeater(heater::HEATER_4_CAMERA, HeaterHandler::SwitchState::OFF); - } - } else { - if (heater4Countdown.hasTimedOut()) { - // Sensor or heater failure - heaterHandler.switchHeater(heater::HEATER_4_CAMERA, HeaterHandler::SwitchState::OFF); - triggerEvent(HEATER_MAX_BURNTIME_REACHED, heater::HEATER_4_CAMERA); - }; - } + cameraTemp = sensorTemperatures.sensor_4k_camera.value; + } else if (sensorTemperatures.sensor_dro.isValid()) { + cameraTemp = sensorTemperatures.sensor_dro.value; + } else if (sensorTemperatures.sensor_mpa.isValid()) { + cameraTemp = sensorTemperatures.sensor_mpa.value; } else { if (heaterHandler.checkSwitchState(heater::HEATER_4_CAMERA)) { heaterHandler.switchHeater(heater::HEATER_4_CAMERA, HeaterHandler::SwitchState::OFF); } - triggerEvent(INVALID_SENSOR_TEMPERATURE, heater::HEATER_4_CAMERA); + triggerEvent(NO_VALID_SENSOR_TEMPERATURE, heater::HEATER_4_CAMERA); + cameraTempAvailable = false; } -} + + // TODO: include redundant heater + if (cameraTempAvailable) { + if (not heaterHandler.checkSwitchState(heater::HEATER_4_CAMERA)) { + // TODO: check if op or nop + if (cameraTemp < cameraLimits.opLowerLimit) { + heaterHandler.switchHeater(heater::HEATER_4_CAMERA, HeaterHandler::SwitchState::ON); + } else if (heaterHandler.checkSwitchState(heater::HEATER_4_CAMERA)) { + if (cameraTemp >= cameraLimits.opLowerLimit + TEMP_OFFSET) { + heaterHandler.switchHeater(heater::HEATER_4_CAMERA, HeaterHandler::SwitchState::OFF); + } + } + } + } +} \ No newline at end of file diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 2df2097f..dd60524b 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -54,14 +54,12 @@ class ThermalController : public ExtendedControllerBase { private: static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::HEATER_HANDLER; - static constexpr Event HEATER_MAX_BURNTIME_REACHED = MAKE_EVENT(0, severity::LOW); - static constexpr Event INVALID_SENSOR_TEMPERATURE = MAKE_EVENT(1, severity::LOW); + static constexpr Event NO_VALID_SENSOR_TEMPERATURE = MAKE_EVENT(0, severity::LOW); static const uint32_t DELAY = 500; // TODO to be changed - static const uint32_t OP_TIME = 1000; - static const uint32_t TEMP_OFFSET = 10; + static const uint32_t TEMP_OFFSET = 5; enum class InternalState { STARTUP, INITIAL_DELAY, READY }; @@ -138,16 +136,6 @@ class ThermalController : public ExtendedControllerBase { // Initial delay to make sure all pool variables have been initialized their owners Countdown initialCountdown = Countdown(DELAY); - // Heater Countdown to make sure heater - Countdown heater0Countdown = Countdown(OP_TIME); - Countdown heater1Countdown = Countdown(OP_TIME); - Countdown heater2Countdown = Countdown(OP_TIME); - Countdown heater3Countdown = Countdown(OP_TIME); - Countdown heater4Countdown = Countdown(OP_TIME); - Countdown heater5Countdown = Countdown(OP_TIME); - Countdown heater6Countdown = Countdown(OP_TIME); - Countdown heater7Countdown = Countdown(OP_TIME); - PoolEntry tmp1075Tcs0 = PoolEntry(10.0); PoolEntry tmp1075Tcs1 = PoolEntry(10.0); PoolEntry tmp1075PlPcdu0 = PoolEntry(10.0); @@ -159,7 +147,7 @@ class ThermalController : public ExtendedControllerBase { void copySus(); void copyDevices(); - void ctrl4KCameraHeater(); + void ctrl4KCamera(); }; #endif /* MISSION_CONTROLLER_THERMALCONTROLLER_H_ */ From b89e440fc4a015995a42c56e20550fc36a329ead Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 13 Dec 2022 10:19:28 +0100 Subject: [PATCH 048/330] added health getter function --- bsp_hosted/scheduling.cpp | 2 +- mission/controller/ThermalController.cpp | 1 - mission/controller/ThermalController.h | 3 ++- mission/devices/HeaterHandler.cpp | 9 +++++++++ mission/devices/HeaterHandler.h | 2 ++ 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/bsp_hosted/scheduling.cpp b/bsp_hosted/scheduling.cpp index ba393e3a..843b2892 100644 --- a/bsp_hosted/scheduling.cpp +++ b/bsp_hosted/scheduling.cpp @@ -186,7 +186,7 @@ void scheduling::initTasks() { #endif /* OBSW_ADD_TEST_CODE == 1 */ PeriodicTaskIF* dummyTask = factory->createPeriodicTask( - "DUMMY_TASK", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, missedDeadlineFunc); + "DUMMY_TASK", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, missedDeadlineFunc); scheduling::scheduleTmpTempSensors(dummyTask); scheduling::scheduleRtdSensors(dummyTask); dummyTask->addComponent(objects::SUS_0_N_LOC_XFYFZM_PT_XF); diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index b2845c69..a8c378df 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -106,7 +106,6 @@ void ThermalController::performControlOperation() { // TODO: Heater control ctrl4KCamera(); - } ReturnValue_t ThermalController::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index dd60524b..a6d6a3b3 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -19,7 +19,8 @@ * limit is exceeded to avoid reaching NOP limit */ struct TempLimits { - TempLimits(float nopLowerLimit, float opLowerLimit, float cutOffLimit, float opUpperLimit, float nopUpperLimit) + TempLimits(float nopLowerLimit, float opLowerLimit, float cutOffLimit, float opUpperLimit, + float nopUpperLimit) : opLowerLimit(opLowerLimit), opUpperLimit(opUpperLimit), cutOffLimit(cutOffLimit), diff --git a/mission/devices/HeaterHandler.cpp b/mission/devices/HeaterHandler.cpp index a2e4a451..8fd166f0 100644 --- a/mission/devices/HeaterHandler.cpp +++ b/mission/devices/HeaterHandler.cpp @@ -361,3 +361,12 @@ ReturnValue_t HeaterHandler::getSwitchState(uint8_t switchNr) const { ReturnValue_t HeaterHandler::getFuseState(uint8_t fuseNr) const { return 0; } uint32_t HeaterHandler::getSwitchDelayMs(void) const { return 2000; } + +HasHealthIF::HealthState HeaterHandler::getHealth(heater::Switchers heater) { + auto* healthDev = heaterVec.at(heater).healthDevice; + if (healthDev != nullptr) { + MutexGuard mg(heaterMutex); + return healthDev->getHealth(); + } + return HasHealthIF::HealthState::FAULTY; +} diff --git a/mission/devices/HeaterHandler.h b/mission/devices/HeaterHandler.h index ede7c422..ac4f94f4 100644 --- a/mission/devices/HeaterHandler.h +++ b/mission/devices/HeaterHandler.h @@ -68,6 +68,8 @@ class HeaterHandler : public ExecutableObjectIF, enum SwitchAction : uint8_t { SET_SWITCH_OFF, SET_SWITCH_ON, NONE }; ReturnValue_t switchHeater(heater::Switchers heater, SwitchState switchState); + HasHealthIF::HealthState getHealth(heater::Switchers heater); + ReturnValue_t performOperation(uint8_t operationCode = 0) override; ReturnValue_t sendSwitchCommand(uint8_t switchNr, ReturnValue_t onOff) override; From b49d37e15a2ed22808ec8b8b8672bc2e9a1c11a3 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Tue, 13 Dec 2022 11:51:03 +0100 Subject: [PATCH 049/330] clang --- mission/controller/AcsController.cpp | 26 +- mission/controller/acs/AcsParameters.h | 108 +++-- mission/controller/acs/ActuatorCmd.cpp | 4 +- mission/controller/acs/ActuatorCmd.h | 58 +-- mission/controller/acs/Guidance.cpp | 424 ++++++++++--------- mission/controller/acs/Guidance.h | 34 +- mission/controller/acs/Igrf13Model.h | 24 +- mission/controller/acs/SensorProcessing.cpp | 14 +- mission/controller/acs/control/Detumble.h | 13 +- mission/controller/acs/control/PtgCtrl.cpp | 106 +++-- mission/controller/acs/control/PtgCtrl.h | 5 +- mission/controller/acs/util/MathOperations.h | 336 +++++++-------- 12 files changed, 577 insertions(+), 575 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index ef3c6cf4..9e400e75 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -51,7 +51,7 @@ void AcsController::performControlOperation() { case SUBMODE_DETUMBLE: performDetumble(); break; - case SUBMODE_PTG_SUN: + case SUBMODE_PTG_SUN: case SUBMODE_PTG_TARGET: case SUBMODE_PTG_NADIR: case SUBMODE_PTG_INERTIAL: @@ -248,9 +248,10 @@ void AcsController::performPointingCtrl() { &mekfData, &validMekf); double targetQuat[4] = {0, 0, 0, 0}, refSatRate[3] = {0, 0, 0}; - switch (submode) { + switch (submode) { case SUBMODE_PTG_TARGET: - guidance.targetQuatPtg(&sensorValues, &mekfData, &susDataProcessed, now, targetQuat, refSatRate); + guidance.targetQuatPtg(&sensorValues, &mekfData, &susDataProcessed, now, targetQuat, + refSatRate); break; case SUBMODE_PTG_SUN: guidance.sunQuatPtg(&sensorValues, &outputValues, now, targetQuat, refSatRate); @@ -261,7 +262,8 @@ void AcsController::performPointingCtrl() { case SUBMODE_PTG_INERTIAL: guidance.inertialQuatPtg(targetQuat, refSatRate); break; - } double quatErrorComplete[4] = {0, 0, 0, 0}, quatError[3] = {0, 0, 0}, + } + double quatErrorComplete[4] = {0, 0, 0, 0}, quatError[3] = {0, 0, 0}, deltaRate[3] = {0, 0, 0}; // ToDo: check if pointer needed guidance.comparePtg(targetQuat, &mekfData, refSatRate, quatErrorComplete, quatError, deltaRate); double rwPseudoInv[4][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; @@ -277,16 +279,18 @@ void AcsController::performPointingCtrl() { actuatorCmd.scalingTorqueRws(torqueRws, torqueRwsScaled); if (acsParameters.pointingModeControllerParameters.enableAntiStiction) { - bool rwAvailable[4] = {true, true, true, true}; // WHICH INPUT SENSOR SET? - int32_t rwSpeed[4] = {(sensorValues.rw1Set.currSpeed.value), (sensorValues.rw2Set.currSpeed.value), - (sensorValues.rw3Set.currSpeed.value), (sensorValues.rw4Set.currSpeed.value)}; - ptgCtrl.rwAntistiction(rwAvailable, rwSpeed, torqueRwsScaled); + bool rwAvailable[4] = {true, true, true, true}; // WHICH INPUT SENSOR SET? + int32_t rwSpeed[4] = { + (sensorValues.rw1Set.currSpeed.value), (sensorValues.rw2Set.currSpeed.value), + (sensorValues.rw3Set.currSpeed.value), (sensorValues.rw4Set.currSpeed.value)}; + ptgCtrl.rwAntistiction(rwAvailable, rwSpeed, torqueRwsScaled); } double cmdSpeedRws[4] = {0, 0, 0, 0}; // Should be given to the actuator reaction wheel as input - actuatorCmd.cmdSpeedToRws( - &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), - &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), torqueRwsScaled, cmdSpeedRws); + actuatorCmd.cmdSpeedToRws(&(sensorValues.rw1Set.currSpeed.value), + &(sensorValues.rw2Set.currSpeed.value), + &(sensorValues.rw3Set.currSpeed.value), + &(sensorValues.rw4Set.currSpeed.value), torqueRwsScaled, cmdSpeedRws); double mgtDpDes[3] = {0, 0, 0}, dipolUnits[3] = {0, 0, 0}; // Desaturation Dipol ptgCtrl.ptgDesaturation(mgmDataProcessed.mgmVecTot.value, mgmDataProcessed.mgmVecTot.isValid(), mekfData.satRotRateMekf.value, &(sensorValues.rw1Set.currSpeed.value), diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index 7315ca89..88c4ddb0 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -26,22 +26,22 @@ class AcsParameters /*: public HasParametersIF*/ { } onBoardParams; struct InertiaEIVE { - double inertiaMatrix[3][3] = {{0.1539829, -0.0001821456, -0.0050135}, - {-0.0001821456, 0.1701302, 0.0004748963}, - {-0.0050135, 0.0004748963, 0.08374296}}; //19.11.2021 + double inertiaMatrix[3][3] = {{0.1539829, -0.0001821456, -0.0050135}, + {-0.0001821456, 0.1701302, 0.0004748963}, + {-0.0050135, 0.0004748963, 0.08374296}}; // 19.11.2021 // Possible inertia matrices - double inertiaMatrixDeployed[3][3] = {{0.1539829, -0.0001821456, -0.0050135}, - {-0.0001821456, 0.1701302, 0.0004748963}, - {-0.0050135, 0.0004748963, 0.08374296}}; //19.11.2021 - double inertiaMatrixUndeployed[3][3] = {{0.122485, -0.0001798426, -0.005008}, - {-0.0001798426, 0.162240, 0.000475596}, - {-0.005008, 0.000475596, 0.060136}}; //19.11.2021 - double inertiaMatrixPanel1[3][3] = {{0.13823347, -0.0001836122, -0.00501207}, - {-0.0001836122, 0.16619787, 0.0083537}, - {-0.00501207, 0.0083537, 0.07192588}}; //19.11.2021 - double inertiaMatrixPanel3[3][3] = {{0.13823487, -0.000178376, -0.005009767}, - {-0.000178376, 0.166172, -0.007403}, - {-0.005009767, -0.007403, 0.07195314}}; + double inertiaMatrixDeployed[3][3] = {{0.1539829, -0.0001821456, -0.0050135}, + {-0.0001821456, 0.1701302, 0.0004748963}, + {-0.0050135, 0.0004748963, 0.08374296}}; // 19.11.2021 + double inertiaMatrixUndeployed[3][3] = {{0.122485, -0.0001798426, -0.005008}, + {-0.0001798426, 0.162240, 0.000475596}, + {-0.005008, 0.000475596, 0.060136}}; // 19.11.2021 + double inertiaMatrixPanel1[3][3] = {{0.13823347, -0.0001836122, -0.00501207}, + {-0.0001836122, 0.16619787, 0.0083537}, + {-0.00501207, 0.0083537, 0.07192588}}; // 19.11.2021 + double inertiaMatrixPanel3[3][3] = {{0.13823487, -0.000178376, -0.005009767}, + {-0.000178376, 0.166172, -0.007403}, + {-0.005009767, -0.007403, 0.07195314}}; } inertiaEIVE; struct MgmHandlingParameters { @@ -786,9 +786,9 @@ class AcsParameters /*: public HasParametersIF*/ { double rw2orientationMatrix[3][3]; double rw3orientationMatrix[3][3]; double inertiaWheel = 0.000028198; - double maxTrq = 0.0032; // 3.2 [mNm] - double stictionSpeed = 80; //RPM - double stictionReleaseSpeed = 120; //RPM + double maxTrq = 0.0032; // 3.2 [mNm] + double stictionSpeed = 80; // RPM + double stictionReleaseSpeed = 120; // RPM double stictionTorque = 0.0006; } rwHandlingParameters; @@ -796,31 +796,21 @@ class AcsParameters /*: public HasParametersIF*/ { double alignmentMatrix[3][4] = {{0.9205, 0.0000, -0.9205, 0.0000}, {0.0000, -0.9205, 0.0000, 0.9205}, {0.3907, 0.3907, 0.3907, 0.3907}}; -// double pseudoInverse[4][3] = {{0.4434, -0.2845, 0.3597}, -// {0.2136, -0.3317, 1.0123}, -// {-0.8672, -0.1406, 0.1778}, -// {0.6426, 0.4794, 1.3603}}; -// where does the first pseudo inverse come frome - matlab gives result below - double pseudoInverse[4][3] = {{0.5432, 0, 0.6398}, - {0, -0.5432, 0.6398}, - {-0.5432, 0, 0.6398}, - {0, 0.5432, 0.6398}}; - double without0[4][3] = {{0, 0, 0}, - {0.5432, -0.5432, 1.2797}, - {-1.0864, 0, 0}, - {0.5432, 0.5432, 1.2797}}; - double without1[4][3] = {{0.5432, -0.5432, 1.2797}, - {0, 0, 0}, - {-0.5432, -0.5432, 1.2797}, - {0, 1.0864, 0}}; - double without2[4][3] = {{1.0864, 0, 0}, - {-0.5432, -0.5432, 1.2797}, - {0, 0, 0}, - {-0.5432, 0.5432, 1.2797}}; - double without3[4][3] = {{0.5432, 0.5432, 1.2797}, - {0, -1.0864, 0}, - {-0.5432, 0.5432, 1.2797}, - {0, 0, 0}}; + // double pseudoInverse[4][3] = {{0.4434, -0.2845, 0.3597}, + // {0.2136, -0.3317, 1.0123}, + // {-0.8672, -0.1406, 0.1778}, + // {0.6426, 0.4794, 1.3603}}; + // where does the first pseudo inverse come frome - matlab gives result below + double pseudoInverse[4][3] = { + {0.5432, 0, 0.6398}, {0, -0.5432, 0.6398}, {-0.5432, 0, 0.6398}, {0, 0.5432, 0.6398}}; + double without0[4][3] = { + {0, 0, 0}, {0.5432, -0.5432, 1.2797}, {-1.0864, 0, 0}, {0.5432, 0.5432, 1.2797}}; + double without1[4][3] = { + {0.5432, -0.5432, 1.2797}, {0, 0, 0}, {-0.5432, -0.5432, 1.2797}, {0, 1.0864, 0}}; + double without2[4][3] = { + {1.0864, 0, 0}, {-0.5432, -0.5432, 1.2797}, {0, 0, 0}, {-0.5432, 0.5432, 1.2797}}; + double without3[4][3] = { + {0.5432, 0.5432, 1.2797}, {0, -1.0864, 0}, {-0.5432, 0.5432, 1.2797}, {0, 0, 0}}; double nullspace[4] = {-0.5000, 0.5000, -0.5000, 0.5000}; } rwMatrices; @@ -828,9 +818,11 @@ class AcsParameters /*: public HasParametersIF*/ { double k_rate_mekf = 0.00059437; double k_align_mekf = 0.000056875; - double k_rate_no_mekf = 0.00059437;; - double k_align_no_mekf = 0.000056875;; - double sunMagAngleMin; // ??? + double k_rate_no_mekf = 0.00059437; + ; + double k_align_no_mekf = 0.000056875; + ; + double sunMagAngleMin; // ??? double sunTargetDir[3] = {0, 0, 1}; double satRateRef[3] = {0, 0, 0}; @@ -839,7 +831,7 @@ class AcsParameters /*: public HasParametersIF*/ { // ToDo: mutiple structs for different pointing mode controllers? struct PointingModeControllerParameters { - double refDirection[3] = {-1, 0, 0}; //Antenna + double refDirection[3] = {-1, 0, 0}; // Antenna double refRotRate[3] = {0, 0, 0}; double quatRef[4] = {0, 0, 0, 1}; bool avoidBlindStr = true; @@ -860,11 +852,12 @@ class AcsParameters /*: public HasParametersIF*/ { double omegaEarth = 0.000072921158553; - double nadirRefDirection[3] = {-1, 0, 0}; //Camera + double nadirRefDirection[3] = {-1, 0, 0}; // Camera double tgtQuatInertial[4] = {0, 0, 0, 1}; double tgtRotRateInertial[3] = {0, 0, 0}; int8_t nadirTimeElapsedMax = 10; - } pointingModeControllerParameters, inertialModeControllerParameters, nadirModeControllerParameters, targetModeControllerParameters; + } pointingModeControllerParameters, inertialModeControllerParameters, + nadirModeControllerParameters, targetModeControllerParameters; struct StrParameters { double exclusionAngle = 20 * M_PI / 180; @@ -872,7 +865,7 @@ class AcsParameters /*: public HasParametersIF*/ { } strParameters; struct GpsParameters { - double timeDiffVelocityMax = 30; //[s] + double timeDiffVelocityMax = 30; //[s] } gpsParameters; struct GroundStationParameters { @@ -883,10 +876,11 @@ class AcsParameters /*: public HasParametersIF*/ { struct SunModelParameters { float domega = 36000.771; - float omega_0 = 280.46 * M_PI / 180.; //282.94 * M_PI / 180.; // RAAN plus argument of perigee - float m_0 = 357.5277; //357.5256; // coefficients for mean anomaly - float dm = 35999.049; // coefficients for mean anomaly - float e = 23.4392911 * M_PI / 180.; // angle of earth's rotation axis + float omega_0 = 280.46 * M_PI / 180.; // 282.94 * M_PI / 180.; // RAAN plus argument of + // perigee + float m_0 = 357.5277; // 357.5256; // coefficients for mean anomaly + float dm = 35999.049; // coefficients for mean anomaly + float e = 23.4392911 * M_PI / 180.; // angle of earth's rotation axis float e1 = 0.74508 * M_PI / 180.; float p1 = 6892. / 3600. * M_PI / 180.; // some parameter @@ -899,8 +893,8 @@ class AcsParameters /*: public HasParametersIF*/ { double sensorNoiseMAG = 4 * M_PI / 180; double sensorNoiseGYR = 0.1 * M_PI / 180; - double sensorNoiseArwGYR = 3*0.0043*M_PI / sqrt(10) / 180; // Angular Random Walk - double sensorNoiseBsGYR = 3 * M_PI / 180 / 3600; // Bias Stability + double sensorNoiseArwGYR = 3 * 0.0043 * M_PI / sqrt(10) / 180; // Angular Random Walk + double sensorNoiseBsGYR = 3 * M_PI / 180 / 3600; // Bias Stability } kalmanFilterParameters; struct MagnetorquesParameter { @@ -914,7 +908,7 @@ class AcsParameters /*: public HasParametersIF*/ { } magnetorquesParameter; struct DetumbleParameter { - uint8_t detumblecounter = 75; // 30 s + uint8_t detumblecounter = 75; // 30 s double omegaDetumbleStart = 2 * M_PI / 180; double omegaDetumbleEnd = 0.4 * M_PI / 180; double gainD = pow(10.0, -3.3); diff --git a/mission/controller/acs/ActuatorCmd.cpp b/mission/controller/acs/ActuatorCmd.cpp index f8c9b249..4b3bb28c 100644 --- a/mission/controller/acs/ActuatorCmd.cpp +++ b/mission/controller/acs/ActuatorCmd.cpp @@ -33,8 +33,8 @@ void ActuatorCmd::scalingTorqueRws(const double *rwTrq, double *rwTrqScaled) { } if (maxValue > maxTrq) { - double scalingFactor = maxTrq / maxValue; - VectorOperations::mulScalar(rwTrq, scalingFactor, rwTrqScaled, 4); + double scalingFactor = maxTrq / maxValue; + VectorOperations::mulScalar(rwTrq, scalingFactor, rwTrqScaled, 4); } } diff --git a/mission/controller/acs/ActuatorCmd.h b/mission/controller/acs/ActuatorCmd.h index cd61e639..918bce9b 100644 --- a/mission/controller/acs/ActuatorCmd.h +++ b/mission/controller/acs/ActuatorCmd.h @@ -6,38 +6,38 @@ #include "SensorProcessing.h" #include "SensorValues.h" -class ActuatorCmd{ -public: - ActuatorCmd(AcsParameters *acsParameters_); //Input mode ? - virtual ~ActuatorCmd(); +class ActuatorCmd { + public: + ActuatorCmd(AcsParameters *acsParameters_); // Input mode ? + virtual ~ActuatorCmd(); - /* - * @brief: scalingTorqueRws() scales the torque via maximum part in case this part is higher - * then the maximum torque - * @param: rwTrq given torque for reaction wheels - * rwTrqScaled possible scaled torque - */ - void scalingTorqueRws(const double *rwTrq, double *rwTrqScaled); + /* + * @brief: scalingTorqueRws() scales the torque via maximum part in case this part is + * higher then the maximum torque + * @param: rwTrq given torque for reaction wheels + * rwTrqScaled possible scaled torque + */ + void scalingTorqueRws(const double *rwTrq, double *rwTrqScaled); - /* - * @brief: cmdSpeedToRws() will set the maximum possible torque for the reaction wheels, also - * will calculate the needed revolutions per minute for the RWs, which will be given - * as Input to the RWs - * @param: rwTrqIn given torque from pointing controller - * rwTrqNS Nullspace torque - * rwCmdSpeed output revolutions per minute for every reaction wheel - */ - void cmdSpeedToRws(const int32_t *speedRw0, const int32_t *speedRw1, - const int32_t *speedRw2, const int32_t *speedRw3, const double *rwTorque, - double *rwCmdSpeed); + /* + * @brief: cmdSpeedToRws() will set the maximum possible torque for the reaction + * wheels, also will calculate the needed revolutions per minute for the RWs, which will be given + * as Input to the RWs + * @param: rwTrqIn given torque from pointing controller + * rwTrqNS Nullspace torque + * rwCmdSpeed output revolutions per minute for every + * reaction wheel + */ + void cmdSpeedToRws(const int32_t *speedRw0, const int32_t *speedRw1, const int32_t *speedRw2, + const int32_t *speedRw3, const double *rwTorque, double *rwCmdSpeed); - /* - * @brief: cmdDipolMtq() gives the commanded dipol moment for the magnetorques - * - * @param: dipolMoment given dipol moment in spacecraft frame - * dipolMomentUnits resulting dipol moment for every unit - */ - void cmdDipolMtq(const double *dipolMoment, double *dipolMomentUnits); + /* + * @brief: cmdDipolMtq() gives the commanded dipol moment for the magnetorques + * + * @param: dipolMoment given dipol moment in spacecraft frame + * dipolMomentUnits resulting dipol moment for every unit + */ + void cmdDipolMtq(const double *dipolMoment, double *dipolMomentUnits); protected: private: diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index eeb161d0..199fce9c 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -47,9 +47,9 @@ void Guidance::targetQuatPtg(ACS::SensorValues *sensorValues, acsctrl::MekfData // Position of the satellite in the earth/fixed frame via GPS double posSatE[3] = {0, 0, 0}; - double geodeticLatRad = (sensorValues->gpsSet.latitude.value)*PI/180; - double longitudeRad = (sensorValues->gpsSet.longitude.value)*PI/180; - MathOperations::cartesianFromLatLongAlt(geodeticLatRad,longitudeRad, + double geodeticLatRad = (sensorValues->gpsSet.latitude.value) * PI / 180; + double longitudeRad = (sensorValues->gpsSet.longitude.value) * PI / 180; + MathOperations::cartesianFromLatLongAlt(geodeticLatRad, longitudeRad, sensorValues->gpsSet.altitude.value, posSatE); // Target direction in the ECEF frame @@ -174,125 +174,128 @@ void Guidance::targetQuatPtg(ACS::SensorValues *sensorValues, acsctrl::MekfData } } -void Guidance::targetQuatPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, - double targetQuat[4], double refSatRate[3]) { +void Guidance::targetQuatPtg(ACS::SensorValues *sensorValues, ACS::OutputValues *outputValues, + timeval now, double targetQuat[4], double refSatRate[3]) { + //------------------------------------------------------------------------------------- + // Calculation of target quaternion for target pointing + //------------------------------------------------------------------------------------- + // Transform longitude, latitude and altitude to cartesian coordiantes (earth + // fixed/centered frame) + double groundStationCart[3] = {0, 0, 0}; - //------------------------------------------------------------------------------------- - // Calculation of target quaternion for target pointing - //------------------------------------------------------------------------------------- - // Transform longitude, latitude and altitude to cartesian coordiantes (earth - // fixed/centered frame) - double groundStationCart[3] = {0, 0, 0}; + MathOperations::cartesianFromLatLongAlt(acsParameters.groundStationParameters.latitudeGs, + acsParameters.groundStationParameters.longitudeGs, + acsParameters.groundStationParameters.altitudeGs, + groundStationCart); + // Position of the satellite in the earth/fixed frame via GPS + double posSatE[3] = {0, 0, 0}; + double geodeticLatRad = (sensorValues->gpsSet.latitude.value) * PI / 180; + double longitudeRad = (sensorValues->gpsSet.longitude.value) * PI / 180; + MathOperations::cartesianFromLatLongAlt(geodeticLatRad, longitudeRad, + sensorValues->gpsSet.altitude.value, posSatE); + double targetDirE[3] = {0, 0, 0}; + VectorOperations::subtract(groundStationCart, posSatE, targetDirE, 3); - MathOperations::cartesianFromLatLongAlt(acsParameters.groundStationParameters.latitudeGs, - acsParameters.groundStationParameters.longitudeGs, - acsParameters.groundStationParameters.altitudeGs, - groundStationCart); - // Position of the satellite in the earth/fixed frame via GPS - double posSatE[3] = {0, 0, 0}; - double geodeticLatRad = (sensorValues->gpsSet.latitude.value)*PI/180; - double longitudeRad = (sensorValues->gpsSet.longitude.value)*PI/180; - MathOperations::cartesianFromLatLongAlt(geodeticLatRad,longitudeRad, - sensorValues->gpsSet.altitude.value, posSatE); - double targetDirE[3] = {0, 0, 0}; - VectorOperations::subtract(groundStationCart, posSatE, targetDirE, 3); + // Transformation between ECEF and IJK frame + double dcmEJ[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + double dcmJE[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + double dcmEJDot[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + MathOperations::ecfToEciWithNutPre(now, *dcmEJ, *dcmEJDot); + MathOperations::inverseMatrixDimThree(*dcmEJ, *dcmJE); - // Transformation between ECEF and IJK frame - double dcmEJ[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; - double dcmJE[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; - double dcmEJDot[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; - MathOperations::ecfToEciWithNutPre(now, *dcmEJ, *dcmEJDot); - MathOperations::inverseMatrixDimThree(*dcmEJ, *dcmJE); + double dcmJEDot[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + MathOperations::inverseMatrixDimThree(*dcmEJDot, *dcmJEDot); - double dcmJEDot[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; - MathOperations::inverseMatrixDimThree(*dcmEJDot, *dcmJEDot); + // Target Direction and position vector in the inertial frame + double targetDirJ[3] = {0, 0, 0}, posSatJ[3] = {0, 0, 0}; + MatrixOperations::multiply(*dcmJE, targetDirE, targetDirJ, 3, 3, 1); + MatrixOperations::multiply(*dcmJE, posSatE, posSatJ, 3, 3, 1); - // Target Direction and position vector in the inertial frame - double targetDirJ[3] = {0, 0, 0}, posSatJ[3] = {0, 0, 0}; - MatrixOperations::multiply(*dcmJE, targetDirE, targetDirJ, 3, 3, 1); - MatrixOperations::multiply(*dcmJE, posSatE, posSatJ, 3, 3, 1); + // negative x-Axis aligned with target (Camera/E-band transmitter position) + double xAxis[3] = {0, 0, 0}; + VectorOperations::normalize(targetDirJ, xAxis, 3); + VectorOperations::mulScalar(xAxis, -1, xAxis, 3); - // negative x-Axis aligned with target (Camera/E-band transmitter position) - double xAxis[3] = {0, 0, 0}; - VectorOperations::normalize(targetDirJ, xAxis, 3); - VectorOperations::mulScalar(xAxis, -1, xAxis, 3); + // Transform velocity into inertial frame + double velocityE[3] = {outputValues->gpsVelocity[0], outputValues->gpsVelocity[1], + outputValues->gpsVelocity[2]}; + double velocityJ[3] = {0, 0, 0}, velPart1[3] = {0, 0, 0}, velPart2[3] = {0, 0, 0}; + MatrixOperations::multiply(*dcmJE, velocityE, velPart1, 3, 3, 1); + MatrixOperations::multiply(*dcmJEDot, posSatE, velPart2, 3, 3, 1); + VectorOperations::add(velPart1, velPart2, velocityJ, 3); - // Transform velocity into inertial frame - double velocityE[3] = {outputValues->gpsVelocity[0], outputValues->gpsVelocity[1], outputValues->gpsVelocity[2]}; - double velocityJ[3] = {0, 0, 0}, velPart1[3] = {0, 0, 0}, velPart2[3] = {0, 0, 0}; - MatrixOperations::multiply(*dcmJE, velocityE, velPart1, 3, 3, 1); - MatrixOperations::multiply(*dcmJEDot, posSatE, velPart2, 3, 3, 1); - VectorOperations::add(velPart1, velPart2, velocityJ, 3); + // orbital normal vector + double orbitalNormalJ[3] = {0, 0, 0}; + VectorOperations::cross(posSatJ, velocityJ, orbitalNormalJ); + VectorOperations::normalize(orbitalNormalJ, orbitalNormalJ, 3); - // orbital normal vector - double orbitalNormalJ[3] = {0, 0, 0}; - VectorOperations::cross(posSatJ, velocityJ, orbitalNormalJ); - VectorOperations::normalize(orbitalNormalJ, orbitalNormalJ, 3); + // y-Axis of satellite in orbit plane so that z-axis parallel to long side of picture resolution + double yAxis[3] = {0, 0, 0}; + VectorOperations::cross(orbitalNormalJ, xAxis, yAxis); + VectorOperations::normalize(yAxis, yAxis, 3); - // y-Axis of satellite in orbit plane so that z-axis parallel to long side of picture resolution - double yAxis[3] = {0, 0, 0}; - VectorOperations::cross(orbitalNormalJ, xAxis, yAxis); - VectorOperations::normalize(yAxis, yAxis, 3); + // z-Axis completes RHS + double zAxis[3] = {0, 0, 0}; + VectorOperations::cross(xAxis, yAxis, zAxis); - // z-Axis completes RHS - double zAxis[3] = {0, 0, 0}; - VectorOperations::cross(xAxis, yAxis, zAxis); + // Complete transformation matrix + double dcmTgt[3][3] = {{xAxis[0], yAxis[0], zAxis[0]}, + {xAxis[1], yAxis[1], zAxis[1]}, + {xAxis[2], yAxis[2], zAxis[2]}}; + double quatInertialTarget[4] = {0, 0, 0, 0}; + QuaternionOperations::fromDcm(dcmTgt, quatInertialTarget); - //Complete transformation matrix - double dcmTgt[3][3] = {{xAxis[0], yAxis[0], zAxis[0]}, {xAxis[1], yAxis[1], zAxis[1]}, {xAxis[2], yAxis[2], zAxis[2]}}; - double quatInertialTarget[4] = {0, 0, 0, 0}; - QuaternionOperations::fromDcm(dcmTgt,quatInertialTarget); + //------------------------------------------------------------------------------------- + // Calculation of reference rotation rate + //------------------------------------------------------------------------------------- + double timeElapsed = + now.tv_sec + now.tv_usec * pow(10, -6) - + (timeSavedQuaternionNadir.tv_sec + + timeSavedQuaternionNadir.tv_usec * pow(timeSavedQuaternionNadir.tv_usec, -6)); + if (timeElapsed < acsParameters.pointingModeControllerParameters.nadirTimeElapsedMax) { + double qDiff[4] = {0, 0, 0, 0}; + VectorOperations::subtract(quatInertialTarget, savedQuaternionNadir, qDiff, 4); + VectorOperations::mulScalar(qDiff, 1 / timeElapsed, qDiff, 4); - //------------------------------------------------------------------------------------- - // Calculation of reference rotation rate - //------------------------------------------------------------------------------------- - double timeElapsed = now.tv_sec + now.tv_usec * pow(10,-6) - (timeSavedQuaternionNadir.tv_sec + - timeSavedQuaternionNadir.tv_usec * pow(timeSavedQuaternionNadir.tv_usec,-6)); - if (timeElapsed < acsParameters.pointingModeControllerParameters.nadirTimeElapsedMax) { - double qDiff[4] = {0, 0, 0, 0}; - VectorOperations::subtract(quatInertialTarget, savedQuaternionNadir, qDiff, 4); - VectorOperations::mulScalar(qDiff, 1/timeElapsed, qDiff, 4); + double tgtQuatVec[3] = {quatInertialTarget[0], quatInertialTarget[1], quatInertialTarget[2]}, + qDiffVec[3] = {qDiff[0], qDiff[1], qDiff[2]}; + double sum1[3] = {0, 0, 0}, sum2[3] = {0, 0, 0}, sum3[3] = {0, 0, 0}, sum[3] = {0, 0, 0}; + VectorOperations::cross(quatInertialTarget, qDiff, sum1); + VectorOperations::mulScalar(tgtQuatVec, qDiff[3], sum2, 3); + VectorOperations::mulScalar(qDiffVec, quatInertialTarget[3], sum3, 3); + VectorOperations::add(sum1, sum2, sum, 3); + VectorOperations::subtract(sum, sum3, sum, 3); + double omegaRefNew[3] = {0, 0, 0}; + VectorOperations::mulScalar(sum, -2, omegaRefNew, 3); - double tgtQuatVec[3] = {quatInertialTarget[0], quatInertialTarget[1], quatInertialTarget[2]}, - qDiffVec[3] = {qDiff[0], qDiff[1], qDiff[2]}; - double sum1[3] = {0, 0, 0}, sum2[3] = {0, 0, 0}, sum3[3] = {0, 0, 0}, sum[3] = {0, 0, 0}; - VectorOperations::cross(quatInertialTarget, qDiff, sum1); - VectorOperations::mulScalar(tgtQuatVec, qDiff[3], sum2, 3); - VectorOperations::mulScalar(qDiffVec, quatInertialTarget[3], sum3, 3); - VectorOperations::add(sum1, sum2, sum, 3); - VectorOperations::subtract(sum, sum3, sum, 3); - double omegaRefNew[3] = {0, 0, 0}; - VectorOperations::mulScalar(sum, -2, omegaRefNew, 3); + VectorOperations::mulScalar(omegaRefNew, 2, refSatRate, 3); + VectorOperations::subtract(refSatRate, omegaRefSavedNadir, refSatRate, 3); + omegaRefSavedNadir[0] = omegaRefNew[0]; + omegaRefSavedNadir[1] = omegaRefNew[1]; + omegaRefSavedNadir[2] = omegaRefNew[2]; + } else { + refSatRate[0] = 0; + refSatRate[1] = 0; + refSatRate[2] = 0; + } - VectorOperations::mulScalar(omegaRefNew, 2, refSatRate, 3); - VectorOperations::subtract(refSatRate, omegaRefSavedNadir, refSatRate, 3); - omegaRefSavedNadir[0] = omegaRefNew[0]; - omegaRefSavedNadir[1] = omegaRefNew[1]; - omegaRefSavedNadir[2] = omegaRefNew[2]; - } - else { - refSatRate[0] = 0; - refSatRate[1] = 0; - refSatRate[2] = 0; - } + timeSavedQuaternionNadir = now; + savedQuaternionNadir[0] = quatInertialTarget[0]; + savedQuaternionNadir[1] = quatInertialTarget[1]; + savedQuaternionNadir[2] = quatInertialTarget[2]; + savedQuaternionNadir[3] = quatInertialTarget[3]; - timeSavedQuaternionNadir = now; - savedQuaternionNadir[0] = quatInertialTarget[0]; - savedQuaternionNadir[1] = quatInertialTarget[1]; - savedQuaternionNadir[2] = quatInertialTarget[2]; - savedQuaternionNadir[3] = quatInertialTarget[3]; - - // Transform in system relative to satellite frame - double quatBJ[4] = {0, 0, 0, 0}; - quatBJ[0] = outputValues->quatMekfBJ[0]; - quatBJ[1] = outputValues->quatMekfBJ[1]; - quatBJ[2] = outputValues->quatMekfBJ[2]; - quatBJ[3] = outputValues->quatMekfBJ[3]; - QuaternionOperations::multiply(quatBJ, quatInertialTarget, targetQuat); + // Transform in system relative to satellite frame + double quatBJ[4] = {0, 0, 0, 0}; + quatBJ[0] = outputValues->quatMekfBJ[0]; + quatBJ[1] = outputValues->quatMekfBJ[1]; + quatBJ[2] = outputValues->quatMekfBJ[2]; + quatBJ[3] = outputValues->quatMekfBJ[3]; + QuaternionOperations::multiply(quatBJ, quatInertialTarget, targetQuat); } -void Guidance::sunQuatPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, - double targetQuat[4], double refSatRate[3]) { +void Guidance::sunQuatPtg(ACS::SensorValues *sensorValues, ACS::OutputValues *outputValues, + timeval now, double targetQuat[4], double refSatRate[3]) { //------------------------------------------------------------------------------------- // Calculation of target quaternion to sun //------------------------------------------------------------------------------------- @@ -354,17 +357,18 @@ void Guidance::sunQuatPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *ou MathOperations::inverseMatrixDimThree(*dcmEJDot, *dcmJEDot); // positive z-Axis of EIVE in direction of sun - double zAxis[3] = {0 ,0 ,0}; + double zAxis[3] = {0, 0, 0}; VectorOperations::normalize(sunDirB, zAxis, 3); // Position of the satellite in the earth/fixed frame via GPS and body // velocity double posSatE[3] = {0, 0, 0}; - double geodeticLatRad = (sensorValues->gpsSet.latitude.value)*PI/180; - double longitudeRad = (sensorValues->gpsSet.longitude.value)*PI/180; - MathOperations::cartesianFromLatLongAlt(geodeticLatRad,longitudeRad, + double geodeticLatRad = (sensorValues->gpsSet.latitude.value) * PI / 180; + double longitudeRad = (sensorValues->gpsSet.longitude.value) * PI / 180; + MathOperations::cartesianFromLatLongAlt(geodeticLatRad, longitudeRad, sensorValues->gpsSet.altitude.value, posSatE); - double velocityE[3] = {outputValues->gpsVelocity[0], outputValues->gpsVelocity[1], outputValues->gpsVelocity[2]}; + double velocityE[3] = {outputValues->gpsVelocity[0], outputValues->gpsVelocity[1], + outputValues->gpsVelocity[2]}; double velocityJ[3] = {0, 0, 0}, velPart1[3] = {0, 0, 0}, velPart2[3] = {0, 0, 0}; MatrixOperations::multiply(*dcmJE, velocityE, velPart1, 3, 3, 1); MatrixOperations::multiply(*dcmJEDot, posSatE, velPart2, 3, 3, 1); @@ -387,9 +391,11 @@ void Guidance::sunQuatPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *ou // Transformation matrix to Sun, no further transforamtions, reference is already // the EIVE body frame - double dcmTgt[3][3] = {{xAxis[0], yAxis[0], zAxis[0]}, {xAxis[1], yAxis[1], zAxis[1]}, {xAxis[2], yAxis[2], zAxis[2]}}; + double dcmTgt[3][3] = {{xAxis[0], yAxis[0], zAxis[0]}, + {xAxis[1], yAxis[1], zAxis[1]}, + {xAxis[2], yAxis[2], zAxis[2]}}; double quatSun[4] = {0, 0, 0, 0}; - QuaternionOperations::fromDcm(dcmTgt,quatSun); + QuaternionOperations::fromDcm(dcmTgt, quatSun); targetQuat[0] = quatSun[0]; targetQuat[1] = quatSun[1]; @@ -404,16 +410,18 @@ void Guidance::sunQuatPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *ou refSatRate[2] = 0; } -void Guidance::quatNadirPtgOldVersion(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, - double targetQuat[4], double refSatRate[3]) { // old version of Nadir Pointing +void Guidance::quatNadirPtgOldVersion(ACS::SensorValues *sensorValues, + ACS::OutputValues *outputValues, timeval now, + double targetQuat[4], + double refSatRate[3]) { // old version of Nadir Pointing //------------------------------------------------------------------------------------- // Calculation of target quaternion for Nadir pointing //------------------------------------------------------------------------------------- // Position of the satellite in the earth/fixed frame via GPS double posSatE[3] = {0, 0, 0}; - double geodeticLatRad = (sensorValues->gpsSet.latitude.value)*PI/180; - double longitudeRad = (sensorValues->gpsSet.longitude.value)*PI/180; - MathOperations::cartesianFromLatLongAlt(geodeticLatRad,longitudeRad, + double geodeticLatRad = (sensorValues->gpsSet.latitude.value) * PI / 180; + double longitudeRad = (sensorValues->gpsSet.longitude.value) * PI / 180; + MathOperations::cartesianFromLatLongAlt(geodeticLatRad, longitudeRad, sensorValues->gpsSet.altitude.value, posSatE); double targetDirE[3] = {0, 0, 0}; VectorOperations::mulScalar(posSatE, -1, targetDirE, 3); @@ -468,116 +476,118 @@ void Guidance::quatNadirPtgOldVersion(ACS::SensorValues* sensorValues, ACS::Outp refSatRate[0] = 0; refSatRate[1] = 0; refSatRate[2] = 0; - } -void Guidance::quatNadirPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, - double targetQuat[4], double refSatRate[3]) { +void Guidance::quatNadirPtg(ACS::SensorValues *sensorValues, ACS::OutputValues *outputValues, + timeval now, double targetQuat[4], double refSatRate[3]) { + //------------------------------------------------------------------------------------- + // Calculation of target quaternion for Nadir pointing + //------------------------------------------------------------------------------------- + // Position of the satellite in the earth/fixed frame via GPS + double posSatE[3] = {0, 0, 0}; + double geodeticLatRad = (sensorValues->gpsSet.latitude.value) * PI / 180; + double longitudeRad = (sensorValues->gpsSet.longitude.value) * PI / 180; + MathOperations::cartesianFromLatLongAlt(geodeticLatRad, longitudeRad, + sensorValues->gpsSet.altitude.value, posSatE); + double targetDirE[3] = {0, 0, 0}; + VectorOperations::mulScalar(posSatE, -1, targetDirE, 3); - //------------------------------------------------------------------------------------- - // Calculation of target quaternion for Nadir pointing - //------------------------------------------------------------------------------------- - // Position of the satellite in the earth/fixed frame via GPS - double posSatE[3] = {0, 0, 0}; - double geodeticLatRad = (sensorValues->gpsSet.latitude.value)*PI/180; - double longitudeRad = (sensorValues->gpsSet.longitude.value)*PI/180; - MathOperations::cartesianFromLatLongAlt(geodeticLatRad,longitudeRad, - sensorValues->gpsSet.altitude.value, posSatE); - double targetDirE[3] = {0, 0, 0}; - VectorOperations::mulScalar(posSatE, -1, targetDirE, 3); + // Transformation between ECEF and IJK frame + double dcmEJ[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + double dcmJE[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + double dcmEJDot[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + MathOperations::ecfToEciWithNutPre(now, *dcmEJ, *dcmEJDot); + MathOperations::inverseMatrixDimThree(*dcmEJ, *dcmJE); - // Transformation between ECEF and IJK frame - double dcmEJ[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; - double dcmJE[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; - double dcmEJDot[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; - MathOperations::ecfToEciWithNutPre(now, *dcmEJ, *dcmEJDot); - MathOperations::inverseMatrixDimThree(*dcmEJ, *dcmJE); + double dcmJEDot[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + MathOperations::inverseMatrixDimThree(*dcmEJDot, *dcmJEDot); - double dcmJEDot[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; - MathOperations::inverseMatrixDimThree(*dcmEJDot, *dcmJEDot); + // Target Direction in the body frame + double targetDirJ[3] = {0, 0, 0}; + MatrixOperations::multiply(*dcmJE, targetDirE, targetDirJ, 3, 3, 1); - // Target Direction in the body frame - double targetDirJ[3] = {0, 0, 0}; - MatrixOperations::multiply(*dcmJE, targetDirE, targetDirJ, 3, 3, 1); + // negative x-Axis aligned with target (Camera position) + double xAxis[3] = {0, 0, 0}; + VectorOperations::normalize(targetDirJ, xAxis, 3); + VectorOperations::mulScalar(xAxis, -1, xAxis, 3); - // negative x-Axis aligned with target (Camera position) - double xAxis[3] = {0, 0, 0}; - VectorOperations::normalize(targetDirJ, xAxis, 3); - VectorOperations::mulScalar(xAxis, -1, xAxis, 3); + // z-Axis parallel to long side of picture resolution + double zAxis[3] = {0, 0, 0}; + double velocityE[3] = {outputValues->gpsVelocity[0], outputValues->gpsVelocity[1], + outputValues->gpsVelocity[2]}; + double velocityJ[3] = {0, 0, 0}, velPart1[3] = {0, 0, 0}, velPart2[3] = {0, 0, 0}; + MatrixOperations::multiply(*dcmJE, velocityE, velPart1, 3, 3, 1); + MatrixOperations::multiply(*dcmJEDot, posSatE, velPart2, 3, 3, 1); + VectorOperations::add(velPart1, velPart2, velocityJ, 3); + VectorOperations::cross(xAxis, velocityJ, zAxis); + VectorOperations::normalize(zAxis, zAxis, 3); - // z-Axis parallel to long side of picture resolution - double zAxis[3] = {0, 0, 0}; - double velocityE[3] = {outputValues->gpsVelocity[0], outputValues->gpsVelocity[1], outputValues->gpsVelocity[2]}; - double velocityJ[3] = {0, 0, 0}, velPart1[3] = {0, 0, 0}, velPart2[3] = {0, 0, 0}; - MatrixOperations::multiply(*dcmJE, velocityE, velPart1, 3, 3, 1); - MatrixOperations::multiply(*dcmJEDot, posSatE, velPart2, 3, 3, 1); - VectorOperations::add(velPart1, velPart2, velocityJ, 3); - VectorOperations::cross(xAxis, velocityJ, zAxis); - VectorOperations::normalize(zAxis, zAxis, 3); + // y-Axis completes RHS + double yAxis[3] = {0, 0, 0}; + VectorOperations::cross(zAxis, xAxis, yAxis); - // y-Axis completes RHS - double yAxis[3] = {0, 0, 0}; - VectorOperations::cross(zAxis, xAxis, yAxis); + // Complete transformation matrix + double dcmTgt[3][3] = {{xAxis[0], yAxis[0], zAxis[0]}, + {xAxis[1], yAxis[1], zAxis[1]}, + {xAxis[2], yAxis[2], zAxis[2]}}; + double quatInertialTarget[4] = {0, 0, 0, 0}; + QuaternionOperations::fromDcm(dcmTgt, quatInertialTarget); - //Complete transformation matrix - double dcmTgt[3][3] = {{xAxis[0], yAxis[0], zAxis[0]}, {xAxis[1], yAxis[1], zAxis[1]}, {xAxis[2], yAxis[2], zAxis[2]}}; - double quatInertialTarget[4] = {0, 0, 0, 0}; - QuaternionOperations::fromDcm(dcmTgt,quatInertialTarget); + //------------------------------------------------------------------------------------- + // Calculation of reference rotation rate + //------------------------------------------------------------------------------------- + double timeElapsed = + now.tv_sec + now.tv_usec * pow(10, -6) - + (timeSavedQuaternionNadir.tv_sec + + timeSavedQuaternionNadir.tv_usec * pow(timeSavedQuaternionNadir.tv_usec, -6)); + if (timeElapsed < acsParameters.pointingModeControllerParameters.nadirTimeElapsedMax) { + double qDiff[4] = {0, 0, 0, 0}; + VectorOperations::subtract(quatInertialTarget, savedQuaternionNadir, qDiff, 4); + VectorOperations::mulScalar(qDiff, 1 / timeElapsed, qDiff, 4); - //------------------------------------------------------------------------------------- - // Calculation of reference rotation rate - //------------------------------------------------------------------------------------- - double timeElapsed = now.tv_sec + now.tv_usec * pow(10,-6) - (timeSavedQuaternionNadir.tv_sec + - timeSavedQuaternionNadir.tv_usec * pow(timeSavedQuaternionNadir.tv_usec,-6)); - if (timeElapsed < acsParameters.pointingModeControllerParameters.nadirTimeElapsedMax) { - double qDiff[4] = {0, 0, 0, 0}; - VectorOperations::subtract(quatInertialTarget, savedQuaternionNadir, qDiff, 4); - VectorOperations::mulScalar(qDiff, 1/timeElapsed, qDiff, 4); + double tgtQuatVec[3] = {quatInertialTarget[0], quatInertialTarget[1], quatInertialTarget[2]}, + qDiffVec[3] = {qDiff[0], qDiff[1], qDiff[2]}; + double sum1[3] = {0, 0, 0}, sum2[3] = {0, 0, 0}, sum3[3] = {0, 0, 0}, sum[3] = {0, 0, 0}; + VectorOperations::cross(quatInertialTarget, qDiff, sum1); + VectorOperations::mulScalar(tgtQuatVec, qDiff[3], sum2, 3); + VectorOperations::mulScalar(qDiffVec, quatInertialTarget[3], sum3, 3); + VectorOperations::add(sum1, sum2, sum, 3); + VectorOperations::subtract(sum, sum3, sum, 3); + double omegaRefNew[3] = {0, 0, 0}; + VectorOperations::mulScalar(sum, -2, omegaRefNew, 3); - double tgtQuatVec[3] = {quatInertialTarget[0], quatInertialTarget[1], quatInertialTarget[2]}, - qDiffVec[3] = {qDiff[0], qDiff[1], qDiff[2]}; - double sum1[3] = {0, 0, 0}, sum2[3] = {0, 0, 0}, sum3[3] = {0, 0, 0}, sum[3] = {0, 0, 0}; - VectorOperations::cross(quatInertialTarget, qDiff, sum1); - VectorOperations::mulScalar(tgtQuatVec, qDiff[3], sum2, 3); - VectorOperations::mulScalar(qDiffVec, quatInertialTarget[3], sum3, 3); - VectorOperations::add(sum1, sum2, sum, 3); - VectorOperations::subtract(sum, sum3, sum, 3); - double omegaRefNew[3] = {0, 0, 0}; - VectorOperations::mulScalar(sum, -2, omegaRefNew, 3); + VectorOperations::mulScalar(omegaRefNew, 2, refSatRate, 3); + VectorOperations::subtract(refSatRate, omegaRefSavedNadir, refSatRate, 3); + omegaRefSavedNadir[0] = omegaRefNew[0]; + omegaRefSavedNadir[1] = omegaRefNew[1]; + omegaRefSavedNadir[2] = omegaRefNew[2]; + } else { + refSatRate[0] = 0; + refSatRate[1] = 0; + refSatRate[2] = 0; + } - VectorOperations::mulScalar(omegaRefNew, 2, refSatRate, 3); - VectorOperations::subtract(refSatRate, omegaRefSavedNadir, refSatRate, 3); - omegaRefSavedNadir[0] = omegaRefNew[0]; - omegaRefSavedNadir[1] = omegaRefNew[1]; - omegaRefSavedNadir[2] = omegaRefNew[2]; - } - else { - refSatRate[0] = 0; - refSatRate[1] = 0; - refSatRate[2] = 0; - } + timeSavedQuaternionNadir = now; + savedQuaternionNadir[0] = quatInertialTarget[0]; + savedQuaternionNadir[1] = quatInertialTarget[1]; + savedQuaternionNadir[2] = quatInertialTarget[2]; + savedQuaternionNadir[3] = quatInertialTarget[3]; - timeSavedQuaternionNadir = now; - savedQuaternionNadir[0] = quatInertialTarget[0]; - savedQuaternionNadir[1] = quatInertialTarget[1]; - savedQuaternionNadir[2] = quatInertialTarget[2]; - savedQuaternionNadir[3] = quatInertialTarget[3]; - - // Transform in system relative to satellite frame - double quatBJ[4] = {0, 0, 0, 0}; - quatBJ[0] = outputValues->quatMekfBJ[0]; - quatBJ[1] = outputValues->quatMekfBJ[1]; - quatBJ[2] = outputValues->quatMekfBJ[2]; - quatBJ[3] = outputValues->quatMekfBJ[3]; - QuaternionOperations::multiply(quatBJ, quatInertialTarget, targetQuat); + // Transform in system relative to satellite frame + double quatBJ[4] = {0, 0, 0, 0}; + quatBJ[0] = outputValues->quatMekfBJ[0]; + quatBJ[1] = outputValues->quatMekfBJ[1]; + quatBJ[2] = outputValues->quatMekfBJ[2]; + quatBJ[3] = outputValues->quatMekfBJ[3]; + QuaternionOperations::multiply(quatBJ, quatInertialTarget, targetQuat); } void Guidance::inertialQuatPtg(double targetQuat[4], double refSatRate[3]) { for (int i = 0; i < 4; i++) { - targetQuat[i] = acsParameters.inertialModeControllerParameters.tgtQuatInertial[i]; + targetQuat[i] = acsParameters.inertialModeControllerParameters.tgtQuatInertial[i]; } for (int i = 0; i < 3; i++) { - refSatRate[i] = acsParameters.inertialModeControllerParameters.tgtRotRateInertial[i]; + refSatRate[i] = acsParameters.inertialModeControllerParameters.tgtRotRateInertial[i]; } } diff --git a/mission/controller/acs/Guidance.h b/mission/controller/acs/Guidance.h index 234627cf..1b6bfcb6 100644 --- a/mission/controller/acs/Guidance.h +++ b/mission/controller/acs/Guidance.h @@ -21,27 +21,31 @@ class Guidance { void getTargetParamsSafe(double sunTargetSafe[3], double satRateRef[3]); - // Function to get the target quaternion and refence rotation rate from gps position and position of the ground station - void targetQuatPtgOldVersion(ACS::SensorValues *sensorValues, acsctrl::MekfData *mekfData, - acsctrl::SusDataProcessed *susDataProcessed, timeval now, double targetQuat[4], - double refSatRate[3]); - void targetQuatPtg(ACS::SensorValues *sensorValues, acsctrl::MekfData *mekfData, + // Function to get the target quaternion and refence rotation rate from gps position and position + // of the ground station + void targetQuatPtgOldVersion(ACS::SensorValues *sensorValues, acsctrl::MekfData *mekfData, + acsctrl::SusDataProcessed *susDataProcessed, timeval now, + double targetQuat[4], double refSatRate[3]); + void targetQuatPtg(ACS::SensorValues *sensorValues, acsctrl::MekfData *mekfData, acsctrl::SusDataProcessed *susDataProcessed, timeval now, double targetQuat[4], double refSatRate[3]); - // Function to get the target quaternion and refence rotation rate for sun pointing after ground station - void sunQuatPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, - double targetQuat[4], double refSatRate[3]); + // Function to get the target quaternion and refence rotation rate for sun pointing after ground + // station + void sunQuatPtg(ACS::SensorValues *sensorValues, ACS::OutputValues *outputValues, timeval now, + double targetQuat[4], double refSatRate[3]); - // Function to get the target quaternion and refence rotation rate from gps position for Nadir pointing - void quatNadirPtgOldVersion(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, - double targetQuat[4], double refSatRate[3]); + // Function to get the target quaternion and refence rotation rate from gps position for Nadir + // pointing + void quatNadirPtgOldVersion(ACS::SensorValues *sensorValues, ACS::OutputValues *outputValues, + timeval now, double targetQuat[4], double refSatRate[3]); - void quatNadirPtg(ACS::SensorValues* sensorValues, ACS::OutputValues *outputValues, timeval now, - double targetQuat[4], double refSatRate[3]); + void quatNadirPtg(ACS::SensorValues *sensorValues, ACS::OutputValues *outputValues, timeval now, + double targetQuat[4], double refSatRate[3]); - // Function to get the target quaternion and refence rotation rate from parameters for inertial pointing - void inertialQuatPtg(double targetQuat[4], double refSatRate[3]); + // Function to get the target quaternion and refence rotation rate from parameters for inertial + // pointing + void inertialQuatPtg(double targetQuat[4], double refSatRate[3]); // @note: compares target Quaternion and reference quaternion, also actual satellite rate and // desired diff --git a/mission/controller/acs/Igrf13Model.h b/mission/controller/acs/Igrf13Model.h index f5cded71..ea2c1044 100644 --- a/mission/controller/acs/Igrf13Model.h +++ b/mission/controller/acs/Igrf13Model.h @@ -114,21 +114,15 @@ class Igrf13Model /*:public HasParametersIF*/ { {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}}; // [m][n] in nT - - double schmidtFactors[14][13] = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; + + double schmidtFactors[14][13] = { + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; ; double updatedG[14][13]; diff --git a/mission/controller/acs/SensorProcessing.cpp b/mission/controller/acs/SensorProcessing.cpp index 73d5fa81..5ce2cb77 100644 --- a/mission/controller/acs/SensorProcessing.cpp +++ b/mission/controller/acs/SensorProcessing.cpp @@ -574,11 +574,13 @@ void SensorProcessing::processGps(const double gpsLatitude, const double gpsLong // Calculation of the satellite velocity in earth fixed frame double posSatE[3] = {0, 0, 0}, deltaDistance[3] = {0, 0, 0}; // RADIANS OR DEGREE ? Function needs rad as input - MathOperations::cartesianFromLatLongAlt(gps0latitude, gps0longitude, gps0altitude, posSatE); - if (validSavedPosSatE && (gps0UnixSeconds - timeOfSavedPosSatE) < (gpsParameters->timeDiffVelocityMax)) { - VectorOperations::subtract(posSatE, savedPosSatE, deltaDistance, 3); - double timeDiffGpsMeas = gps0UnixSeconds - timeOfSavedPosSatE; - VectorOperations::mulScalar(deltaDistance, 1/timeDiffGpsMeas, gpsVelocityE, 3); + MathOperations::cartesianFromLatLongAlt(gps0latitude, gps0longitude, gps0altitude, + posSatE); + if (validSavedPosSatE && + (gps0UnixSeconds - timeOfSavedPosSatE) < (gpsParameters->timeDiffVelocityMax)) { + VectorOperations::subtract(posSatE, savedPosSatE, deltaDistance, 3); + double timeDiffGpsMeas = gps0UnixSeconds - timeOfSavedPosSatE; + VectorOperations::mulScalar(deltaDistance, 1 / timeDiffGpsMeas, gpsVelocityE, 3); } } { @@ -600,7 +602,7 @@ void SensorProcessing::processGps(const double gpsLatitude, const double gpsLong validSavedPosSatE = true; } else { - validGcLatitude = false; + validGcLatitude = false; } } diff --git a/mission/controller/acs/control/Detumble.h b/mission/controller/acs/control/Detumble.h index f47ce86c..16bf82bc 100644 --- a/mission/controller/acs/control/Detumble.h +++ b/mission/controller/acs/control/Detumble.h @@ -35,15 +35,14 @@ class Detumble { ReturnValue_t bangbangLaw(const double *magRate, const bool magRateValid, double *magMom); - ReturnValue_t bangbangLaw(const double *magRate, const bool *magRateValid, double *magMom); + ReturnValue_t bangbangLaw(const double *magRate, const bool *magRateValid, double *magMom); - ReturnValue_t bDotLawGyro(const double *satRate, const bool *satRateValid, - const double *magField, const bool *magFieldValid, - double *magMom); + ReturnValue_t bDotLawGyro(const double *satRate, const bool *satRateValid, const double *magField, + const bool *magFieldValid, double *magMom); -private: - AcsParameters::DetumbleParameter* detumbleParameter; - AcsParameters::MagnetorquesParameter* magnetorquesParameter; + private: + AcsParameters::DetumbleParameter *detumbleParameter; + AcsParameters::MagnetorquesParameter *magnetorquesParameter; }; #endif /*ACS_CONTROL_DETUMBLE_H_*/ diff --git a/mission/controller/acs/control/PtgCtrl.cpp b/mission/controller/acs/control/PtgCtrl.cpp index 64666be1..9d4f8d6d 100644 --- a/mission/controller/acs/control/PtgCtrl.cpp +++ b/mission/controller/acs/control/PtgCtrl.cpp @@ -16,9 +16,7 @@ #include "../util/MathOperations.h" -PtgCtrl::PtgCtrl(AcsParameters *acsParameters_){ - loadAcsParameters(acsParameters_); -} +PtgCtrl::PtgCtrl(AcsParameters *acsParameters_) { loadAcsParameters(acsParameters_); } PtgCtrl::~PtgCtrl() {} @@ -29,7 +27,8 @@ void PtgCtrl::loadAcsParameters(AcsParameters *acsParameters_) { rwMatrices = &(acsParameters_->rwMatrices); } -void PtgCtrl::ptgLaw(const double mode, const double *qError, const double *deltaRate,const double *rwPseudoInv, double *torqueRws){ +void PtgCtrl::ptgLaw(const double mode, const double *qError, const double *deltaRate, + const double *rwPseudoInv, double *torqueRws) { //------------------------------------------------------------------------------------------------ // Compute gain matrix K and P matrix //------------------------------------------------------------------------------------------------ @@ -84,30 +83,28 @@ void PtgCtrl::ptgLaw(const double mode, const double *qError, const double *delt double pErrorSign[3] = {0, 0, 0}; for (int i = 0; i < 3; i++) { - if (abs(pError[i]) > 1) { - pErrorSign[i] = sign(pError[i]); - } - else { - pErrorSign[i] = pError[i]; - } - } -// Torque for quaternion error - double torqueQuat[3] = {0, 0, 0}; - MatrixOperations::multiply(*gainMatrix, pErrorSign, torqueQuat, 3, 3, 1); - VectorOperations::mulScalar(torqueQuat, -1, torqueQuat, 3); + if (abs(pError[i]) > 1) { + pErrorSign[i] = sign(pError[i]); + } else { + pErrorSign[i] = pError[i]; + } + } + // Torque for quaternion error + double torqueQuat[3] = {0, 0, 0}; + MatrixOperations::multiply(*gainMatrix, pErrorSign, torqueQuat, 3, 3, 1); + VectorOperations::mulScalar(torqueQuat, -1, torqueQuat, 3); -// Torque for rate error - double torqueRate[3] = {0, 0, 0}; - MatrixOperations::multiply(*(inertiaEIVE->inertiaMatrix), deltaRate, torqueRate, 3, 3, 1); - VectorOperations::mulScalar(torqueRate, cInt, torqueRate, 3); - VectorOperations::mulScalar(torqueRate, -1, torqueRate, 3); - -// Final commanded Torque for every reaction wheel - double torque[3] = {0, 0, 0}; - VectorOperations::add(torqueRate, torqueQuat, torque, 3); - MatrixOperations::multiply(rwPseudoInv, torque, torqueRws, 4, 3, 1); - VectorOperations::mulScalar(torqueRws, -1, torqueRws, 4); + // Torque for rate error + double torqueRate[3] = {0, 0, 0}; + MatrixOperations::multiply(*(inertiaEIVE->inertiaMatrix), deltaRate, torqueRate, 3, 3, 1); + VectorOperations::mulScalar(torqueRate, cInt, torqueRate, 3); + VectorOperations::mulScalar(torqueRate, -1, torqueRate, 3); + // Final commanded Torque for every reaction wheel + double torque[3] = {0, 0, 0}; + VectorOperations::add(torqueRate, torqueQuat, torque, 3); + MatrixOperations::multiply(rwPseudoInv, torque, torqueRws, 4, 3, 1); + VectorOperations::mulScalar(torqueRws, -1, torqueRws, 4); } void PtgCtrl::ptgDesaturation(double *magFieldEst, bool magFieldEstValid, double *satRate, @@ -162,34 +159,31 @@ void PtgCtrl::ptgNullspace(const int32_t *speedRw0, const int32_t *speedRw1, VectorOperations::mulScalar(rwTrqNs, -1, rwTrqNs, 4); } -void PtgCtrl::rwAntistiction(const bool* rwAvailable, const int32_t* omegaRw, - double* torqueCommand) { - for (uint8_t i = 0; i < 4; i++) { - if (rwAvailable[i]) { - if (torqueMemory[i] != 0) { - if ((omegaRw[i] * torqueMemory[i]) - > rwHandlingParameters->stictionReleaseSpeed) { - torqueMemory[i] = 0; - } else { - torqueCommand[i] = torqueMemory[i] - * rwHandlingParameters->stictionTorque; - } - } else { - if ((omegaRw[i] < rwHandlingParameters->stictionSpeed) - && (omegaRw[i] > -rwHandlingParameters->stictionSpeed)) { - if (omegaRw[i] < omegaMemory[i]) { - torqueMemory[i] = -1; - } else { - torqueMemory[i] = 1; - } +void PtgCtrl::rwAntistiction(const bool *rwAvailable, const int32_t *omegaRw, + double *torqueCommand) { + for (uint8_t i = 0; i < 4; i++) { + if (rwAvailable[i]) { + if (torqueMemory[i] != 0) { + if ((omegaRw[i] * torqueMemory[i]) > rwHandlingParameters->stictionReleaseSpeed) { + torqueMemory[i] = 0; + } else { + torqueCommand[i] = torqueMemory[i] * rwHandlingParameters->stictionTorque; + } + } else { + if ((omegaRw[i] < rwHandlingParameters->stictionSpeed) && + (omegaRw[i] > -rwHandlingParameters->stictionSpeed)) { + if (omegaRw[i] < omegaMemory[i]) { + torqueMemory[i] = -1; + } else { + torqueMemory[i] = 1; + } - torqueCommand[i] = torqueMemory[i] - * rwHandlingParameters->stictionTorque; - } - } - } else { - torqueMemory[i] = 0; - } - omegaMemory[i] = omegaRw[i]; - } - } + torqueCommand[i] = torqueMemory[i] * rwHandlingParameters->stictionTorque; + } + } + } else { + torqueMemory[i] = 0; + } + omegaMemory[i] = omegaRw[i]; + } +} diff --git a/mission/controller/acs/control/PtgCtrl.h b/mission/controller/acs/control/PtgCtrl.h index 24ccafae..d176b0c2 100644 --- a/mission/controller/acs/control/PtgCtrl.h +++ b/mission/controller/acs/control/PtgCtrl.h @@ -42,7 +42,7 @@ class PtgCtrl { * @param: acsParameters_ Pointer to object which defines the ACS configuration parameters */ void ptgLaw(const double mode, const double *qError, const double *deltaRate, - const double *rwPseudoInv, double *torqueRws); + const double *rwPseudoInv, double *torqueRws); void ptgDesaturation(double *magFieldEst, bool magFieldEstValid, double *satRate, int32_t *speedRw0, int32_t *speedRw1, int32_t *speedRw2, int32_t *speedRw3, @@ -56,8 +56,7 @@ class PtgCtrl { * omegaRw current wheel speed of reaction wheels * torqueCommand modified torque after antistiction */ - void rwAntistiction(const bool* rwAvailable, const int32_t* omegaRw, - double* torqueCommand); + void rwAntistiction(const bool *rwAvailable, const int32_t *omegaRw, double *torqueCommand); private: AcsParameters::PointingModeControllerParameters *pointingModeControllerParameters; diff --git a/mission/controller/acs/util/MathOperations.h b/mission/controller/acs/util/MathOperations.h index 90056927..56665c4d 100644 --- a/mission/controller/acs/util/MathOperations.h +++ b/mission/controller/acs/util/MathOperations.h @@ -64,12 +64,13 @@ class MathOperations { } } - static void convertDateToJD2000(const T1 time, T2 julianDate){ - // time = { Y, M, D, h, m,s} - // time in sec and microsec -> The Epoch (unixtime) - julianDate = 1721013.5 + 367*time[0]- floor(7/4*(time[0]+(time[1]+9)/12)) - +floor(275*time[1]/9)+time[2]+(60*time[3]+time[4]+(time(5)/60))/1440; - } + static void convertDateToJD2000(const T1 time, T2 julianDate) { + // time = { Y, M, D, h, m,s} + // time in sec and microsec -> The Epoch (unixtime) + julianDate = 1721013.5 + 367 * time[0] - floor(7 / 4 * (time[0] + (time[1] + 9) / 12)) + + floor(275 * time[1] / 9) + time[2] + + (60 * time[3] + time[4] + (time(5) / 60)) / 1440; + } static T1 convertUnixToJD2000(timeval time) { // time = {{s},{us}} @@ -93,43 +94,42 @@ class MathOperations { outputDcm[8] = -pow(vector[0], 2) - pow(vector[1], 2) + pow(vector[2], 2) + pow(vector[3], 2); } - static void cartesianFromLatLongAlt(const T1 lat, const T1 longi, const T1 alt, T2 *cartesianOutput){ - /* @brief: cartesianFromLatLongAlt() - calculates cartesian coordinates in ECEF from latitude, - * longitude and altitude - * @param: lat geodetic latitude [rad] - * longi longitude [rad] - * alt altitude [m] - * cartesianOutput Cartesian Coordinates in ECEF (3x1) - * @source: Fundamentals of Spacecraft Attitude Determination and Control, P.34ff - * Landis Markley and John L. Crassidis*/ - double radiusPolar = 6356752.314; - double radiusEqua = 6378137; + static void cartesianFromLatLongAlt(const T1 lat, const T1 longi, const T1 alt, + T2 *cartesianOutput) { + /* @brief: cartesianFromLatLongAlt() - calculates cartesian coordinates in ECEF from latitude, + * longitude and altitude + * @param: lat geodetic latitude [rad] + * longi longitude [rad] + * alt altitude [m] + * cartesianOutput Cartesian Coordinates in ECEF (3x1) + * @source: Fundamentals of Spacecraft Attitude Determination and Control, P.34ff + * Landis Markley and John L. Crassidis*/ + double radiusPolar = 6356752.314; + double radiusEqua = 6378137; - double eccentricity = sqrt(1 - pow(radiusPolar,2) / pow(radiusEqua,2)); - double auxRadius = radiusEqua / sqrt(1 - pow(eccentricity,2) * pow(sin(lat),2)); + double eccentricity = sqrt(1 - pow(radiusPolar, 2) / pow(radiusEqua, 2)); + double auxRadius = radiusEqua / sqrt(1 - pow(eccentricity, 2) * pow(sin(lat), 2)); - cartesianOutput[0] = (auxRadius + alt) * cos(lat) * cos(longi); - cartesianOutput[1] = (auxRadius + alt) * cos(lat) * sin(longi); - cartesianOutput[2] = ((1 - pow(eccentricity,2)) * auxRadius + alt) * sin(lat); - - } - static void dcmEJ(timeval time, T1 * outputDcmEJ, T1 * outputDotDcmEJ){ - /* @brief: dcmEJ() - calculates the transformation matrix between ECEF and ECI frame - * @param: time Current time - * outputDcmEJ Transformation matrix from ECI (J) to ECEF (E) [3][3] - * outputDotDcmEJ Derivative of transformation matrix [3][3] - * @source: Fundamentals of Spacecraft Attitude Determination and Control, P.32ff - * Landis Markley and John L. Crassidis*/ - double JD2000Floor = 0; - double JD2000 = convertUnixToJD2000(time); - // Getting Julian Century from Day start : JD (Y,M,D,0,0,0) - JD2000Floor = floor(JD2000); - if ( ( JD2000 - JD2000Floor) < 0.5) { - JD2000Floor -= 0.5; - } - else { - JD2000Floor += 0.5; - } + cartesianOutput[0] = (auxRadius + alt) * cos(lat) * cos(longi); + cartesianOutput[1] = (auxRadius + alt) * cos(lat) * sin(longi); + cartesianOutput[2] = ((1 - pow(eccentricity, 2)) * auxRadius + alt) * sin(lat); + } + static void dcmEJ(timeval time, T1 *outputDcmEJ, T1 *outputDotDcmEJ) { + /* @brief: dcmEJ() - calculates the transformation matrix between ECEF and ECI frame + * @param: time Current time + * outputDcmEJ Transformation matrix from ECI (J) to ECEF (E) [3][3] + * outputDotDcmEJ Derivative of transformation matrix [3][3] + * @source: Fundamentals of Spacecraft Attitude Determination and Control, P.32ff + * Landis Markley and John L. Crassidis*/ + double JD2000Floor = 0; + double JD2000 = convertUnixToJD2000(time); + // Getting Julian Century from Day start : JD (Y,M,D,0,0,0) + JD2000Floor = floor(JD2000); + if ((JD2000 - JD2000Floor) < 0.5) { + JD2000Floor -= 0.5; + } else { + JD2000Floor += 0.5; + } double JC2000 = JD2000Floor / 36525; double sec = (JD2000 - JD2000Floor) * 86400; @@ -152,150 +152,152 @@ class MathOperations { outputDcmEJ[7] = 0; outputDcmEJ[8] = 1; - // Derivative of dmcEJ WITHOUT PRECISSION AND NUTATION - double dcmEJCalc[3][3] = {{outputDcmEJ[0], outputDcmEJ[1], outputDcmEJ[2]}, - {outputDcmEJ[3], outputDcmEJ[4], outputDcmEJ[5]}, - {outputDcmEJ[6], outputDcmEJ[7], outputDcmEJ[8]}}; - double dcmDot[3][3] = {{0, 1, 0}, {-1, 0, 0}, {0, 0, 0}}; - double omegaEarth = 0.000072921158553; - double dotDcmEJ[3][3] = {{0,0,0},{0,0,0},{0,0,0}}; - MatrixOperations::multiply(*dcmDot, *dcmEJCalc, *dotDcmEJ, 3, 3, 3); - MatrixOperations::multiplyScalar(*dotDcmEJ, omegaEarth, outputDotDcmEJ, 3, 3); + // Derivative of dmcEJ WITHOUT PRECISSION AND NUTATION + double dcmEJCalc[3][3] = {{outputDcmEJ[0], outputDcmEJ[1], outputDcmEJ[2]}, + {outputDcmEJ[3], outputDcmEJ[4], outputDcmEJ[5]}, + {outputDcmEJ[6], outputDcmEJ[7], outputDcmEJ[8]}}; + double dcmDot[3][3] = {{0, 1, 0}, {-1, 0, 0}, {0, 0, 0}}; + double omegaEarth = 0.000072921158553; + double dotDcmEJ[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + MatrixOperations::multiply(*dcmDot, *dcmEJCalc, *dotDcmEJ, 3, 3, 3); + MatrixOperations::multiplyScalar(*dotDcmEJ, omegaEarth, outputDotDcmEJ, 3, 3); } + /* @brief: ecfToEciWithNutPre() - calculates the transformation matrix between ECEF and ECI frame + * give also the back the derivative of this matrix + * @param: unixTime Current time in Unix format + * outputDcmEJ Transformation matrix from ECI (J) to ECEF (E) [3][3] + * outputDotDcmEJ Derivative of transformation matrix [3][3] + * @source: Entwicklung einer Simulationsumgebung und robuster Algorithmen für das Lage- und + Orbitkontrollsystem der Kleinsatelliten Flying Laptop und PERSEUS, P.244ff + * Oliver Zeile + * + https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_Studenten/Marquardt_Robin&openfile=896110*/ + static void ecfToEciWithNutPre(timeval unixTime, T1 *outputDcmEJ, T1 *outputDotDcmEJ) { + // TT = UTC/Unix + 32.184s (TAI Difference) + 27 (Leap Seconds in UTC since 1972) + 10 + //(initial Offset) International Atomic Time (TAI) - /* @brief: ecfToEciWithNutPre() - calculates the transformation matrix between ECEF and ECI frame - * give also the back the derivative of this matrix - * @param: unixTime Current time in Unix format - * outputDcmEJ Transformation matrix from ECI (J) to ECEF (E) [3][3] - * outputDotDcmEJ Derivative of transformation matrix [3][3] - * @source: Entwicklung einer Simulationsumgebung und robuster Algorithmen für das Lage- und - Orbitkontrollsystem der Kleinsatelliten Flying Laptop und PERSEUS, P.244ff - * Oliver Zeile - * https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_Studenten/Marquardt_Robin&openfile=896110*/ - static void ecfToEciWithNutPre(timeval unixTime, T1 * outputDcmEJ, T1 * outputDotDcmEJ ) { + double JD2000UTC1 = convertUnixToJD2000(unixTime); -// TT = UTC/Unix + 32.184s (TAI Difference) + 27 (Leap Seconds in UTC since 1972) + 10 (initial Offset) -// International Atomic Time (TAI) + // Julian Date / century from TT + timeval terestrialTime = unixTime; + terestrialTime.tv_sec = unixTime.tv_sec + 32.184 + 37; + double JD2000TT = convertUnixToJD2000(terestrialTime); + double JC2000TT = JD2000TT / 36525; - double JD2000UTC1 = convertUnixToJD2000(unixTime); + //------------------------------------------------------------------------------------- + // Calculation of Transformation from earth rotation Theta + //------------------------------------------------------------------------------------- + double theta[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + // Earth Rotation angle + double era = 0; + era = 2 * PI * (0.779057273264 + 1.00273781191135448 * JD2000UTC1); + // Greenwich Mean Sidereal Time + double gmst2000 = 0.014506 + 4612.15739966 * JC2000TT + 1.39667721 * pow(JC2000TT, 2) - + 0.00009344 * pow(JC2000TT, 3) + 0.00001882 * pow(JC2000TT, 4); + double arcsecFactor = 1 * PI / (180 * 3600); + gmst2000 *= arcsecFactor; + gmst2000 += era; -// Julian Date / century from TT - timeval terestrialTime = unixTime; - terestrialTime.tv_sec = unixTime.tv_sec + 32.184 + 37; - double JD2000TT = convertUnixToJD2000(terestrialTime); - double JC2000TT = JD2000TT / 36525; + theta[0][0] = cos(gmst2000); + theta[0][1] = sin(gmst2000); + theta[0][2] = 0; + theta[1][0] = -sin(gmst2000); + theta[1][1] = cos(gmst2000); + theta[1][2] = 0; + theta[2][0] = 0; + theta[2][1] = 0; + theta[2][2] = 1; -//------------------------------------------------------------------------------------- -// Calculation of Transformation from earth rotation Theta -//------------------------------------------------------------------------------------- - double theta[3][3] = {{0,0,0},{0,0,0},{0,0,0}}; -// Earth Rotation angle - double era = 0; - era = 2* PI *(0.779057273264 + 1.00273781191135448 * JD2000UTC1); -// Greenwich Mean Sidereal Time - double gmst2000 = 0.014506 + 4612.15739966 * JC2000TT + 1.39667721 * pow(JC2000TT,2) - - 0.00009344 * pow(JC2000TT,3) + 0.00001882 * pow(JC2000TT,4); - double arcsecFactor = 1 * PI / (180 * 3600); - gmst2000 *= arcsecFactor; - gmst2000 += era; + //------------------------------------------------------------------------------------- + // Calculation of Transformation from earth Precession P + //------------------------------------------------------------------------------------- + double precession[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; - theta[0][0] = cos(gmst2000); - theta[0][1] = sin(gmst2000); - theta[0][2] = 0; - theta[1][0] = -sin(gmst2000); - theta[1][1] = cos(gmst2000); - theta[1][2] = 0; - theta[2][0] = 0; - theta[2][1] = 0; - theta[2][2] = 1; + double zeta = 2306.2181 * JC2000TT + 0.30188 * pow(JC2000TT, 2) + 0.017998 * pow(JC2000TT, 3); + double theta2 = 2004.3109 * JC2000TT - 0.42665 * pow(JC2000TT, 2) - 0.041833 * pow(JC2000TT, 3); + double ze = zeta + 0.79280 * pow(JC2000TT, 2) + 0.000205 * pow(JC2000TT, 3); -//------------------------------------------------------------------------------------- -// Calculation of Transformation from earth Precession P -//------------------------------------------------------------------------------------- - double precession[3][3] = {{0,0,0},{0,0,0},{0,0,0}}; + zeta *= arcsecFactor; + theta2 *= arcsecFactor; + ze *= arcsecFactor; - double zeta = 2306.2181 * JC2000TT + 0.30188 * pow(JC2000TT,2) + 0.017998 * pow(JC2000TT,3); - double theta2 = 2004.3109 * JC2000TT - 0.42665 * pow(JC2000TT,2) - 0.041833 * pow(JC2000TT,3); - double ze = zeta + 0.79280 * pow(JC2000TT,2) + 0.000205 * pow(JC2000TT,3); + precession[0][0] = -sin(ze) * sin(zeta) + cos(ze) * cos(theta2) * cos(zeta); + precession[1][0] = cos(ze) * sin(zeta) + sin(ze) * cos(theta2) * cos(zeta); + precession[2][0] = sin(theta2) * cos(zeta); + precession[0][1] = -sin(ze) * cos(zeta) - cos(ze) * cos(theta2) * sin(zeta); + precession[1][1] = cos(ze) * cos(zeta) - sin(ze) * cos(theta2) * sin(zeta); + precession[2][1] = -sin(theta2) * sin(zeta); + precession[0][2] = -cos(ze) * sin(theta2); + precession[1][2] = -sin(ze) * sin(theta2); + precession[2][2] = cos(theta2); - zeta *= arcsecFactor; - theta2 *= arcsecFactor; - ze *= arcsecFactor; + //------------------------------------------------------------------------------------- + // Calculation of Transformation from earth Nutation N + //------------------------------------------------------------------------------------- + double nutation[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + // lunar asc node + double Om = 125 * 3600 + 2 * 60 + 40.28 - (1934 * 3600 + 8 * 60 + 10.539) * JC2000TT + + 7.455 * pow(JC2000TT, 2) + 0.008 * pow(JC2000TT, 3); + Om *= arcsecFactor; + // delta psi approx + double dp = -17.2 * arcsecFactor * sin(Om); - precession[0][0]=-sin(ze)*sin(zeta)+cos(ze)*cos(theta2)*cos(zeta); - precession[1][0]=cos(ze)*sin(zeta)+sin(ze)*cos(theta2)*cos(zeta); - precession[2][0]=sin(theta2)*cos(zeta); - precession[0][1]=-sin(ze)*cos(zeta)-cos(ze)*cos(theta2)*sin(zeta); - precession[1][1]=cos(ze)*cos(zeta)-sin(ze)*cos(theta2)*sin(zeta); - precession[2][1]=-sin(theta2)*sin(zeta); - precession[0][2]=-cos(ze)*sin(theta2); - precession[1][2]=-sin(ze)*sin(theta2); - precession[2][2]=cos(theta2); + // delta eps approx + double de = 9.203 * arcsecFactor * cos(Om); -//------------------------------------------------------------------------------------- -// Calculation of Transformation from earth Nutation N -//------------------------------------------------------------------------------------- - double nutation[3][3] = {{0,0,0},{0,0,0},{0,0,0}}; -// lunar asc node - double Om = 125 * 3600 + 2 * 60 + 40.28 - (1934 * 3600 + 8 * 60 + 10.539) * JC2000TT + - 7.455 * pow(JC2000TT,2) + 0.008 * pow(JC2000TT,3); - Om *= arcsecFactor; -// delta psi approx - double dp = -17.2 * arcsecFactor *sin(Om); + // % true obliquity of the ecliptic eps p.71 (simplified) + double e = 23.43929111 * PI / 180 - 46.8150 / 3600 * JC2000TT * PI / 180; -// delta eps approx - double de = 9.203 * arcsecFactor *cos(Om); + nutation[0][0] = cos(dp); + nutation[1][0] = cos(e + de) * sin(dp); + nutation[2][0] = sin(e + de) * sin(dp); + nutation[0][1] = -cos(e) * sin(dp); + nutation[1][1] = cos(e) * cos(e + de) * cos(dp) + sin(e) * sin(e + de); + nutation[2][1] = cos(e) * sin(e + de) * cos(dp) - sin(e) * cos(e + de); + nutation[0][2] = -sin(e) * sin(dp); + nutation[1][2] = sin(e) * cos(e + de) * cos(dp) - cos(e) * sin(e + de); + nutation[2][2] = sin(e) * sin(e + de) * cos(dp) + cos(e) * cos(e + de); -// % true obliquity of the ecliptic eps p.71 (simplified) - double e = 23.43929111 * PI / 180 - 46.8150 / 3600 * JC2000TT * PI / 180; + //------------------------------------------------------------------------------------- + // Calculation of Derivative of rotation matrix from earth + //------------------------------------------------------------------------------------- + double thetaDot[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + double dotMatrix[3][3] = {{0, 1, 0}, {-1, 0, 0}, {0, 0, 0}}; + double omegaEarth = 0.000072921158553; + MatrixOperations::multiply(*dotMatrix, *theta, *thetaDot, 3, 3, 3); + MatrixOperations::multiplyScalar(*thetaDot, omegaEarth, *thetaDot, 3, 3); - nutation[0][0]=cos(dp); - nutation[1][0]=cos(e+de)*sin(dp); - nutation[2][0]=sin(e+de)*sin(dp); - nutation[0][1]=-cos(e)*sin(dp); - nutation[1][1]=cos(e)*cos(e+de)*cos(dp)+sin(e)*sin(e+de); - nutation[2][1]=cos(e)*sin(e+de)*cos(dp)-sin(e)*cos(e+de); - nutation[0][2]=-sin(e)*sin(dp); - nutation[1][2]=sin(e)*cos(e+de)*cos(dp)-cos(e)*sin(e+de); - nutation[2][2]=sin(e)*sin(e+de)*cos(dp)+cos(e)*cos(e+de); + //------------------------------------------------------------------------------------- + // Calculation of transformation matrix and Derivative of transformation matrix + //------------------------------------------------------------------------------------- + double nutationPrecession[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + MatrixOperations::multiply(*nutation, *precession, *nutationPrecession, 3, 3, 3); + MatrixOperations::multiply(*nutationPrecession, *theta, outputDcmEJ, 3, 3, 3); -//------------------------------------------------------------------------------------- -// Calculation of Derivative of rotation matrix from earth -//------------------------------------------------------------------------------------- - double thetaDot[3][3] = {{0,0,0},{0,0,0},{0,0,0}}; - double dotMatrix[3][3] = {{0,1,0},{-1,0,0},{0,0,0}}; - double omegaEarth = 0.000072921158553; - MatrixOperations::multiply(*dotMatrix, *theta, *thetaDot, 3, 3, 3); - MatrixOperations::multiplyScalar(*thetaDot, omegaEarth, *thetaDot, 3, 3); + MatrixOperations::multiply(*nutationPrecession, *thetaDot, outputDotDcmEJ, 3, 3, 3); + } + static void inverseMatrixDimThree(const T1 *matrix, T1 *output) { + int i, j; + double determinant; + double mat[3][3] = {{matrix[0], matrix[1], matrix[2]}, + {matrix[3], matrix[4], matrix[5]}, + {matrix[6], matrix[7], matrix[8]}}; -//------------------------------------------------------------------------------------- -// Calculation of transformation matrix and Derivative of transformation matrix -//------------------------------------------------------------------------------------- - double nutationPrecession[3][3] = {{0,0,0},{0,0,0},{0,0,0}}; - MatrixOperations::multiply(*nutation, *precession, *nutationPrecession, 3, 3, 3); - MatrixOperations::multiply(*nutationPrecession, *theta, outputDcmEJ, 3, 3, 3); - - MatrixOperations::multiply(*nutationPrecession, *thetaDot, outputDotDcmEJ, 3, 3, 3); - - } - static void inverseMatrixDimThree(const T1 *matrix, T1 * output){ - int i,j; - double determinant; - double mat[3][3] = {{matrix[0], matrix[1], matrix[2]},{matrix[3], matrix[4], matrix[5]}, - {matrix[6], matrix[7], matrix[8]}}; - - for(i = 0; i < 3; i++) { - determinant = determinant + (mat[0][i] * (mat[1][(i+1)%3] * mat[2][(i+2)%3] - mat[1][(i+2)%3] * mat[2][(i+1)%3])); - } -// cout<<"\n\ndeterminant: "< Date: Tue, 13 Dec 2022 12:08:53 +0100 Subject: [PATCH 050/330] changes thermal controller --- fsfw | 2 +- mission/controller/ThermalController.cpp | 127 ++++++++++++++++++----- mission/controller/ThermalController.h | 29 +++++- tmtc | 2 +- 4 files changed, 131 insertions(+), 29 deletions(-) diff --git a/fsfw b/fsfw index 05cad893..5b0ea912 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 05cad893a2b713827cf4cdc9afe49675f18afcc7 +Subproject commit 5b0ea91222a6b8efb2f4562cfecbcb735dfeedd5 diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index a8c378df..008a8077 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -105,7 +105,7 @@ void ThermalController::performControlOperation() { } // TODO: Heater control - ctrl4KCamera(); + ctrlCameraBody(); } ReturnValue_t ThermalController::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, @@ -953,36 +953,111 @@ void ThermalController::copyDevices() { } } -void ThermalController::ctrl4KCamera() { - // 4K Camera - float cameraTemp; +void ThermalController::ctrlMgt() { + float sensorTemp; + float opLowerLimit = mgtLimits.opLowerLimit; + float cutOffLimit = mgtLimits.cutOffLimit; + heater::Switchers switchNr = heater::HEATER_2_ACS_BRD; + heater::Switchers redSwitchNr = heater::HEATER_3_PCDU_PDU; bool cameraTempAvailable = true; + bool heaterAvailable = true; + bool redSwitchNrInUse = false; - if (sensorTemperatures.sensor_4k_camera.isValid()) { - cameraTemp = sensorTemperatures.sensor_4k_camera.value; - } else if (sensorTemperatures.sensor_dro.isValid()) { - cameraTemp = sensorTemperatures.sensor_dro.value; - } else if (sensorTemperatures.sensor_mpa.isValid()) { - cameraTemp = sensorTemperatures.sensor_mpa.value; - } else { - if (heaterHandler.checkSwitchState(heater::HEATER_4_CAMERA)) { - heaterHandler.switchHeater(heater::HEATER_4_CAMERA, HeaterHandler::SwitchState::OFF); + // Choose Heater + chooseHeater(switchNr, redSwitchNr, redSwitchNrInUse, heaterAvailable); + + if (heaterAvailable) { + // Choose sensor + if (sensorTemperatures.sensor_magnettorquer.isValid()) { + sensorTemp = sensorTemperatures.sensor_magnettorquer.value; + } else if (sensorTemperatures.sensor_magnettorquer.isValid()) { // TODO: int sensor + sensorTemp = sensorTemperatures.sensor_magnettorquer.value; + } else if (sensorTemperatures.sensor_plpcdu_heatspreader.isValid()) { + sensorTemp = sensorTemperatures.sensor_plpcdu_heatspreader.value; + } else { + if (heaterHandler.checkSwitchState(switchNr)) { + heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); + } + triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); + cameraTempAvailable = false; } - triggerEvent(NO_VALID_SENSOR_TEMPERATURE, heater::HEATER_4_CAMERA); - cameraTempAvailable = false; - } - // TODO: include redundant heater - if (cameraTempAvailable) { - if (not heaterHandler.checkSwitchState(heater::HEATER_4_CAMERA)) { - // TODO: check if op or nop - if (cameraTemp < cameraLimits.opLowerLimit) { - heaterHandler.switchHeater(heater::HEATER_4_CAMERA, HeaterHandler::SwitchState::ON); - } else if (heaterHandler.checkSwitchState(heater::HEATER_4_CAMERA)) { - if (cameraTemp >= cameraLimits.opLowerLimit + TEMP_OFFSET) { - heaterHandler.switchHeater(heater::HEATER_4_CAMERA, HeaterHandler::SwitchState::OFF); - } + // Thermal Control + if (cameraTempAvailable) { + ctrlHeater(switchNr, redSwitchNr, redSwitchNrInUse, sensorTemp, opLowerLimit, cutOffLimit); + } + } +} +void ThermalController::ctrlCameraBody() { + // Camera Body + float sensorTemp; + float opLowerLimit = cameraLimits.opLowerLimit; + float cutOffLimit = cameraLimits.cutOffLimit; + heater::Switchers switchNr = heater::HEATER_4_CAMERA; + heater::Switchers redSwitchNr = heater::HEATER_6_DRO; + bool cameraTempAvailable = true; + bool heaterAvailable = true; + bool redSwitchNrInUse = false; + + // Choose Heater + chooseHeater(switchNr, redSwitchNr, redSwitchNrInUse, heaterAvailable); + + if (heaterAvailable) { + // Choose sensor + if (sensorTemperatures.sensor_4k_camera.isValid()) { + sensorTemp = sensorTemperatures.sensor_4k_camera.value; + } else if (sensorTemperatures.sensor_dro.isValid()) { + sensorTemp = sensorTemperatures.sensor_dro.value; + } else if (sensorTemperatures.sensor_mpa.isValid()) { + sensorTemp = sensorTemperatures.sensor_mpa.value; + } else { + if (heaterHandler.checkSwitchState(switchNr)) { + heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); + } + triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); + cameraTempAvailable = false; + } + + // Thermal Control + if (cameraTempAvailable) { + ctrlHeater(switchNr, redSwitchNr, redSwitchNrInUse, sensorTemp, opLowerLimit, cutOffLimit); + } + } +} + +void ThermalController::ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, + bool redSwitchNrInUse, float sensorTemp, float opLowerLimit, + float cutOffLimit) { + // Heater off + if (not heaterHandler.checkSwitchState(switchNr)) { + // TODO: check if OP or NOP + if (sensorTemp < opLowerLimit) { + heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::ON); + } + // Heater on + } else if (heaterHandler.checkSwitchState(switchNr)) { + if (sensorTemp >= opLowerLimit + TEMP_OFFSET) { + heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); + } + } else if (not redSwitchNrInUse) { + if (heaterHandler.checkSwitchState(redSwitchNr)) { + if (sensorTemp >= cutOffLimit) { + heaterHandler.switchHeater(redSwitchNr, HeaterHandler::SwitchState::OFF); } } } +} + +void ThermalController::chooseHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, + bool& redSwitchNrInUse, bool& heaterAvailable) { + // Choose Heater + if (heaterHandler.getHealth(switchNr) != HasHealthIF::HEALTHY) { + if (heaterHandler.getHealth(redSwitchNr) == HasHealthIF::HEALTHY) { + switchNr = redSwitchNr; + redSwitchNrInUse = true; + } else { + heaterAvailable = false; + // TODO: triggerEvent ? + } + } } \ No newline at end of file diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index a6d6a3b3..4fe61e8c 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -148,7 +148,34 @@ class ThermalController : public ExtendedControllerBase { void copySus(); void copyDevices(); - void ctrl4KCamera(); + void ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, bool redSwitchNrInUse, + float sensorTemp, float opLowerLimit, float cutOffLimit); + void chooseHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, + bool& redSwitchNrInUse, bool& heaterAvailable); + + void ctrlAcsBoard(); + void ctrlMgt(); + void ctrlRw(); + void ctrlStr(); + void ctrlIfBoard(); + void ctrlTcsBoard(); + void ctrlObc(); + void ctrlObcIfBoard(); + void ctrlSBandTransceiver(); + void ctrlPcduP60Board(); + void ctrlPcduAcu(); + void ctrlPcduPdu(); + void ctrlPlPcduBoard(); + void ctrlPlocMissionBoard(); + void ctrlPlocProcessingBoard(); + void ctrlDac(); + void ctrlCameraBody(); + void ctrlDro(); + void ctrlX8(); + void ctrlHpa(); + void ctrlTx(); + void ctrlMpa(); + void ctrlScexBoard(); }; #endif /* MISSION_CONTROLLER_THERMALCONTROLLER_H_ */ diff --git a/tmtc b/tmtc index 30cf4736..56d0f26c 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 30cf47365fec68a4b78395de03ecb2ae95af4e7e +Subproject commit 56d0f26cbffbfbf4e790d3a19858162291104934 From b80ecfb60062d333e501f9c2192870e09877dc76 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Wed, 14 Dec 2022 10:03:57 +0100 Subject: [PATCH 051/330] removed comments --- mission/controller/acs/AcsParameters.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index 88c4ddb0..8bd10091 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -876,11 +876,11 @@ class AcsParameters /*: public HasParametersIF*/ { struct SunModelParameters { float domega = 36000.771; - float omega_0 = 280.46 * M_PI / 180.; // 282.94 * M_PI / 180.; // RAAN plus argument of + float omega_0 = 280.46 * M_PI / 180.; // RAAN plus argument of // perigee - float m_0 = 357.5277; // 357.5256; // coefficients for mean anomaly - float dm = 35999.049; // coefficients for mean anomaly - float e = 23.4392911 * M_PI / 180.; // angle of earth's rotation axis + float m_0 = 357.5277; // coefficients for mean anomaly + float dm = 35999.049; // coefficients for mean anomaly + float e = 23.4392911 * M_PI / 180.; // angle of earth's rotation axis float e1 = 0.74508 * M_PI / 180.; float p1 = 6892. / 3600. * M_PI / 180.; // some parameter From d5677c20f7a7c437af84932afbaf4c2ba3f589b7 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Wed, 14 Dec 2022 10:04:37 +0100 Subject: [PATCH 052/330] fixed gps velocity merge aftermath --- mission/controller/acs/SensorProcessing.cpp | 39 ++++++++++----------- mission/controller/acs/SensorProcessing.h | 5 +-- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/mission/controller/acs/SensorProcessing.cpp b/mission/controller/acs/SensorProcessing.cpp index 5ce2cb77..5b4267e7 100644 --- a/mission/controller/acs/SensorProcessing.cpp +++ b/mission/controller/acs/SensorProcessing.cpp @@ -559,29 +559,35 @@ void SensorProcessing::processGyr( } void SensorProcessing::processGps(const double gpsLatitude, const double gpsLongitude, + const double gpsAltitude, const double gpsUnixSeconds, const bool validGps, + const AcsParameters::GpsParameters *gpsParameters, acsctrl::GpsDataProcessed *gpsDataProcessed) { // name to convert not process double gdLongitude, gcLatitude; if (validGps) { // Transforming from Degree to Radians and calculation geocentric lattitude from geodetic - gdLongitude = gpsLongitude * PI / 180; - double latitudeRad = gpsLatitude * PI / 180; + gdLongitude = gpsLongitude * PI / 180.; + double latitudeRad = gpsLatitude * PI / 180.; double eccentricityWgs84 = 0.0818195; double factor = 1 - pow(eccentricityWgs84, 2); gcLatitude = atan(factor * tan(latitudeRad)); // Calculation of the satellite velocity in earth fixed frame - double posSatE[3] = {0, 0, 0}, deltaDistance[3] = {0, 0, 0}; - // RADIANS OR DEGREE ? Function needs rad as input - MathOperations::cartesianFromLatLongAlt(gps0latitude, gps0longitude, gps0altitude, - posSatE); + double posSatE[3] = {0, 0, 0}, deltaDistance[3] = {0, 0, 0}, gpsVelocityE[3] = {0, 0, 0}; + MathOperations::cartesianFromLatLongAlt(latitudeRad, gdLongitude, gpsAltitude, posSatE); if (validSavedPosSatE && - (gps0UnixSeconds - timeOfSavedPosSatE) < (gpsParameters->timeDiffVelocityMax)) { + (gpsUnixSeconds - timeOfSavedPosSatE) < (gpsParameters->timeDiffVelocityMax)) { VectorOperations::subtract(posSatE, savedPosSatE, deltaDistance, 3); - double timeDiffGpsMeas = gps0UnixSeconds - timeOfSavedPosSatE; - VectorOperations::mulScalar(deltaDistance, 1 / timeDiffGpsMeas, gpsVelocityE, 3); + double timeDiffGpsMeas = gpsUnixSeconds - timeOfSavedPosSatE; + VectorOperations::mulScalar(deltaDistance, 1. / timeDiffGpsMeas, gpsVelocityE, 3); } + savedPosSatE[0] = posSatE[0]; + savedPosSatE[1] = posSatE[1]; + savedPosSatE[2] = posSatE[2]; + + timeOfSavedPosSatE = gpsUnixSeconds; + validSavedPosSatE = true; } { PoolReadGuard pg(gpsDataProcessed); @@ -594,15 +600,6 @@ void SensorProcessing::processGps(const double gpsLatitude, const double gpsLong gpsDataProcessed->gcLatitude.value = 0.0; } } - savedPosSatE[0] = posSatE[0]; - savedPosSatE[1] = posSatE[1]; - savedPosSatE[2] = posSatE[2]; - - timeOfSavedPosSatE = gps0UnixSeconds; - validSavedPosSatE = true; - } - else { - validGcLatitude = false; } } @@ -614,9 +611,11 @@ void SensorProcessing::process(timeval now, ACS::SensorValues *sensorValues, const AcsParameters *acsParameters) { sensorValues->update(); processGps(sensorValues->gpsSet.latitude.value, sensorValues->gpsSet.longitude.value, + sensorValues->gpsSet.altitude.value, sensorValues->gpsSet.unixSeconds.value, (sensorValues->gpsSet.latitude.isValid() && sensorValues->gpsSet.longitude.isValid() && - sensorValues->gpsSet.altitude.isValid()), - gpsDataProcessed); + sensorValues->gpsSet.altitude.isValid() && sensorValues->gpsSet.altitude.isValid() && + sensorValues->gpsSet.unixSeconds.isValid()), + &acsParameters->gpsParameters, gpsDataProcessed); processMgm(sensorValues->mgm0Lis3Set.fieldStrengths.value, sensorValues->mgm0Lis3Set.fieldStrengths.isValid(), diff --git a/mission/controller/acs/SensorProcessing.h b/mission/controller/acs/SensorProcessing.h index a3a8c5fb..77205669 100644 --- a/mission/controller/acs/SensorProcessing.h +++ b/mission/controller/acs/SensorProcessing.h @@ -65,7 +65,9 @@ class SensorProcessing { void processStr(); - void processGps(const double gps0latitude, const double gps0longitude, const bool validGps, + void processGps(const double gpsLatitude, const double gpsLongitude, const double gpsAltitude, + const double gpsUnixSeconds, const bool validGps, + const AcsParameters::GpsParameters *gpsParameters, acsctrl::GpsDataProcessed *gpsDataProcessed); double savedMgmVecTot[3]; @@ -73,7 +75,6 @@ class SensorProcessing { double savedSusVecTot[3]; timeval timeOfSavedSusDirEst; bool validMagField; - bool validGcLatitude; double savedPosSatE[3]; uint32_t timeOfSavedPosSatE; From 12a367f65f61ea1bc2374a93e9b699ac9e89061f Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Wed, 14 Dec 2022 10:13:28 +0100 Subject: [PATCH 053/330] fixed detumble merge aftermath --- mission/controller/acs/control/Detumble.cpp | 23 +++++++++------------ mission/controller/acs/control/Detumble.h | 2 +- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/mission/controller/acs/control/Detumble.cpp b/mission/controller/acs/control/Detumble.cpp index 1b0b674c..9053fc01 100644 --- a/mission/controller/acs/control/Detumble.cpp +++ b/mission/controller/acs/control/Detumble.cpp @@ -22,22 +22,19 @@ Detumble::Detumble(AcsParameters *acsParameters_) { loadAcsParameters(acsParamet Detumble::~Detumble() {} void Detumble::loadAcsParameters(AcsParameters *acsParameters_) { - detumbleCtrlParameters = &(acsParameters_->detumbleCtrlParameters); + detumbleParameter = &(acsParameters_->detumbleParameter); magnetorquesParameter = &(acsParameters_->magnetorquesParameter); } -ReturnValue_t Detumble::bDotLaw(const double *magRate, const bool *magRateValid, - const double *magField, const bool *magFieldValid, - double *magMom) { - - if (!magRateValid || !magFieldValid) { - return DETUMBLE_NO_SENSORDATA; - } - double gain = detumbleParameter->gainD; - double factor = -gain / pow(VectorOperations::norm(magField,3),2); - VectorOperations::mulScalar(magRate, factor, magMom, 3); - return returnvalue::OK; - +ReturnValue_t Detumble::bDotLaw(const double *magRate, const bool magRateValid, + const double *magField, const bool magFieldValid, double *magMom) { + if (!magRateValid || !magFieldValid) { + return DETUMBLE_NO_SENSORDATA; + } + double gain = detumbleParameter->gainD; + double factor = -gain / pow(VectorOperations::norm(magField, 3), 2); + VectorOperations::mulScalar(magRate, factor, magMom, 3); + return returnvalue::OK; } ReturnValue_t Detumble::bangbangLaw(const double *magRate, const bool magRateValid, diff --git a/mission/controller/acs/control/Detumble.h b/mission/controller/acs/control/Detumble.h index 16bf82bc..6a3e6eaa 100644 --- a/mission/controller/acs/control/Detumble.h +++ b/mission/controller/acs/control/Detumble.h @@ -25,7 +25,7 @@ class Detumble { static const uint8_t INTERFACE_ID = CLASS_ID::DETUMBLE; static const ReturnValue_t DETUMBLE_NO_SENSORDATA = MAKE_RETURN_CODE(0x01); - /* @brief: Load AcsParameters für this class + /* @brief: Load AcsParameters for this class * @param: acsParameters_ Pointer to object which defines the ACS configuration parameters */ void loadAcsParameters(AcsParameters *acsParameters_); From b6c5796121b61881dc473ac90ad70bd492860189 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Wed, 14 Dec 2022 10:31:20 +0100 Subject: [PATCH 054/330] fixed init for SensorProcessing and type of timeDiff --- mission/controller/acs/SensorProcessing.cpp | 3 +-- mission/controller/acs/SensorProcessing.h | 12 ++++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/mission/controller/acs/SensorProcessing.cpp b/mission/controller/acs/SensorProcessing.cpp index 5b4267e7..f5d2568b 100644 --- a/mission/controller/acs/SensorProcessing.cpp +++ b/mission/controller/acs/SensorProcessing.cpp @@ -21,8 +21,7 @@ using namespace Math; -SensorProcessing::SensorProcessing(AcsParameters *acsParameters_) - : savedMgmVecTot{0, 0, 0}, validMagField(false), validGcLatitude(false) {} +SensorProcessing::SensorProcessing(AcsParameters *acsParameters_) {} SensorProcessing::~SensorProcessing() {} diff --git a/mission/controller/acs/SensorProcessing.h b/mission/controller/acs/SensorProcessing.h index 77205669..1a094dab 100644 --- a/mission/controller/acs/SensorProcessing.h +++ b/mission/controller/acs/SensorProcessing.h @@ -70,15 +70,15 @@ class SensorProcessing { const AcsParameters::GpsParameters *gpsParameters, acsctrl::GpsDataProcessed *gpsDataProcessed); - double savedMgmVecTot[3]; + double savedMgmVecTot[3] = {0.0, 0.0, 0.0}; timeval timeOfSavedMagFieldEst; - double savedSusVecTot[3]; + double savedSusVecTot[3] = {0.0, 0.0, 0.0}; timeval timeOfSavedSusDirEst; - bool validMagField; + bool validMagField = false; - double savedPosSatE[3]; - uint32_t timeOfSavedPosSatE; - bool validSavedPosSatE; + double savedPosSatE[3] = {0.0, 0.0, 0.0}; + double timeOfSavedPosSatE = 0.0; + bool validSavedPosSatE = false; const float zeroVector[3] = {0.0, 0.0, 0.0}; SusConverter susConverter; From c97d319b2a2619361dbb1c4c071d0a755b87af57 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Wed, 14 Dec 2022 10:39:41 +0100 Subject: [PATCH 055/330] added gpsVelocity to gpsProcessed dataSet --- mission/controller/AcsController.cpp | 1 + mission/controller/AcsController.h | 1 + mission/controller/controllerdefinitions/AcsCtrlDefinitions.h | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 9e400e75..7d1ebc60 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -393,6 +393,7 @@ ReturnValue_t AcsController::initializeLocalDataPool(localpool::DataPool &localD // GPS Processed localDataPoolMap.emplace(acsctrl::PoolIds::GC_LATITUDE, &gcLatitude); localDataPoolMap.emplace(acsctrl::PoolIds::GD_LONGITUDE, &gdLongitude); + localDataPoolMap.emplace(acsctrl::PoolIds::GPS_VELOCITY, &gpsVelocity); poolManager.subscribeForRegularPeriodicPacket({gpsDataProcessed.getSid(), false, 5.0}); // MEKF localDataPoolMap.emplace(acsctrl::PoolIds::QUAT_MEKF, &quatMekf); diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index 844d85d3..ec1749b3 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -144,6 +144,7 @@ class AcsController : public ExtendedControllerBase { acsctrl::GpsDataProcessed gpsDataProcessed; PoolEntry gcLatitude = PoolEntry(); PoolEntry gdLongitude = PoolEntry(); + PoolEntry gpsVelocity = PoolEntry(3); // MEKF acsctrl::MekfData mekfData; diff --git a/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h b/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h index 2652ca3c..ab5ed8da 100644 --- a/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h +++ b/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h @@ -86,6 +86,7 @@ enum PoolIds : lp_id_t { // GPS Processed GC_LATITUDE, GD_LONGITUDE, + GPS_VELOCITY, // MEKF SAT_ROT_RATE_MEKF, QUAT_MEKF, @@ -105,7 +106,7 @@ static constexpr uint8_t SUS_SET_RAW_ENTRIES = 12; static constexpr uint8_t SUS_SET_PROCESSED_ENTRIES = 15; static constexpr uint8_t GYR_SET_RAW_ENTRIES = 4; static constexpr uint8_t GYR_SET_PROCESSED_ENTRIES = 5; -static constexpr uint8_t GPS_SET_PROCESSED_ENTRIES = 2; +static constexpr uint8_t GPS_SET_PROCESSED_ENTRIES = 3; static constexpr uint8_t MEKF_SET_ENTRIES = 2; static constexpr uint8_t CTRL_VAL_SET_ENTRIES = 3; static constexpr uint8_t ACT_CMD_SET_ENTRIES = 3; @@ -224,6 +225,7 @@ class GpsDataProcessed : public StaticLocalDataSet { lp_var_t gcLatitude = lp_var_t(sid.objectId, GC_LATITUDE, this); lp_var_t gdLongitude = lp_var_t(sid.objectId, GD_LONGITUDE, this); + lp_vec_t gpsVelocity = lp_vec_t(sid.objectId, GPS_VELOCITY, this); private: }; From 8a9ed28845d3854643432846b477f20f4c1052c1 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Wed, 14 Dec 2022 11:24:03 +0100 Subject: [PATCH 056/330] changes thermal control --- mission/controller/ThermalController.cpp | 93 +++++++++++------------- mission/controller/ThermalController.h | 15 +++- 2 files changed, 54 insertions(+), 54 deletions(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 008a8077..9b68d085 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -954,80 +954,49 @@ void ThermalController::copyDevices() { } void ThermalController::ctrlMgt() { - float sensorTemp; float opLowerLimit = mgtLimits.opLowerLimit; float cutOffLimit = mgtLimits.cutOffLimit; heater::Switchers switchNr = heater::HEATER_2_ACS_BRD; heater::Switchers redSwitchNr = heater::HEATER_3_PCDU_PDU; - bool cameraTempAvailable = true; - bool heaterAvailable = true; - bool redSwitchNrInUse = false; - // Choose Heater - chooseHeater(switchNr, redSwitchNr, redSwitchNrInUse, heaterAvailable); + chooseHeater(switchNr, redSwitchNr); if (heaterAvailable) { - // Choose sensor - if (sensorTemperatures.sensor_magnettorquer.isValid()) { - sensorTemp = sensorTemperatures.sensor_magnettorquer.value; - } else if (sensorTemperatures.sensor_magnettorquer.isValid()) { // TODO: int sensor - sensorTemp = sensorTemperatures.sensor_magnettorquer.value; - } else if (sensorTemperatures.sensor_plpcdu_heatspreader.isValid()) { - sensorTemp = sensorTemperatures.sensor_plpcdu_heatspreader.value; - } else { - if (heaterHandler.checkSwitchState(switchNr)) { - heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); - } - triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); - cameraTempAvailable = false; - } + chooseSensor(switchNr, sensorTemperatures.sensor_magnettorquer.value, + sensorTemperatures.sensor_magnettorquer.value, + sensorTemperatures.sensor_plpcdu_heatspreader.value, + sensorTemperatures.sensor_magnettorquer.isValid(), + sensorTemperatures.sensor_magnettorquer.isValid(), + sensorTemperatures.sensor_plpcdu_heatspreader.isValid()); // TODO: int sensor - // Thermal Control - if (cameraTempAvailable) { - ctrlHeater(switchNr, redSwitchNr, redSwitchNrInUse, sensorTemp, opLowerLimit, cutOffLimit); + if (sensorTempAvailable) { + ctrlHeater(switchNr, redSwitchNr, opLowerLimit, cutOffLimit); } } } void ThermalController::ctrlCameraBody() { // Camera Body - float sensorTemp; float opLowerLimit = cameraLimits.opLowerLimit; float cutOffLimit = cameraLimits.cutOffLimit; heater::Switchers switchNr = heater::HEATER_4_CAMERA; heater::Switchers redSwitchNr = heater::HEATER_6_DRO; - bool cameraTempAvailable = true; - bool heaterAvailable = true; - bool redSwitchNrInUse = false; - // Choose Heater - chooseHeater(switchNr, redSwitchNr, redSwitchNrInUse, heaterAvailable); + chooseHeater(switchNr, redSwitchNr); if (heaterAvailable) { - // Choose sensor - if (sensorTemperatures.sensor_4k_camera.isValid()) { - sensorTemp = sensorTemperatures.sensor_4k_camera.value; - } else if (sensorTemperatures.sensor_dro.isValid()) { - sensorTemp = sensorTemperatures.sensor_dro.value; - } else if (sensorTemperatures.sensor_mpa.isValid()) { - sensorTemp = sensorTemperatures.sensor_mpa.value; - } else { - if (heaterHandler.checkSwitchState(switchNr)) { - heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); - } - triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); - cameraTempAvailable = false; - } + chooseSensor(switchNr, sensorTemperatures.sensor_4k_camera.value, + sensorTemperatures.sensor_dro.value, sensorTemperatures.sensor_mpa.value, + sensorTemperatures.sensor_4k_camera.isValid(), + sensorTemperatures.sensor_dro.isValid(), sensorTemperatures.sensor_mpa.isValid()); - // Thermal Control - if (cameraTempAvailable) { - ctrlHeater(switchNr, redSwitchNr, redSwitchNrInUse, sensorTemp, opLowerLimit, cutOffLimit); + if (sensorTempAvailable) { + ctrlHeater(switchNr, redSwitchNr, opLowerLimit, cutOffLimit); } } } void ThermalController::ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, - bool redSwitchNrInUse, float sensorTemp, float opLowerLimit, - float cutOffLimit) { + float opLowerLimit, float cutOffLimit) { // Heater off if (not heaterHandler.checkSwitchState(switchNr)) { // TODO: check if OP or NOP @@ -1048,9 +1017,10 @@ void ThermalController::ctrlHeater(heater::Switchers switchNr, heater::Switchers } } -void ThermalController::chooseHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, - bool& redSwitchNrInUse, bool& heaterAvailable) { +void ThermalController::chooseHeater(heater::Switchers& switchNr, heater::Switchers redSwitchNr) { // Choose Heater + heaterAvailable = true; + if (heaterHandler.getHealth(switchNr) != HasHealthIF::HEALTHY) { if (heaterHandler.getHealth(redSwitchNr) == HasHealthIF::HEALTHY) { switchNr = redSwitchNr; @@ -1059,5 +1029,28 @@ void ThermalController::chooseHeater(heater::Switchers switchNr, heater::Switche heaterAvailable = false; // TODO: triggerEvent ? } + } else { + redSwitchNrInUse = false; + } +} + +void ThermalController::chooseSensor(heater::Switchers switchNr, float sensorValue1, + float sensorValue2, float sensorValue3, bool sensor1Valid, + bool sensor2Valid, bool sensor3Valid) { + // Choose sensor + sensorTempAvailable = true; + + if (sensor1Valid) { + sensorTemp = sensorValue1; + } else if (sensor2Valid) { + sensorTemp = sensorValue2; + } else if (sensor3Valid) { + sensorTemp = sensorValue3; + } else { + if (heaterHandler.checkSwitchState(switchNr)) { + heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); + } + triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); + sensorTempAvailable = false; } } \ No newline at end of file diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 4fe61e8c..ed765278 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -134,6 +134,11 @@ class ThermalController : public ExtendedControllerBase { TempLimits mpaLimits = TempLimits(-40.0, -30.0, -75.0, 80.0, 90.0); TempLimits scexBoardLimits = TempLimits(-60.0, -40.0, 80.0, 85.0, 150.0); + float sensorTemp; + bool sensorTempAvailable = true; + bool heaterAvailable = true; + bool redSwitchNrInUse = false; + // Initial delay to make sure all pool variables have been initialized their owners Countdown initialCountdown = Countdown(DELAY); @@ -144,14 +149,16 @@ class ThermalController : public ExtendedControllerBase { PoolEntry tmp1075IfBrd = PoolEntry(10.0); static constexpr dur_millis_t MUTEX_TIMEOUT = 50; + void copySensors(); void copySus(); void copyDevices(); - void ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, bool redSwitchNrInUse, - float sensorTemp, float opLowerLimit, float cutOffLimit); - void chooseHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, - bool& redSwitchNrInUse, bool& heaterAvailable); + void ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, float opLowerLimit, + float cutOffLimit); + void chooseHeater(heater::Switchers& switchNr, heater::Switchers redSwitchNr); + void chooseSensor(heater::Switchers switchNr, float sensorValue1, float sensorValue2, + float sensorValue3, bool sensor1Valid, bool sensor2Valid, bool sensor3Valid); void ctrlAcsBoard(); void ctrlMgt(); From 8b415883e9e0c35d3fa9d4ce8b43366096a1526e Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Wed, 14 Dec 2022 11:46:58 +0100 Subject: [PATCH 057/330] removed references to deprecated OutputValues and renamed guidance strategies --- mission/controller/AcsController.cpp | 15 +++-- mission/controller/acs/Guidance.cpp | 92 ++++++++++++---------------- mission/controller/acs/Guidance.h | 27 ++++---- 3 files changed, 63 insertions(+), 71 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 7d1ebc60..9057f5e4 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -249,15 +249,18 @@ void AcsController::performPointingCtrl() { double targetQuat[4] = {0, 0, 0, 0}, refSatRate[3] = {0, 0, 0}; switch (submode) { - case SUBMODE_PTG_TARGET: - guidance.targetQuatPtg(&sensorValues, &mekfData, &susDataProcessed, now, targetQuat, - refSatRate); - break; case SUBMODE_PTG_SUN: - guidance.sunQuatPtg(&sensorValues, &outputValues, now, targetQuat, refSatRate); + guidance.sunQuatPtg(&sensorValues, &mekfData, &susDataProcessed, &gpsDataProcessed, now, + targetQuat, refSatRate); break; + case SUBMODE_PTG_TARGET: + guidance.targetQuatPtgThreeAxes(&sensorValues, &gpsDataProcessed, &mekfData, now, targetQuat, + refSatRate); + break; + case SUBMODE_PTG_NADIR: - guidance.quatNadirPtg(&sensorValues, &outputValues, now, targetQuat, refSatRate); + guidance.quatNadirPtgThreeAxes(&sensorValues, &gpsDataProcessed, &mekfData, now, targetQuat, + refSatRate); break; case SUBMODE_PTG_INERTIAL: guidance.inertialQuatPtg(targetQuat, refSatRate); diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index 199fce9c..afd4d41e 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -30,9 +30,10 @@ void Guidance::getTargetParamsSafe(double sunTargetSafe[3], double satRateSafe[3 // memcpy(sunTargetSafe, acsParameters.safeModeControllerParameters.sunTargetDir, 24); } -void Guidance::targetQuatPtg(ACS::SensorValues *sensorValues, acsctrl::MekfData *mekfData, - acsctrl::SusDataProcessed *susDataProcessed, timeval now, - double targetQuat[4], double refSatRate[3]) { +void Guidance::targetQuatPtgSingleAxis(ACS::SensorValues *sensorValues, acsctrl::MekfData *mekfData, + acsctrl::SusDataProcessed *susDataProcessed, + acsctrl::GpsDataProcessed *gpsDataProcessed, timeval now, + double targetQuat[4], double refSatRate[3]) { //------------------------------------------------------------------------------------- // Calculation of target quaternion to groundstation or given latitude, longitude and altitude //------------------------------------------------------------------------------------- @@ -102,9 +103,7 @@ void Guidance::targetQuatPtg(ACS::SensorValues *sensorValues, acsctrl::MekfData // Calculation of reference rotation rate //------------------------------------------------------------------------------------- double velSatE[3] = {0, 0, 0}; - velSatE[0] = outputValues->gpsVelocity[0]; // sensorValues->gps0Velocity[0]; - velSatE[1] = outputValues->gpsVelocity[1]; // sensorValues->gps0Velocity[1]; - velSatE[2] = outputValues->gpsVelocity[2]; // sensorValues->gps0Velocity[2]; + std::memcpy(velSatE, gpsDataProcessed->gpsVelocity.value, 3 * sizeof(double)); double velSatB[3] = {0, 0, 0}, velSatBPart1[3] = {0, 0, 0}, velSatBPart2[3] = {0, 0, 0}; // Velocity: v_B = dcm_BI * dcmIE * v_E + dcm_BI * DotDcm_IE * v_E MatrixOperations::multiply(*dcmBE, velSatE, velSatBPart1, 3, 3, 1); @@ -127,7 +126,7 @@ void Guidance::targetQuatPtg(ACS::SensorValues *sensorValues, acsctrl::MekfData if (acsParameters.targetModeControllerParameters.avoidBlindStr) { double sunDirB[3] = {0, 0, 0}; - if (outputValues->sunDirModelValid) { + if (susDataProcessed->sunIjkModel.isValid()) { double sunDirJ[3] = {0, 0, 0}; std::memcpy(sunDirJ, susDataProcessed->sunIjkModel.value, 3 * sizeof(double)); MatrixOperations::multiply(*dcmBJ, sunDirJ, sunDirB, 3, 3, 1); @@ -174,8 +173,10 @@ void Guidance::targetQuatPtg(ACS::SensorValues *sensorValues, acsctrl::MekfData } } -void Guidance::targetQuatPtg(ACS::SensorValues *sensorValues, ACS::OutputValues *outputValues, - timeval now, double targetQuat[4], double refSatRate[3]) { +void Guidance::targetQuatPtgThreeAxes(ACS::SensorValues *sensorValues, + acsctrl::GpsDataProcessed *gpsDataProcessed, + acsctrl::MekfData *mekfData, timeval now, + double targetQuat[4], double refSatRate[3]) { //------------------------------------------------------------------------------------- // Calculation of target quaternion for target pointing //------------------------------------------------------------------------------------- @@ -217,8 +218,8 @@ void Guidance::targetQuatPtg(ACS::SensorValues *sensorValues, ACS::OutputValues VectorOperations::mulScalar(xAxis, -1, xAxis, 3); // Transform velocity into inertial frame - double velocityE[3] = {outputValues->gpsVelocity[0], outputValues->gpsVelocity[1], - outputValues->gpsVelocity[2]}; + double velocityE[3]; + std::memcpy(velocityE, gpsDataProcessed->gpsVelocity.value, 3 * sizeof(double)); double velocityJ[3] = {0, 0, 0}, velPart1[3] = {0, 0, 0}, velPart2[3] = {0, 0, 0}; MatrixOperations::multiply(*dcmJE, velocityE, velPart1, 3, 3, 1); MatrixOperations::multiply(*dcmJEDot, posSatE, velPart2, 3, 3, 1); @@ -251,7 +252,7 @@ void Guidance::targetQuatPtg(ACS::SensorValues *sensorValues, ACS::OutputValues double timeElapsed = now.tv_sec + now.tv_usec * pow(10, -6) - (timeSavedQuaternionNadir.tv_sec + - timeSavedQuaternionNadir.tv_usec * pow(timeSavedQuaternionNadir.tv_usec, -6)); + timeSavedQuaternionNadir.tv_usec * pow((double)timeSavedQuaternionNadir.tv_usec, -6)); if (timeElapsed < acsParameters.pointingModeControllerParameters.nadirTimeElapsedMax) { double qDiff[4] = {0, 0, 0, 0}; VectorOperations::subtract(quatInertialTarget, savedQuaternionNadir, qDiff, 4); @@ -287,38 +288,28 @@ void Guidance::targetQuatPtg(ACS::SensorValues *sensorValues, ACS::OutputValues // Transform in system relative to satellite frame double quatBJ[4] = {0, 0, 0, 0}; - quatBJ[0] = outputValues->quatMekfBJ[0]; - quatBJ[1] = outputValues->quatMekfBJ[1]; - quatBJ[2] = outputValues->quatMekfBJ[2]; - quatBJ[3] = outputValues->quatMekfBJ[3]; + std::memcpy(quatBJ, mekfData->quatMekf.value, 4 * sizeof(double)); QuaternionOperations::multiply(quatBJ, quatInertialTarget, targetQuat); } -void Guidance::sunQuatPtg(ACS::SensorValues *sensorValues, ACS::OutputValues *outputValues, - timeval now, double targetQuat[4], double refSatRate[3]) { +void Guidance::sunQuatPtg(ACS::SensorValues *sensorValues, acsctrl::MekfData *mekfData, + acsctrl::SusDataProcessed *susDataProcessed, + acsctrl::GpsDataProcessed *gpsDataProcessed, timeval now, + double targetQuat[4], double refSatRate[3]) { //------------------------------------------------------------------------------------- // Calculation of target quaternion to sun //------------------------------------------------------------------------------------- double quatBJ[4] = {0, 0, 0, 0}; double dcmBJ[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; - quatBJ[0] = outputValues->quatMekfBJ[0]; - quatBJ[1] = outputValues->quatMekfBJ[1]; - quatBJ[2] = outputValues->quatMekfBJ[2]; - quatBJ[3] = outputValues->quatMekfBJ[3]; + std::memcpy(quatBJ, mekfData->quatMekf.value, 4 * sizeof(double)); QuaternionOperations::toDcm(quatBJ, dcmBJ); double sunDirJ[3] = {0, 0, 0}, sunDirB[3] = {0, 0, 0}; - if (outputValues->sunDirModelValid) { - sunDirJ[0] = outputValues->sunDirModel[0]; - sunDirJ[1] = outputValues->sunDirModel[1]; - sunDirJ[2] = outputValues->sunDirModel[2]; + if (susDataProcessed->sunIjkModel.isValid()) { + std::memcpy(sunDirJ, susDataProcessed->sunIjkModel.value, 3 * sizeof(double)); MatrixOperations::multiply(*dcmBJ, sunDirJ, sunDirB, 3, 3, 1); - } - - else { - sunDirB[0] = outputValues->sunDirEst[0]; - sunDirB[1] = outputValues->sunDirEst[1]; - sunDirB[2] = outputValues->sunDirEst[2]; + } else { + std::memcpy(sunDirB, susDataProcessed->susVecTot.value, 3 * sizeof(double)); } /* @@ -367,8 +358,8 @@ void Guidance::sunQuatPtg(ACS::SensorValues *sensorValues, ACS::OutputValues *ou double longitudeRad = (sensorValues->gpsSet.longitude.value) * PI / 180; MathOperations::cartesianFromLatLongAlt(geodeticLatRad, longitudeRad, sensorValues->gpsSet.altitude.value, posSatE); - double velocityE[3] = {outputValues->gpsVelocity[0], outputValues->gpsVelocity[1], - outputValues->gpsVelocity[2]}; + double velocityE[3]; + std::memcpy(velocityE, gpsDataProcessed->gpsVelocity.value, 3 * sizeof(double)); double velocityJ[3] = {0, 0, 0}, velPart1[3] = {0, 0, 0}, velPart2[3] = {0, 0, 0}; MatrixOperations::multiply(*dcmJE, velocityE, velPart1, 3, 3, 1); MatrixOperations::multiply(*dcmJEDot, posSatE, velPart2, 3, 3, 1); @@ -410,9 +401,8 @@ void Guidance::sunQuatPtg(ACS::SensorValues *sensorValues, ACS::OutputValues *ou refSatRate[2] = 0; } -void Guidance::quatNadirPtgOldVersion(ACS::SensorValues *sensorValues, - ACS::OutputValues *outputValues, timeval now, - double targetQuat[4], +void Guidance::quatNadirPtgSingleAxis(ACS::SensorValues *sensorValues, acsctrl::MekfData *mekfData, + timeval now, double targetQuat[4], double refSatRate[3]) { // old version of Nadir Pointing //------------------------------------------------------------------------------------- // Calculation of target quaternion for Nadir pointing @@ -440,10 +430,7 @@ void Guidance::quatNadirPtgOldVersion(ACS::SensorValues *sensorValues, double dcmBJ[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; double dcmBE[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; double quatBJ[4] = {0, 0, 0, 0}; - quatBJ[0] = outputValues->quatMekfBJ[0]; - quatBJ[1] = outputValues->quatMekfBJ[1]; - quatBJ[2] = outputValues->quatMekfBJ[2]; - quatBJ[3] = outputValues->quatMekfBJ[3]; + std::memcpy(quatBJ, mekfData->quatMekf.value, 4 * sizeof(double)); QuaternionOperations::toDcm(quatBJ, dcmBJ); MatrixOperations::multiply(*dcmBJ, *dcmJE, *dcmBE, 3, 3, 3); @@ -478,8 +465,10 @@ void Guidance::quatNadirPtgOldVersion(ACS::SensorValues *sensorValues, refSatRate[2] = 0; } -void Guidance::quatNadirPtg(ACS::SensorValues *sensorValues, ACS::OutputValues *outputValues, - timeval now, double targetQuat[4], double refSatRate[3]) { +void Guidance::quatNadirPtgThreeAxes(ACS::SensorValues *sensorValues, + acsctrl::GpsDataProcessed *gpsDataProcessed, + acsctrl::MekfData *mekfData, timeval now, double targetQuat[4], + double refSatRate[3]) { //------------------------------------------------------------------------------------- // Calculation of target quaternion for Nadir pointing //------------------------------------------------------------------------------------- @@ -512,9 +501,8 @@ void Guidance::quatNadirPtg(ACS::SensorValues *sensorValues, ACS::OutputValues * VectorOperations::mulScalar(xAxis, -1, xAxis, 3); // z-Axis parallel to long side of picture resolution - double zAxis[3] = {0, 0, 0}; - double velocityE[3] = {outputValues->gpsVelocity[0], outputValues->gpsVelocity[1], - outputValues->gpsVelocity[2]}; + double zAxis[3] = {0, 0, 0}, velocityE[3]; + std::memcpy(velocityE, gpsDataProcessed->gpsVelocity.value, 3 * sizeof(double)); double velocityJ[3] = {0, 0, 0}, velPart1[3] = {0, 0, 0}, velPart2[3] = {0, 0, 0}; MatrixOperations::multiply(*dcmJE, velocityE, velPart1, 3, 3, 1); MatrixOperations::multiply(*dcmJEDot, posSatE, velPart2, 3, 3, 1); @@ -539,7 +527,7 @@ void Guidance::quatNadirPtg(ACS::SensorValues *sensorValues, ACS::OutputValues * double timeElapsed = now.tv_sec + now.tv_usec * pow(10, -6) - (timeSavedQuaternionNadir.tv_sec + - timeSavedQuaternionNadir.tv_usec * pow(timeSavedQuaternionNadir.tv_usec, -6)); + timeSavedQuaternionNadir.tv_usec * pow((double)timeSavedQuaternionNadir.tv_usec, -6)); if (timeElapsed < acsParameters.pointingModeControllerParameters.nadirTimeElapsedMax) { double qDiff[4] = {0, 0, 0, 0}; VectorOperations::subtract(quatInertialTarget, savedQuaternionNadir, qDiff, 4); @@ -575,10 +563,7 @@ void Guidance::quatNadirPtg(ACS::SensorValues *sensorValues, ACS::OutputValues * // Transform in system relative to satellite frame double quatBJ[4] = {0, 0, 0, 0}; - quatBJ[0] = outputValues->quatMekfBJ[0]; - quatBJ[1] = outputValues->quatMekfBJ[1]; - quatBJ[2] = outputValues->quatMekfBJ[2]; - quatBJ[3] = outputValues->quatMekfBJ[3]; + std::memcpy(quatBJ, mekfData->quatMekf.value, 4 * sizeof(double)); QuaternionOperations::multiply(quatBJ, quatInertialTarget, targetQuat); } @@ -608,7 +593,6 @@ void Guidance::comparePtg(double targetQuat[4], acsctrl::MekfData *mekfData, dou {quatRef[1], -quatRef[0], quatRef[3], -quatRef[2]}, {quatRef[0], -quatRef[1], quatRef[2], quatRef[3]}}; - double quatErrorComplete[4] = {0, 0, 0, 0}; MatrixOperations::multiply(*quatErrorMtx, targetQuat, quatErrorComplete, 4, 4, 1); if (quatErrorComplete[3] < 0) { @@ -619,8 +603,8 @@ void Guidance::comparePtg(double targetQuat[4], acsctrl::MekfData *mekfData, dou quatError[1] = quatErrorComplete[1]; quatError[2] = quatErrorComplete[2]; - // target flag in matlab, importance, does look like it only gives - // feedback if pointing control is under 150 arcsec ?? + // target flag in matlab, importance, does look like it only gives feedback if pointing control is + // under 150 arcsec ?? } void Guidance::getDistributionMatrixRw(ACS::SensorValues *sensorValues, double *rwPseudoInv) { diff --git a/mission/controller/acs/Guidance.h b/mission/controller/acs/Guidance.h index 1b6bfcb6..176d51a2 100644 --- a/mission/controller/acs/Guidance.h +++ b/mission/controller/acs/Guidance.h @@ -23,26 +23,31 @@ class Guidance { // Function to get the target quaternion and refence rotation rate from gps position and position // of the ground station - void targetQuatPtgOldVersion(ACS::SensorValues *sensorValues, acsctrl::MekfData *mekfData, - acsctrl::SusDataProcessed *susDataProcessed, timeval now, + void targetQuatPtgThreeAxes(ACS::SensorValues *sensorValues, + acsctrl::GpsDataProcessed *gpsDataProcessed, + acsctrl::MekfData *mekfData, timeval now, double targetQuat[4], + double refSatRate[3]); + void targetQuatPtgSingleAxis(ACS::SensorValues *sensorValues, acsctrl::MekfData *mekfData, + acsctrl::SusDataProcessed *susDataProcessed, + acsctrl::GpsDataProcessed *gpsDataProcessed, timeval now, double targetQuat[4], double refSatRate[3]); - void targetQuatPtg(ACS::SensorValues *sensorValues, acsctrl::MekfData *mekfData, - acsctrl::SusDataProcessed *susDataProcessed, timeval now, double targetQuat[4], - double refSatRate[3]); // Function to get the target quaternion and refence rotation rate for sun pointing after ground // station - void sunQuatPtg(ACS::SensorValues *sensorValues, ACS::OutputValues *outputValues, timeval now, - double targetQuat[4], double refSatRate[3]); + void sunQuatPtg(ACS::SensorValues *sensorValues, acsctrl::MekfData *mekfData, + acsctrl::SusDataProcessed *susDataProcessed, + acsctrl::GpsDataProcessed *gpsDataProcessed, timeval now, double targetQuat[4], + double refSatRate[3]); // Function to get the target quaternion and refence rotation rate from gps position for Nadir // pointing - void quatNadirPtgOldVersion(ACS::SensorValues *sensorValues, ACS::OutputValues *outputValues, + void quatNadirPtgThreeAxes(ACS::SensorValues *sensorValues, + acsctrl::GpsDataProcessed *gpsDataProcessed, + acsctrl::MekfData *mekfData, timeval now, double targetQuat[4], + double refSatRate[3]); + void quatNadirPtgSingleAxis(ACS::SensorValues *sensorValues, acsctrl::MekfData *mekfData, timeval now, double targetQuat[4], double refSatRate[3]); - void quatNadirPtg(ACS::SensorValues *sensorValues, ACS::OutputValues *outputValues, timeval now, - double targetQuat[4], double refSatRate[3]); - // Function to get the target quaternion and refence rotation rate from parameters for inertial // pointing void inertialQuatPtg(double targetQuat[4], double refSatRate[3]); From 3f2910c3a72632e939056587843ff447b2f1111d Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Wed, 14 Dec 2022 11:50:29 +0100 Subject: [PATCH 058/330] changed order of submodes and their naming --- mission/controller/AcsController.cpp | 6 +++--- mission/controller/AcsController.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 9057f5e4..fa106d4c 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -51,7 +51,7 @@ void AcsController::performControlOperation() { case SUBMODE_DETUMBLE: performDetumble(); break; - case SUBMODE_PTG_SUN: + case SUBMODE_IDLE: case SUBMODE_PTG_TARGET: case SUBMODE_PTG_NADIR: case SUBMODE_PTG_INERTIAL: @@ -249,7 +249,7 @@ void AcsController::performPointingCtrl() { double targetQuat[4] = {0, 0, 0, 0}, refSatRate[3] = {0, 0, 0}; switch (submode) { - case SUBMODE_PTG_SUN: + case SUBMODE_IDLE: guidance.sunQuatPtg(&sensorValues, &mekfData, &susDataProcessed, &gpsDataProcessed, now, targetQuat, refSatRate); break; @@ -452,7 +452,7 @@ ReturnValue_t AcsController::checkModeCommand(Mode_t mode, Submode_t submode, return INVALID_SUBMODE; } } else if ((mode == MODE_ON) || (mode == MODE_NORMAL)) { - if ((submode > 6) || (submode < 2)) { + if ((submode > 7) || (submode < 2)) { return INVALID_SUBMODE; } else { return returnvalue::OK; diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index ec1749b3..de7cb23f 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -26,9 +26,9 @@ class AcsController : public ExtendedControllerBase { static const Submode_t SUBMODE_SAFE = 2; static const Submode_t SUBMODE_DETUMBLE = 3; - static const Submode_t SUBMODE_PTG_TARGET = 4; + static const Submode_t SUBMODE_IDLE = 4; static const Submode_t SUBMODE_PTG_NADIR = 5; - static const Submode_t SUBMODE_PTG_SUN = 6; + static const Submode_t SUBMODE_PTG_TARGET = 6; static const Submode_t SUBMODE_PTG_INERTIAL = 7; static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::ACS_SUBSYSTEM; From b3a2cc43670757662861e6af9b9e33d084b386c6 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Fri, 16 Dec 2022 13:59:49 +0100 Subject: [PATCH 059/330] fixed booleans in acs Parameters and enabled setting of parameters --- mission/controller/acs/AcsParameters.cpp | 1069 ++++++++++--------- mission/controller/acs/AcsParameters.h | 21 +- mission/controller/acs/SensorProcessing.cpp | 2 +- 3 files changed, 549 insertions(+), 543 deletions(-) diff --git a/mission/controller/acs/AcsParameters.cpp b/mission/controller/acs/AcsParameters.cpp index cc9959ab..3205f7b2 100644 --- a/mission/controller/acs/AcsParameters.cpp +++ b/mission/controller/acs/AcsParameters.cpp @@ -3,542 +3,549 @@ #include #include -AcsParameters::AcsParameters(){}; //(uint8_t parameterModuleId) : - // parameterModuleId(parameterModuleId) {} +AcsParameters::AcsParameters() {} AcsParameters::~AcsParameters() {} -/*ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint16_t parameterId, +ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, ParameterWrapper* parameterWrapper, const ParameterWrapper* newValues, uint16_t startAtIndex) { - if (domainId == parameterModuleId) { - switch (parameterId >> 8) { - case 0x0: // direct members - switch (parameterId & 0xFF) { - default: - return INVALID_IDENTIFIER_ID; - } - break; - case 0x1: // OnBoardParams - switch (parameterId & 0xFF) { - case 0x0: - parameterWrapper->set(onBoardParams.sampleTime); - break; - default: - return INVALID_IDENTIFIER_ID; - } - break; - case 0x2: // InertiaEIVE - switch (parameterId & 0xFF) { - case 0x0: - parameterWrapper->set(inertiaEIVE.inertiaMatrix); - break; - case 0x1: - parameterWrapper->set(inertiaEIVE.inertiaMatrixInverse); - break; - default: - return INVALID_IDENTIFIER_ID; - } - break; - case 0x3: // MgmHandlingParameters - switch (parameterId & 0xFF) { - case 0x0: - parameterWrapper->set(mgmHandlingParameters.mgm0orientationMatrix); - break; - case 0x1: - parameterWrapper->set(mgmHandlingParameters.mgm1orientationMatrix); - break; - case 0x2: - parameterWrapper->set(mgmHandlingParameters.mgm2orientationMatrix); - break; - case 0x3: - parameterWrapper->set(mgmHandlingParameters.mgm3orientationMatrix); - break; - case 0x4: - parameterWrapper->set(mgmHandlingParameters.mgm4orientationMatrix); - break; - case 0x5: - parameterWrapper->set(mgmHandlingParameters.mgm0hardIronOffset); - break; - case 0x6: - parameterWrapper->set(mgmHandlingParameters.mgm1hardIronOffset); - break; - case 0x7: - parameterWrapper->set(mgmHandlingParameters.mgm2hardIronOffset); - break; - case 0x8: - parameterWrapper->set(mgmHandlingParameters.mgm3hardIronOffset); - break; - case 0x9: - parameterWrapper->set(mgmHandlingParameters.mgm4hardIronOffset); - break; - case 0xA: - parameterWrapper->set(mgmHandlingParameters.mgm0softIronInverse); - break; - case 0xB: - parameterWrapper->set(mgmHandlingParameters.mgm1softIronInverse); - break; - case 0xC: - parameterWrapper->set(mgmHandlingParameters.mgm2softIronInverse); - break; - case 0xD: - parameterWrapper->set(mgmHandlingParameters.mgm3softIronInverse); - break; - case 0xE: - parameterWrapper->set(mgmHandlingParameters.mgm4softIronInverse); - break; - default: - return INVALID_IDENTIFIER_ID; - } - break; - case 0x4: // SusHandlingParameters - switch (parameterId & 0xFF) { - case 0x0: - parameterWrapper->set(susHandlingParameters.sus0orientationMatrix); - break; - case 0x1: - parameterWrapper->set(susHandlingParameters.sus1orientationMatrix); - break; - case 0x2: - parameterWrapper->set(susHandlingParameters.sus2orientationMatrix); - break; - case 0x3: - parameterWrapper->set(susHandlingParameters.sus3orientationMatrix); - break; - case 0x4: - parameterWrapper->set(susHandlingParameters.sus4orientationMatrix); - break; - case 0x5: - parameterWrapper->set(susHandlingParameters.sus5orientationMatrix); - break; - case 0x6: - parameterWrapper->set(susHandlingParameters.sus6orientationMatrix); - break; - case 0x7: - parameterWrapper->set(susHandlingParameters.sus7orientationMatrix); - break; - case 0x8: - parameterWrapper->set(susHandlingParameters.sus8orientationMatrix); - break; - case 0x9: - parameterWrapper->set(susHandlingParameters.sus9orientationMatrix); - break; - case 0xA: - parameterWrapper->set(susHandlingParameters.sus10orientationMatrix); - break; - case 0xB: - parameterWrapper->set(susHandlingParameters.sus11orientationMatrix); - break; - case 0xC: - parameterWrapper->set(susHandlingParameters.sus0coeffAlpha); - break; - case 0xD: - parameterWrapper->set(susHandlingParameters.sus0coeffBeta); - break; - case 0xE: - parameterWrapper->set(susHandlingParameters.sus1coeffAlpha); - break; - case 0xF: - parameterWrapper->set(susHandlingParameters.sus1coeffBeta); - break; - case 0x10: - parameterWrapper->set(susHandlingParameters.sus2coeffAlpha); - break; - case 0x11: - parameterWrapper->set(susHandlingParameters.sus2coeffBeta); - break; - case 0x12: - parameterWrapper->set(susHandlingParameters.sus3coeffAlpha); - break; - case 0x13: - parameterWrapper->set(susHandlingParameters.sus3coeffBeta); - break; - case 0x14: - parameterWrapper->set(susHandlingParameters.sus4coeffAlpha); - break; - case 0x15: - parameterWrapper->set(susHandlingParameters.sus4coeffBeta); - break; - case 0x16: - parameterWrapper->set(susHandlingParameters.sus5coeffAlpha); - break; - case 0x17: - parameterWrapper->set(susHandlingParameters.sus5coeffBeta); - break; - case 0x18: - parameterWrapper->set(susHandlingParameters.sus6coeffAlpha); - break; - case 0x19: - parameterWrapper->set(susHandlingParameters.sus6coeffBeta); - break; - case 0x1A: - parameterWrapper->set(susHandlingParameters.sus7coeffAlpha); - break; - case 0x1B: - parameterWrapper->set(susHandlingParameters.sus7coeffBeta); - break; - case 0x1C: - parameterWrapper->set(susHandlingParameters.sus8coeffAlpha); - break; - case 0x1D: - parameterWrapper->set(susHandlingParameters.sus8coeffBeta); - break; - case 0x1E: - parameterWrapper->set(susHandlingParameters.sus9coeffAlpha); - break; - case 0x1F: - parameterWrapper->set(susHandlingParameters.sus9coeffBeta); - break; - case 0x20: - parameterWrapper->set(susHandlingParameters.sus10coeffAlpha); - break; - case 0x21: - parameterWrapper->set(susHandlingParameters.sus10coeffBeta); - break; - case 0x22: - parameterWrapper->set(susHandlingParameters.sus11coeffAlpha); - break; - case 0x23: - parameterWrapper->set(susHandlingParameters.sus11coeffBeta); - break; - case 0x24: - parameterWrapper->set(susHandlingParameters.filterAlpha); - break; - case 0x25: - parameterWrapper->set(susHandlingParameters.sunThresh); - break; - default: - return INVALID_IDENTIFIER_ID; - } - break; - case (0x5): // GyrHandlingParameters - switch (parameterId & 0xFF) { - case 0x0: - parameterWrapper->set(gyrHandlingParameters.gyr0orientationMatrix); - break; - case 0x1: - parameterWrapper->set(gyrHandlingParameters.gyr1orientationMatrix); - break; - case 0x2: - parameterWrapper->set(gyrHandlingParameters.gyr2orientationMatrix); - break; - case 0x3: - parameterWrapper->set(gyrHandlingParameters.gyr3orientationMatrix); - break; - case 0x4: - parameterWrapper->set(gyrHandlingParameters.gyrFusionWeight); - break; - default: - return INVALID_IDENTIFIER_ID; - } - break; - case (0x6): // RwHandlingParameters - switch (parameterId & 0xFF) { - case 0x0: - parameterWrapper->set(rwHandlingParameters.rw0orientationMatrix); - break; - case 0x1: - parameterWrapper->set(rwHandlingParameters.rw1orientationMatrix); - break; - case 0x2: - parameterWrapper->set(rwHandlingParameters.rw2orientationMatrix); - break; - case 0x3: - parameterWrapper->set(rwHandlingParameters.rw3orientationMatrix); - break; - case 0x4: - parameterWrapper->set(rwHandlingParameters.inertiaWheel); - break; - case 0x5: - parameterWrapper->set(rwHandlingParameters.maxTrq); - break; - default: - return INVALID_IDENTIFIER_ID; - } - break; - case (0x7): // RwMatrices - switch (parameterId & 0xFF) { - case 0x0: - parameterWrapper->set(rwMatrices.alignmentMatrix); - break; - case 0x1: - parameterWrapper->set(rwMatrices.pseudoInverse); - break; - case 0x2: - parameterWrapper->set(rwMatrices.without0); - break; - case 0x3: - parameterWrapper->set(rwMatrices.without1); - break; - case 0x4: - parameterWrapper->set(rwMatrices.without2); - break; - case 0x5: - parameterWrapper->set(rwMatrices.without3); - break; - default: - return INVALID_IDENTIFIER_ID; - } - break; - case (0x8): // SafeModeControllerParameters - switch (parameterId & 0xFF) { - case 0x0: - parameterWrapper->set(safeModeControllerParameters.k_rate_mekf); - break; - case 0x1: - parameterWrapper->set(safeModeControllerParameters.k_align_mekf); - break; - case 0x2: - parameterWrapper->set(safeModeControllerParameters.k_rate_no_mekf); - break; - case 0x3: - parameterWrapper->set(safeModeControllerParameters.k_align_no_mekf); - break; - case 0x4: - parameterWrapper->set(safeModeControllerParameters.sunMagAngleMin); - break; - case 0x5: - parameterWrapper->set(safeModeControllerParameters.sunTargetDir); - break; - case 0x6: - parameterWrapper->set(safeModeControllerParameters.satRateRef); - break; - default: - return INVALID_IDENTIFIER_ID; - } - break; - case (0x9): // DetumbleCtrlParameters - switch (parameterId & 0xFF) { - case 0x0: - parameterWrapper->set(detumbleCtrlParameters.gainD); - break; - default: - return INVALID_IDENTIFIER_ID; - } - break; - case (0xA): // PointingModeControllerParameters - switch (parameterId & 0xFF) { - case 0x0: - parameterWrapper->set(targetModeControllerParameters.updtFlag); - break; - case 0x1: - parameterWrapper->set(targetModeControllerParameters.A_rw); - break; - case 0x2: - parameterWrapper->set(targetModeControllerParameters.refDirection); - break; - case 0x3: - parameterWrapper->set(targetModeControllerParameters.refRotRate); - break; - case 0x4: - parameterWrapper->set(targetModeControllerParameters.quatRef); - break; - case 0x5: - parameterWrapper->set(targetModeControllerParameters.avoidBlindStr); - break; - case 0x6: - parameterWrapper->set(targetModeControllerParameters.blindAvoidStart); - break; - case 0x7: - parameterWrapper->set(targetModeControllerParameters.blindAvoidStop); - break; - case 0x8: - parameterWrapper->set(targetModeControllerParameters.blindRotRate); - break; - case 0x9: - parameterWrapper->set(targetModeControllerParameters.zeta); - break; - case 0xA: - parameterWrapper->set(targetModeControllerParameters.zetaLow); - break; - case 0xB: - parameterWrapper->set(targetModeControllerParameters.om); - break; - case 0xC: - parameterWrapper->set(targetModeControllerParameters.omLow); - break; - case 0xD: - parameterWrapper->set(targetModeControllerParameters.omMax); - break; - case 0xE: - parameterWrapper->set(targetModeControllerParameters.qiMin); - break; - case 0xF: - parameterWrapper->set(targetModeControllerParameters.gainNullspace); - break; - case 0x10: - parameterWrapper->set(targetModeControllerParameters.desatMomentumRef); - break; - case 0x11: - parameterWrapper->set(targetModeControllerParameters.deSatGainFactor); - break; - case 0x12: - parameterWrapper->set(targetModeControllerParameters.desatOn); - break; - case 0x13: - parameterWrapper->set(targetModeControllerParameters.omegaEarth); - break; - default: - return INVALID_IDENTIFIER_ID; - } - break; - case (0xB): // StrParameters - switch (parameterId & 0xFF) { - case 0x0: - parameterWrapper->set(strParameters.exclusionAngle); - break; - case 0x1: - parameterWrapper->set(strParameters.boresightAxis); - break; - default: - return INVALID_IDENTIFIER_ID; - } - break; - case (0xC): // GpsParameters - switch (parameterId & 0xFF) { - default: - return INVALID_IDENTIFIER_ID; - } - break; - case (0xD): // GroundStationParameters - switch (parameterId & 0xFF) { - case 0x0: - parameterWrapper->set(groundStationParameters.latitudeGs); - break; - case 0x1: - parameterWrapper->set(groundStationParameters.longitudeGs); - break; - case 0x2: - parameterWrapper->set(groundStationParameters.altitudeGs); - break; - case 0x3: - parameterWrapper->set(groundStationParameters.earthRadiusEquat); - break; - case 0x4: - parameterWrapper->set(groundStationParameters.earthRadiusPolar); - break; - default: - return INVALID_IDENTIFIER_ID; - } - break; - case (0xE): // SunModelParameters - switch (parameterId & 0xFF) { - case 0x0: - parameterWrapper->set(sunModelParameters.useSunModel); - break; - case 0x1: - parameterWrapper->set(sunModelParameters.domega); - break; - case 0x2: - parameterWrapper->set(sunModelParameters.omega_0); - break; - case 0x3: - parameterWrapper->set(sunModelParameters.m_0); - break; - case 0x4: - parameterWrapper->set(sunModelParameters.dm); - break; - case 0x5: - parameterWrapper->set(sunModelParameters.e); - break; - case 0x6: - parameterWrapper->set(sunModelParameters.e1); - break; - case 0x7: - parameterWrapper->set(sunModelParameters.p1); - break; - case 0x8: - parameterWrapper->set(sunModelParameters.p2); - break; - default: - return INVALID_IDENTIFIER_ID; - } - break; - case (0xF): // KalmanFilterParameters - switch (parameterId & 0xFF) { - case 0x0: - parameterWrapper->set(kalmanFilterParameters.activateKalmanFilter); - break; - case 0x1: - parameterWrapper->set(kalmanFilterParameters.requestResetFlag); - break; - case 0x2: - parameterWrapper->set( - kalmanFilterParameters.maxToleratedTimeBetweenKalmanFilterExecutionSteps); - break; - case 0x3: - parameterWrapper->set(kalmanFilterParameters.processNoiseOmega); - break; - case 0x4: - parameterWrapper->set(kalmanFilterParameters.processNoiseQuaternion); - break; - case 0x5: - parameterWrapper->set(kalmanFilterParameters.sensorNoiseSTR); - break; - case 0x6: - parameterWrapper->set(kalmanFilterParameters.sensorNoiseSS); - break; - case 0x7: - parameterWrapper->set(kalmanFilterParameters.sensorNoiseMAG); - break; - case 0x8: - parameterWrapper->set(kalmanFilterParameters.sensorNoiseGYR); - break; - case 0x9: - parameterWrapper->set(kalmanFilterParameters.sensorNoiseArwGYR); - break; - case 0xA: - parameterWrapper->set(kalmanFilterParameters.sensorNoiseBsGYR); - break; - default: - return INVALID_IDENTIFIER_ID; - } - break; - case (0x10): // MagnetorquesParameter - switch (parameterId & 0xFF) { - case 0x0: - parameterWrapper->set(magnetorquesParameter.mtq0orientationMatrix); - break; - case 0x1: - parameterWrapper->set(magnetorquesParameter.mtq1orientationMatrix); - break; - case 0x2: - parameterWrapper->set(magnetorquesParameter.mtq2orientationMatrix); - break; - case 0x3: - parameterWrapper->set(magnetorquesParameter.alignmentMatrixMtq); - break; - case 0x4: - parameterWrapper->set(magnetorquesParameter.inverseAlignment); - break; - case 0x5: - parameterWrapper->set(magnetorquesParameter.DipolMax); - break; - default: - return INVALID_IDENTIFIER_ID; - } - break; - case (0x11): // DetumbleParameter - switch (parameterId & 0xFF) { - case 0x0: - parameterWrapper->set(detumbleParameter.detumblecounter); - break; - case 0x1: - parameterWrapper->set(detumbleParameter.omegaDetumbleStart); - break; - case 0x2: - parameterWrapper->set(detumbleParameter.omegaDetumbleEnd); - break; - default: - return INVALID_IDENTIFIER_ID; - } - break; - default: - return INVALID_IDENTIFIER_ID; + // if (domainId == parameterModuleId) { + switch (parameterId >> 8) { + case 0x0: // direct members + switch (parameterId & 0xFF) { + default: + return INVALID_IDENTIFIER_ID; + } + break; + case 0x1: // OnBoardParams + switch (parameterId & 0xFF) { + case 0x0: + parameterWrapper->set(onBoardParams.sampleTime); + break; + default: + return INVALID_IDENTIFIER_ID; + } + break; + case 0x2: // InertiaEIVE + switch (parameterId & 0xFF) { + case 0x0: + parameterWrapper->set(inertiaEIVE.inertiaMatrix); + break; + case 0x1: + parameterWrapper->set(inertiaEIVE.inertiaMatrixDeployed); + break; + case 0x2: + parameterWrapper->set(inertiaEIVE.inertiaMatrixUndeployed); + break; + case 0x3: + parameterWrapper->set(inertiaEIVE.inertiaMatrixPanel1); + break; + case 0x4: + parameterWrapper->set(inertiaEIVE.inertiaMatrixPanel3); + break; + default: + return INVALID_IDENTIFIER_ID; + } + break; + case 0x3: // MgmHandlingParameters + switch (parameterId & 0xFF) { + case 0x0: + parameterWrapper->set(mgmHandlingParameters.mgm0orientationMatrix); + break; + case 0x1: + parameterWrapper->set(mgmHandlingParameters.mgm1orientationMatrix); + break; + case 0x2: + parameterWrapper->set(mgmHandlingParameters.mgm2orientationMatrix); + break; + case 0x3: + parameterWrapper->set(mgmHandlingParameters.mgm3orientationMatrix); + break; + case 0x4: + parameterWrapper->set(mgmHandlingParameters.mgm4orientationMatrix); + break; + case 0x5: + parameterWrapper->set(mgmHandlingParameters.mgm0hardIronOffset); + break; + case 0x6: + parameterWrapper->set(mgmHandlingParameters.mgm1hardIronOffset); + break; + case 0x7: + parameterWrapper->set(mgmHandlingParameters.mgm2hardIronOffset); + break; + case 0x8: + parameterWrapper->set(mgmHandlingParameters.mgm3hardIronOffset); + break; + case 0x9: + parameterWrapper->set(mgmHandlingParameters.mgm4hardIronOffset); + break; + case 0xA: + parameterWrapper->set(mgmHandlingParameters.mgm0softIronInverse); + break; + case 0xB: + parameterWrapper->set(mgmHandlingParameters.mgm1softIronInverse); + break; + case 0xC: + parameterWrapper->set(mgmHandlingParameters.mgm2softIronInverse); + break; + case 0xD: + parameterWrapper->set(mgmHandlingParameters.mgm3softIronInverse); + break; + case 0xE: + parameterWrapper->set(mgmHandlingParameters.mgm4softIronInverse); + break; + case 0xF: + parameterWrapper->set(mgmHandlingParameters.mgm02variance); + break; + case 0x10: + parameterWrapper->set(mgmHandlingParameters.mgm13variance); + break; + case 0x11: + parameterWrapper->set(mgmHandlingParameters.mgm4variance); + break; + default: + return INVALID_IDENTIFIER_ID; + } + break; + case 0x4: // SusHandlingParameters + switch (parameterId & 0xFF) { + case 0x0: + parameterWrapper->set(susHandlingParameters.sus0orientationMatrix); + break; + case 0x1: + parameterWrapper->set(susHandlingParameters.sus1orientationMatrix); + break; + case 0x2: + parameterWrapper->set(susHandlingParameters.sus2orientationMatrix); + break; + case 0x3: + parameterWrapper->set(susHandlingParameters.sus3orientationMatrix); + break; + case 0x4: + parameterWrapper->set(susHandlingParameters.sus4orientationMatrix); + break; + case 0x5: + parameterWrapper->set(susHandlingParameters.sus5orientationMatrix); + break; + case 0x6: + parameterWrapper->set(susHandlingParameters.sus6orientationMatrix); + break; + case 0x7: + parameterWrapper->set(susHandlingParameters.sus7orientationMatrix); + break; + case 0x8: + parameterWrapper->set(susHandlingParameters.sus8orientationMatrix); + break; + case 0x9: + parameterWrapper->set(susHandlingParameters.sus9orientationMatrix); + break; + case 0xA: + parameterWrapper->set(susHandlingParameters.sus10orientationMatrix); + break; + case 0xB: + parameterWrapper->set(susHandlingParameters.sus11orientationMatrix); + break; + case 0xC: + parameterWrapper->set(susHandlingParameters.sus0coeffAlpha); + break; + case 0xD: + parameterWrapper->set(susHandlingParameters.sus0coeffBeta); + break; + case 0xE: + parameterWrapper->set(susHandlingParameters.sus1coeffAlpha); + break; + case 0xF: + parameterWrapper->set(susHandlingParameters.sus1coeffBeta); + break; + case 0x10: + parameterWrapper->set(susHandlingParameters.sus2coeffAlpha); + break; + case 0x11: + parameterWrapper->set(susHandlingParameters.sus2coeffBeta); + break; + case 0x12: + parameterWrapper->set(susHandlingParameters.sus3coeffAlpha); + break; + case 0x13: + parameterWrapper->set(susHandlingParameters.sus3coeffBeta); + break; + case 0x14: + parameterWrapper->set(susHandlingParameters.sus4coeffAlpha); + break; + case 0x15: + parameterWrapper->set(susHandlingParameters.sus4coeffBeta); + break; + case 0x16: + parameterWrapper->set(susHandlingParameters.sus5coeffAlpha); + break; + case 0x17: + parameterWrapper->set(susHandlingParameters.sus5coeffBeta); + break; + case 0x18: + parameterWrapper->set(susHandlingParameters.sus6coeffAlpha); + break; + case 0x19: + parameterWrapper->set(susHandlingParameters.sus6coeffBeta); + break; + case 0x1A: + parameterWrapper->set(susHandlingParameters.sus7coeffAlpha); + break; + case 0x1B: + parameterWrapper->set(susHandlingParameters.sus7coeffBeta); + break; + case 0x1C: + parameterWrapper->set(susHandlingParameters.sus8coeffAlpha); + break; + case 0x1D: + parameterWrapper->set(susHandlingParameters.sus8coeffBeta); + break; + case 0x1E: + parameterWrapper->set(susHandlingParameters.sus9coeffAlpha); + break; + case 0x1F: + parameterWrapper->set(susHandlingParameters.sus9coeffBeta); + break; + case 0x20: + parameterWrapper->set(susHandlingParameters.sus10coeffAlpha); + break; + case 0x21: + parameterWrapper->set(susHandlingParameters.sus10coeffBeta); + break; + case 0x22: + parameterWrapper->set(susHandlingParameters.sus11coeffAlpha); + break; + case 0x23: + parameterWrapper->set(susHandlingParameters.sus11coeffBeta); + break; + case 0x24: + parameterWrapper->set(susHandlingParameters.filterAlpha); + break; + case 0x25: + parameterWrapper->set(susHandlingParameters.sunThresh); + break; + default: + return INVALID_IDENTIFIER_ID; + } + break; + case (0x5): // GyrHandlingParameters + switch (parameterId & 0xFF) { + case 0x0: + parameterWrapper->set(gyrHandlingParameters.gyr0orientationMatrix); + break; + case 0x1: + parameterWrapper->set(gyrHandlingParameters.gyr1orientationMatrix); + break; + case 0x2: + parameterWrapper->set(gyrHandlingParameters.gyr2orientationMatrix); + break; + case 0x3: + parameterWrapper->set(gyrHandlingParameters.gyr3orientationMatrix); + break; + case 0x4: + parameterWrapper->set(gyrHandlingParameters.gyr02variance); + break; + case 0x5: + parameterWrapper->set(gyrHandlingParameters.gyr13variance); + break; + case 0x6: + parameterWrapper->set(gyrHandlingParameters.preferAdis); + break; + default: + return INVALID_IDENTIFIER_ID; + } + break; + case (0x6): // RwHandlingParameters + switch (parameterId & 0xFF) { + case 0x0: + parameterWrapper->set(rwHandlingParameters.rw0orientationMatrix); + break; + case 0x1: + parameterWrapper->set(rwHandlingParameters.rw1orientationMatrix); + break; + case 0x2: + parameterWrapper->set(rwHandlingParameters.rw2orientationMatrix); + break; + case 0x3: + parameterWrapper->set(rwHandlingParameters.rw3orientationMatrix); + break; + case 0x4: + parameterWrapper->set(rwHandlingParameters.inertiaWheel); + break; + case 0x5: + parameterWrapper->set(rwHandlingParameters.maxTrq); + break; + case 0x6: + parameterWrapper->set(rwHandlingParameters.stictionSpeed); + break; + case 0x7: + parameterWrapper->set(rwHandlingParameters.stictionReleaseSpeed); + break; + case 0x8: + parameterWrapper->set(rwHandlingParameters.stictionTorque); + break; + default: + return INVALID_IDENTIFIER_ID; + } + break; + case (0x7): // RwMatrices + switch (parameterId & 0xFF) { + case 0x0: + parameterWrapper->set(rwMatrices.alignmentMatrix); + break; + case 0x1: + parameterWrapper->set(rwMatrices.pseudoInverse); + break; + case 0x2: + parameterWrapper->set(rwMatrices.without0); + break; + case 0x3: + parameterWrapper->set(rwMatrices.without1); + break; + case 0x4: + parameterWrapper->set(rwMatrices.without2); + break; + case 0x5: + parameterWrapper->set(rwMatrices.without3); + break; + case 0x6: + parameterWrapper->set(rwMatrices.nullspace); + break; + default: + return INVALID_IDENTIFIER_ID; + } + break; + case (0x8): // SafeModeControllerParameters + switch (parameterId & 0xFF) { + case 0x0: + parameterWrapper->set(safeModeControllerParameters.k_rate_mekf); + break; + case 0x1: + parameterWrapper->set(safeModeControllerParameters.k_align_mekf); + break; + case 0x2: + parameterWrapper->set(safeModeControllerParameters.k_rate_no_mekf); + break; + case 0x3: + parameterWrapper->set(safeModeControllerParameters.k_align_no_mekf); + break; + case 0x4: + parameterWrapper->set(safeModeControllerParameters.sunMagAngleMin); + break; + case 0x5: + parameterWrapper->set(safeModeControllerParameters.sunTargetDir); + break; + case 0x6: + parameterWrapper->set(safeModeControllerParameters.satRateRef); + break; + default: + return INVALID_IDENTIFIER_ID; + } + break; + case (0x9): // PointingModeControllerParameters + switch (parameterId & 0xFF) { + case 0x0: + parameterWrapper->set(targetModeControllerParameters.refDirection); + break; + case 0x1: + parameterWrapper->set(targetModeControllerParameters.refRotRate); + break; + case 0x2: + parameterWrapper->set(targetModeControllerParameters.quatRef); + break; + case 0x3: + parameterWrapper->set(targetModeControllerParameters.avoidBlindStr); + break; + case 0x4: + parameterWrapper->set(targetModeControllerParameters.blindAvoidStart); + break; + case 0x5: + parameterWrapper->set(targetModeControllerParameters.blindAvoidStop); + break; + case 0x6: + parameterWrapper->set(targetModeControllerParameters.blindRotRate); + break; + case 0x7: + parameterWrapper->set(targetModeControllerParameters.zeta); + break; + case 0x8: + parameterWrapper->set(targetModeControllerParameters.om); + break; + case 0x9: + parameterWrapper->set(targetModeControllerParameters.omMax); + break; + case 0xA: + parameterWrapper->set(targetModeControllerParameters.qiMin); + break; + case 0xB: + parameterWrapper->set(targetModeControllerParameters.gainNullspace); + break; + case 0xC: + parameterWrapper->set(targetModeControllerParameters.desatMomentumRef); + break; + case 0xD: + parameterWrapper->set(targetModeControllerParameters.deSatGainFactor); + break; + case 0xE: + parameterWrapper->set(targetModeControllerParameters.desatOn); + break; + case 0xF: + parameterWrapper->set(targetModeControllerParameters.omegaEarth); + break; + case 0x10: + parameterWrapper->set(targetModeControllerParameters.nadirRefDirection); + break; + case 0x11: + parameterWrapper->set(targetModeControllerParameters.tgtQuatInertial); + break; + case 0x12: + parameterWrapper->set(targetModeControllerParameters.tgtRotRateInertial); + break; + case 0x13: + parameterWrapper->set(targetModeControllerParameters.nadirTimeElapsedMax); + break; + default: + return INVALID_IDENTIFIER_ID; + } + break; + case (0xA): // StrParameters + switch (parameterId & 0xFF) { + case 0x0: + parameterWrapper->set(strParameters.exclusionAngle); + break; + case 0x1: + parameterWrapper->set(strParameters.boresightAxis); + break; + default: + return INVALID_IDENTIFIER_ID; + } + break; + case (0xB): // GpsParameters + switch (parameterId & 0xFF) { + case 0x0: + parameterWrapper->set(gpsParameters.timeDiffVelocityMax); + break; + default: + return INVALID_IDENTIFIER_ID; + } + break; + case (0xC): // GroundStationParameters + switch (parameterId & 0xFF) { + case 0x0: + parameterWrapper->set(groundStationParameters.latitudeGs); + break; + case 0x1: + parameterWrapper->set(groundStationParameters.longitudeGs); + break; + case 0x2: + parameterWrapper->set(groundStationParameters.altitudeGs); + break; + default: + return INVALID_IDENTIFIER_ID; + } + break; + case (0xD): // SunModelParameters + switch (parameterId & 0xFF) { + case 0x0: + parameterWrapper->set(sunModelParameters.domega); + break; + case 0x1: + parameterWrapper->set(sunModelParameters.omega_0); + break; + case 0x2: + parameterWrapper->set(sunModelParameters.m_0); + break; + case 0x3: + parameterWrapper->set(sunModelParameters.dm); + break; + case 0x4: + parameterWrapper->set(sunModelParameters.e); + break; + case 0x5: + parameterWrapper->set(sunModelParameters.e1); + break; + case 0x6: + parameterWrapper->set(sunModelParameters.p1); + break; + case 0x7: + parameterWrapper->set(sunModelParameters.p2); + break; + default: + return INVALID_IDENTIFIER_ID; + } + break; + case (0xE): // KalmanFilterParameters + switch (parameterId & 0xFF) { + case 0x0: + parameterWrapper->set(kalmanFilterParameters.sensorNoiseSTR); + break; + case 0x1: + parameterWrapper->set(kalmanFilterParameters.sensorNoiseSS); + break; + case 0x2: + parameterWrapper->set(kalmanFilterParameters.sensorNoiseMAG); + break; + case 0x3: + parameterWrapper->set(kalmanFilterParameters.sensorNoiseGYR); + break; + case 0x4: + parameterWrapper->set(kalmanFilterParameters.sensorNoiseArwGYR); + break; + case 0x5: + parameterWrapper->set(kalmanFilterParameters.sensorNoiseBsGYR); + break; + default: + return INVALID_IDENTIFIER_ID; + } + break; + case (0xF): // MagnetorquesParameter + switch (parameterId & 0xFF) { + case 0x0: + parameterWrapper->set(magnetorquesParameter.mtq0orientationMatrix); + break; + case 0x1: + parameterWrapper->set(magnetorquesParameter.mtq1orientationMatrix); + break; + case 0x2: + parameterWrapper->set(magnetorquesParameter.mtq2orientationMatrix); + break; + case 0x3: + parameterWrapper->set(magnetorquesParameter.alignmentMatrixMtq); + break; + case 0x4: + parameterWrapper->set(magnetorquesParameter.inverseAlignment); + break; + case 0x5: + parameterWrapper->set(magnetorquesParameter.DipolMax); + break; + default: + return INVALID_IDENTIFIER_ID; + } + break; + case (0x10): // DetumbleParameter + switch (parameterId & 0xFF) { + case 0x0: + parameterWrapper->set(detumbleParameter.detumblecounter); + break; + case 0x1: + parameterWrapper->set(detumbleParameter.omegaDetumbleStart); + break; + case 0x2: + parameterWrapper->set(detumbleParameter.omegaDetumbleEnd); + break; + case 0x3: + parameterWrapper->set(detumbleParameter.gainD); + break; + default: + return INVALID_IDENTIFIER_ID; + } + break; + default: + return INVALID_IDENTIFIER_ID; } return returnvalue::OK; - } else { - return INVALID_DOMAIN_ID; - } -}*/ + // } else { + // return INVALID_DOMAIN_ID; + // } +} diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index 8bd10091..3c88c9a1 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -12,15 +12,15 @@ typedef unsigned char uint8_t; -class AcsParameters /*: public HasParametersIF*/ { +class AcsParameters : public HasParametersIF { public: AcsParameters(); virtual ~AcsParameters(); - /* - virtual ReturnValue_t getParameter(uint8_t domainId, uint16_t parameterId, - ParameterWrapper *parameterWrapper, - const ParameterWrapper *newValues, uint16_t startAtIndex); - */ + + ReturnValue_t getParameter(uint8_t domainId, uint8_t parameterId, + ParameterWrapper *parameterWrapper, const ParameterWrapper *newValues, + uint16_t startAtIndex) override; + struct OnBoardParams { double sampleTime = 0.4; // [s] } onBoardParams; @@ -776,8 +776,7 @@ class AcsParameters /*: public HasParametersIF*/ { pow(3.0e-3 * sqrt(2), 2), // RND_y = 3.0e-3 deg/s/sqrt(Hz) rms pow(4.3e-3 * sqrt(2), 2)}; // RND_z = 4.3e-3 deg/s/sqrt(Hz) rms float gyr13variance[3] = {pow(11e-3, 2), pow(11e-3, 2), pow(11e-3, 2)}; - enum PreferAdis { NO = 0, YES = 1 }; - uint8_t preferAdis = PreferAdis::YES; + uint8_t preferAdis = true; } gyrHandlingParameters; struct RwHandlingParameters { @@ -834,7 +833,7 @@ class AcsParameters /*: public HasParametersIF*/ { double refDirection[3] = {-1, 0, 0}; // Antenna double refRotRate[3] = {0, 0, 0}; double quatRef[4] = {0, 0, 0, 1}; - bool avoidBlindStr = true; + uint8_t avoidBlindStr = true; double blindAvoidStart = 1.5; double blindAvoidStop = 2.5; double blindRotRate = 1 * M_PI / 180; @@ -847,8 +846,8 @@ class AcsParameters /*: public HasParametersIF*/ { double desatMomentumRef[3] = {0, 0, 0}; double deSatGainFactor = 1000; - bool desatOn = true; - bool enableAntiStiction = true; + uint8_t desatOn = true; + uint8_t enableAntiStiction = true; double omegaEarth = 0.000072921158553; diff --git a/mission/controller/acs/SensorProcessing.cpp b/mission/controller/acs/SensorProcessing.cpp index f5d2568b..7bbefe08 100644 --- a/mission/controller/acs/SensorProcessing.cpp +++ b/mission/controller/acs/SensorProcessing.cpp @@ -530,7 +530,7 @@ void SensorProcessing::processGyr( // take ADIS measurements, if both avail // if just one ADIS measurement avail, perform sensor fusion double gyrVecTot[3] = {0.0, 0.0, 0.0}; - if ((gyr0valid && gyr2valid) && gyrParameters->preferAdis == gyrParameters->PreferAdis::YES) { + if ((gyr0valid && gyr2valid) && gyrParameters->preferAdis == true) { double gyr02ValuesSum[3]; VectorOperations::add(gyr0ValueBody, gyr2ValueBody, gyr02ValuesSum, 3); VectorOperations::mulScalar(gyr02ValuesSum, .5, gyrVecTot, 3); From 6365f497a7396fdca23b6d9f7d5de2364396f961 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Mon, 19 Dec 2022 10:51:31 +0100 Subject: [PATCH 060/330] changes thermal control --- mission/controller/ThermalController.cpp | 107 +++++++++++++++++++---- mission/controller/ThermalController.h | 3 +- 2 files changed, 92 insertions(+), 18 deletions(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 9b68d085..bcb448a0 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -105,7 +105,29 @@ void ThermalController::performControlOperation() { } // TODO: Heater control + ctrlAcsBoard(); + ctrlMgt(); + ctrlRw(); + ctrlStr(); + ctrlIfBoard(); + ctrlTcsBoard(); + ctrlObc(); + ctrlObcIfBoard(); + ctrlSBandTransceiver(); + ctrlPcduP60Board(); + ctrlPcduAcu(); + ctrlPcduPdu(); + ctrlPlPcduBoard(); + ctrlPlocMissionBoard(); + ctrlPlocProcessingBoard(); + ctrlDac(); ctrlCameraBody(); + ctrlDro(); + ctrlX8(); + ctrlHpa(); + ctrlTx(); + ctrlMpa(); + ctrlScexBoard(); } ReturnValue_t ThermalController::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, @@ -953,9 +975,8 @@ void ThermalController::copyDevices() { } } +void ThermalController::ctrlAcsBoard() {} void ThermalController::ctrlMgt() { - float opLowerLimit = mgtLimits.opLowerLimit; - float cutOffLimit = mgtLimits.cutOffLimit; heater::Switchers switchNr = heater::HEATER_2_ACS_BRD; heater::Switchers redSwitchNr = heater::HEATER_3_PCDU_PDU; @@ -963,21 +984,70 @@ void ThermalController::ctrlMgt() { if (heaterAvailable) { chooseSensor(switchNr, sensorTemperatures.sensor_magnettorquer.value, - sensorTemperatures.sensor_magnettorquer.value, + deviceTemperatures.mgt.value, sensorTemperatures.sensor_plpcdu_heatspreader.value, sensorTemperatures.sensor_magnettorquer.isValid(), - sensorTemperatures.sensor_magnettorquer.isValid(), - sensorTemperatures.sensor_plpcdu_heatspreader.isValid()); // TODO: int sensor + deviceTemperatures.mgt.isValid(), + sensorTemperatures.sensor_plpcdu_heatspreader.isValid()); if (sensorTempAvailable) { - ctrlHeater(switchNr, redSwitchNr, opLowerLimit, cutOffLimit); + ctrlHeater(switchNr, redSwitchNr, &mgtLimits); } } } + +void ThermalController::ctrlRw() {} + +void ThermalController::ctrlStr() { + heater::Switchers switchNr = heater::HEATER_5_STR; + heater::Switchers redSwitchNr = heater::HEATER_6_DRO; + + chooseHeater(switchNr, redSwitchNr); + + if (heaterAvailable) { + chooseSensor(switchNr, sensorTemperatures.sensor_startracker.value, + deviceTemperatures.startracker.value, + sensorTemperatures.sensor_dro.value, + sensorTemperatures.sensor_startracker.isValid(), + deviceTemperatures.startracker.isValid(), + sensorTemperatures.sensor_dro.isValid()); + + if (sensorTempAvailable) { + ctrlHeater(switchNr, redSwitchNr, &strLimits); + } + } +} +void ThermalController::ctrlIfBoard() { + heater::Switchers switchNr = heater::HEATER_2_ACS_BRD; + heater::Switchers redSwitchNr = heater::HEATER_3_PCDU_PDU; + + chooseHeater(switchNr, redSwitchNr); + + if (heaterAvailable) { + chooseSensor(switchNr, sensorTemperatures.tmp1075IfBrd.value, + sensorTemperatures.sensor_magnettorquer.value, + deviceTemperatures.mgm2SideB.value, + sensorTemperatures.tmp1075IfBrd.isValid(), + sensorTemperatures.sensor_magnettorquer.isValid(), + deviceTemperatures.mgm2SideB.isValid()); + + if (sensorTempAvailable) { + ctrlHeater(switchNr, redSwitchNr, &ifBoardLimits); + } + } +} +void ThermalController::ctrlTcsBoard() {} +void ThermalController::ctrlObc() {} +void ThermalController::ctrlObcIfBoard() {} +void ThermalController::ctrlSBandTransceiver() {} +void ThermalController::ctrlPcduP60Board() {} +void ThermalController::ctrlPcduAcu() {} +void ThermalController::ctrlPcduPdu() {} +void ThermalController::ctrlPlPcduBoard() {} +void ThermalController::ctrlPlocMissionBoard() {} +void ThermalController::ctrlPlocProcessingBoard() {} +void ThermalController::ctrlDac() {} void ThermalController::ctrlCameraBody() { - // Camera Body - float opLowerLimit = cameraLimits.opLowerLimit; - float cutOffLimit = cameraLimits.cutOffLimit; heater::Switchers switchNr = heater::HEATER_4_CAMERA; heater::Switchers redSwitchNr = heater::HEATER_6_DRO; @@ -990,27 +1060,33 @@ void ThermalController::ctrlCameraBody() { sensorTemperatures.sensor_dro.isValid(), sensorTemperatures.sensor_mpa.isValid()); if (sensorTempAvailable) { - ctrlHeater(switchNr, redSwitchNr, opLowerLimit, cutOffLimit); + ctrlHeater(switchNr, redSwitchNr, &cameraLimits); } } } -void ThermalController::ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, - float opLowerLimit, float cutOffLimit) { +void ThermalController::ctrlDro() {} +void ThermalController::ctrlX8() {} +void ThermalController::ctrlHpa() {} +void ThermalController::ctrlTx() {} +void ThermalController::ctrlMpa() {} +void ThermalController::ctrlScexBoard() {} + +void ThermalController::ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, struct TempLimits *tempLimit) { // Heater off if (not heaterHandler.checkSwitchState(switchNr)) { // TODO: check if OP or NOP - if (sensorTemp < opLowerLimit) { + if (sensorTemp < (*tempLimit).opLowerLimit) { heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::ON); } // Heater on } else if (heaterHandler.checkSwitchState(switchNr)) { - if (sensorTemp >= opLowerLimit + TEMP_OFFSET) { + if (sensorTemp >= (*tempLimit).opLowerLimit + TEMP_OFFSET) { heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); } } else if (not redSwitchNrInUse) { if (heaterHandler.checkSwitchState(redSwitchNr)) { - if (sensorTemp >= cutOffLimit) { + if (sensorTemp >= (*tempLimit).cutOffLimit) { heaterHandler.switchHeater(redSwitchNr, HeaterHandler::SwitchState::OFF); } } @@ -1037,7 +1113,6 @@ void ThermalController::chooseHeater(heater::Switchers& switchNr, heater::Switch void ThermalController::chooseSensor(heater::Switchers switchNr, float sensorValue1, float sensorValue2, float sensorValue3, bool sensor1Valid, bool sensor2Valid, bool sensor3Valid) { - // Choose sensor sensorTempAvailable = true; if (sensor1Valid) { diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index ed765278..3094b8de 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -154,8 +154,7 @@ class ThermalController : public ExtendedControllerBase { void copySus(); void copyDevices(); - void ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, float opLowerLimit, - float cutOffLimit); + void ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, struct TempLimits *tempLimit); void chooseHeater(heater::Switchers& switchNr, heater::Switchers redSwitchNr); void chooseSensor(heater::Switchers switchNr, float sensorValue1, float sensorValue2, float sensorValue3, bool sensor1Valid, bool sensor2Valid, bool sensor3Valid); From e4936b1bedb3c0a08ceed13911cb0e8daa57c55c Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Mon, 19 Dec 2022 14:23:42 +0100 Subject: [PATCH 061/330] removed deprecated acs parameters and set sunMagAngleMin --- mission/controller/acs/AcsParameters.cpp | 26 ++++-------------------- mission/controller/acs/AcsParameters.h | 17 ++-------------- 2 files changed, 6 insertions(+), 37 deletions(-) diff --git a/mission/controller/acs/AcsParameters.cpp b/mission/controller/acs/AcsParameters.cpp index 3205f7b2..276204d2 100644 --- a/mission/controller/acs/AcsParameters.cpp +++ b/mission/controller/acs/AcsParameters.cpp @@ -219,12 +219,6 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, case 0x23: parameterWrapper->set(susHandlingParameters.sus11coeffBeta); break; - case 0x24: - parameterWrapper->set(susHandlingParameters.filterAlpha); - break; - case 0x25: - parameterWrapper->set(susHandlingParameters.sunThresh); - break; default: return INVALID_IDENTIFIER_ID; } @@ -259,30 +253,18 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, case (0x6): // RwHandlingParameters switch (parameterId & 0xFF) { case 0x0: - parameterWrapper->set(rwHandlingParameters.rw0orientationMatrix); - break; - case 0x1: - parameterWrapper->set(rwHandlingParameters.rw1orientationMatrix); - break; - case 0x2: - parameterWrapper->set(rwHandlingParameters.rw2orientationMatrix); - break; - case 0x3: - parameterWrapper->set(rwHandlingParameters.rw3orientationMatrix); - break; - case 0x4: parameterWrapper->set(rwHandlingParameters.inertiaWheel); break; - case 0x5: + case 0x1: parameterWrapper->set(rwHandlingParameters.maxTrq); break; - case 0x6: + case 0x2: parameterWrapper->set(rwHandlingParameters.stictionSpeed); break; - case 0x7: + case 0x3: parameterWrapper->set(rwHandlingParameters.stictionReleaseSpeed); break; - case 0x8: + case 0x4: parameterWrapper->set(rwHandlingParameters.stictionTorque); break; default: diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index 3c88c9a1..895eaf9b 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -760,9 +760,6 @@ class AcsParameters : public HasParametersIF { {116.975421945286, -5.53022680362263, -5.61081660666997, 0.109754904982136, 0.167666815691513, 0.163137400730063, -0.000609874123906977, -0.00205336098697513, -0.000889232196185857, -0.00168429567131815}}; - - float filterAlpha; - float sunThresh; } susHandlingParameters; struct GyrHandlingParameters { @@ -780,10 +777,6 @@ class AcsParameters : public HasParametersIF { } gyrHandlingParameters; struct RwHandlingParameters { - double rw0orientationMatrix[3][3]; - double rw1orientationMatrix[3][3]; - double rw2orientationMatrix[3][3]; - double rw3orientationMatrix[3][3]; double inertiaWheel = 0.000028198; double maxTrq = 0.0032; // 3.2 [mNm] double stictionSpeed = 80; // RPM @@ -795,11 +788,6 @@ class AcsParameters : public HasParametersIF { double alignmentMatrix[3][4] = {{0.9205, 0.0000, -0.9205, 0.0000}, {0.0000, -0.9205, 0.0000, 0.9205}, {0.3907, 0.3907, 0.3907, 0.3907}}; - // double pseudoInverse[4][3] = {{0.4434, -0.2845, 0.3597}, - // {0.2136, -0.3317, 1.0123}, - // {-0.8672, -0.1406, 0.1778}, - // {0.6426, 0.4794, 1.3603}}; - // where does the first pseudo inverse come frome - matlab gives result below double pseudoInverse[4][3] = { {0.5432, 0, 0.6398}, {0, -0.5432, 0.6398}, {-0.5432, 0, 0.6398}, {0, 0.5432, 0.6398}}; double without0[4][3] = { @@ -818,10 +806,9 @@ class AcsParameters : public HasParametersIF { double k_align_mekf = 0.000056875; double k_rate_no_mekf = 0.00059437; - ; double k_align_no_mekf = 0.000056875; - ; - double sunMagAngleMin; // ??? + + double sunMagAngleMin = 5 * M_PI / 180; double sunTargetDir[3] = {0, 0, 1}; double satRateRef[3] = {0, 0, 0}; From c338c4fb58c494596cfd4c2ff546906541a39125 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Mon, 19 Dec 2022 14:24:03 +0100 Subject: [PATCH 062/330] fixed usage of sunMagAngleMin --- mission/controller/acs/control/SafeCtrl.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mission/controller/acs/control/SafeCtrl.cpp b/mission/controller/acs/control/SafeCtrl.cpp index 54ae27ee..88f4de9b 100644 --- a/mission/controller/acs/control/SafeCtrl.cpp +++ b/mission/controller/acs/control/SafeCtrl.cpp @@ -129,10 +129,8 @@ void SafeCtrl::safeNoMekf(timeval now, double *susDirB, bool susDirBValid, doubl /* Only valid if angle between sun direction and magnetic field direction is sufficiently large */ - double sinAngle = 0; - sinAngle = sin(acos(cos(cosAngleSunMag))); - - if (!(sinAngle > sin(safeModeControllerParameters->sunMagAngleMin * M_PI / 180))) { + double angleSunMag = acos(cosAngleSunMag); + if (angleSunMag < safeModeControllerParameters->sunMagAngleMin) { return; } From d9d75590972c777ad5c711c1d29d8628613cd26a Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Mon, 19 Dec 2022 14:34:20 +0100 Subject: [PATCH 063/330] fixed usage of wrong sample time for MEKF --- .../controller/acs/MultiplicativeKalmanFilter.cpp | 13 ++++++++----- mission/controller/acs/MultiplicativeKalmanFilter.h | 3 +-- mission/controller/acs/Navigation.cpp | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/mission/controller/acs/MultiplicativeKalmanFilter.cpp b/mission/controller/acs/MultiplicativeKalmanFilter.cpp index 14c2a2ec..f54893a2 100644 --- a/mission/controller/acs/MultiplicativeKalmanFilter.cpp +++ b/mission/controller/acs/MultiplicativeKalmanFilter.cpp @@ -197,11 +197,14 @@ void MultiplicativeKalmanFilter::init( } // --------------- MEKF DISCRETE TIME STEP ------------------------------- -ReturnValue_t MultiplicativeKalmanFilter::mekfEst( - const double *quaternionSTR, const bool validSTR_, const double *rateGYRs_, - const bool validGYRs_, const double *magneticField_, const bool validMagField_, - const double *sunDir_, const bool validSS, const double *sunDirJ, const bool validSSModel, - const double *magFieldJ, const bool validMagModel, acsctrl::MekfData *mekfData) { +ReturnValue_t MultiplicativeKalmanFilter::mekfEst(const double *quaternionSTR, const bool validSTR_, + const double *rateGYRs_, const bool validGYRs_, + const double *magneticField_, + const bool validMagField_, const double *sunDir_, + const bool validSS, const double *sunDirJ, + const bool validSSModel, const double *magFieldJ, + const bool validMagModel, double sampleTime, + acsctrl::MekfData *mekfData) { // Check for GYR Measurements int MDF = 0; // Matrix Dimension Factor if (!validGYRs_) { diff --git a/mission/controller/acs/MultiplicativeKalmanFilter.h b/mission/controller/acs/MultiplicativeKalmanFilter.h index 5eb47418..79d39510 100644 --- a/mission/controller/acs/MultiplicativeKalmanFilter.h +++ b/mission/controller/acs/MultiplicativeKalmanFilter.h @@ -61,7 +61,7 @@ class MultiplicativeKalmanFilter { const bool validGYRs_, const double *magneticField_, const bool validMagField_, const double *sunDir_, const bool validSS, const double *sunDirJ, const bool validSSModel, const double *magFieldJ, - const bool validMagModel, acsctrl::MekfData *mekfData); + const bool validMagModel, double sampleTime, acsctrl::MekfData *mekfData); // Declaration of Events (like init) and memberships // static const uint8_t INTERFACE_ID = CLASS_ID::MEKF; //CLASS IDS ND @@ -79,7 +79,6 @@ class MultiplicativeKalmanFilter { AcsParameters::KalmanFilterParameters *kalmanFilterParameters; double quaternion_STR_SB[4]; bool validInit; - double sampleTime = 0.1; /*States*/ double initialQuaternion[4]; /*after reset?QUEST*/ diff --git a/mission/controller/acs/Navigation.cpp b/mission/controller/acs/Navigation.cpp index 921ae604..a9de5817 100644 --- a/mission/controller/acs/Navigation.cpp +++ b/mission/controller/acs/Navigation.cpp @@ -39,7 +39,7 @@ void Navigation::useMekf(ACS::SensorValues *sensorValues, mgmDataProcessed->mgmVecTot.isValid(), susDataProcessed->susVecTot.value, susDataProcessed->susVecTot.isValid(), susDataProcessed->sunIjkModel.value, susDataProcessed->sunIjkModel.isValid(), mgmDataProcessed->magIgrfModel.value, - mgmDataProcessed->magIgrfModel.isValid(), + mgmDataProcessed->magIgrfModel.isValid(), acsParameters.onBoardParams.sampleTime, mekfData); // VALIDS FOR QUAT AND RATE ?? } else { multiplicativeKalmanFilter.init( From 8bfe2405cdd56b3fa5d5bcc4151260c76509fa89 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Mon, 19 Dec 2022 18:30:22 +0100 Subject: [PATCH 064/330] changes thermal control --- mission/controller/ThermalController.cpp | 115 ++++++++++++++++++----- mission/controller/ThermalController.h | 4 +- 2 files changed, 95 insertions(+), 24 deletions(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index bcb448a0..53530634 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -975,7 +975,9 @@ void ThermalController::copyDevices() { } } -void ThermalController::ctrlAcsBoard() {} +void ThermalController::ctrlAcsBoard() { + ctrlComponentTemperature(heater::HEATER_2_ACS_BRD, heater::HEATER_0_OBC_BRD, &acsBoardLimits); +} void ThermalController::ctrlMgt() { heater::Switchers switchNr = heater::HEATER_2_ACS_BRD; heater::Switchers redSwitchNr = heater::HEATER_3_PCDU_PDU; @@ -984,8 +986,7 @@ void ThermalController::ctrlMgt() { if (heaterAvailable) { chooseSensor(switchNr, sensorTemperatures.sensor_magnettorquer.value, - deviceTemperatures.mgt.value, - sensorTemperatures.sensor_plpcdu_heatspreader.value, + deviceTemperatures.mgt.value, sensorTemperatures.sensor_plpcdu_heatspreader.value, sensorTemperatures.sensor_magnettorquer.isValid(), deviceTemperatures.mgt.isValid(), sensorTemperatures.sensor_plpcdu_heatspreader.isValid()); @@ -996,7 +997,9 @@ void ThermalController::ctrlMgt() { } } -void ThermalController::ctrlRw() {} +void ThermalController::ctrlRw() { + ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_6_DRO, &rwLimits); +} void ThermalController::ctrlStr() { heater::Switchers switchNr = heater::HEATER_5_STR; @@ -1006,11 +1009,9 @@ void ThermalController::ctrlStr() { if (heaterAvailable) { chooseSensor(switchNr, sensorTemperatures.sensor_startracker.value, - deviceTemperatures.startracker.value, - sensorTemperatures.sensor_dro.value, + deviceTemperatures.startracker.value, sensorTemperatures.sensor_dro.value, sensorTemperatures.sensor_startracker.isValid(), - deviceTemperatures.startracker.isValid(), - sensorTemperatures.sensor_dro.isValid()); + deviceTemperatures.startracker.isValid(), sensorTemperatures.sensor_dro.isValid()); if (sensorTempAvailable) { ctrlHeater(switchNr, redSwitchNr, &strLimits); @@ -1025,8 +1026,7 @@ void ThermalController::ctrlIfBoard() { if (heaterAvailable) { chooseSensor(switchNr, sensorTemperatures.tmp1075IfBrd.value, - sensorTemperatures.sensor_magnettorquer.value, - deviceTemperatures.mgm2SideB.value, + sensorTemperatures.sensor_magnettorquer.value, deviceTemperatures.mgm2SideB.value, sensorTemperatures.tmp1075IfBrd.isValid(), sensorTemperatures.sensor_magnettorquer.isValid(), deviceTemperatures.mgm2SideB.isValid()); @@ -1036,17 +1036,71 @@ void ThermalController::ctrlIfBoard() { } } } -void ThermalController::ctrlTcsBoard() {} -void ThermalController::ctrlObc() {} -void ThermalController::ctrlObcIfBoard() {} -void ThermalController::ctrlSBandTransceiver() {} -void ThermalController::ctrlPcduP60Board() {} -void ThermalController::ctrlPcduAcu() {} -void ThermalController::ctrlPcduPdu() {} -void ThermalController::ctrlPlPcduBoard() {} -void ThermalController::ctrlPlocMissionBoard() {} -void ThermalController::ctrlPlocProcessingBoard() {} -void ThermalController::ctrlDac() {} +void ThermalController::ctrlTcsBoard() { + ctrlComponentTemperature(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, &tcsBoardLimits); +} +void ThermalController::ctrlObc() { + ctrlComponentTemperature(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, &obcLimits); +} +void ThermalController::ctrlObcIfBoard() { + ctrlComponentTemperature(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, &obcIfBoardLimits); +} +void ThermalController::ctrlSBandTransceiver() { + ctrlComponentTemperature(heater::HEATER_7_S_BAND, heater::HEATER_4_CAMERA, &sBandTransceiverLimits); +} +void ThermalController::ctrlPcduP60Board() { + ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, &pcduP60BoardLimits); +} +void ThermalController::ctrlPcduAcu() { + ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, &pcduAcuLimits); +} +void ThermalController::ctrlPcduPdu() { + ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, &pcduPduLimits); +} +void ThermalController::ctrlPlPcduBoard() { + ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, &plPcduBoardLimits); +} +void ThermalController::ctrlPlocMissionBoard() { + ctrlComponentTemperature(heater::HEATER_1_PLOC_PROC_BRD, heater::HEATER_0_OBC_BRD, &plocMissionBoardLimits); +} +void ThermalController::ctrlPlocProcessingBoard() { + heater::Switchers switchNr = heater::HEATER_1_PLOC_PROC_BRD; + heater::Switchers redSwitchNr = heater::HEATER_0_OBC_BRD; + + chooseHeater(switchNr, redSwitchNr); + + if (heaterAvailable) { + chooseSensor(switchNr, sensorTemperatures.sensor_ploc_missionboard.value, + sensorTemperatures.sensor_ploc_heatspreader.value, + sensorTemperatures.sensor_dac_heatspreader.value, + sensorTemperatures.sensor_ploc_missionboard.isValid(), + sensorTemperatures.sensor_ploc_heatspreader.isValid(), + sensorTemperatures.sensor_dac_heatspreader.isValid()); + + if (sensorTempAvailable) { + ctrlHeater(switchNr, redSwitchNr, &plocProcessingBoardLimits); + } + } +} +void ThermalController::ctrlDac() { + heater::Switchers switchNr = heater::HEATER_1_PLOC_PROC_BRD; + heater::Switchers redSwitchNr = heater::HEATER_0_OBC_BRD; + + chooseHeater(switchNr, redSwitchNr); + + if (heaterAvailable) { + chooseSensor(switchNr, sensorTemperatures.sensor_dac_heatspreader.value, + sensorTemperatures.sensor_ploc_missionboard.value, + sensorTemperatures.sensor_ploc_heatspreader.value, + sensorTemperatures.sensor_dac_heatspreader.isValid(), + sensorTemperatures.sensor_ploc_missionboard.isValid(), + sensorTemperatures.sensor_ploc_heatspreader.isValid()); + + if (sensorTempAvailable) { + ctrlHeater(switchNr, redSwitchNr, &dacLimits); + } + } +} void ThermalController::ctrlCameraBody() { heater::Switchers switchNr = heater::HEATER_4_CAMERA; heater::Switchers redSwitchNr = heater::HEATER_6_DRO; @@ -1072,7 +1126,8 @@ void ThermalController::ctrlTx() {} void ThermalController::ctrlMpa() {} void ThermalController::ctrlScexBoard() {} -void ThermalController::ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, struct TempLimits *tempLimit) { +void ThermalController::ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, + struct TempLimits* tempLimit) { // Heater off if (not heaterHandler.checkSwitchState(switchNr)) { // TODO: check if OP or NOP @@ -1128,4 +1183,18 @@ void ThermalController::chooseSensor(heater::Switchers switchNr, float sensorVal triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); sensorTempAvailable = false; } -} \ No newline at end of file +} + +void ThermalController::ctrlComponentTemperature(heater::Switchers switchNr, heater::Switchers redSwitchNr, TempLimits *tempLimit) { + + chooseHeater(switchNr, redSwitchNr); + + if (heaterAvailable) { + //chooseSensor(); //TODO + + if (sensorTempAvailable) { + ctrlHeater(switchNr, redSwitchNr, tempLimit); + } + } +} + diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 3094b8de..35707ff5 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -154,7 +154,9 @@ class ThermalController : public ExtendedControllerBase { void copySus(); void copyDevices(); - void ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, struct TempLimits *tempLimit); + void ctrlComponentTemperature(heater::Switchers switchNr, heater::Switchers redSwitchNr, TempLimits *tempLimit); + void ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, + struct TempLimits* tempLimit); void chooseHeater(heater::Switchers& switchNr, heater::Switchers redSwitchNr); void chooseSensor(heater::Switchers switchNr, float sensorValue1, float sensorValue2, float sensorValue3, bool sensor1Valid, bool sensor2Valid, bool sensor3Valid); From 20fd204aa93b1e8859ff6859d6bc3329a82e3fbd Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Mon, 19 Dec 2022 18:45:08 +0100 Subject: [PATCH 065/330] changes thermal control --- mission/controller/ThermalController.cpp | 61 ++++++++++++++++++------ mission/controller/ThermalController.h | 3 +- 2 files changed, 49 insertions(+), 15 deletions(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 53530634..d0456c54 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -978,6 +978,7 @@ void ThermalController::copyDevices() { void ThermalController::ctrlAcsBoard() { ctrlComponentTemperature(heater::HEATER_2_ACS_BRD, heater::HEATER_0_OBC_BRD, &acsBoardLimits); } + void ThermalController::ctrlMgt() { heater::Switchers switchNr = heater::HEATER_2_ACS_BRD; heater::Switchers redSwitchNr = heater::HEATER_3_PCDU_PDU; @@ -1018,6 +1019,7 @@ void ThermalController::ctrlStr() { } } } + void ThermalController::ctrlIfBoard() { heater::Switchers switchNr = heater::HEATER_2_ACS_BRD; heater::Switchers redSwitchNr = heater::HEATER_3_PCDU_PDU; @@ -1036,33 +1038,45 @@ void ThermalController::ctrlIfBoard() { } } } + void ThermalController::ctrlTcsBoard() { ctrlComponentTemperature(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, &tcsBoardLimits); } + void ThermalController::ctrlObc() { ctrlComponentTemperature(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, &obcLimits); } + void ThermalController::ctrlObcIfBoard() { ctrlComponentTemperature(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, &obcIfBoardLimits); } + void ThermalController::ctrlSBandTransceiver() { - ctrlComponentTemperature(heater::HEATER_7_S_BAND, heater::HEATER_4_CAMERA, &sBandTransceiverLimits); + ctrlComponentTemperature(heater::HEATER_7_S_BAND, heater::HEATER_4_CAMERA, + &sBandTransceiverLimits); } void ThermalController::ctrlPcduP60Board() { - ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, &pcduP60BoardLimits); + ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, + &pcduP60BoardLimits); } + void ThermalController::ctrlPcduAcu() { ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, &pcduAcuLimits); } + void ThermalController::ctrlPcduPdu() { ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, &pcduPduLimits); } + void ThermalController::ctrlPlPcduBoard() { ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, &plPcduBoardLimits); } + void ThermalController::ctrlPlocMissionBoard() { - ctrlComponentTemperature(heater::HEATER_1_PLOC_PROC_BRD, heater::HEATER_0_OBC_BRD, &plocMissionBoardLimits); + ctrlComponentTemperature(heater::HEATER_1_PLOC_PROC_BRD, heater::HEATER_0_OBC_BRD, + &plocMissionBoardLimits); } + void ThermalController::ctrlPlocProcessingBoard() { heater::Switchers switchNr = heater::HEATER_1_PLOC_PROC_BRD; heater::Switchers redSwitchNr = heater::HEATER_0_OBC_BRD; @@ -1082,6 +1096,7 @@ void ThermalController::ctrlPlocProcessingBoard() { } } } + void ThermalController::ctrlDac() { heater::Switchers switchNr = heater::HEATER_1_PLOC_PROC_BRD; heater::Switchers redSwitchNr = heater::HEATER_0_OBC_BRD; @@ -1101,6 +1116,7 @@ void ThermalController::ctrlDac() { } } } + void ThermalController::ctrlCameraBody() { heater::Switchers switchNr = heater::HEATER_4_CAMERA; heater::Switchers redSwitchNr = heater::HEATER_6_DRO; @@ -1119,12 +1135,29 @@ void ThermalController::ctrlCameraBody() { } } -void ThermalController::ctrlDro() {} -void ThermalController::ctrlX8() {} -void ThermalController::ctrlHpa() {} -void ThermalController::ctrlTx() {} -void ThermalController::ctrlMpa() {} -void ThermalController::ctrlScexBoard() {} +void ThermalController::ctrlDro() { + ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, &droLimits); +} + +void ThermalController::ctrlX8() { + ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, &x8Limits); +} + +void ThermalController::ctrlTx() { + ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, &txLimits); +} + +void ThermalController::ctrlMpa() { + ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, &mpaLimits); +} + +void ThermalController::ctrlHpa() { + ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, &hpaLimits); +} + +void ThermalController::ctrlScexBoard() { + ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_5_STR, &scexBoardLimits); +} void ThermalController::ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, struct TempLimits* tempLimit) { @@ -1185,16 +1218,16 @@ void ThermalController::chooseSensor(heater::Switchers switchNr, float sensorVal } } -void ThermalController::ctrlComponentTemperature(heater::Switchers switchNr, heater::Switchers redSwitchNr, TempLimits *tempLimit) { - +void ThermalController::ctrlComponentTemperature(heater::Switchers switchNr, + heater::Switchers redSwitchNr, + TempLimits* tempLimit) { chooseHeater(switchNr, redSwitchNr); if (heaterAvailable) { - //chooseSensor(); //TODO + // chooseSensor(); //TODO if (sensorTempAvailable) { ctrlHeater(switchNr, redSwitchNr, tempLimit); } } -} - +} \ No newline at end of file diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 35707ff5..874297fd 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -154,7 +154,8 @@ class ThermalController : public ExtendedControllerBase { void copySus(); void copyDevices(); - void ctrlComponentTemperature(heater::Switchers switchNr, heater::Switchers redSwitchNr, TempLimits *tempLimit); + void ctrlComponentTemperature(heater::Switchers switchNr, heater::Switchers redSwitchNr, + TempLimits* tempLimit); void ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, struct TempLimits* tempLimit); void chooseHeater(heater::Switchers& switchNr, heater::Switchers redSwitchNr); From bd52da8afdefa59724759f8293bf2c51dde91a43 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Tue, 20 Dec 2022 09:59:42 +0100 Subject: [PATCH 066/330] set stictionSpeed to minimum commandable RW speed --- mission/controller/acs/AcsParameters.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index 895eaf9b..e2f26c96 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -767,8 +767,8 @@ class AcsParameters : public HasParametersIF { double gyr1orientationMatrix[3][3] = {{0, 0, -1}, {0, 1, 0}, {1, 0, 0}}; double gyr2orientationMatrix[3][3] = {{0, 0, -1}, {0, -1, 0}, {-1, 0, 0}}; double gyr3orientationMatrix[3][3] = {{0, 0, -1}, {0, 1, 0}, {1, 0, 0}}; - // var = sqrt(sigma), sigma = RND*sqrt(freq), following values are RND^2 and not var as freq is - // assumed to be equal for the same class of sensors + /* var = sqrt(sigma), sigma = RND*sqrt(freq), following values are RND^2 and not var as freq is + * assumed to be equal for the same class of sensors */ float gyr02variance[3] = {pow(3.0e-3 * sqrt(2), 2), // RND_x = 3.0e-3 deg/s/sqrt(Hz) rms pow(3.0e-3 * sqrt(2), 2), // RND_y = 3.0e-3 deg/s/sqrt(Hz) rms pow(4.3e-3 * sqrt(2), 2)}; // RND_z = 4.3e-3 deg/s/sqrt(Hz) rms @@ -779,7 +779,7 @@ class AcsParameters : public HasParametersIF { struct RwHandlingParameters { double inertiaWheel = 0.000028198; double maxTrq = 0.0032; // 3.2 [mNm] - double stictionSpeed = 80; // RPM + double stictionSpeed = 100; // 80; // RPM double stictionReleaseSpeed = 120; // RPM double stictionTorque = 0.0006; } rwHandlingParameters; From bac8166611090c85c9ce71bb9e477a884c4c8ed0 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Tue, 20 Dec 2022 15:47:40 +0100 Subject: [PATCH 067/330] changes thermal control --- mission/controller/ThermalController.cpp | 17 ++++++++++------- mission/controller/ThermalController.h | 3 ++- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index d0456c54..380b70cf 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -105,7 +105,8 @@ void ThermalController::performControlOperation() { } // TODO: Heater control - ctrlAcsBoard(); + ctrlCameraBody(); + /*ctrlAcsBoard(); ctrlMgt(); ctrlRw(); ctrlStr(); @@ -121,13 +122,13 @@ void ThermalController::performControlOperation() { ctrlPlocMissionBoard(); ctrlPlocProcessingBoard(); ctrlDac(); - ctrlCameraBody(); + ctrlDro(); ctrlX8(); ctrlHpa(); ctrlTx(); ctrlMpa(); - ctrlScexBoard(); + ctrlScexBoard();*/ } ReturnValue_t ThermalController::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, @@ -1121,7 +1122,7 @@ void ThermalController::ctrlCameraBody() { heater::Switchers switchNr = heater::HEATER_4_CAMERA; heater::Switchers redSwitchNr = heater::HEATER_6_DRO; - chooseHeater(switchNr, redSwitchNr); + //chooseHeater(switchNr, redSwitchNr); if (heaterAvailable) { chooseSensor(switchNr, sensorTemperatures.sensor_4k_camera.value, @@ -1130,7 +1131,7 @@ void ThermalController::ctrlCameraBody() { sensorTemperatures.sensor_dro.isValid(), sensorTemperatures.sensor_mpa.isValid()); if (sensorTempAvailable) { - ctrlHeater(switchNr, redSwitchNr, &cameraLimits); + //ctrlHeater(switchNr, redSwitchNr, &cameraLimits); } } } @@ -1191,7 +1192,8 @@ void ThermalController::chooseHeater(heater::Switchers& switchNr, heater::Switch redSwitchNrInUse = true; } else { heaterAvailable = false; - // TODO: triggerEvent ? + //TODO: triggerEvent(NO_HEALTHY_HEATER_AVAILABLE, switchNr, redSwitchNr); + sif::error << "ThermalController::chooseSensor: Both heater: "<< switchNr << " + " << redSwitchNr << " not healthy" << std::endl; } } else { redSwitchNrInUse = false; @@ -1213,7 +1215,8 @@ void ThermalController::chooseSensor(heater::Switchers switchNr, float sensorVal if (heaterHandler.checkSwitchState(switchNr)) { heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); } - triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); + //TODO: triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); + sif::error << "ThermalController::chooseSensor: No valid Sensor found"<< std::endl; sensorTempAvailable = false; } } diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 874297fd..5611b67f 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -55,7 +55,8 @@ class ThermalController : public ExtendedControllerBase { private: static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::HEATER_HANDLER; - static constexpr Event NO_VALID_SENSOR_TEMPERATURE = MAKE_EVENT(0, severity::LOW); + static constexpr Event NO_VALID_SENSOR_TEMPERATURE = MAKE_EVENT(8, severity::MEDIUM); + static constexpr Event NO_HEALTHY_HEATER_AVAILABLE = MAKE_EVENT(9, severity::MEDIUM); static const uint32_t DELAY = 500; From 23906047ec28f963d7f6a76f41550d61df5cb9fe Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Wed, 4 Jan 2023 17:30:17 +0100 Subject: [PATCH 068/330] thermal control changes --- mission/controller/ThermalController.cpp | 59 +++++++++++++----------- mission/controller/ThermalController.h | 5 +- 2 files changed, 35 insertions(+), 29 deletions(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 380b70cf..538f6434 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -976,6 +976,7 @@ void ThermalController::copyDevices() { } } +/* void ThermalController::ctrlAcsBoard() { ctrlComponentTemperature(heater::HEATER_2_ACS_BRD, heater::HEATER_0_OBC_BRD, &acsBoardLimits); } @@ -987,7 +988,7 @@ void ThermalController::ctrlMgt() { chooseHeater(switchNr, redSwitchNr); if (heaterAvailable) { - chooseSensor(switchNr, sensorTemperatures.sensor_magnettorquer.value, + chooseSensorOldVersion(switchNr, sensorTemperatures.sensor_magnettorquer.value, deviceTemperatures.mgt.value, sensorTemperatures.sensor_plpcdu_heatspreader.value, sensorTemperatures.sensor_magnettorquer.isValid(), deviceTemperatures.mgt.isValid(), @@ -1010,7 +1011,7 @@ void ThermalController::ctrlStr() { chooseHeater(switchNr, redSwitchNr); if (heaterAvailable) { - chooseSensor(switchNr, sensorTemperatures.sensor_startracker.value, + chooseSensorOldVersion(switchNr, sensorTemperatures.sensor_startracker.value, deviceTemperatures.startracker.value, sensorTemperatures.sensor_dro.value, sensorTemperatures.sensor_startracker.isValid(), deviceTemperatures.startracker.isValid(), sensorTemperatures.sensor_dro.isValid()); @@ -1028,7 +1029,7 @@ void ThermalController::ctrlIfBoard() { chooseHeater(switchNr, redSwitchNr); if (heaterAvailable) { - chooseSensor(switchNr, sensorTemperatures.tmp1075IfBrd.value, + chooseSensorOldVersion(switchNr, sensorTemperatures.tmp1075IfBrd.value, sensorTemperatures.sensor_magnettorquer.value, deviceTemperatures.mgm2SideB.value, sensorTemperatures.tmp1075IfBrd.isValid(), sensorTemperatures.sensor_magnettorquer.isValid(), @@ -1085,7 +1086,7 @@ void ThermalController::ctrlPlocProcessingBoard() { chooseHeater(switchNr, redSwitchNr); if (heaterAvailable) { - chooseSensor(switchNr, sensorTemperatures.sensor_ploc_missionboard.value, + chooseSensorOldVersion(switchNr, sensorTemperatures.sensor_ploc_missionboard.value, sensorTemperatures.sensor_ploc_heatspreader.value, sensorTemperatures.sensor_dac_heatspreader.value, sensorTemperatures.sensor_ploc_missionboard.isValid(), @@ -1105,7 +1106,7 @@ void ThermalController::ctrlDac() { chooseHeater(switchNr, redSwitchNr); if (heaterAvailable) { - chooseSensor(switchNr, sensorTemperatures.sensor_dac_heatspreader.value, + chooseSensorOldVersion(switchNr, sensorTemperatures.sensor_dac_heatspreader.value, sensorTemperatures.sensor_ploc_missionboard.value, sensorTemperatures.sensor_ploc_heatspreader.value, sensorTemperatures.sensor_dac_heatspreader.isValid(), @@ -1117,25 +1118,11 @@ void ThermalController::ctrlDac() { } } } - +*/ void ThermalController::ctrlCameraBody() { - heater::Switchers switchNr = heater::HEATER_4_CAMERA; - heater::Switchers redSwitchNr = heater::HEATER_6_DRO; - - //chooseHeater(switchNr, redSwitchNr); - - if (heaterAvailable) { - chooseSensor(switchNr, sensorTemperatures.sensor_4k_camera.value, - sensorTemperatures.sensor_dro.value, sensorTemperatures.sensor_mpa.value, - sensorTemperatures.sensor_4k_camera.isValid(), - sensorTemperatures.sensor_dro.isValid(), sensorTemperatures.sensor_mpa.isValid()); - - if (sensorTempAvailable) { - //ctrlHeater(switchNr, redSwitchNr, &cameraLimits); - } - } + ctrlComponentTemperature(heater::HEATER_4_CAMERA, heater::HEATER_6_DRO, sensorTemperatures.sensor_4k_camera, sensorTemperatures.sensor_dro, sensorTemperatures.sensor_mpa, &cameraLimits); } - +/* void ThermalController::ctrlDro() { ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, &droLimits); } @@ -1159,7 +1146,7 @@ void ThermalController::ctrlHpa() { void ThermalController::ctrlScexBoard() { ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_5_STR, &scexBoardLimits); } - +*/ void ThermalController::ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, struct TempLimits* tempLimit) { // Heater off @@ -1183,7 +1170,6 @@ void ThermalController::ctrlHeater(heater::Switchers switchNr, heater::Switchers } void ThermalController::chooseHeater(heater::Switchers& switchNr, heater::Switchers redSwitchNr) { - // Choose Heater heaterAvailable = true; if (heaterHandler.getHealth(switchNr) != HasHealthIF::HEALTHY) { @@ -1200,7 +1186,26 @@ void ThermalController::chooseHeater(heater::Switchers& switchNr, heater::Switch } } -void ThermalController::chooseSensor(heater::Switchers switchNr, float sensorValue1, +void ThermalController::chooseSensor(heater::Switchers switchNr, const lp_float_t& sensor1, const lp_float_t& sensor2, const lp_float_t& sensor3) { + sensorTempAvailable = true; + + if (sensor1.isValid()) { + sensorTemp = sensor1.value; + } else if (sensor2.isValid()) { + sensorTemp = sensor2.value; + } else if (sensor3.isValid()) { + sensorTemp = sensor3.value; + } else { + if (heaterHandler.checkSwitchState(switchNr)) { + heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); + } + //TODO: triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); + sif::error << "ThermalController::chooseSensor: No valid Sensor found"<< std::endl; + sensorTempAvailable = false; + } +} + +void ThermalController::chooseSensorOldVersion(heater::Switchers switchNr, float sensorValue1, float sensorValue2, float sensorValue3, bool sensor1Valid, bool sensor2Valid, bool sensor3Valid) { sensorTempAvailable = true; @@ -1222,12 +1227,12 @@ void ThermalController::chooseSensor(heater::Switchers switchNr, float sensorVal } void ThermalController::ctrlComponentTemperature(heater::Switchers switchNr, - heater::Switchers redSwitchNr, + heater::Switchers redSwitchNr, const lp_float_t& sensor1, const lp_float_t& sensor2, const lp_float_t& sensor3, TempLimits* tempLimit) { chooseHeater(switchNr, redSwitchNr); if (heaterAvailable) { - // chooseSensor(); //TODO + chooseSensor(switchNr, sensor1, sensor2, sensor3); if (sensorTempAvailable) { ctrlHeater(switchNr, redSwitchNr, tempLimit); diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 5611b67f..7a7ef7e7 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -155,12 +155,13 @@ class ThermalController : public ExtendedControllerBase { void copySus(); void copyDevices(); - void ctrlComponentTemperature(heater::Switchers switchNr, heater::Switchers redSwitchNr, + void ctrlComponentTemperature(heater::Switchers switchNr, heater::Switchers redSwitchNr, const lp_float_t& sensor1, const lp_float_t& sensor2, const lp_float_t& sensor3, TempLimits* tempLimit); void ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, struct TempLimits* tempLimit); void chooseHeater(heater::Switchers& switchNr, heater::Switchers redSwitchNr); - void chooseSensor(heater::Switchers switchNr, float sensorValue1, float sensorValue2, + void chooseSensor(heater::Switchers switchNr, const lp_float_t& sensor1, const lp_float_t& sensor2, const lp_float_t& sensor3); + void chooseSensorOldVersion(heater::Switchers switchNr, float sensorValue1, float sensorValue2, float sensorValue3, bool sensor1Valid, bool sensor2Valid, bool sensor3Valid); void ctrlAcsBoard(); From a81e7c5057811d9ea63bdfcdf39df4db563d843c Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Wed, 4 Jan 2023 19:03:01 +0100 Subject: [PATCH 069/330] thermal control chooseSensor() changes --- mission/controller/ThermalController.cpp | 154 ++++++++--------------- mission/controller/ThermalController.h | 13 +- 2 files changed, 57 insertions(+), 110 deletions(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 538f6434..c1e3cf71 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -105,7 +105,7 @@ void ThermalController::performControlOperation() { } // TODO: Heater control - ctrlCameraBody(); + //ctrlCameraBody(); /*ctrlAcsBoard(); ctrlMgt(); ctrlRw(); @@ -978,7 +978,10 @@ void ThermalController::copyDevices() { /* void ThermalController::ctrlAcsBoard() { - ctrlComponentTemperature(heater::HEATER_2_ACS_BRD, heater::HEATER_0_OBC_BRD, &acsBoardLimits); + ctrlComponentTemperature(heater::HEATER_2_ACS_BRD, heater::HEATER_0_OBC_BRD, + deviceTemperatures.gyro0SideA, deviceTemperatures.mgm0SideA, + deviceTemperatures.gyro1SideA, + &acsBoardLimits); // TODO: add red sensors } void ThermalController::ctrlMgt() { @@ -988,11 +991,11 @@ void ThermalController::ctrlMgt() { chooseHeater(switchNr, redSwitchNr); if (heaterAvailable) { - chooseSensorOldVersion(switchNr, sensorTemperatures.sensor_magnettorquer.value, - deviceTemperatures.mgt.value, sensorTemperatures.sensor_plpcdu_heatspreader.value, - sensorTemperatures.sensor_magnettorquer.isValid(), - deviceTemperatures.mgt.isValid(), - sensorTemperatures.sensor_plpcdu_heatspreader.isValid()); + chooseSensorOldVersion( + switchNr, sensorTemperatures.sensor_magnettorquer.value, deviceTemperatures.mgt.value, + sensorTemperatures.sensor_plpcdu_heatspreader.value, + sensorTemperatures.sensor_magnettorquer.isValid(), deviceTemperatures.mgt.isValid(), + sensorTemperatures.sensor_plpcdu_heatspreader.isValid()); if (sensorTempAvailable) { ctrlHeater(switchNr, redSwitchNr, &mgtLimits); @@ -1001,44 +1004,20 @@ void ThermalController::ctrlMgt() { } void ThermalController::ctrlRw() { - ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_6_DRO, &rwLimits); + // ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_6_DRO, + // sensorTemperatures.sensor_rw1, deviceTemperatures.rw1, deviceTemperatures.rw3, &rwLimits); } void ThermalController::ctrlStr() { - heater::Switchers switchNr = heater::HEATER_5_STR; - heater::Switchers redSwitchNr = heater::HEATER_6_DRO; - - chooseHeater(switchNr, redSwitchNr); - - if (heaterAvailable) { - chooseSensorOldVersion(switchNr, sensorTemperatures.sensor_startracker.value, - deviceTemperatures.startracker.value, sensorTemperatures.sensor_dro.value, - sensorTemperatures.sensor_startracker.isValid(), - deviceTemperatures.startracker.isValid(), sensorTemperatures.sensor_dro.isValid()); - - if (sensorTempAvailable) { - ctrlHeater(switchNr, redSwitchNr, &strLimits); - } - } + ctrlComponentTemperature(heater::HEATER_5_STR, heater::HEATER_6_DRO, + sensorTemperatures.sensor_startracker, deviceTemperatures.startracker, + sensorTemperatures.sensor_dro, &strLimits); } void ThermalController::ctrlIfBoard() { - heater::Switchers switchNr = heater::HEATER_2_ACS_BRD; - heater::Switchers redSwitchNr = heater::HEATER_3_PCDU_PDU; - - chooseHeater(switchNr, redSwitchNr); - - if (heaterAvailable) { - chooseSensorOldVersion(switchNr, sensorTemperatures.tmp1075IfBrd.value, - sensorTemperatures.sensor_magnettorquer.value, deviceTemperatures.mgm2SideB.value, - sensorTemperatures.tmp1075IfBrd.isValid(), - sensorTemperatures.sensor_magnettorquer.isValid(), - deviceTemperatures.mgm2SideB.isValid()); - - if (sensorTempAvailable) { - ctrlHeater(switchNr, redSwitchNr, &ifBoardLimits); - } - } + ctrlComponentTemperature(heater::HEATER_2_ACS_BRD, heater::HEATER_3_PCDU_PDU, + sensorTemperatures.tmp1075IfBrd, sensorTemperatures.sensor_magnettorquer, + deviceTemperatures.mgm2SideB, &ifBoardLimits); } void ThermalController::ctrlTcsBoard() { @@ -1080,49 +1059,25 @@ void ThermalController::ctrlPlocMissionBoard() { } void ThermalController::ctrlPlocProcessingBoard() { - heater::Switchers switchNr = heater::HEATER_1_PLOC_PROC_BRD; - heater::Switchers redSwitchNr = heater::HEATER_0_OBC_BRD; - - chooseHeater(switchNr, redSwitchNr); - - if (heaterAvailable) { - chooseSensorOldVersion(switchNr, sensorTemperatures.sensor_ploc_missionboard.value, - sensorTemperatures.sensor_ploc_heatspreader.value, - sensorTemperatures.sensor_dac_heatspreader.value, - sensorTemperatures.sensor_ploc_missionboard.isValid(), - sensorTemperatures.sensor_ploc_heatspreader.isValid(), - sensorTemperatures.sensor_dac_heatspreader.isValid()); - - if (sensorTempAvailable) { - ctrlHeater(switchNr, redSwitchNr, &plocProcessingBoardLimits); - } - } + ctrlComponentTemperature(heater::HEATER_1_PLOC_PROC_BRD, heater::HEATER_0_OBC_BRD, + sensorTemperatures.sensor_ploc_missionboard, + sensorTemperatures.sensor_ploc_heatspreader, + sensorTemperatures.sensor_dac_heatspreader, &plocProcessingBoardLimits); } void ThermalController::ctrlDac() { - heater::Switchers switchNr = heater::HEATER_1_PLOC_PROC_BRD; - heater::Switchers redSwitchNr = heater::HEATER_0_OBC_BRD; - - chooseHeater(switchNr, redSwitchNr); - - if (heaterAvailable) { - chooseSensorOldVersion(switchNr, sensorTemperatures.sensor_dac_heatspreader.value, - sensorTemperatures.sensor_ploc_missionboard.value, - sensorTemperatures.sensor_ploc_heatspreader.value, - sensorTemperatures.sensor_dac_heatspreader.isValid(), - sensorTemperatures.sensor_ploc_missionboard.isValid(), - sensorTemperatures.sensor_ploc_heatspreader.isValid()); - - if (sensorTempAvailable) { - ctrlHeater(switchNr, redSwitchNr, &dacLimits); - } - } + ctrlComponentTemperature(heater::HEATER_1_PLOC_PROC_BRD, heater::HEATER_0_OBC_BRD, + sensorTemperatures.sensor_dac_heatspreader, + sensorTemperatures.sensor_ploc_missionboard, + sensorTemperatures.sensor_ploc_heatspreader, &dacLimits); } -*/ + void ThermalController::ctrlCameraBody() { - ctrlComponentTemperature(heater::HEATER_4_CAMERA, heater::HEATER_6_DRO, sensorTemperatures.sensor_4k_camera, sensorTemperatures.sensor_dro, sensorTemperatures.sensor_mpa, &cameraLimits); + ctrlComponentTemperature(heater::HEATER_4_CAMERA, heater::HEATER_6_DRO, + sensorTemperatures.sensor_4k_camera, sensorTemperatures.sensor_dro, + sensorTemperatures.sensor_mpa, &cameraLimits); } -/* + void ThermalController::ctrlDro() { ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, &droLimits); } @@ -1178,15 +1133,19 @@ void ThermalController::chooseHeater(heater::Switchers& switchNr, heater::Switch redSwitchNrInUse = true; } else { heaterAvailable = false; - //TODO: triggerEvent(NO_HEALTHY_HEATER_AVAILABLE, switchNr, redSwitchNr); - sif::error << "ThermalController::chooseSensor: Both heater: "<< switchNr << " + " << redSwitchNr << " not healthy" << std::endl; + // TODO: triggerEvent(NO_HEALTHY_HEATER_AVAILABLE, switchNr, redSwitchNr); + sif::error << "ThermalController::chooseSensor: Both heater: " << switchNr << " + " + << redSwitchNr << " not healthy" << std::endl; } } else { redSwitchNrInUse = false; } } -void ThermalController::chooseSensor(heater::Switchers switchNr, const lp_float_t& sensor1, const lp_float_t& sensor2, const lp_float_t& sensor3) { +void ThermalController::chooseSensor(heater::Switchers switchNr, const lp_float_t& sensor1, + const lp_float_t& sensor2, const lp_float_t& sensor3, + const lp_float_t& sensor4, const lp_float_t& sensor5, + bool moreThan3Sensors) { sensorTempAvailable = true; if (sensor1.isValid()) { @@ -1195,44 +1154,29 @@ void ThermalController::chooseSensor(heater::Switchers switchNr, const lp_float_ sensorTemp = sensor2.value; } else if (sensor3.isValid()) { sensorTemp = sensor3.value; + } else if (moreThan3Sensors and sensor4.isValid()) { + sensorTemp = sensor4.value; + } else if (moreThan3Sensors and sensor5.isValid()) { + sensorTemp = sensor5.value; } else { if (heaterHandler.checkSwitchState(switchNr)) { heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); } - //TODO: triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); - sif::error << "ThermalController::chooseSensor: No valid Sensor found"<< std::endl; + // TODO: triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); + sif::error << "ThermalController::chooseSensor: No valid Sensor found" << std::endl; sensorTempAvailable = false; } } -void ThermalController::chooseSensorOldVersion(heater::Switchers switchNr, float sensorValue1, - float sensorValue2, float sensorValue3, bool sensor1Valid, - bool sensor2Valid, bool sensor3Valid) { - sensorTempAvailable = true; - if (sensor1Valid) { - sensorTemp = sensorValue1; - } else if (sensor2Valid) { - sensorTemp = sensorValue2; - } else if (sensor3Valid) { - sensorTemp = sensorValue3; - } else { - if (heaterHandler.checkSwitchState(switchNr)) { - heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); - } - //TODO: triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); - sif::error << "ThermalController::chooseSensor: No valid Sensor found"<< std::endl; - sensorTempAvailable = false; - } -} - -void ThermalController::ctrlComponentTemperature(heater::Switchers switchNr, - heater::Switchers redSwitchNr, const lp_float_t& sensor1, const lp_float_t& sensor2, const lp_float_t& sensor3, - TempLimits* tempLimit) { +void ThermalController::ctrlComponentTemperature( + heater::Switchers switchNr, heater::Switchers redSwitchNr, const lp_float_t& sensor1, + const lp_float_t& sensor2, const lp_float_t& sensor3, const lp_float_t& sensor4, + const lp_float_t& sensor5, TempLimits* tempLimit, bool moreThan3Sensors) { chooseHeater(switchNr, redSwitchNr); if (heaterAvailable) { - chooseSensor(switchNr, sensor1, sensor2, sensor3); + chooseSensor(switchNr, sensor1, sensor2, sensor3, sensor4, sensor5, moreThan3Sensors); if (sensorTempAvailable) { ctrlHeater(switchNr, redSwitchNr, tempLimit); diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 7a7ef7e7..439bc5fe 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -155,14 +155,17 @@ class ThermalController : public ExtendedControllerBase { void copySus(); void copyDevices(); - void ctrlComponentTemperature(heater::Switchers switchNr, heater::Switchers redSwitchNr, const lp_float_t& sensor1, const lp_float_t& sensor2, const lp_float_t& sensor3, - TempLimits* tempLimit); + void ctrlComponentTemperature(heater::Switchers switchNr, heater::Switchers redSwitchNr, + const lp_float_t& sensor1, const lp_float_t& sensor2, + const lp_float_t& sensor3, const lp_float_t& sensor4, + const lp_float_t& sensor5, TempLimits* tempLimit, + bool moreThan3Sensors = false); void ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, struct TempLimits* tempLimit); void chooseHeater(heater::Switchers& switchNr, heater::Switchers redSwitchNr); - void chooseSensor(heater::Switchers switchNr, const lp_float_t& sensor1, const lp_float_t& sensor2, const lp_float_t& sensor3); - void chooseSensorOldVersion(heater::Switchers switchNr, float sensorValue1, float sensorValue2, - float sensorValue3, bool sensor1Valid, bool sensor2Valid, bool sensor3Valid); + void chooseSensor(heater::Switchers switchNr, const lp_float_t& sensor1, + const lp_float_t& sensor2, const lp_float_t& sensor3, const lp_float_t& sensor4, + const lp_float_t& sensor5, bool moreThan3Sensors); void ctrlAcsBoard(); void ctrlMgt(); From 94c178941dddd49822f6cae3107f3ea54efb7bc3 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Thu, 5 Jan 2023 19:39:51 +0100 Subject: [PATCH 070/330] ThermalController: added sensors to components --- mission/controller/ThermalController.cpp | 116 +++++++++++++---------- mission/controller/ThermalController.h | 11 +-- 2 files changed, 72 insertions(+), 55 deletions(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index c1e3cf71..1feef038 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -105,9 +105,9 @@ void ThermalController::performControlOperation() { } // TODO: Heater control - //ctrlCameraBody(); - /*ctrlAcsBoard(); - ctrlMgt(); + // ctrlCameraBody(); + // ctrlAcsBoard(); + /*ctrlMgt(); ctrlRw(); ctrlStr(); ctrlIfBoard(); @@ -976,31 +976,19 @@ void ThermalController::copyDevices() { } } -/* void ThermalController::ctrlAcsBoard() { ctrlComponentTemperature(heater::HEATER_2_ACS_BRD, heater::HEATER_0_OBC_BRD, deviceTemperatures.gyro0SideA, deviceTemperatures.mgm0SideA, - deviceTemperatures.gyro1SideA, + deviceTemperatures.gyro1SideA, // mgm1(int), + // sensorTemperatures.sensor_tcs_board, &acsBoardLimits); // TODO: add red sensors } void ThermalController::ctrlMgt() { - heater::Switchers switchNr = heater::HEATER_2_ACS_BRD; - heater::Switchers redSwitchNr = heater::HEATER_3_PCDU_PDU; - - chooseHeater(switchNr, redSwitchNr); - - if (heaterAvailable) { - chooseSensorOldVersion( - switchNr, sensorTemperatures.sensor_magnettorquer.value, deviceTemperatures.mgt.value, - sensorTemperatures.sensor_plpcdu_heatspreader.value, - sensorTemperatures.sensor_magnettorquer.isValid(), deviceTemperatures.mgt.isValid(), - sensorTemperatures.sensor_plpcdu_heatspreader.isValid()); - - if (sensorTempAvailable) { - ctrlHeater(switchNr, redSwitchNr, &mgtLimits); - } - } + // TODO: cast deviceTemperatures.mgt + // ctrlComponentTemperature(heater::HEATER_2_ACS_BRD, heater::HEATER_3_PCDU_PDU, + // sensorTemperatures.sensor_magnettorquer, deviceTemperatures.mgt, + // sensorTemperatures.sensor_plpcdu_heatspreader, &mgtLimits); } void ThermalController::ctrlRw() { @@ -1021,41 +1009,61 @@ void ThermalController::ctrlIfBoard() { } void ThermalController::ctrlTcsBoard() { - ctrlComponentTemperature(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, &tcsBoardLimits); + ctrlComponentTemperature(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, + sensorTemperatures.sensor_tcs_board, sensorTemperatures.tmp1075Tcs0, + sensorTemperatures.tmp1075Tcs1, &tcsBoardLimits); } void ThermalController::ctrlObc() { - ctrlComponentTemperature(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, &obcLimits); + ctrlComponentTemperature(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, + deviceTemperatures.q7s, sensorTemperatures.tmp1075Tcs1, + sensorTemperatures.tmp1075Tcs0, &obcLimits); } void ThermalController::ctrlObcIfBoard() { - ctrlComponentTemperature(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, &obcIfBoardLimits); + ctrlComponentTemperature(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, + deviceTemperatures.q7s, sensorTemperatures.tmp1075Tcs0, + sensorTemperatures.tmp1075Tcs1, &obcIfBoardLimits); } void ThermalController::ctrlSBandTransceiver() { ctrlComponentTemperature(heater::HEATER_7_S_BAND, heater::HEATER_4_CAMERA, - &sBandTransceiverLimits); + deviceTemperatures.syrlinksPowerAmplifier, + deviceTemperatures.syrlinksBasebandBoard, + sensorTemperatures.sensor_4k_camera, &sBandTransceiverLimits); } void ThermalController::ctrlPcduP60Board() { + // TODO: remove sensor3 ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, - &pcduP60BoardLimits); + deviceTemperatures.temp1P60dock, deviceTemperatures.temp2P60dock, + deviceTemperatures.temp2P60dock, &pcduP60BoardLimits); } void ThermalController::ctrlPcduAcu() { - ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, &pcduAcuLimits); + // TODO: check sensors (float,3) + // ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, + // deviceTemperatures.acu, deviceTemperatures.acu, sensorTemperatures.sensor_acu, &pcduAcuLimits); } void ThermalController::ctrlPcduPdu() { - ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, &pcduPduLimits); + // TODO: remove sensor3 + ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, + deviceTemperatures.pdu1, deviceTemperatures.pdu2, + deviceTemperatures.pdu2, &pcduPduLimits); } void ThermalController::ctrlPlPcduBoard() { - ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, &plPcduBoardLimits); + // TODO: add sensor 4: sensorTemperatures.sensor_plpcdu_heatspreader + ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, + sensorTemperatures.tmp1075PlPcdu0, sensorTemperatures.tmp1075PlPcdu1, + deviceTemperatures.adcPayloadPcdu, &plPcduBoardLimits); } void ThermalController::ctrlPlocMissionBoard() { ctrlComponentTemperature(heater::HEATER_1_PLOC_PROC_BRD, heater::HEATER_0_OBC_BRD, - &plocMissionBoardLimits); + sensorTemperatures.sensor_ploc_heatspreader, + sensorTemperatures.sensor_ploc_missionboard, + sensorTemperatures.sensor_dac_heatspreader, &plocMissionBoardLimits); } void ThermalController::ctrlPlocProcessingBoard() { @@ -1079,29 +1087,41 @@ void ThermalController::ctrlCameraBody() { } void ThermalController::ctrlDro() { - ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, &droLimits); + ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, + sensorTemperatures.sensor_dro, sensorTemperatures.sensor_4k_camera, + sensorTemperatures.sensor_mpa, &droLimits); } void ThermalController::ctrlX8() { - ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, &x8Limits); + ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, + sensorTemperatures.sensor_x8, sensorTemperatures.sensor_hpa, + sensorTemperatures.sensor_tx_modul, &x8Limits); } void ThermalController::ctrlTx() { - ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, &txLimits); + ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, + sensorTemperatures.sensor_tx_modul, sensorTemperatures.sensor_x8, + sensorTemperatures.sensor_mpa, &txLimits); } void ThermalController::ctrlMpa() { - ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, &mpaLimits); + ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, + sensorTemperatures.sensor_mpa, sensorTemperatures.sensor_hpa, + sensorTemperatures.sensor_tx_modul, &mpaLimits); } void ThermalController::ctrlHpa() { - ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, &hpaLimits); + ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, + sensorTemperatures.sensor_hpa, sensorTemperatures.sensor_x8, + sensorTemperatures.sensor_mpa, &hpaLimits); } void ThermalController::ctrlScexBoard() { - ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_5_STR, &scexBoardLimits); + ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_5_STR, + sensorTemperatures.sensor_scex, sensorTemperatures.sensor_x8, + sensorTemperatures.sensor_hpa, &scexBoardLimits); } -*/ + void ThermalController::ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, struct TempLimits* tempLimit) { // Heater off @@ -1144,7 +1164,6 @@ void ThermalController::chooseHeater(heater::Switchers& switchNr, heater::Switch void ThermalController::chooseSensor(heater::Switchers switchNr, const lp_float_t& sensor1, const lp_float_t& sensor2, const lp_float_t& sensor3, - const lp_float_t& sensor4, const lp_float_t& sensor5, bool moreThan3Sensors) { sensorTempAvailable = true; @@ -1154,10 +1173,10 @@ void ThermalController::chooseSensor(heater::Switchers switchNr, const lp_float_ sensorTemp = sensor2.value; } else if (sensor3.isValid()) { sensorTemp = sensor3.value; - } else if (moreThan3Sensors and sensor4.isValid()) { - sensorTemp = sensor4.value; - } else if (moreThan3Sensors and sensor5.isValid()) { - sensorTemp = sensor5.value; + /*} else if (moreThan3Sensors and sensor4.isValid()) { + sensorTemp = sensor4.value; + } else if (moreThan3Sensors and sensor5.isValid()) { + sensorTemp = sensor5.value; */ } else { if (heaterHandler.checkSwitchState(switchNr)) { heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); @@ -1168,15 +1187,16 @@ void ThermalController::chooseSensor(heater::Switchers switchNr, const lp_float_ } } - -void ThermalController::ctrlComponentTemperature( - heater::Switchers switchNr, heater::Switchers redSwitchNr, const lp_float_t& sensor1, - const lp_float_t& sensor2, const lp_float_t& sensor3, const lp_float_t& sensor4, - const lp_float_t& sensor5, TempLimits* tempLimit, bool moreThan3Sensors) { +void ThermalController::ctrlComponentTemperature(heater::Switchers switchNr, + heater::Switchers redSwitchNr, + const lp_float_t& sensor1, + const lp_float_t& sensor2, + const lp_float_t& sensor3, TempLimits* tempLimit, + bool moreThan3Sensors) { chooseHeater(switchNr, redSwitchNr); if (heaterAvailable) { - chooseSensor(switchNr, sensor1, sensor2, sensor3, sensor4, sensor5, moreThan3Sensors); + chooseSensor(switchNr, sensor1, sensor2, sensor3, moreThan3Sensors); if (sensorTempAvailable) { ctrlHeater(switchNr, redSwitchNr, tempLimit); diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 439bc5fe..d43519cf 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -135,7 +135,7 @@ class ThermalController : public ExtendedControllerBase { TempLimits mpaLimits = TempLimits(-40.0, -30.0, -75.0, 80.0, 90.0); TempLimits scexBoardLimits = TempLimits(-60.0, -40.0, 80.0, 85.0, 150.0); - float sensorTemp; + static float sensorTemp; bool sensorTempAvailable = true; bool heaterAvailable = true; bool redSwitchNrInUse = false; @@ -157,15 +157,12 @@ class ThermalController : public ExtendedControllerBase { void ctrlComponentTemperature(heater::Switchers switchNr, heater::Switchers redSwitchNr, const lp_float_t& sensor1, const lp_float_t& sensor2, - const lp_float_t& sensor3, const lp_float_t& sensor4, - const lp_float_t& sensor5, TempLimits* tempLimit, + const lp_float_t& sensor3, TempLimits* tempLimit, bool moreThan3Sensors = false); - void ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, - struct TempLimits* tempLimit); + void ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, TempLimits* tempLimit); void chooseHeater(heater::Switchers& switchNr, heater::Switchers redSwitchNr); void chooseSensor(heater::Switchers switchNr, const lp_float_t& sensor1, - const lp_float_t& sensor2, const lp_float_t& sensor3, const lp_float_t& sensor4, - const lp_float_t& sensor5, bool moreThan3Sensors); + const lp_float_t& sensor2, const lp_float_t& sensor3, bool moreThan3Sensors); void ctrlAcsBoard(); void ctrlMgt(); From 341966e70920b57a7f24accd153eae3451450ac4 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Mon, 9 Jan 2023 09:36:00 +0100 Subject: [PATCH 071/330] added GS target mode --- mission/controller/AcsController.cpp | 2 +- mission/controller/AcsController.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 235f7193..03f36b6f 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -451,7 +451,7 @@ ReturnValue_t AcsController::checkModeCommand(Mode_t mode, Submode_t submode, return INVALID_SUBMODE; } } else if ((mode == MODE_ON) || (mode == MODE_NORMAL)) { - if ((submode > 7) || (submode < 2)) { + if ((submode > 8) || (submode < 2)) { return INVALID_SUBMODE; } else { return returnvalue::OK; diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index de7cb23f..d2e11792 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -29,7 +29,8 @@ class AcsController : public ExtendedControllerBase { static const Submode_t SUBMODE_IDLE = 4; static const Submode_t SUBMODE_PTG_NADIR = 5; static const Submode_t SUBMODE_PTG_TARGET = 6; - static const Submode_t SUBMODE_PTG_INERTIAL = 7; + static const Submode_t SUBMODE_PTG_TARGET_GS = 7; + static const Submode_t SUBMODE_PTG_INERTIAL = 8; static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::ACS_SUBSYSTEM; static const Event SAFE_RATE_VIOLATION = From 10f1898b98b3118b04abb8b223774a7063fde5c9 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Mon, 9 Jan 2023 09:36:30 +0100 Subject: [PATCH 072/330] fixed init of varibales --- mission/controller/acs/control/PtgCtrl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mission/controller/acs/control/PtgCtrl.h b/mission/controller/acs/control/PtgCtrl.h index d176b0c2..c493b383 100644 --- a/mission/controller/acs/control/PtgCtrl.h +++ b/mission/controller/acs/control/PtgCtrl.h @@ -64,8 +64,8 @@ class PtgCtrl { AcsParameters::InertiaEIVE *inertiaEIVE; AcsParameters::RwMatrices *rwMatrices; - double torqueMemory[4]; - double omegaMemory[4]; + double torqueMemory[4] = {0, 0, 0, 0}; + double omegaMemory[4] = {0, 0, 0, 0}; }; #endif /* ACS_CONTROL_PTGCTRL_H_ */ From 4e74dc7beee935e6e21ab717e90dd2d3d8a09b35 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Tue, 10 Jan 2023 09:05:27 +0100 Subject: [PATCH 073/330] added target mode for GS flyby --- mission/controller/acs/Guidance.cpp | 5 +++++ mission/controller/acs/Guidance.h | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index afd4d41e..e46abe37 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -292,6 +292,11 @@ void Guidance::targetQuatPtgThreeAxes(ACS::SensorValues *sensorValues, QuaternionOperations::multiply(quatBJ, quatInertialTarget, targetQuat); } +void Guidance::targetQuatPtgGs(ACS::SensorValues *sensorValues, acsctrl::MekfData *mekfData, + acsctrl::SusDataProcessed *susDataProcessed, + acsctrl::GpsDataProcessed *gpsDataProcessed, timeval now, + double targetQuat[4], double refSatRate[3]) {} + void Guidance::sunQuatPtg(ACS::SensorValues *sensorValues, acsctrl::MekfData *mekfData, acsctrl::SusDataProcessed *susDataProcessed, acsctrl::GpsDataProcessed *gpsDataProcessed, timeval now, diff --git a/mission/controller/acs/Guidance.h b/mission/controller/acs/Guidance.h index 176d51a2..80993a0d 100644 --- a/mission/controller/acs/Guidance.h +++ b/mission/controller/acs/Guidance.h @@ -27,6 +27,10 @@ class Guidance { acsctrl::GpsDataProcessed *gpsDataProcessed, acsctrl::MekfData *mekfData, timeval now, double targetQuat[4], double refSatRate[3]); + void targetQuatPtgGs(ACS::SensorValues *sensorValues, acsctrl::MekfData *mekfData, + acsctrl::SusDataProcessed *susDataProcessed, + acsctrl::GpsDataProcessed *gpsDataProcessed, timeval now, + double targetQuat[4], double refSatRate[3]); void targetQuatPtgSingleAxis(ACS::SensorValues *sensorValues, acsctrl::MekfData *mekfData, acsctrl::SusDataProcessed *susDataProcessed, acsctrl::GpsDataProcessed *gpsDataProcessed, timeval now, From 887d193526c5ef7c46cf8996dfae8bd44a9d6ebf Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Tue, 10 Jan 2023 09:06:09 +0100 Subject: [PATCH 074/330] added ReceiversParameterMessagesIF and ParameterHelper to ACS Ctrl --- mission/controller/AcsController.cpp | 1113 +++++++++++++------------- mission/controller/AcsController.h | 14 +- 2 files changed, 579 insertions(+), 548 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 03f36b6f..78a78c6f 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -14,6 +14,7 @@ AcsController::AcsController(object_id_t objectId) detumble(&acsParameters), ptgCtrl(&acsParameters), detumbleCounter{0}, + parameterHelper(this), mgmDataRaw(this), mgmDataProcessed(this), susDataRaw(this), @@ -26,6 +27,23 @@ AcsController::AcsController(object_id_t objectId) actuatorCmdData(this) {} ReturnValue_t AcsController::handleCommandMessage(CommandMessage *message) { + ReturnValue_t result = actionHelper.handleActionMessage(message); + if (result == returnvalue::OK) { + return result; + } + result = parameterHelper.handleParameterMessage(message); + if (result == returnvalue::OK) { + return result; + } + return result; +} + +MessageQueueId_t AcsController::getCommandQueue() const { return commandQueue->getId(); } + +ReturnValue_t AcsController::getParameter(uint8_t domainId, uint8_t parameterId, + ParameterWrapper* parameterWrapper, + const ParameterWrapper* newValues, + uint16_t startAtIndex) { return returnvalue::OK; } @@ -53,6 +71,7 @@ void AcsController::performControlOperation() { break; case SUBMODE_IDLE: case SUBMODE_PTG_TARGET: + case SUBMODE_PTG_TARGET_GS: case SUBMODE_PTG_NADIR: case SUBMODE_PTG_INERTIAL: performPointingCtrl(); @@ -83,577 +102,581 @@ void AcsController::performControlOperation() { copyGyrData(); } } -} + } -void AcsController::performSafe() { - ACS::SensorValues sensorValues; + void AcsController::performSafe() { + ACS::SensorValues sensorValues; - timeval now; - Clock::getClock_timeval(&now); + timeval now; + Clock::getClock_timeval(&now); - sensorProcessing.process(now, &sensorValues, &mgmDataProcessed, &susDataProcessed, - &gyrDataProcessed, &gpsDataProcessed, &acsParameters); - ReturnValue_t validMekf; - navigation.useMekf(&sensorValues, &gyrDataProcessed, &mgmDataProcessed, &susDataProcessed, - &mekfData, &validMekf); + sensorProcessing.process(now, &sensorValues, &mgmDataProcessed, &susDataProcessed, + &gyrDataProcessed, &gpsDataProcessed, &acsParameters); + ReturnValue_t validMekf; + navigation.useMekf(&sensorValues, &gyrDataProcessed, &mgmDataProcessed, &susDataProcessed, + &mekfData, &validMekf); - // Give desired satellite rate and sun direction to align - double satRateSafe[3] = {0, 0, 0}, sunTargetDir[3] = {0, 0, 0}; - guidance.getTargetParamsSafe(sunTargetDir, satRateSafe); - // IF MEKF is working - double magMomMtq[3] = {0, 0, 0}, errAng = 0.0; - bool magMomMtqValid = false; - if (validMekf == returnvalue::OK) { - safeCtrl.safeMekf(now, mekfData.quatMekf.value, mekfData.quatMekf.isValid(), - mgmDataProcessed.magIgrfModel.value, mgmDataProcessed.magIgrfModel.isValid(), - susDataProcessed.sunIjkModel.value, susDataProcessed.isValid(), - mekfData.satRotRateMekf.value, mekfData.satRotRateMekf.isValid(), - sunTargetDir, satRateSafe, &errAng, magMomMtq, &magMomMtqValid); - } else { - safeCtrl.safeNoMekf( - now, susDataProcessed.susVecTot.value, susDataProcessed.susVecTot.isValid(), - susDataProcessed.susVecTotDerivative.value, susDataProcessed.susVecTotDerivative.isValid(), - mgmDataProcessed.mgmVecTot.value, mgmDataProcessed.mgmVecTot.isValid(), + // Give desired satellite rate and sun direction to align + double satRateSafe[3] = {0, 0, 0}, sunTargetDir[3] = {0, 0, 0}; + guidance.getTargetParamsSafe(sunTargetDir, satRateSafe); + // IF MEKF is working + double magMomMtq[3] = {0, 0, 0}, errAng = 0.0; + bool magMomMtqValid = false; + if (validMekf == returnvalue::OK) { + safeCtrl.safeMekf(now, mekfData.quatMekf.value, mekfData.quatMekf.isValid(), + mgmDataProcessed.magIgrfModel.value, + mgmDataProcessed.magIgrfModel.isValid(), susDataProcessed.sunIjkModel.value, + susDataProcessed.isValid(), mekfData.satRotRateMekf.value, + mekfData.satRotRateMekf.isValid(), sunTargetDir, satRateSafe, &errAng, + magMomMtq, &magMomMtqValid); + } else { + safeCtrl.safeNoMekf( + now, susDataProcessed.susVecTot.value, susDataProcessed.susVecTot.isValid(), + susDataProcessed.susVecTotDerivative.value, + susDataProcessed.susVecTotDerivative.isValid(), mgmDataProcessed.mgmVecTot.value, + mgmDataProcessed.mgmVecTot.isValid(), mgmDataProcessed.mgmVecTotDerivative.value, + mgmDataProcessed.mgmVecTotDerivative.isValid(), sunTargetDir, satRateSafe, &errAng, + magMomMtq, &magMomMtqValid); + } + + double dipolCmdUnits[3] = {0, 0, 0}; + actuatorCmd.cmdDipolMtq(magMomMtq, dipolCmdUnits); + + { + PoolReadGuard pg(&ctrlValData); + if (pg.getReadResult() == returnvalue::OK) { + double zeroQuat[4] = {0, 0, 0, 0}; + std::memcpy(ctrlValData.tgtQuat.value, zeroQuat, 4 * sizeof(double)); + ctrlValData.tgtQuat.setValid(false); + std::memcpy(ctrlValData.errQuat.value, zeroQuat, 4 * sizeof(double)); + ctrlValData.errQuat.setValid(false); + ctrlValData.errAng.value = errAng; + ctrlValData.errAng.setValid(true); + ctrlValData.setValidity(true, false); + } + } + + // Detumble check and switch + if (mekfData.satRotRateMekf.isValid() && + VectorOperations::norm(mekfData.satRotRateMekf.value, 3) > + acsParameters.detumbleParameter.omegaDetumbleStart) { + detumbleCounter++; + } else if (gyrDataProcessed.gyrVecTot.isValid() && + VectorOperations::norm(gyrDataProcessed.gyrVecTot.value, 3) > + acsParameters.detumbleParameter.omegaDetumbleStart) { + detumbleCounter++; + } else { + detumbleCounter = 0; + } + if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) { + submode = SUBMODE_DETUMBLE; + detumbleCounter = 0; + triggerEvent(SAFE_RATE_VIOLATION); + } + + { + PoolReadGuard pg(&actuatorCmdData); + if (pg.getReadResult() == returnvalue::OK) { + int32_t zeroVec[4] = {0, 0, 0, 0}; + std::memcpy(actuatorCmdData.rwTargetTorque.value, zeroVec, 4 * sizeof(int32_t)); + actuatorCmdData.rwTargetTorque.setValid(false); + std::memcpy(actuatorCmdData.rwTargetSpeed.value, zeroVec, 4 * sizeof(int32_t)); + actuatorCmdData.rwTargetSpeed.setValid(false); + std::memcpy(actuatorCmdData.mtqTargetDipole.value, dipolCmdUnits, 3 * sizeof(int16_t)); + actuatorCmdData.mtqTargetDipole.setValid(true); + actuatorCmdData.setValidity(true, false); + } + } + // { + // PoolReadGuard pg(&dipoleSet); + // MutexGuard mg(torquer::lazyLock()); + // torquer::NEW_ACTUATION_FLAG = true; + // dipoleSet.setDipoles(cmdDipolUnits[0], cmdDipolUnits[1], cmdDipolUnits[2], + // torqueDuration); + // } + } + + void AcsController::performDetumble() { + ACS::SensorValues sensorValues; + + timeval now; + Clock::getClock_timeval(&now); + + sensorProcessing.process(now, &sensorValues, &mgmDataProcessed, &susDataProcessed, + &gyrDataProcessed, &gpsDataProcessed, &acsParameters); + ReturnValue_t validMekf; + navigation.useMekf(&sensorValues, &gyrDataProcessed, &mgmDataProcessed, &susDataProcessed, + &mekfData, &validMekf); + + double magMomMtq[3] = {0, 0, 0}; + detumble.bDotLaw( mgmDataProcessed.mgmVecTotDerivative.value, mgmDataProcessed.mgmVecTotDerivative.isValid(), - sunTargetDir, satRateSafe, &errAng, magMomMtq, &magMomMtqValid); - } + mgmDataProcessed.mgmVecTot.value, mgmDataProcessed.mgmVecTot.isValid(), magMomMtq); + double dipolCmdUnits[3] = {0, 0, 0}; + actuatorCmd.cmdDipolMtq(magMomMtq, dipolCmdUnits); - double dipolCmdUnits[3] = {0, 0, 0}; - actuatorCmd.cmdDipolMtq(magMomMtq, dipolCmdUnits); - - { - PoolReadGuard pg(&ctrlValData); - if (pg.getReadResult() == returnvalue::OK) { - double zeroQuat[4] = {0, 0, 0, 0}; - std::memcpy(ctrlValData.tgtQuat.value, zeroQuat, 4 * sizeof(double)); - ctrlValData.tgtQuat.setValid(false); - std::memcpy(ctrlValData.errQuat.value, zeroQuat, 4 * sizeof(double)); - ctrlValData.errQuat.setValid(false); - ctrlValData.errAng.value = errAng; - ctrlValData.errAng.setValid(true); - ctrlValData.setValidity(true, false); + if (mekfData.satRotRateMekf.isValid() && + VectorOperations::norm(mekfData.satRotRateMekf.value, 3) < + acsParameters.detumbleParameter.omegaDetumbleEnd) { + detumbleCounter++; + } else if (gyrDataProcessed.gyrVecTot.isValid() && + VectorOperations::norm(gyrDataProcessed.gyrVecTot.value, 3) < + acsParameters.detumbleParameter.omegaDetumbleEnd) { + detumbleCounter++; + } else { + detumbleCounter = 0; } - } - - // Detumble check and switch - if (mekfData.satRotRateMekf.isValid() && - VectorOperations::norm(mekfData.satRotRateMekf.value, 3) > - acsParameters.detumbleParameter.omegaDetumbleStart) { - detumbleCounter++; - } else if (gyrDataProcessed.gyrVecTot.isValid() && - VectorOperations::norm(gyrDataProcessed.gyrVecTot.value, 3) > - acsParameters.detumbleParameter.omegaDetumbleStart) { - detumbleCounter++; - } else { - detumbleCounter = 0; - } - if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) { - submode = SUBMODE_DETUMBLE; - detumbleCounter = 0; - triggerEvent(SAFE_RATE_VIOLATION); - } - - { - PoolReadGuard pg(&actuatorCmdData); - if (pg.getReadResult() == returnvalue::OK) { - int32_t zeroVec[4] = {0, 0, 0, 0}; - std::memcpy(actuatorCmdData.rwTargetTorque.value, zeroVec, 4 * sizeof(int32_t)); - actuatorCmdData.rwTargetTorque.setValid(false); - std::memcpy(actuatorCmdData.rwTargetSpeed.value, zeroVec, 4 * sizeof(int32_t)); - actuatorCmdData.rwTargetSpeed.setValid(false); - std::memcpy(actuatorCmdData.mtqTargetDipole.value, dipolCmdUnits, 3 * sizeof(int16_t)); - actuatorCmdData.mtqTargetDipole.setValid(true); - actuatorCmdData.setValidity(true, false); + if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) { + submode = SUBMODE_SAFE; + detumbleCounter = 0; } - } - // { - // PoolReadGuard pg(&dipoleSet); - // MutexGuard mg(torquer::lazyLock()); - // torquer::NEW_ACTUATION_FLAG = true; - // dipoleSet.setDipoles(cmdDipolUnits[0], cmdDipolUnits[1], cmdDipolUnits[2], torqueDuration); - // } -} -void AcsController::performDetumble() { - ACS::SensorValues sensorValues; - - timeval now; - Clock::getClock_timeval(&now); - - sensorProcessing.process(now, &sensorValues, &mgmDataProcessed, &susDataProcessed, - &gyrDataProcessed, &gpsDataProcessed, &acsParameters); - ReturnValue_t validMekf; - navigation.useMekf(&sensorValues, &gyrDataProcessed, &mgmDataProcessed, &susDataProcessed, - &mekfData, &validMekf); - - double magMomMtq[3] = {0, 0, 0}; - detumble.bDotLaw(mgmDataProcessed.mgmVecTotDerivative.value, - mgmDataProcessed.mgmVecTotDerivative.isValid(), mgmDataProcessed.mgmVecTot.value, - mgmDataProcessed.mgmVecTot.isValid(), magMomMtq); - double dipolCmdUnits[3] = {0, 0, 0}; - actuatorCmd.cmdDipolMtq(magMomMtq, dipolCmdUnits); - - if (mekfData.satRotRateMekf.isValid() && - VectorOperations::norm(mekfData.satRotRateMekf.value, 3) < - acsParameters.detumbleParameter.omegaDetumbleEnd) { - detumbleCounter++; - } else if (gyrDataProcessed.gyrVecTot.isValid() && - VectorOperations::norm(gyrDataProcessed.gyrVecTot.value, 3) < - acsParameters.detumbleParameter.omegaDetumbleEnd) { - detumbleCounter++; - } else { - detumbleCounter = 0; - } - if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) { - submode = SUBMODE_SAFE; - detumbleCounter = 0; - } - - int16_t cmdDipolUnitsInt[3] = {0, 0, 0}; - for (int i = 0; i < 3; ++i) { - cmdDipolUnitsInt[i] = std::round(dipolCmdUnits[i]); - } - { - PoolReadGuard pg(&actuatorCmdData); - if (pg.getReadResult() == returnvalue::OK) { - std::memset(actuatorCmdData.rwTargetTorque.value, 0, 4 * sizeof(double)); - actuatorCmdData.rwTargetTorque.setValid(false); - std::memset(actuatorCmdData.rwTargetSpeed.value, 0, 4 * sizeof(int32_t)); - actuatorCmdData.rwTargetSpeed.setValid(false); - std::memcpy(actuatorCmdData.mtqTargetDipole.value, cmdDipolUnitsInt, 3 * sizeof(int16_t)); - actuatorCmdData.mtqTargetDipole.setValid(true); - actuatorCmdData.setValidity(true, false); + int16_t cmdDipolUnitsInt[3] = {0, 0, 0}; + for (int i = 0; i < 3; ++i) { + cmdDipolUnitsInt[i] = std::round(dipolCmdUnits[i]); } - } - // { - // PoolReadGuard pg(&dipoleSet); - // MutexGuard mg(torquer::lazyLock()); - // torquer::NEW_ACTUATION_FLAG = true; - // dipoleSet.setDipoles(cmdDipolUnitsInt[0], cmdDipolUnitsInt[1], cmdDipolUnitsInt[2], - // torqueDuration); - // } -} - -void AcsController::performPointingCtrl() { - ACS::SensorValues sensorValues; - - timeval now; - Clock::getClock_timeval(&now); - - sensorProcessing.process(now, &sensorValues, &mgmDataProcessed, &susDataProcessed, - &gyrDataProcessed, &gpsDataProcessed, &acsParameters); - ReturnValue_t validMekf; - navigation.useMekf(&sensorValues, &gyrDataProcessed, &mgmDataProcessed, &susDataProcessed, - &mekfData, &validMekf); - - double targetQuat[4] = {0, 0, 0, 0}, refSatRate[3] = {0, 0, 0}; - switch (submode) { - case SUBMODE_IDLE: - guidance.sunQuatPtg(&sensorValues, &mekfData, &susDataProcessed, &gpsDataProcessed, now, - targetQuat, refSatRate); - break; - case SUBMODE_PTG_TARGET: - guidance.targetQuatPtgThreeAxes(&sensorValues, &gpsDataProcessed, &mekfData, now, targetQuat, - refSatRate); - break; - - case SUBMODE_PTG_NADIR: - guidance.quatNadirPtgThreeAxes(&sensorValues, &gpsDataProcessed, &mekfData, now, targetQuat, - refSatRate); - break; - case SUBMODE_PTG_INERTIAL: - guidance.inertialQuatPtg(targetQuat, refSatRate); - break; - } - double quatErrorComplete[4] = {0, 0, 0, 0}, quatError[3] = {0, 0, 0}, - deltaRate[3] = {0, 0, 0}; // ToDo: check if pointer needed - guidance.comparePtg(targetQuat, &mekfData, refSatRate, quatErrorComplete, quatError, deltaRate); - double rwPseudoInv[4][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; - guidance.getDistributionMatrixRw(&sensorValues, *rwPseudoInv); - double torquePtgRws[4] = {0, 0, 0, 0}, mode = 0; - ptgCtrl.ptgLaw(mode, quatError, deltaRate, *rwPseudoInv, torquePtgRws); - double rwTrqNs[4] = {0, 0, 0, 0}; - ptgCtrl.ptgNullspace( - &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), - &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), rwTrqNs); - double torqueRws[4] = {0, 0, 0, 0}, torqueRwsScaled[4] = {0, 0, 0, 0}; - VectorOperations::add(torquePtgRws, rwTrqNs, torqueRws, 4); - actuatorCmd.scalingTorqueRws(torqueRws, torqueRwsScaled); - - if (acsParameters.pointingModeControllerParameters.enableAntiStiction) { - bool rwAvailable[4] = {true, true, true, true}; // WHICH INPUT SENSOR SET? - int32_t rwSpeed[4] = { - (sensorValues.rw1Set.currSpeed.value), (sensorValues.rw2Set.currSpeed.value), - (sensorValues.rw3Set.currSpeed.value), (sensorValues.rw4Set.currSpeed.value)}; - ptgCtrl.rwAntistiction(rwAvailable, rwSpeed, torqueRwsScaled); + { + PoolReadGuard pg(&actuatorCmdData); + if (pg.getReadResult() == returnvalue::OK) { + std::memset(actuatorCmdData.rwTargetTorque.value, 0, 4 * sizeof(double)); + actuatorCmdData.rwTargetTorque.setValid(false); + std::memset(actuatorCmdData.rwTargetSpeed.value, 0, 4 * sizeof(int32_t)); + actuatorCmdData.rwTargetSpeed.setValid(false); + std::memcpy(actuatorCmdData.mtqTargetDipole.value, cmdDipolUnitsInt, 3 * sizeof(int16_t)); + actuatorCmdData.mtqTargetDipole.setValid(true); + actuatorCmdData.setValidity(true, false); + } + } + // { + // PoolReadGuard pg(&dipoleSet); + // MutexGuard mg(torquer::lazyLock()); + // torquer::NEW_ACTUATION_FLAG = true; + // dipoleSet.setDipoles(cmdDipolUnitsInt[0], cmdDipolUnitsInt[1], cmdDipolUnitsInt[2], + // torqueDuration); + // } } - double cmdSpeedRws[4] = {0, 0, 0, 0}; // Should be given to the actuator reaction wheel as input - actuatorCmd.cmdSpeedToRws(&(sensorValues.rw1Set.currSpeed.value), + void AcsController::performPointingCtrl() { + ACS::SensorValues sensorValues; + + timeval now; + Clock::getClock_timeval(&now); + + sensorProcessing.process(now, &sensorValues, &mgmDataProcessed, &susDataProcessed, + &gyrDataProcessed, &gpsDataProcessed, &acsParameters); + ReturnValue_t validMekf; + navigation.useMekf(&sensorValues, &gyrDataProcessed, &mgmDataProcessed, &susDataProcessed, + &mekfData, &validMekf); + + double targetQuat[4] = {0, 0, 0, 0}, refSatRate[3] = {0, 0, 0}; + switch (submode) { + case SUBMODE_IDLE: + guidance.sunQuatPtg(&sensorValues, &mekfData, &susDataProcessed, &gpsDataProcessed, now, + targetQuat, refSatRate); + break; + case SUBMODE_PTG_TARGET: + guidance.targetQuatPtgThreeAxes(&sensorValues, &gpsDataProcessed, &mekfData, now, + targetQuat, refSatRate); + break; + case SUBMODE_PTG_TARGET_GS: + guidance.targetQuatPtgGs(&sensorValues, &mekfData, &susDataProcessed, &gpsDataProcessed, + now, targetQuat, refSatRate); + break; + case SUBMODE_PTG_NADIR: + guidance.quatNadirPtgThreeAxes(&sensorValues, &gpsDataProcessed, &mekfData, now, targetQuat, + refSatRate); + break; + case SUBMODE_PTG_INERTIAL: + guidance.inertialQuatPtg(targetQuat, refSatRate); + break; + } + double quatErrorComplete[4] = {0, 0, 0, 0}, quatError[3] = {0, 0, 0}, + deltaRate[3] = {0, 0, 0}; // ToDo: check if pointer needed + guidance.comparePtg(targetQuat, &mekfData, refSatRate, quatErrorComplete, quatError, deltaRate); + double rwPseudoInv[4][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + guidance.getDistributionMatrixRw(&sensorValues, *rwPseudoInv); + double torquePtgRws[4] = {0, 0, 0, 0}, mode = 0; + ptgCtrl.ptgLaw(mode, quatError, deltaRate, *rwPseudoInv, torquePtgRws); + double rwTrqNs[4] = {0, 0, 0, 0}; + ptgCtrl.ptgNullspace( + &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), + &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), rwTrqNs); + double torqueRws[4] = {0, 0, 0, 0}, torqueRwsScaled[4] = {0, 0, 0, 0}; + VectorOperations::add(torquePtgRws, rwTrqNs, torqueRws, 4); + actuatorCmd.scalingTorqueRws(torqueRws, torqueRwsScaled); + + if (acsParameters.pointingModeControllerParameters.enableAntiStiction) { + bool rwAvailable[4] = {true, true, true, true}; // WHICH INPUT SENSOR SET? + int32_t rwSpeed[4] = { + (sensorValues.rw1Set.currSpeed.value), (sensorValues.rw2Set.currSpeed.value), + (sensorValues.rw3Set.currSpeed.value), (sensorValues.rw4Set.currSpeed.value)}; + ptgCtrl.rwAntistiction(rwAvailable, rwSpeed, torqueRwsScaled); + } + + double cmdSpeedRws[4] = {0, 0, 0, + 0}; // Should be given to the actuator reaction wheel as input + actuatorCmd.cmdSpeedToRws(&(sensorValues.rw1Set.currSpeed.value), + &(sensorValues.rw2Set.currSpeed.value), + &(sensorValues.rw3Set.currSpeed.value), + &(sensorValues.rw4Set.currSpeed.value), torqueRwsScaled, cmdSpeedRws); + double mgtDpDes[3] = {0, 0, 0}, dipolUnits[3] = {0, 0, 0}; // Desaturation Dipol + ptgCtrl.ptgDesaturation(mgmDataProcessed.mgmVecTot.value, mgmDataProcessed.mgmVecTot.isValid(), + mekfData.satRotRateMekf.value, &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), &(sensorValues.rw3Set.currSpeed.value), - &(sensorValues.rw4Set.currSpeed.value), torqueRwsScaled, cmdSpeedRws); - double mgtDpDes[3] = {0, 0, 0}, dipolUnits[3] = {0, 0, 0}; // Desaturation Dipol - ptgCtrl.ptgDesaturation(mgmDataProcessed.mgmVecTot.value, mgmDataProcessed.mgmVecTot.isValid(), - mekfData.satRotRateMekf.value, &(sensorValues.rw1Set.currSpeed.value), - &(sensorValues.rw2Set.currSpeed.value), - &(sensorValues.rw3Set.currSpeed.value), - &(sensorValues.rw4Set.currSpeed.value), mgtDpDes); - actuatorCmd.cmdDipolMtq(mgtDpDes, dipolUnits); + &(sensorValues.rw4Set.currSpeed.value), mgtDpDes); + actuatorCmd.cmdDipolMtq(mgtDpDes, dipolUnits); - int16_t cmdDipolUnitsInt[3] = {0, 0, 0}; - for (int i = 0; i < 3; ++i) { - cmdDipolUnitsInt[i] = std::round(dipolUnits[i]); - } - int32_t cmdRwSpeedInt[4] = {0, 0, 0, 0}; - for (int i = 0; i < 4; ++i) { - cmdRwSpeedInt[i] = std::round(cmdSpeedRws[i]); + int16_t cmdDipolUnitsInt[3] = {0, 0, 0}; + for (int i = 0; i < 3; ++i) { + cmdDipolUnitsInt[i] = std::round(dipolUnits[i]); + } + int32_t cmdRwSpeedInt[4] = {0, 0, 0, 0}; + for (int i = 0; i < 4; ++i) { + cmdRwSpeedInt[i] = std::round(cmdSpeedRws[i]); + } + + { + PoolReadGuard pg(&actuatorCmdData); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(actuatorCmdData.rwTargetTorque.value, rwTrqNs, 4 * sizeof(double)); + std::memcpy(actuatorCmdData.rwTargetSpeed.value, cmdRwSpeedInt, 4 * sizeof(int32_t)); + std::memcpy(actuatorCmdData.mtqTargetDipole.value, cmdDipolUnitsInt, 3 * sizeof(int16_t)); + actuatorCmdData.setValidity(true, true); + } + } + // { + // PoolReadGuard pg(&dipoleSet); + // MutexGuard mg(torquer::lazyLock()); + // torquer::NEW_ACTUATION_FLAG = true; + // dipoleSet.setDipoles(cmdDipolUnitsInt[0], cmdDipolUnitsInt[1], cmdDipolUnitsInt[2], + // torqueDuration); + // } } - { - PoolReadGuard pg(&actuatorCmdData); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(actuatorCmdData.rwTargetTorque.value, rwTrqNs, 4 * sizeof(double)); - std::memcpy(actuatorCmdData.rwTargetSpeed.value, cmdRwSpeedInt, 4 * sizeof(int32_t)); - std::memcpy(actuatorCmdData.mtqTargetDipole.value, cmdDipolUnitsInt, 3 * sizeof(int16_t)); - actuatorCmdData.setValidity(true, true); - } + ReturnValue_t AcsController::initializeLocalDataPool(localpool::DataPool & localDataPoolMap, + LocalDataPoolManager & poolManager) { + // MGM Raw + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_0_LIS3_UT, &mgm0VecRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_1_RM3100_UT, &mgm1VecRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_2_LIS3_UT, &mgm2VecRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_3_RM3100_UT, &mgm3VecRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_IMTQ_CAL_NT, &imtqMgmVecRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_IMTQ_CAL_ACT_STATUS, &imtqCalActStatus); + poolManager.subscribeForRegularPeriodicPacket({mgmDataRaw.getSid(), false, 5.0}); + // MGM Processed + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_0_VEC, &mgm0VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_1_VEC, &mgm1VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_2_VEC, &mgm2VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_3_VEC, &mgm3VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_4_VEC, &mgm4VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_VEC_TOT, &mgmVecTot); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_VEC_TOT_DERIVATIVE, &mgmVecTotDer); + localDataPoolMap.emplace(acsctrl::PoolIds::MAG_IGRF_MODEL, &magIgrf); + poolManager.subscribeForRegularPeriodicPacket({mgmDataProcessed.getSid(), false, 5.0}); + // SUS Raw + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_0_N_LOC_XFYFZM_PT_XF, &sus0ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_1_N_LOC_XBYFZM_PT_XB, &sus1ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_2_N_LOC_XFYBZB_PT_YB, &sus2ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_3_N_LOC_XFYBZF_PT_YF, &sus3ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_4_N_LOC_XMYFZF_PT_ZF, &sus4ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_5_N_LOC_XFYMZB_PT_ZB, &sus5ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_6_R_LOC_XFYBZM_PT_XF, &sus6ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_7_R_LOC_XBYBZM_PT_XB, &sus7ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_8_R_LOC_XBYBZB_PT_YB, &sus8ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_9_R_LOC_XBYBZB_PT_YF, &sus9ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_10_N_LOC_XMYBZF_PT_ZF, &sus10ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_11_R_LOC_XBYMZB_PT_ZB, &sus11ValRaw); + poolManager.subscribeForRegularPeriodicPacket({susDataRaw.getSid(), false, 5.0}); + // SUS Processed + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_0_VEC, &sus0VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_1_VEC, &sus1VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_2_VEC, &sus2VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_3_VEC, &sus3VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_4_VEC, &sus4VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_5_VEC, &sus5VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_6_VEC, &sus6VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_7_VEC, &sus7VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_8_VEC, &sus8VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_9_VEC, &sus9VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_10_VEC, &sus10VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_11_VEC, &sus11VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_VEC_TOT, &susVecTot); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_VEC_TOT_DERIVATIVE, &susVecTotDer); + localDataPoolMap.emplace(acsctrl::PoolIds::SUN_IJK_MODEL, &sunIjk); + poolManager.subscribeForRegularPeriodicPacket({susDataProcessed.getSid(), false, 5.0}); + // GYR Raw + localDataPoolMap.emplace(acsctrl::PoolIds::GYR_0_ADIS, &gyr0VecRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::GYR_1_L3, &gyr1VecRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::GYR_2_ADIS, &gyr2VecRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::GYR_3_L3, &gyr3VecRaw); + poolManager.subscribeForRegularPeriodicPacket({gyrDataRaw.getSid(), false, 5.0}); + // GYR Processed + localDataPoolMap.emplace(acsctrl::PoolIds::GYR_0_VEC, &gyr0VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::GYR_1_VEC, &gyr1VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::GYR_2_VEC, &gyr2VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::GYR_3_VEC, &gyr3VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::GYR_VEC_TOT, &gyrVecTot); + poolManager.subscribeForRegularPeriodicPacket({gyrDataProcessed.getSid(), false, 5.0}); + // GPS Processed + localDataPoolMap.emplace(acsctrl::PoolIds::GC_LATITUDE, &gcLatitude); + localDataPoolMap.emplace(acsctrl::PoolIds::GD_LONGITUDE, &gdLongitude); + localDataPoolMap.emplace(acsctrl::PoolIds::GPS_VELOCITY, &gpsVelocity); + poolManager.subscribeForRegularPeriodicPacket({gpsDataProcessed.getSid(), false, 5.0}); + // MEKF + localDataPoolMap.emplace(acsctrl::PoolIds::QUAT_MEKF, &quatMekf); + localDataPoolMap.emplace(acsctrl::PoolIds::SAT_ROT_RATE_MEKF, &satRotRateMekf); + poolManager.subscribeForRegularPeriodicPacket({mekfData.getSid(), false, 5.0}); + // Ctrl Values + localDataPoolMap.emplace(acsctrl::PoolIds::TGT_QUAT, &tgtQuat); + localDataPoolMap.emplace(acsctrl::PoolIds::ERROR_QUAT, &errQuat); + localDataPoolMap.emplace(acsctrl::PoolIds::ERROR_ANG, &errAng); + poolManager.subscribeForRegularPeriodicPacket({ctrlValData.getSid(), false, 5.0}); + // Actuator CMD + localDataPoolMap.emplace(acsctrl::PoolIds::RW_TARGET_TORQUE, &rwTargetTorque); + localDataPoolMap.emplace(acsctrl::PoolIds::RW_TARGET_SPEED, &rwTargetSpeed); + localDataPoolMap.emplace(acsctrl::PoolIds::MTQ_TARGET_DIPOLE, &mtqTargetDipole); + poolManager.subscribeForRegularPeriodicPacket({actuatorCmdData.getSid(), false, 5.0}); + return returnvalue::OK; } - // { - // PoolReadGuard pg(&dipoleSet); - // MutexGuard mg(torquer::lazyLock()); - // torquer::NEW_ACTUATION_FLAG = true; - // dipoleSet.setDipoles(cmdDipolUnitsInt[0], cmdDipolUnitsInt[1], cmdDipolUnitsInt[2], - // torqueDuration); - // } -} -ReturnValue_t AcsController::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, - LocalDataPoolManager &poolManager) { - // MGM Raw - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_0_LIS3_UT, &mgm0VecRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_1_RM3100_UT, &mgm1VecRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_2_LIS3_UT, &mgm2VecRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_3_RM3100_UT, &mgm3VecRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_IMTQ_CAL_NT, &imtqMgmVecRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_IMTQ_CAL_ACT_STATUS, &imtqCalActStatus); - poolManager.subscribeForRegularPeriodicPacket({mgmDataRaw.getSid(), false, 5.0}); - // MGM Processed - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_0_VEC, &mgm0VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_1_VEC, &mgm1VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_2_VEC, &mgm2VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_3_VEC, &mgm3VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_4_VEC, &mgm4VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_VEC_TOT, &mgmVecTot); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_VEC_TOT_DERIVATIVE, &mgmVecTotDer); - localDataPoolMap.emplace(acsctrl::PoolIds::MAG_IGRF_MODEL, &magIgrf); - poolManager.subscribeForRegularPeriodicPacket({mgmDataProcessed.getSid(), false, 5.0}); - // SUS Raw - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_0_N_LOC_XFYFZM_PT_XF, &sus0ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_1_N_LOC_XBYFZM_PT_XB, &sus1ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_2_N_LOC_XFYBZB_PT_YB, &sus2ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_3_N_LOC_XFYBZF_PT_YF, &sus3ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_4_N_LOC_XMYFZF_PT_ZF, &sus4ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_5_N_LOC_XFYMZB_PT_ZB, &sus5ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_6_R_LOC_XFYBZM_PT_XF, &sus6ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_7_R_LOC_XBYBZM_PT_XB, &sus7ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_8_R_LOC_XBYBZB_PT_YB, &sus8ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_9_R_LOC_XBYBZB_PT_YF, &sus9ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_10_N_LOC_XMYBZF_PT_ZF, &sus10ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_11_R_LOC_XBYMZB_PT_ZB, &sus11ValRaw); - poolManager.subscribeForRegularPeriodicPacket({susDataRaw.getSid(), false, 5.0}); - // SUS Processed - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_0_VEC, &sus0VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_1_VEC, &sus1VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_2_VEC, &sus2VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_3_VEC, &sus3VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_4_VEC, &sus4VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_5_VEC, &sus5VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_6_VEC, &sus6VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_7_VEC, &sus7VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_8_VEC, &sus8VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_9_VEC, &sus9VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_10_VEC, &sus10VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_11_VEC, &sus11VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_VEC_TOT, &susVecTot); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_VEC_TOT_DERIVATIVE, &susVecTotDer); - localDataPoolMap.emplace(acsctrl::PoolIds::SUN_IJK_MODEL, &sunIjk); - poolManager.subscribeForRegularPeriodicPacket({susDataProcessed.getSid(), false, 5.0}); - // GYR Raw - localDataPoolMap.emplace(acsctrl::PoolIds::GYR_0_ADIS, &gyr0VecRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::GYR_1_L3, &gyr1VecRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::GYR_2_ADIS, &gyr2VecRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::GYR_3_L3, &gyr3VecRaw); - poolManager.subscribeForRegularPeriodicPacket({gyrDataRaw.getSid(), false, 5.0}); - // GYR Processed - localDataPoolMap.emplace(acsctrl::PoolIds::GYR_0_VEC, &gyr0VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::GYR_1_VEC, &gyr1VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::GYR_2_VEC, &gyr2VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::GYR_3_VEC, &gyr3VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::GYR_VEC_TOT, &gyrVecTot); - poolManager.subscribeForRegularPeriodicPacket({gyrDataProcessed.getSid(), false, 5.0}); - // GPS Processed - localDataPoolMap.emplace(acsctrl::PoolIds::GC_LATITUDE, &gcLatitude); - localDataPoolMap.emplace(acsctrl::PoolIds::GD_LONGITUDE, &gdLongitude); - localDataPoolMap.emplace(acsctrl::PoolIds::GPS_VELOCITY, &gpsVelocity); - poolManager.subscribeForRegularPeriodicPacket({gpsDataProcessed.getSid(), false, 5.0}); - // MEKF - localDataPoolMap.emplace(acsctrl::PoolIds::QUAT_MEKF, &quatMekf); - localDataPoolMap.emplace(acsctrl::PoolIds::SAT_ROT_RATE_MEKF, &satRotRateMekf); - poolManager.subscribeForRegularPeriodicPacket({mekfData.getSid(), false, 5.0}); - // Ctrl Values - localDataPoolMap.emplace(acsctrl::PoolIds::TGT_QUAT, &tgtQuat); - localDataPoolMap.emplace(acsctrl::PoolIds::ERROR_QUAT, &errQuat); - localDataPoolMap.emplace(acsctrl::PoolIds::ERROR_ANG, &errAng); - poolManager.subscribeForRegularPeriodicPacket({ctrlValData.getSid(), false, 5.0}); - // Actuator CMD - localDataPoolMap.emplace(acsctrl::PoolIds::RW_TARGET_TORQUE, &rwTargetTorque); - localDataPoolMap.emplace(acsctrl::PoolIds::RW_TARGET_SPEED, &rwTargetSpeed); - localDataPoolMap.emplace(acsctrl::PoolIds::MTQ_TARGET_DIPOLE, &mtqTargetDipole); - poolManager.subscribeForRegularPeriodicPacket({actuatorCmdData.getSid(), false, 5.0}); - return returnvalue::OK; -} + LocalPoolDataSetBase *AcsController::getDataSetHandle(sid_t sid) { + switch (sid.ownerSetId) { + case acsctrl::MGM_SENSOR_DATA: + return &mgmDataRaw; + case acsctrl::MGM_PROCESSED_DATA: + return &mgmDataProcessed; + case acsctrl::SUS_SENSOR_DATA: + return &susDataRaw; + case acsctrl::SUS_PROCESSED_DATA: + return &susDataProcessed; + case acsctrl::GYR_SENSOR_DATA: + return &gyrDataRaw; + case acsctrl::GYR_PROCESSED_DATA: + return &gyrDataProcessed; + case acsctrl::GPS_PROCESSED_DATA: + return &gpsDataProcessed; + case acsctrl::MEKF_DATA: + return &mekfData; + case acsctrl::CTRL_VAL_DATA: + return &ctrlValData; + case acsctrl::ACTUATOR_CMD_DATA: + return &actuatorCmdData; + default: + return nullptr; + } + return nullptr; + } -LocalPoolDataSetBase *AcsController::getDataSetHandle(sid_t sid) { - switch (sid.ownerSetId) { - case acsctrl::MGM_SENSOR_DATA: - return &mgmDataRaw; - case acsctrl::MGM_PROCESSED_DATA: - return &mgmDataProcessed; - case acsctrl::SUS_SENSOR_DATA: - return &susDataRaw; - case acsctrl::SUS_PROCESSED_DATA: - return &susDataProcessed; - case acsctrl::GYR_SENSOR_DATA: - return &gyrDataRaw; - case acsctrl::GYR_PROCESSED_DATA: - return &gyrDataProcessed; - case acsctrl::GPS_PROCESSED_DATA: - return &gpsDataProcessed; - case acsctrl::MEKF_DATA: - return &mekfData; - case acsctrl::CTRL_VAL_DATA: - return &ctrlValData; - case acsctrl::ACTUATOR_CMD_DATA: - return &actuatorCmdData; - default: - return nullptr; + ReturnValue_t AcsController::checkModeCommand(Mode_t mode, Submode_t submode, + uint32_t * msToReachTheMode) { + if (mode == MODE_OFF) { + if (submode == SUBMODE_NONE) { + return returnvalue::OK; + } else { + return INVALID_SUBMODE; + } + } else if ((mode == MODE_ON) || (mode == MODE_NORMAL)) { + if ((submode > 8) || (submode < 2)) { + return INVALID_SUBMODE; + } else { + return returnvalue::OK; + } + } + return INVALID_MODE; } - return nullptr; -} -ReturnValue_t AcsController::checkModeCommand(Mode_t mode, Submode_t submode, - uint32_t *msToReachTheMode) { - if (mode == MODE_OFF) { - if (submode == SUBMODE_NONE) { - return returnvalue::OK; - } else { - return INVALID_SUBMODE; + void AcsController::copyMgmData() { + ACS::SensorValues sensorValues; + { + PoolReadGuard pg(&sensorValues.mgm0Lis3Set); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(mgmDataRaw.mgm0Lis3.value, sensorValues.mgm0Lis3Set.fieldStrengths.value, + 3 * sizeof(float)); + mgmDataRaw.mgm0Lis3.setValid(sensorValues.mgm0Lis3Set.fieldStrengths.isValid()); + } } - } else if ((mode == MODE_ON) || (mode == MODE_NORMAL)) { - if ((submode > 8) || (submode < 2)) { - return INVALID_SUBMODE; - } else { - return returnvalue::OK; + { + PoolReadGuard pg(&sensorValues.mgm1Rm3100Set); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(mgmDataRaw.mgm1Rm3100.value, sensorValues.mgm1Rm3100Set.fieldStrengths.value, + 3 * sizeof(float)); + mgmDataRaw.mgm1Rm3100.setValid(sensorValues.mgm1Rm3100Set.fieldStrengths.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.mgm2Lis3Set); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(mgmDataRaw.mgm2Lis3.value, sensorValues.mgm2Lis3Set.fieldStrengths.value, + 3 * sizeof(float)); + mgmDataRaw.mgm2Lis3.setValid(sensorValues.mgm2Lis3Set.fieldStrengths.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.mgm3Rm3100Set); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(mgmDataRaw.mgm3Rm3100.value, sensorValues.mgm3Rm3100Set.fieldStrengths.value, + 3 * sizeof(float)); + mgmDataRaw.mgm3Rm3100.setValid(sensorValues.mgm3Rm3100Set.fieldStrengths.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.imtqMgmSet); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(mgmDataRaw.imtqRaw.value, sensorValues.imtqMgmSet.mtmRawNt.value, + 3 * sizeof(float)); + mgmDataRaw.imtqRaw.setValid(sensorValues.imtqMgmSet.mtmRawNt.isValid()); + mgmDataRaw.actuationCalStatus.value = sensorValues.imtqMgmSet.coilActuationStatus.value; + mgmDataRaw.actuationCalStatus.setValid( + sensorValues.imtqMgmSet.coilActuationStatus.isValid()); + } } } - return INVALID_MODE; -} -void AcsController::modeChanged(Mode_t mode, Submode_t submode) {} + void AcsController::copySusData() { + ACS::SensorValues sensorValues; + { + PoolReadGuard pg(&sensorValues.susSets[0]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus0.value, sensorValues.susSets[0].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus0.setValid(sensorValues.susSets[0].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[1]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus1.value, sensorValues.susSets[1].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus1.setValid(sensorValues.susSets[1].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[2]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus2.value, sensorValues.susSets[2].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus2.setValid(sensorValues.susSets[2].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[3]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus3.value, sensorValues.susSets[3].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus3.setValid(sensorValues.susSets[3].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[4]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus4.value, sensorValues.susSets[4].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus4.setValid(sensorValues.susSets[4].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[5]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus5.value, sensorValues.susSets[5].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus5.setValid(sensorValues.susSets[5].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[6]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus6.value, sensorValues.susSets[6].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus6.setValid(sensorValues.susSets[6].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[7]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus7.value, sensorValues.susSets[7].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus7.setValid(sensorValues.susSets[7].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[8]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus8.value, sensorValues.susSets[8].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus8.setValid(sensorValues.susSets[8].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[9]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus9.value, sensorValues.susSets[9].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus9.setValid(sensorValues.susSets[9].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[10]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus10.value, sensorValues.susSets[10].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus10.setValid(sensorValues.susSets[10].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[11]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus11.value, sensorValues.susSets[11].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus11.setValid(sensorValues.susSets[11].channels.isValid()); + } + } + } -void AcsController::announceMode(bool recursive) {} - -void AcsController::copyMgmData() { - ACS::SensorValues sensorValues; - { - PoolReadGuard pg(&sensorValues.mgm0Lis3Set); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(mgmDataRaw.mgm0Lis3.value, sensorValues.mgm0Lis3Set.fieldStrengths.value, - 3 * sizeof(float)); - mgmDataRaw.mgm0Lis3.setValid(sensorValues.mgm0Lis3Set.fieldStrengths.isValid()); + void AcsController::copyGyrData() { + ACS::SensorValues sensorValues; + { + PoolReadGuard pg(&sensorValues.gyr0AdisSet); + if (pg.getReadResult() == returnvalue::OK) { + gyrDataRaw.gyr0Adis.value[0] = sensorValues.gyr0AdisSet.angVelocX.value; + gyrDataRaw.gyr0Adis.value[1] = sensorValues.gyr0AdisSet.angVelocY.value; + gyrDataRaw.gyr0Adis.value[2] = sensorValues.gyr0AdisSet.angVelocZ.value; + gyrDataRaw.gyr0Adis.setValid(sensorValues.gyr0AdisSet.angVelocX.isValid() && + sensorValues.gyr0AdisSet.angVelocY.isValid() && + sensorValues.gyr0AdisSet.angVelocZ.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.gyr1L3gSet); + if (pg.getReadResult() == returnvalue::OK) { + gyrDataRaw.gyr1L3.value[0] = sensorValues.gyr1L3gSet.angVelocX.value; + gyrDataRaw.gyr1L3.value[1] = sensorValues.gyr1L3gSet.angVelocY.value; + gyrDataRaw.gyr1L3.value[2] = sensorValues.gyr1L3gSet.angVelocZ.value; + gyrDataRaw.gyr1L3.setValid(sensorValues.gyr1L3gSet.angVelocX.isValid() && + sensorValues.gyr1L3gSet.angVelocY.isValid() && + sensorValues.gyr1L3gSet.angVelocZ.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.gyr2AdisSet); + if (pg.getReadResult() == returnvalue::OK) { + gyrDataRaw.gyr2Adis.value[0] = sensorValues.gyr2AdisSet.angVelocX.value; + gyrDataRaw.gyr2Adis.value[1] = sensorValues.gyr2AdisSet.angVelocY.value; + gyrDataRaw.gyr2Adis.value[2] = sensorValues.gyr2AdisSet.angVelocZ.value; + gyrDataRaw.gyr2Adis.setValid(sensorValues.gyr2AdisSet.angVelocX.isValid() && + sensorValues.gyr2AdisSet.angVelocY.isValid() && + sensorValues.gyr2AdisSet.angVelocZ.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.gyr3L3gSet); + if (pg.getReadResult() == returnvalue::OK) { + gyrDataRaw.gyr3L3.value[0] = sensorValues.gyr3L3gSet.angVelocX.value; + gyrDataRaw.gyr3L3.value[1] = sensorValues.gyr3L3gSet.angVelocY.value; + gyrDataRaw.gyr3L3.value[2] = sensorValues.gyr3L3gSet.angVelocZ.value; + gyrDataRaw.gyr3L3.setValid(sensorValues.gyr3L3gSet.angVelocX.isValid() && + sensorValues.gyr3L3gSet.angVelocY.isValid() && + sensorValues.gyr3L3gSet.angVelocZ.isValid()); + } } } - { - PoolReadGuard pg(&sensorValues.mgm1Rm3100Set); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(mgmDataRaw.mgm1Rm3100.value, sensorValues.mgm1Rm3100Set.fieldStrengths.value, - 3 * sizeof(float)); - mgmDataRaw.mgm1Rm3100.setValid(sensorValues.mgm1Rm3100Set.fieldStrengths.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.mgm2Lis3Set); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(mgmDataRaw.mgm2Lis3.value, sensorValues.mgm2Lis3Set.fieldStrengths.value, - 3 * sizeof(float)); - mgmDataRaw.mgm2Lis3.setValid(sensorValues.mgm2Lis3Set.fieldStrengths.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.mgm3Rm3100Set); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(mgmDataRaw.mgm3Rm3100.value, sensorValues.mgm3Rm3100Set.fieldStrengths.value, - 3 * sizeof(float)); - mgmDataRaw.mgm3Rm3100.setValid(sensorValues.mgm3Rm3100Set.fieldStrengths.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.imtqMgmSet); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(mgmDataRaw.imtqRaw.value, sensorValues.imtqMgmSet.mtmRawNt.value, - 3 * sizeof(float)); - mgmDataRaw.imtqRaw.setValid(sensorValues.imtqMgmSet.mtmRawNt.isValid()); - mgmDataRaw.actuationCalStatus.value = sensorValues.imtqMgmSet.coilActuationStatus.value; - mgmDataRaw.actuationCalStatus.setValid(sensorValues.imtqMgmSet.coilActuationStatus.isValid()); - } - } -} - -void AcsController::copySusData() { - ACS::SensorValues sensorValues; - { - PoolReadGuard pg(&sensorValues.susSets[0]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus0.value, sensorValues.susSets[0].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus0.setValid(sensorValues.susSets[0].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[1]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus1.value, sensorValues.susSets[1].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus1.setValid(sensorValues.susSets[1].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[2]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus2.value, sensorValues.susSets[2].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus2.setValid(sensorValues.susSets[2].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[3]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus3.value, sensorValues.susSets[3].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus3.setValid(sensorValues.susSets[3].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[4]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus4.value, sensorValues.susSets[4].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus4.setValid(sensorValues.susSets[4].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[5]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus5.value, sensorValues.susSets[5].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus5.setValid(sensorValues.susSets[5].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[6]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus6.value, sensorValues.susSets[6].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus6.setValid(sensorValues.susSets[6].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[7]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus7.value, sensorValues.susSets[7].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus7.setValid(sensorValues.susSets[7].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[8]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus8.value, sensorValues.susSets[8].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus8.setValid(sensorValues.susSets[8].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[9]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus9.value, sensorValues.susSets[9].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus9.setValid(sensorValues.susSets[9].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[10]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus10.value, sensorValues.susSets[10].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus10.setValid(sensorValues.susSets[10].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[11]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus11.value, sensorValues.susSets[11].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus11.setValid(sensorValues.susSets[11].channels.isValid()); - } - } -} - -void AcsController::copyGyrData() { - ACS::SensorValues sensorValues; - { - PoolReadGuard pg(&sensorValues.gyr0AdisSet); - if (pg.getReadResult() == returnvalue::OK) { - gyrDataRaw.gyr0Adis.value[0] = sensorValues.gyr0AdisSet.angVelocX.value; - gyrDataRaw.gyr0Adis.value[1] = sensorValues.gyr0AdisSet.angVelocY.value; - gyrDataRaw.gyr0Adis.value[2] = sensorValues.gyr0AdisSet.angVelocZ.value; - gyrDataRaw.gyr0Adis.setValid(sensorValues.gyr0AdisSet.angVelocX.isValid() && - sensorValues.gyr0AdisSet.angVelocY.isValid() && - sensorValues.gyr0AdisSet.angVelocZ.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.gyr1L3gSet); - if (pg.getReadResult() == returnvalue::OK) { - gyrDataRaw.gyr1L3.value[0] = sensorValues.gyr1L3gSet.angVelocX.value; - gyrDataRaw.gyr1L3.value[1] = sensorValues.gyr1L3gSet.angVelocY.value; - gyrDataRaw.gyr1L3.value[2] = sensorValues.gyr1L3gSet.angVelocZ.value; - gyrDataRaw.gyr1L3.setValid(sensorValues.gyr1L3gSet.angVelocX.isValid() && - sensorValues.gyr1L3gSet.angVelocY.isValid() && - sensorValues.gyr1L3gSet.angVelocZ.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.gyr2AdisSet); - if (pg.getReadResult() == returnvalue::OK) { - gyrDataRaw.gyr2Adis.value[0] = sensorValues.gyr2AdisSet.angVelocX.value; - gyrDataRaw.gyr2Adis.value[1] = sensorValues.gyr2AdisSet.angVelocY.value; - gyrDataRaw.gyr2Adis.value[2] = sensorValues.gyr2AdisSet.angVelocZ.value; - gyrDataRaw.gyr2Adis.setValid(sensorValues.gyr2AdisSet.angVelocX.isValid() && - sensorValues.gyr2AdisSet.angVelocY.isValid() && - sensorValues.gyr2AdisSet.angVelocZ.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.gyr3L3gSet); - if (pg.getReadResult() == returnvalue::OK) { - gyrDataRaw.gyr3L3.value[0] = sensorValues.gyr3L3gSet.angVelocX.value; - gyrDataRaw.gyr3L3.value[1] = sensorValues.gyr3L3gSet.angVelocY.value; - gyrDataRaw.gyr3L3.value[2] = sensorValues.gyr3L3gSet.angVelocZ.value; - gyrDataRaw.gyr3L3.setValid(sensorValues.gyr3L3gSet.angVelocX.isValid() && - sensorValues.gyr3L3gSet.angVelocY.isValid() && - sensorValues.gyr3L3gSet.angVelocZ.isValid()); - } - } -} diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index d2e11792..3ffcde85 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -3,6 +3,8 @@ #include #include +#include +#include #include "acs/ActuatorCmd.h" #include "acs/Guidance.h" @@ -18,7 +20,7 @@ #include "mission/devices/devicedefinitions/SusDefinitions.h" #include "mission/devices/devicedefinitions/imtqHandlerDefinitions.h" -class AcsController : public ExtendedControllerBase { +class AcsController : public ExtendedControllerBase, public ReceivesParameterMessagesIF { public: static constexpr dur_millis_t INIT_DELAY = 500; @@ -36,6 +38,12 @@ class AcsController : public ExtendedControllerBase { static const Event SAFE_RATE_VIOLATION = MAKE_EVENT(0, severity::MEDIUM); //!< The limits for the rotation in safe mode were violated. + MessageQueueId_t getCommandQueue() const; + + ReturnValue_t getParameter(uint8_t domainId, uint8_t parameterId, + ParameterWrapper* parameterWrapper, const ParameterWrapper* newValues, + uint16_t startAtIndex) override; + protected: void performSafe(); void performDetumble(); @@ -54,6 +62,8 @@ class AcsController : public ExtendedControllerBase { uint8_t detumbleCounter; + ParameterHelper parameterHelper; + enum class InternalState { STARTUP, INITIAL_DELAY, READY }; InternalState internalState = InternalState::STARTUP; @@ -68,8 +78,6 @@ class AcsController : public ExtendedControllerBase { // Mode abstract functions ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, uint32_t* msToReachTheMode) override; - void modeChanged(Mode_t mode, Submode_t submode); - void announceMode(bool recursive); /* ACS Datasets */ IMTQ::DipoleActuationSet dipoleSet = IMTQ::DipoleActuationSet(objects::IMTQ_HANDLER); From 0854b1c77874844b831b451d738565335ac57fe8 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Tue, 10 Jan 2023 09:16:13 +0100 Subject: [PATCH 075/330] ACS Ctrl getParameter forwarding to ACS Param --- mission/controller/AcsController.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 78a78c6f..7f69936c 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -44,7 +44,8 @@ ReturnValue_t AcsController::getParameter(uint8_t domainId, uint8_t parameterId, ParameterWrapper* parameterWrapper, const ParameterWrapper* newValues, uint16_t startAtIndex) { - return returnvalue::OK; + return acsParameters.getParameter(domainId, parameterId, parameterWrapper, newValues, + startAtIndex); } void AcsController::performControlOperation() { From 93ec49bf8deaaaa073dea28661cc1d49d95399c1 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Tue, 10 Jan 2023 11:20:28 +0100 Subject: [PATCH 076/330] added 3 axes stabilized target mode for GS contact. renamed tgt coordinates acordingly --- mission/controller/acs/AcsParameters.cpp | 8 +- mission/controller/acs/AcsParameters.h | 10 +- mission/controller/acs/Guidance.cpp | 240 ++++++++++++----------- mission/controller/acs/Guidance.h | 6 +- 4 files changed, 136 insertions(+), 128 deletions(-) diff --git a/mission/controller/acs/AcsParameters.cpp b/mission/controller/acs/AcsParameters.cpp index 276204d2..2479eb53 100644 --- a/mission/controller/acs/AcsParameters.cpp +++ b/mission/controller/acs/AcsParameters.cpp @@ -412,16 +412,16 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, return INVALID_IDENTIFIER_ID; } break; - case (0xC): // GroundStationParameters + case (0xC): // PtgTargetParameters switch (parameterId & 0xFF) { case 0x0: - parameterWrapper->set(groundStationParameters.latitudeGs); + parameterWrapper->set(ptgTargetParameters.latitudeTgt); break; case 0x1: - parameterWrapper->set(groundStationParameters.longitudeGs); + parameterWrapper->set(ptgTargetParameters.longitudeTgt); break; case 0x2: - parameterWrapper->set(groundStationParameters.altitudeGs); + parameterWrapper->set(ptgTargetParameters.altitudeTgt); break; default: return INVALID_IDENTIFIER_ID; diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index e2f26c96..df7b0882 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -854,11 +854,11 @@ class AcsParameters : public HasParametersIF { double timeDiffVelocityMax = 30; //[s] } gpsParameters; - struct GroundStationParameters { - double latitudeGs = 48.7495 * M_PI / 180.; // [rad] Latitude - double longitudeGs = 9.10384 * M_PI / 180.; // [rad] Longitude - double altitudeGs = 500; // [m] Altitude - } groundStationParameters; // Stuttgart + struct ptgTargetParameters { // Default is Stuttgart GS + double latitudeTgt = 48.7495 * M_PI / 180.; // [rad] Latitude + double longitudeTgt = 9.10384 * M_PI / 180.; // [rad] Longitude + double altitudeTgt = 500; // [m] Altitude + } ptgTargetParameters; struct SunModelParameters { float domega = 36000.771; diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index e46abe37..cd3a7b95 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -39,12 +39,11 @@ void Guidance::targetQuatPtgSingleAxis(ACS::SensorValues *sensorValues, acsctrl: //------------------------------------------------------------------------------------- // Transform longitude, latitude and altitude to cartesian coordiantes (earth // fixed/centered frame) - double groundStationCart[3] = {0, 0, 0}; + double targetCart[3] = {0, 0, 0}; - MathOperations::cartesianFromLatLongAlt(acsParameters.groundStationParameters.latitudeGs, - acsParameters.groundStationParameters.longitudeGs, - acsParameters.groundStationParameters.altitudeGs, - groundStationCart); + MathOperations::cartesianFromLatLongAlt( + acsParameters.ptgTargetParameters.latitudeTgt, acsParameters.ptgTargetParameters.longitudeTgt, + acsParameters.ptgTargetParameters.altitudeTgt, targetCart); // Position of the satellite in the earth/fixed frame via GPS double posSatE[3] = {0, 0, 0}; @@ -55,7 +54,7 @@ void Guidance::targetQuatPtgSingleAxis(ACS::SensorValues *sensorValues, acsctrl: // Target direction in the ECEF frame double targetDirE[3] = {0, 0, 0}; - VectorOperations::subtract(groundStationCart, posSatE, targetDirE, 3); + VectorOperations::subtract(targetCart, posSatE, targetDirE, 3); // Transformation between ECEF and IJK frame double dcmEJ[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; @@ -173,6 +172,48 @@ void Guidance::targetQuatPtgSingleAxis(ACS::SensorValues *sensorValues, acsctrl: } } +void Guidance::refRotationRate(timeval now, double quatInertialTarget[4], double *refSatRate) { + //------------------------------------------------------------------------------------- + // Calculation of reference rotation rate + //------------------------------------------------------------------------------------- + double timeElapsed = + now.tv_sec + now.tv_usec * pow(10, -6) - + (timeSavedQuaternionNadir.tv_sec + + timeSavedQuaternionNadir.tv_usec * pow((double)timeSavedQuaternionNadir.tv_usec, -6)); + if (timeElapsed < acsParameters.pointingModeControllerParameters.nadirTimeElapsedMax) { + double qDiff[4] = {0, 0, 0, 0}; + VectorOperations::subtract(quatInertialTarget, savedQuaternionNadir, qDiff, 4); + VectorOperations::mulScalar(qDiff, 1 / timeElapsed, qDiff, 4); + + double tgtQuatVec[3] = {quatInertialTarget[0], quatInertialTarget[1], quatInertialTarget[2]}, + qDiffVec[3] = {qDiff[0], qDiff[1], qDiff[2]}; + double sum1[3] = {0, 0, 0}, sum2[3] = {0, 0, 0}, sum3[3] = {0, 0, 0}, sum[3] = {0, 0, 0}; + VectorOperations::cross(quatInertialTarget, qDiff, sum1); + VectorOperations::mulScalar(tgtQuatVec, qDiff[3], sum2, 3); + VectorOperations::mulScalar(qDiffVec, quatInertialTarget[3], sum3, 3); + VectorOperations::add(sum1, sum2, sum, 3); + VectorOperations::subtract(sum, sum3, sum, 3); + double omegaRefNew[3] = {0, 0, 0}; + VectorOperations::mulScalar(sum, -2, omegaRefNew, 3); + + VectorOperations::mulScalar(omegaRefNew, 2, refSatRate, 3); + VectorOperations::subtract(refSatRate, omegaRefSavedNadir, refSatRate, 3); + omegaRefSavedNadir[0] = omegaRefNew[0]; + omegaRefSavedNadir[1] = omegaRefNew[1]; + omegaRefSavedNadir[2] = omegaRefNew[2]; + } else { + refSatRate[0] = 0; + refSatRate[1] = 0; + refSatRate[2] = 0; + } + + timeSavedQuaternionNadir = now; + savedQuaternionNadir[0] = quatInertialTarget[0]; + savedQuaternionNadir[1] = quatInertialTarget[1]; + savedQuaternionNadir[2] = quatInertialTarget[2]; + savedQuaternionNadir[3] = quatInertialTarget[3]; +} + void Guidance::targetQuatPtgThreeAxes(ACS::SensorValues *sensorValues, acsctrl::GpsDataProcessed *gpsDataProcessed, acsctrl::MekfData *mekfData, timeval now, @@ -182,12 +223,11 @@ void Guidance::targetQuatPtgThreeAxes(ACS::SensorValues *sensorValues, //------------------------------------------------------------------------------------- // Transform longitude, latitude and altitude to cartesian coordiantes (earth // fixed/centered frame) - double groundStationCart[3] = {0, 0, 0}; + double targetCart[3] = {0, 0, 0}; - MathOperations::cartesianFromLatLongAlt(acsParameters.groundStationParameters.latitudeGs, - acsParameters.groundStationParameters.longitudeGs, - acsParameters.groundStationParameters.altitudeGs, - groundStationCart); + MathOperations::cartesianFromLatLongAlt( + acsParameters.ptgTargetParameters.latitudeTgt, acsParameters.ptgTargetParameters.longitudeTgt, + acsParameters.ptgTargetParameters.altitudeTgt, targetCart); // Position of the satellite in the earth/fixed frame via GPS double posSatE[3] = {0, 0, 0}; double geodeticLatRad = (sensorValues->gpsSet.latitude.value) * PI / 180; @@ -195,7 +235,7 @@ void Guidance::targetQuatPtgThreeAxes(ACS::SensorValues *sensorValues, MathOperations::cartesianFromLatLongAlt(geodeticLatRad, longitudeRad, sensorValues->gpsSet.altitude.value, posSatE); double targetDirE[3] = {0, 0, 0}; - VectorOperations::subtract(groundStationCart, posSatE, targetDirE, 3); + VectorOperations::subtract(targetCart, posSatE, targetDirE, 3); // Transformation between ECEF and IJK frame double dcmEJ[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; @@ -246,45 +286,7 @@ void Guidance::targetQuatPtgThreeAxes(ACS::SensorValues *sensorValues, double quatInertialTarget[4] = {0, 0, 0, 0}; QuaternionOperations::fromDcm(dcmTgt, quatInertialTarget); - //------------------------------------------------------------------------------------- - // Calculation of reference rotation rate - //------------------------------------------------------------------------------------- - double timeElapsed = - now.tv_sec + now.tv_usec * pow(10, -6) - - (timeSavedQuaternionNadir.tv_sec + - timeSavedQuaternionNadir.tv_usec * pow((double)timeSavedQuaternionNadir.tv_usec, -6)); - if (timeElapsed < acsParameters.pointingModeControllerParameters.nadirTimeElapsedMax) { - double qDiff[4] = {0, 0, 0, 0}; - VectorOperations::subtract(quatInertialTarget, savedQuaternionNadir, qDiff, 4); - VectorOperations::mulScalar(qDiff, 1 / timeElapsed, qDiff, 4); - - double tgtQuatVec[3] = {quatInertialTarget[0], quatInertialTarget[1], quatInertialTarget[2]}, - qDiffVec[3] = {qDiff[0], qDiff[1], qDiff[2]}; - double sum1[3] = {0, 0, 0}, sum2[3] = {0, 0, 0}, sum3[3] = {0, 0, 0}, sum[3] = {0, 0, 0}; - VectorOperations::cross(quatInertialTarget, qDiff, sum1); - VectorOperations::mulScalar(tgtQuatVec, qDiff[3], sum2, 3); - VectorOperations::mulScalar(qDiffVec, quatInertialTarget[3], sum3, 3); - VectorOperations::add(sum1, sum2, sum, 3); - VectorOperations::subtract(sum, sum3, sum, 3); - double omegaRefNew[3] = {0, 0, 0}; - VectorOperations::mulScalar(sum, -2, omegaRefNew, 3); - - VectorOperations::mulScalar(omegaRefNew, 2, refSatRate, 3); - VectorOperations::subtract(refSatRate, omegaRefSavedNadir, refSatRate, 3); - omegaRefSavedNadir[0] = omegaRefNew[0]; - omegaRefSavedNadir[1] = omegaRefNew[1]; - omegaRefSavedNadir[2] = omegaRefNew[2]; - } else { - refSatRate[0] = 0; - refSatRate[1] = 0; - refSatRate[2] = 0; - } - - timeSavedQuaternionNadir = now; - savedQuaternionNadir[0] = quatInertialTarget[0]; - savedQuaternionNadir[1] = quatInertialTarget[1]; - savedQuaternionNadir[2] = quatInertialTarget[2]; - savedQuaternionNadir[3] = quatInertialTarget[3]; + refRotationRate(now, quatInertialTarget, refSatRate); // Transform in system relative to satellite frame double quatBJ[4] = {0, 0, 0, 0}; @@ -295,7 +297,75 @@ void Guidance::targetQuatPtgThreeAxes(ACS::SensorValues *sensorValues, void Guidance::targetQuatPtgGs(ACS::SensorValues *sensorValues, acsctrl::MekfData *mekfData, acsctrl::SusDataProcessed *susDataProcessed, acsctrl::GpsDataProcessed *gpsDataProcessed, timeval now, - double targetQuat[4], double refSatRate[3]) {} + double targetQuat[4], double refSatRate[3]) { + //------------------------------------------------------------------------------------- + // Calculation of target quaternion for ground station pointing + //------------------------------------------------------------------------------------- + // Transform longitude, latitude and altitude to cartesian coordiantes (earth + // fixed/centered frame) + double groundStationCart[3] = {0, 0, 0}; + + MathOperations::cartesianFromLatLongAlt( + acsParameters.ptgTargetParameters.latitudeTgt, acsParameters.ptgTargetParameters.longitudeTgt, + acsParameters.ptgTargetParameters.altitudeTgt, groundStationCart); + // Position of the satellite in the earth/fixed frame via GPS + double posSatE[3] = {0, 0, 0}; + double geodeticLatRad = (sensorValues->gpsSet.latitude.value) * PI / 180; + double longitudeRad = (sensorValues->gpsSet.longitude.value) * PI / 180; + MathOperations::cartesianFromLatLongAlt(geodeticLatRad, longitudeRad, + sensorValues->gpsSet.altitude.value, posSatE); + double targetDirE[3] = {0, 0, 0}; + VectorOperations::subtract(groundStationCart, posSatE, targetDirE, 3); + + // Transformation between ECEF and IJK frame + double dcmEJ[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + double dcmJE[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + double dcmEJDot[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + MathOperations::ecfToEciWithNutPre(now, *dcmEJ, *dcmEJDot); + MathOperations::inverseMatrixDimThree(*dcmEJ, *dcmJE); + + double dcmJEDot[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + MathOperations::inverseMatrixDimThree(*dcmEJDot, *dcmJEDot); + + // Target Direction and position vector in the inertial frame + double targetDirJ[3] = {0, 0, 0}, posSatJ[3] = {0, 0, 0}; + MatrixOperations::multiply(*dcmJE, targetDirE, targetDirJ, 3, 3, 1); + MatrixOperations::multiply(*dcmJE, posSatE, posSatJ, 3, 3, 1); + + // negative x-Axis aligned with target (Camera/E-band transmitter position) + double xAxis[3] = {0, 0, 0}; + VectorOperations::normalize(targetDirJ, xAxis, 3); + VectorOperations::mulScalar(xAxis, -1, xAxis, 3); + + // get Sun Vector Model in ECI as helper vector (element of x-z plane) + double sunJ[3]; + std::memcpy(sunJ, susDataProcessed->sunIjkModel.value, 3 * sizeof(double)); + VectorOperations::normalize(sunJ, sunJ, 3); + + // calculate y-axis + double yAxis[3]; + VectorOperations::cross(sunJ, xAxis, yAxis); + VectorOperations::normalize(yAxis, yAxis, 3); + + // calculate z-axis + double zAxis[3]; + VectorOperations::cross(xAxis, yAxis, zAxis); + VectorOperations::normalize(zAxis, zAxis, 3); + + // Complete transformation matrix + double dcmTgt[3][3] = {{xAxis[0], yAxis[0], zAxis[0]}, + {xAxis[1], yAxis[1], zAxis[1]}, + {xAxis[2], yAxis[2], zAxis[2]}}; + double quatInertialTarget[4] = {0, 0, 0, 0}; + QuaternionOperations::fromDcm(dcmTgt, quatInertialTarget); + + refRotationRate(now, quatInertialTarget, refSatRate); + + // Transform in system relative to satellite frame + double quatBJ[4] = {0, 0, 0, 0}; + std::memcpy(quatBJ, mekfData->quatMekf.value, 4 * sizeof(double)); + QuaternionOperations::multiply(quatBJ, quatInertialTarget, targetQuat); +} void Guidance::sunQuatPtg(ACS::SensorValues *sensorValues, acsctrl::MekfData *mekfData, acsctrl::SusDataProcessed *susDataProcessed, @@ -317,32 +387,6 @@ void Guidance::sunQuatPtg(ACS::SensorValues *sensorValues, acsctrl::MekfData *me std::memcpy(sunDirB, susDataProcessed->susVecTot.value, 3 * sizeof(double)); } - /* - // --------------------------------------------------------------------------- - // Old version of two vector quaternion (only one axis to align) - // --------------------------------------------------------------------------- - double sunRef[3] = {0, 0, 0}; - sunRef[0] = acsParameters.safeModeControllerParameters.sunTargetDir[0]; - sunRef[1] = acsParameters.safeModeControllerParameters.sunTargetDir[1]; - sunRef[2] = acsParameters.safeModeControllerParameters.sunTargetDir[2]; - - double sunCross[3] = {0, 0, 0}; - VectorOperations::cross(sunDirB, sunRef, sunCross); - double normSunDir = VectorOperations::norm(sunDirB, 3); - double normSunRef = VectorOperations::norm(sunRef, 3); - double dotSun = VectorOperations::dot(sunDirB, sunRef); - - targetQuat[0] = sunCross[0]; - targetQuat[1] = sunCross[1]; - targetQuat[2] = sunCross[2]; - targetQuat[3] = sqrt(pow(normSunDir,2) * pow(normSunRef,2) + dotSun); - - VectorOperations::normalize(targetQuat, targetQuat, 4); - */ - - //---------------------------------------------------------------------------- - // New version - //---------------------------------------------------------------------------- // Transformation between ECEF and IJK frame double dcmEJ[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; double dcmJE[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; @@ -526,45 +570,7 @@ void Guidance::quatNadirPtgThreeAxes(ACS::SensorValues *sensorValues, double quatInertialTarget[4] = {0, 0, 0, 0}; QuaternionOperations::fromDcm(dcmTgt, quatInertialTarget); - //------------------------------------------------------------------------------------- - // Calculation of reference rotation rate - //------------------------------------------------------------------------------------- - double timeElapsed = - now.tv_sec + now.tv_usec * pow(10, -6) - - (timeSavedQuaternionNadir.tv_sec + - timeSavedQuaternionNadir.tv_usec * pow((double)timeSavedQuaternionNadir.tv_usec, -6)); - if (timeElapsed < acsParameters.pointingModeControllerParameters.nadirTimeElapsedMax) { - double qDiff[4] = {0, 0, 0, 0}; - VectorOperations::subtract(quatInertialTarget, savedQuaternionNadir, qDiff, 4); - VectorOperations::mulScalar(qDiff, 1 / timeElapsed, qDiff, 4); - - double tgtQuatVec[3] = {quatInertialTarget[0], quatInertialTarget[1], quatInertialTarget[2]}, - qDiffVec[3] = {qDiff[0], qDiff[1], qDiff[2]}; - double sum1[3] = {0, 0, 0}, sum2[3] = {0, 0, 0}, sum3[3] = {0, 0, 0}, sum[3] = {0, 0, 0}; - VectorOperations::cross(quatInertialTarget, qDiff, sum1); - VectorOperations::mulScalar(tgtQuatVec, qDiff[3], sum2, 3); - VectorOperations::mulScalar(qDiffVec, quatInertialTarget[3], sum3, 3); - VectorOperations::add(sum1, sum2, sum, 3); - VectorOperations::subtract(sum, sum3, sum, 3); - double omegaRefNew[3] = {0, 0, 0}; - VectorOperations::mulScalar(sum, -2, omegaRefNew, 3); - - VectorOperations::mulScalar(omegaRefNew, 2, refSatRate, 3); - VectorOperations::subtract(refSatRate, omegaRefSavedNadir, refSatRate, 3); - omegaRefSavedNadir[0] = omegaRefNew[0]; - omegaRefSavedNadir[1] = omegaRefNew[1]; - omegaRefSavedNadir[2] = omegaRefNew[2]; - } else { - refSatRate[0] = 0; - refSatRate[1] = 0; - refSatRate[2] = 0; - } - - timeSavedQuaternionNadir = now; - savedQuaternionNadir[0] = quatInertialTarget[0]; - savedQuaternionNadir[1] = quatInertialTarget[1]; - savedQuaternionNadir[2] = quatInertialTarget[2]; - savedQuaternionNadir[3] = quatInertialTarget[3]; + refRotationRate(now, quatInertialTarget, refSatRate); // Transform in system relative to satellite frame double quatBJ[4] = {0, 0, 0, 0}; diff --git a/mission/controller/acs/Guidance.h b/mission/controller/acs/Guidance.h index 80993a0d..ae232b31 100644 --- a/mission/controller/acs/Guidance.h +++ b/mission/controller/acs/Guidance.h @@ -21,8 +21,8 @@ class Guidance { void getTargetParamsSafe(double sunTargetSafe[3], double satRateRef[3]); - // Function to get the target quaternion and refence rotation rate from gps position and position - // of the ground station + // Function to get the target quaternion and refence rotation rate from gps position and + // position of the ground station void targetQuatPtgThreeAxes(ACS::SensorValues *sensorValues, acsctrl::GpsDataProcessed *gpsDataProcessed, acsctrl::MekfData *mekfData, timeval now, double targetQuat[4], @@ -61,6 +61,8 @@ class Guidance { void comparePtg(double targetQuat[4], acsctrl::MekfData *mekfData, double refSatRate[3], double quatErrorComplete[4], double quatError[3], double deltaRate[3]); + void refRotationRate(timeval now, double quatInertialTarget[4], double *refSatRate); + // @note: will give back the pseudoinverse matrix for the reaction wheel depending on the valid // reation wheel maybe can be done in "commanding.h" void getDistributionMatrixRw(ACS::SensorValues *sensorValues, double *rwPseudoInv); From c79e17514c3f695750cd1d21d50d80b08905c1d3 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Tue, 10 Jan 2023 13:51:55 +0100 Subject: [PATCH 077/330] changed sun and mgm model calc to always be executed --- mission/controller/acs/SensorProcessing.cpp | 139 +++++++++----------- mission/controller/acs/SensorProcessing.h | 1 - 2 files changed, 61 insertions(+), 79 deletions(-) diff --git a/mission/controller/acs/SensorProcessing.cpp b/mission/controller/acs/SensorProcessing.cpp index 7bbefe08..7e49fcdd 100644 --- a/mission/controller/acs/SensorProcessing.cpp +++ b/mission/controller/acs/SensorProcessing.cpp @@ -33,19 +33,35 @@ void SensorProcessing::processMgm(const float *mgm0Value, bool mgm0valid, const acsctrl::GpsDataProcessed *gpsDataProcessed, const double gpsAltitude, bool gpsValid, acsctrl::MgmDataProcessed *mgmDataProcessed) { + // ---------------- IGRF- 13 Implementation here ------------------------------------------------ + double magIgrfModel[3] = {0.0, 0.0, 0.0}; + if (gpsValid) { + // Should be existing class object which will be called and modified here. + Igrf13Model igrf13; + // So the line above should not be done here. Update: Can be done here as long updated coffs + // stored in acsParameters ? + igrf13.schmidtNormalization(); + igrf13.updateCoeffGH(timeOfMgmMeasurement); + // maybe put a condition here, to only update after a full day, this + // class function has around 700 steps to perform + igrf13.magFieldComp(gpsDataProcessed->gdLongitude.value, gpsDataProcessed->gcLatitude.value, + gpsAltitude, timeOfMgmMeasurement, magIgrfModel); + } if (!mgm0valid && !mgm1valid && !mgm2valid && !mgm3valid && !mgm4valid) { { PoolReadGuard pg(mgmDataProcessed); if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(mgmDataProcessed->mgm0vec.value, zeroVector, 3 * sizeof(float)); - std::memcpy(mgmDataProcessed->mgm1vec.value, zeroVector, 3 * sizeof(float)); - std::memcpy(mgmDataProcessed->mgm2vec.value, zeroVector, 3 * sizeof(float)); - std::memcpy(mgmDataProcessed->mgm3vec.value, zeroVector, 3 * sizeof(float)); - std::memcpy(mgmDataProcessed->mgm4vec.value, zeroVector, 3 * sizeof(float)); - std::memcpy(mgmDataProcessed->mgmVecTot.value, zeroVector, 3 * sizeof(float)); - std::memcpy(mgmDataProcessed->mgmVecTotDerivative.value, zeroVector, 3 * sizeof(float)); - std::memcpy(mgmDataProcessed->magIgrfModel.value, zeroVector, 3 * sizeof(double)); + float zeroVec[3] = {0.0, 0.0, 0.0}; + std::memcpy(mgmDataProcessed->mgm0vec.value, zeroVec, 3 * sizeof(float)); + std::memcpy(mgmDataProcessed->mgm1vec.value, zeroVec, 3 * sizeof(float)); + std::memcpy(mgmDataProcessed->mgm2vec.value, zeroVec, 3 * sizeof(float)); + std::memcpy(mgmDataProcessed->mgm3vec.value, zeroVec, 3 * sizeof(float)); + std::memcpy(mgmDataProcessed->mgm4vec.value, zeroVec, 3 * sizeof(float)); + std::memcpy(mgmDataProcessed->mgmVecTot.value, zeroVec, 3 * sizeof(float)); + std::memcpy(mgmDataProcessed->mgmVecTotDerivative.value, zeroVec, 3 * sizeof(float)); mgmDataProcessed->setValidity(false, true); + std::memcpy(mgmDataProcessed->magIgrfModel.value, magIgrfModel, 3 * sizeof(double)); + mgmDataProcessed->magIgrfModel.setValid(gpsValid); } } return; @@ -138,20 +154,6 @@ void SensorProcessing::processMgm(const float *mgm0Value, bool mgm0valid, const } timeOfSavedMagFieldEst = timeOfMgmMeasurement; - // ---------------- IGRF- 13 Implementation here ------------------------------------------------ - double magIgrfModel[3] = {0.0, 0.0, 0.0}; - if (gpsValid) { - // Should be existing class object which will be called and modified here. - Igrf13Model igrf13; - // So the line above should not be done here. Update: Can be done here as long updated coffs - // stored in acsParameters ? - igrf13.schmidtNormalization(); - igrf13.updateCoeffGH(timeOfMgmMeasurement); - // maybe put a condition here, to only update after a full day, this - // class function has around 700 steps to perform - igrf13.magFieldComp(gpsDataProcessed->gdLongitude.value, gpsDataProcessed->gcLatitude.value, - gpsAltitude, timeOfMgmMeasurement, magIgrfModel); - } { PoolReadGuard pg(mgmDataProcessed); if (pg.getReadResult() == returnvalue::OK) { @@ -187,6 +189,25 @@ void SensorProcessing::processSus( timeval timeOfSusMeasurement, const AcsParameters::SusHandlingParameters *susParameters, const AcsParameters::SunModelParameters *sunModelParameters, acsctrl::SusDataProcessed *susDataProcessed) { + /* -------- Sun Model Direction (IJK frame) ------- */ + double JD2000 = MathOperations::convertUnixToJD2000(timeOfSusMeasurement); + + // Julean Centuries + double sunIjkModel[3] = {0.0, 0.0, 0.0}; + double JC2000 = JD2000 / 36525.; + + double meanLongitude = + sunModelParameters->omega_0 + (sunModelParameters->domega * JC2000) * PI / 180.; + double meanAnomaly = (sunModelParameters->m_0 + sunModelParameters->dm * JC2000) * PI / 180.; + + double eclipticLongitude = meanLongitude + sunModelParameters->p1 * sin(meanAnomaly) + + sunModelParameters->p2 * sin(2 * meanAnomaly); + + double epsilon = sunModelParameters->e - (sunModelParameters->e1) * JC2000; + + sunIjkModel[0] = cos(eclipticLongitude); + sunIjkModel[1] = sin(eclipticLongitude) * cos(epsilon); + sunIjkModel[2] = sin(eclipticLongitude) * sin(epsilon); if (sus0valid) { sus0valid = susConverter.checkSunSensorData(sus0Value); } @@ -229,22 +250,24 @@ void SensorProcessing::processSus( { PoolReadGuard pg(susDataProcessed); if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataProcessed->sus0vec.value, zeroVector, 3 * sizeof(float)); - std::memcpy(susDataProcessed->sus1vec.value, zeroVector, 3 * sizeof(float)); - std::memcpy(susDataProcessed->sus2vec.value, zeroVector, 3 * sizeof(float)); - std::memcpy(susDataProcessed->sus3vec.value, zeroVector, 3 * sizeof(float)); - std::memcpy(susDataProcessed->sus4vec.value, zeroVector, 3 * sizeof(float)); - std::memcpy(susDataProcessed->sus5vec.value, zeroVector, 3 * sizeof(float)); - std::memcpy(susDataProcessed->sus6vec.value, zeroVector, 3 * sizeof(float)); - std::memcpy(susDataProcessed->sus7vec.value, zeroVector, 3 * sizeof(float)); - std::memcpy(susDataProcessed->sus8vec.value, zeroVector, 3 * sizeof(float)); - std::memcpy(susDataProcessed->sus9vec.value, zeroVector, 3 * sizeof(float)); - std::memcpy(susDataProcessed->sus10vec.value, zeroVector, 3 * sizeof(float)); - std::memcpy(susDataProcessed->sus11vec.value, zeroVector, 3 * sizeof(float)); - std::memcpy(susDataProcessed->susVecTot.value, zeroVector, 3 * sizeof(float)); - std::memcpy(susDataProcessed->susVecTotDerivative.value, zeroVector, 3 * sizeof(float)); - std::memcpy(susDataProcessed->sunIjkModel.value, zeroVector, 3 * sizeof(double)); + float zeroVec[3] = {0.0, 0.0, 0.0}; + std::memcpy(susDataProcessed->sus0vec.value, zeroVec, 3 * sizeof(float)); + std::memcpy(susDataProcessed->sus1vec.value, zeroVec, 3 * sizeof(float)); + std::memcpy(susDataProcessed->sus2vec.value, zeroVec, 3 * sizeof(float)); + std::memcpy(susDataProcessed->sus3vec.value, zeroVec, 3 * sizeof(float)); + std::memcpy(susDataProcessed->sus4vec.value, zeroVec, 3 * sizeof(float)); + std::memcpy(susDataProcessed->sus5vec.value, zeroVec, 3 * sizeof(float)); + std::memcpy(susDataProcessed->sus6vec.value, zeroVec, 3 * sizeof(float)); + std::memcpy(susDataProcessed->sus7vec.value, zeroVec, 3 * sizeof(float)); + std::memcpy(susDataProcessed->sus8vec.value, zeroVec, 3 * sizeof(float)); + std::memcpy(susDataProcessed->sus9vec.value, zeroVec, 3 * sizeof(float)); + std::memcpy(susDataProcessed->sus10vec.value, zeroVec, 3 * sizeof(float)); + std::memcpy(susDataProcessed->sus11vec.value, zeroVec, 3 * sizeof(float)); + std::memcpy(susDataProcessed->susVecTot.value, zeroVec, 3 * sizeof(float)); + std::memcpy(susDataProcessed->susVecTotDerivative.value, zeroVec, 3 * sizeof(float)); susDataProcessed->setValidity(false, true); + std::memcpy(susDataProcessed->sunIjkModel.value, sunIjkModel, 3 * sizeof(double)); + susDataProcessed->sunIjkModel.setValid(true); } } return; @@ -263,16 +286,6 @@ void SensorProcessing::processSus( susParameters->sus0coeffBeta), sus0VecBody, 3, 3, 1); } - { - PoolReadGuard pg(susDataProcessed); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataProcessed->sus0vec.value, sus0VecBody, 3 * sizeof(float)); - susDataProcessed->sus0vec.setValid(sus0valid); - if (!sus0valid) { - std::memcpy(susDataProcessed->sus0vec.value, zeroVector, 3 * sizeof(float)); - } - } - } if (sus1valid) { MatrixOperations::multiply( susParameters->sus1orientationMatrix[0], @@ -280,16 +293,6 @@ void SensorProcessing::processSus( susParameters->sus1coeffBeta), sus1VecBody, 3, 3, 1); } - { - PoolReadGuard pg(susDataProcessed); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataProcessed->sus1vec.value, sus1VecBody, 3 * sizeof(float)); - susDataProcessed->sus1vec.setValid(sus1valid); - if (!sus1valid) { - std::memcpy(susDataProcessed->sus1vec.value, zeroVector, 3 * sizeof(float)); - } - } - } if (sus2valid) { MatrixOperations::multiply( susParameters->sus2orientationMatrix[0], @@ -397,27 +400,6 @@ void SensorProcessing::processSus( } } timeOfSavedSusDirEst = timeOfSusMeasurement; - - /* -------- Sun Model Direction (IJK frame) ------- */ - // if (useSunModel) eventuell - double JD2000 = MathOperations::convertUnixToJD2000(timeOfSusMeasurement); - - // Julean Centuries - double sunIjkModel[3] = {0.0, 0.0, 0.0}; - double JC2000 = JD2000 / 36525.; - - double meanLongitude = - sunModelParameters->omega_0 + (sunModelParameters->domega * JC2000) * PI / 180.; - double meanAnomaly = (sunModelParameters->m_0 + sunModelParameters->dm * JC2000) * PI / 180.; - - double eclipticLongitude = meanLongitude + sunModelParameters->p1 * sin(meanAnomaly) + - sunModelParameters->p2 * sin(2 * meanAnomaly); - - double epsilon = sunModelParameters->e - (sunModelParameters->e1) * JC2000; - - sunIjkModel[0] = cos(eclipticLongitude); - sunIjkModel[1] = sin(eclipticLongitude) * cos(epsilon); - sunIjkModel[2] = sin(eclipticLongitude) * sin(epsilon); { PoolReadGuard pg(susDataProcessed); if (pg.getReadResult() == returnvalue::OK) { @@ -474,6 +456,7 @@ void SensorProcessing::processGyr( { PoolReadGuard pg(gyrDataProcessed); if (pg.getReadResult() == returnvalue::OK) { + double zeroVector[3] = {0.0, 0.0, 0.0}; std::memcpy(gyrDataProcessed->gyr0vec.value, zeroVector, 3 * sizeof(double)); std::memcpy(gyrDataProcessed->gyr1vec.value, zeroVector, 3 * sizeof(double)); std::memcpy(gyrDataProcessed->gyr2vec.value, zeroVector, 3 * sizeof(double)); diff --git a/mission/controller/acs/SensorProcessing.h b/mission/controller/acs/SensorProcessing.h index 1a094dab..49c659b0 100644 --- a/mission/controller/acs/SensorProcessing.h +++ b/mission/controller/acs/SensorProcessing.h @@ -79,7 +79,6 @@ class SensorProcessing { double savedPosSatE[3] = {0.0, 0.0, 0.0}; double timeOfSavedPosSatE = 0.0; bool validSavedPosSatE = false; - const float zeroVector[3] = {0.0, 0.0, 0.0}; SusConverter susConverter; AcsParameters acsParameters; From ac83e660169e7939536312cadf3ba6eff650d351 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Tue, 10 Jan 2023 13:52:26 +0100 Subject: [PATCH 078/330] naming and frmt --- mission/controller/AcsController.cpp | 11 +++++------ mission/controller/acs/control/SafeCtrl.cpp | 9 ++++----- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 7f69936c..1f9df068 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -146,10 +146,10 @@ void AcsController::performControlOperation() { { PoolReadGuard pg(&ctrlValData); if (pg.getReadResult() == returnvalue::OK) { - double zeroQuat[4] = {0, 0, 0, 0}; - std::memcpy(ctrlValData.tgtQuat.value, zeroQuat, 4 * sizeof(double)); + double unitQuat[4] = {0, 0, 0, 1}; + std::memcpy(ctrlValData.tgtQuat.value, unitQuat, 4 * sizeof(double)); ctrlValData.tgtQuat.setValid(false); - std::memcpy(ctrlValData.errQuat.value, zeroQuat, 4 * sizeof(double)); + std::memcpy(ctrlValData.errQuat.value, unitQuat, 4 * sizeof(double)); ctrlValData.errQuat.setValid(false); ctrlValData.errAng.value = errAng; ctrlValData.errAng.setValid(true); @@ -178,10 +178,9 @@ void AcsController::performControlOperation() { { PoolReadGuard pg(&actuatorCmdData); if (pg.getReadResult() == returnvalue::OK) { - int32_t zeroVec[4] = {0, 0, 0, 0}; - std::memcpy(actuatorCmdData.rwTargetTorque.value, zeroVec, 4 * sizeof(int32_t)); + std::memset(actuatorCmdData.rwTargetTorque.value, 0, 4 * sizeof(int32_t)); actuatorCmdData.rwTargetTorque.setValid(false); - std::memcpy(actuatorCmdData.rwTargetSpeed.value, zeroVec, 4 * sizeof(int32_t)); + std::memset(actuatorCmdData.rwTargetSpeed.value, 0, 4 * sizeof(int32_t)); actuatorCmdData.rwTargetSpeed.setValid(false); std::memcpy(actuatorCmdData.mtqTargetDipole.value, dipolCmdUnits, 3 * sizeof(int16_t)); actuatorCmdData.mtqTargetDipole.setValid(true); diff --git a/mission/controller/acs/control/SafeCtrl.cpp b/mission/controller/acs/control/SafeCtrl.cpp index 88f4de9b..aa04cbb6 100644 --- a/mission/controller/acs/control/SafeCtrl.cpp +++ b/mission/controller/acs/control/SafeCtrl.cpp @@ -87,7 +87,7 @@ ReturnValue_t SafeCtrl::safeMekf(timeval now, double *quatBJ, bool quatBJValid, return returnvalue::OK; } -// Will be the version in worst case scenario in event of no working MEKF (nor RMUs) +// Will be the version in worst case scenario in event of no working MEKF (nor GYRs) void SafeCtrl::safeNoMekf(timeval now, double *susDirB, bool susDirBValid, double *sunRateB, bool sunRateBValid, double *magFieldB, bool magFieldBValid, double *magRateB, bool magRateBValid, double *sunDirRef, @@ -127,18 +127,17 @@ void SafeCtrl::safeNoMekf(timeval now, double *susDirB, bool susDirBValid, doubl VectorOperations::mulScalar(estSatRate, 0.5, estSatRate, 3); /* Only valid if angle between sun direction and magnetic field direction - is sufficiently large */ - + * is sufficiently large */ double angleSunMag = acos(cosAngleSunMag); if (angleSunMag < safeModeControllerParameters->sunMagAngleMin) { return; } - // Rate for Torque Calculation + // Rate for Torque Calculation double diffRate[3] = {0, 0, 0}; /* ADD TO MONITORING */ VectorOperations::subtract(estSatRate, satRateRef, diffRate, 3); - // Torque Align calculation + // Torque Align calculation double kRateNoMekf = 0, kAlignNoMekf = 0; kRateNoMekf = safeModeControllerParameters->k_rate_no_mekf; kAlignNoMekf = safeModeControllerParameters->k_align_no_mekf; From a2626afebb1a5870cd25342811bd2777c889eba2 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Wed, 11 Jan 2023 13:42:48 +0100 Subject: [PATCH 079/330] added gpsPosition to gpsProcessedData --- mission/controller/AcsController.cpp | 1 + mission/controller/AcsController.h | 1 + mission/controller/acs/SensorProcessing.cpp | 10 ++++------ .../controllerdefinitions/AcsCtrlDefinitions.h | 4 +++- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 1f9df068..362a5e1b 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -421,6 +421,7 @@ void AcsController::performControlOperation() { // GPS Processed localDataPoolMap.emplace(acsctrl::PoolIds::GC_LATITUDE, &gcLatitude); localDataPoolMap.emplace(acsctrl::PoolIds::GD_LONGITUDE, &gdLongitude); + localDataPoolMap.emplace(acsctrl::PoolIds::GPS_POSITION, &gpsPosition); localDataPoolMap.emplace(acsctrl::PoolIds::GPS_VELOCITY, &gpsVelocity); poolManager.subscribeForRegularPeriodicPacket({gpsDataProcessed.getSid(), false, 5.0}); // MEKF diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index 3ffcde85..64f5c09f 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -153,6 +153,7 @@ class AcsController : public ExtendedControllerBase, public ReceivesParameterMes acsctrl::GpsDataProcessed gpsDataProcessed; PoolEntry gcLatitude = PoolEntry(); PoolEntry gdLongitude = PoolEntry(); + PoolEntry gpsPosition = PoolEntry(3); PoolEntry gpsVelocity = PoolEntry(3); // MEKF diff --git a/mission/controller/acs/SensorProcessing.cpp b/mission/controller/acs/SensorProcessing.cpp index 7e49fcdd..5d68bc44 100644 --- a/mission/controller/acs/SensorProcessing.cpp +++ b/mission/controller/acs/SensorProcessing.cpp @@ -546,7 +546,7 @@ void SensorProcessing::processGps(const double gpsLatitude, const double gpsLong const AcsParameters::GpsParameters *gpsParameters, acsctrl::GpsDataProcessed *gpsDataProcessed) { // name to convert not process - double gdLongitude, gcLatitude; + double gdLongitude = 0, gcLatitude = 0, posSatE[3] = {0, 0, 0}, gpsVelocityE[3] = {0, 0, 0}; if (validGps) { // Transforming from Degree to Radians and calculation geocentric lattitude from geodetic gdLongitude = gpsLongitude * PI / 180.; @@ -576,11 +576,9 @@ void SensorProcessing::processGps(const double gpsLatitude, const double gpsLong if (pg.getReadResult() == returnvalue::OK) { gpsDataProcessed->gdLongitude.value = gdLongitude; gpsDataProcessed->gcLatitude.value = gcLatitude; - gpsDataProcessed->setValidity(validGps, validGps); - if (!validGps) { - gpsDataProcessed->gdLongitude.value = 0.0; - gpsDataProcessed->gcLatitude.value = 0.0; - } + std::memcpy(gpsDataProcessed->gpsPosition.value, posSatE, 3 * sizeof(double)); + std::memcpy(gpsDataProcessed->gpsVelocity.value, gpsVelocityE, 3 * sizeof(double)); + gpsDataProcessed->setValidity(validGps, true); } } } diff --git a/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h b/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h index ab5ed8da..0955581b 100644 --- a/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h +++ b/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h @@ -86,6 +86,7 @@ enum PoolIds : lp_id_t { // GPS Processed GC_LATITUDE, GD_LONGITUDE, + GPS_POSITION, GPS_VELOCITY, // MEKF SAT_ROT_RATE_MEKF, @@ -106,7 +107,7 @@ static constexpr uint8_t SUS_SET_RAW_ENTRIES = 12; static constexpr uint8_t SUS_SET_PROCESSED_ENTRIES = 15; static constexpr uint8_t GYR_SET_RAW_ENTRIES = 4; static constexpr uint8_t GYR_SET_PROCESSED_ENTRIES = 5; -static constexpr uint8_t GPS_SET_PROCESSED_ENTRIES = 3; +static constexpr uint8_t GPS_SET_PROCESSED_ENTRIES = 4; static constexpr uint8_t MEKF_SET_ENTRIES = 2; static constexpr uint8_t CTRL_VAL_SET_ENTRIES = 3; static constexpr uint8_t ACT_CMD_SET_ENTRIES = 3; @@ -225,6 +226,7 @@ class GpsDataProcessed : public StaticLocalDataSet { lp_var_t gcLatitude = lp_var_t(sid.objectId, GC_LATITUDE, this); lp_var_t gdLongitude = lp_var_t(sid.objectId, GD_LONGITUDE, this); + lp_vec_t gpsPosition = lp_vec_t(sid.objectId, GPS_POSITION, this); lp_vec_t gpsVelocity = lp_vec_t(sid.objectId, GPS_VELOCITY, this); private: From 25867e76b196fa4cddf3a00773df34323e6175e9 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Wed, 11 Jan 2023 16:00:30 +0100 Subject: [PATCH 080/330] fixed solar panels -> sun vector direction --- mission/controller/acs/Guidance.cpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index cd3a7b95..14ea5412 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -337,21 +337,25 @@ void Guidance::targetQuatPtgGs(ACS::SensorValues *sensorValues, acsctrl::MekfDat VectorOperations::normalize(targetDirJ, xAxis, 3); VectorOperations::mulScalar(xAxis, -1, xAxis, 3); - // get Sun Vector Model in ECI as helper vector (element of x-z plane) + // get Sun Vector Model in ECI double sunJ[3]; std::memcpy(sunJ, susDataProcessed->sunIjkModel.value, 3 * sizeof(double)); VectorOperations::normalize(sunJ, sunJ, 3); + // calculate z-axis as projection of sun vector into plane defined by x-axis as normal vector + // z = sPerpenticular = s - sParallel = s - (x*s)/norm(x)^2 * x + double xDotS = VectorOperations::dot(xAxis, sunJ); + xDotS /= pow(VectorOperations::norm(xAxis, 3), 2); + double sunParallel[3], zAxis[3]; + VectorOperations::mulScalar(xAxis, xDotS, sunParallel, 3); + VectorOperations::subtract(sunJ, sunParallel, zAxis, 3); + VectorOperations::normalize(zAxis, zAxis, 3); + // calculate y-axis double yAxis[3]; - VectorOperations::cross(sunJ, xAxis, yAxis); + VectorOperations::cross(zAxis, xAxis, yAxis); VectorOperations::normalize(yAxis, yAxis, 3); - // calculate z-axis - double zAxis[3]; - VectorOperations::cross(xAxis, yAxis, zAxis); - VectorOperations::normalize(zAxis, zAxis, 3); - // Complete transformation matrix double dcmTgt[3][3] = {{xAxis[0], yAxis[0], zAxis[0]}, {xAxis[1], yAxis[1], zAxis[1]}, @@ -383,8 +387,10 @@ void Guidance::sunQuatPtg(ACS::SensorValues *sensorValues, acsctrl::MekfData *me if (susDataProcessed->sunIjkModel.isValid()) { std::memcpy(sunDirJ, susDataProcessed->sunIjkModel.value, 3 * sizeof(double)); MatrixOperations::multiply(*dcmBJ, sunDirJ, sunDirB, 3, 3, 1); - } else { + } else if (susDataProcessed->susVecTot.isValid()) { std::memcpy(sunDirB, susDataProcessed->susVecTot.value, 3 * sizeof(double)); + } else { + return; } // Transformation between ECEF and IJK frame @@ -416,7 +422,7 @@ void Guidance::sunQuatPtg(ACS::SensorValues *sensorValues, acsctrl::MekfData *me double velocityB[3] = {0, 0, 0}; MatrixOperations::multiply(*dcmBJ, velocityJ, velocityB, 3, 3, 1); - // Normale to velocity and sunDir + // Normal to velocity and sunDir double crossVelSun[3] = {0, 0, 0}; VectorOperations::cross(velocityB, sunDirB, crossVelSun); From 66e2d782b21505450954bcd07326bdf4722c7d85 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Thu, 12 Jan 2023 11:47:56 +0100 Subject: [PATCH 081/330] domainId now points to structs. sunVectorSafeLeop added --- mission/controller/acs/AcsParameters.cpp | 51 ++++++++++++------------ mission/controller/acs/AcsParameters.h | 2 + 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/mission/controller/acs/AcsParameters.cpp b/mission/controller/acs/AcsParameters.cpp index 2479eb53..332f1873 100644 --- a/mission/controller/acs/AcsParameters.cpp +++ b/mission/controller/acs/AcsParameters.cpp @@ -11,16 +11,15 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, ParameterWrapper* parameterWrapper, const ParameterWrapper* newValues, uint16_t startAtIndex) { - // if (domainId == parameterModuleId) { - switch (parameterId >> 8) { + switch (domainId) { case 0x0: // direct members - switch (parameterId & 0xFF) { + switch (parameterId) { default: return INVALID_IDENTIFIER_ID; } break; case 0x1: // OnBoardParams - switch (parameterId & 0xFF) { + switch (parameterId) { case 0x0: parameterWrapper->set(onBoardParams.sampleTime); break; @@ -29,7 +28,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, } break; case 0x2: // InertiaEIVE - switch (parameterId & 0xFF) { + switch (parameterId) { case 0x0: parameterWrapper->set(inertiaEIVE.inertiaMatrix); break; @@ -50,7 +49,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, } break; case 0x3: // MgmHandlingParameters - switch (parameterId & 0xFF) { + switch (parameterId) { case 0x0: parameterWrapper->set(mgmHandlingParameters.mgm0orientationMatrix); break; @@ -110,7 +109,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, } break; case 0x4: // SusHandlingParameters - switch (parameterId & 0xFF) { + switch (parameterId) { case 0x0: parameterWrapper->set(susHandlingParameters.sus0orientationMatrix); break; @@ -224,7 +223,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, } break; case (0x5): // GyrHandlingParameters - switch (parameterId & 0xFF) { + switch (parameterId) { case 0x0: parameterWrapper->set(gyrHandlingParameters.gyr0orientationMatrix); break; @@ -251,7 +250,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, } break; case (0x6): // RwHandlingParameters - switch (parameterId & 0xFF) { + switch (parameterId) { case 0x0: parameterWrapper->set(rwHandlingParameters.inertiaWheel); break; @@ -272,7 +271,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, } break; case (0x7): // RwMatrices - switch (parameterId & 0xFF) { + switch (parameterId) { case 0x0: parameterWrapper->set(rwMatrices.alignmentMatrix); break; @@ -299,7 +298,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, } break; case (0x8): // SafeModeControllerParameters - switch (parameterId & 0xFF) { + switch (parameterId) { case 0x0: parameterWrapper->set(safeModeControllerParameters.k_rate_mekf); break; @@ -316,9 +315,12 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, parameterWrapper->set(safeModeControllerParameters.sunMagAngleMin); break; case 0x5: - parameterWrapper->set(safeModeControllerParameters.sunTargetDir); + parameterWrapper->set(safeModeControllerParameters.sunTargetDirLeop); break; case 0x6: + parameterWrapper->set(safeModeControllerParameters.sunTargetDir); + break; + case 0x7: parameterWrapper->set(safeModeControllerParameters.satRateRef); break; default: @@ -326,7 +328,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, } break; case (0x9): // PointingModeControllerParameters - switch (parameterId & 0xFF) { + switch (parameterId) { case 0x0: parameterWrapper->set(targetModeControllerParameters.refDirection); break; @@ -392,7 +394,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, } break; case (0xA): // StrParameters - switch (parameterId & 0xFF) { + switch (parameterId) { case 0x0: parameterWrapper->set(strParameters.exclusionAngle); break; @@ -404,7 +406,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, } break; case (0xB): // GpsParameters - switch (parameterId & 0xFF) { + switch (parameterId) { case 0x0: parameterWrapper->set(gpsParameters.timeDiffVelocityMax); break; @@ -413,7 +415,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, } break; case (0xC): // PtgTargetParameters - switch (parameterId & 0xFF) { + switch (parameterId) { case 0x0: parameterWrapper->set(ptgTargetParameters.latitudeTgt); break; @@ -428,7 +430,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, } break; case (0xD): // SunModelParameters - switch (parameterId & 0xFF) { + switch (parameterId) { case 0x0: parameterWrapper->set(sunModelParameters.domega); break; @@ -458,7 +460,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, } break; case (0xE): // KalmanFilterParameters - switch (parameterId & 0xFF) { + switch (parameterId) { case 0x0: parameterWrapper->set(kalmanFilterParameters.sensorNoiseSTR); break; @@ -482,7 +484,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, } break; case (0xF): // MagnetorquesParameter - switch (parameterId & 0xFF) { + switch (parameterId) { case 0x0: parameterWrapper->set(magnetorquesParameter.mtq0orientationMatrix); break; @@ -506,7 +508,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, } break; case (0x10): // DetumbleParameter - switch (parameterId & 0xFF) { + switch (parameterId) { case 0x0: parameterWrapper->set(detumbleParameter.detumblecounter); break; @@ -524,10 +526,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, } break; default: - return INVALID_IDENTIFIER_ID; - } - return returnvalue::OK; - // } else { - // return INVALID_DOMAIN_ID; - // } + return INVALID_DOMAIN_ID; + } + return returnvalue::OK; } diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index df7b0882..d081c8aa 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -810,7 +810,9 @@ class AcsParameters : public HasParametersIF { double sunMagAngleMin = 5 * M_PI / 180; + double sunTargetDirLeop[3] = {0, .5, .5}; double sunTargetDir[3] = {0, 0, 1}; + double satRateRef[3] = {0, 0, 0}; } safeModeControllerParameters; From 27d6e95062c23dc5c09c59b9dadcce6c5b57a1e4 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Thu, 12 Jan 2023 11:48:57 +0100 Subject: [PATCH 082/330] x-axis now points away of equator plane for sunPtgMode --- mission/controller/acs/Guidance.cpp | 45 +++++++++++++---------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index 14ea5412..16d4341c 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -23,7 +23,11 @@ Guidance::~Guidance() {} void Guidance::getTargetParamsSafe(double sunTargetSafe[3], double satRateSafe[3]) { for (int i = 0; i < 3; i++) { - sunTargetSafe[i] = acsParameters.safeModeControllerParameters.sunTargetDir[i]; + if (false) { // ToDo: if file does not exist anymore + sunTargetSafe[i] = acsParameters.safeModeControllerParameters.sunTargetDir[i]; + } else { + sunTargetSafe[i] = acsParameters.safeModeControllerParameters.sunTargetDirLeop[i]; + } satRateSafe[i] = acsParameters.safeModeControllerParameters.satRateRef[i]; } @@ -230,10 +234,7 @@ void Guidance::targetQuatPtgThreeAxes(ACS::SensorValues *sensorValues, acsParameters.ptgTargetParameters.altitudeTgt, targetCart); // Position of the satellite in the earth/fixed frame via GPS double posSatE[3] = {0, 0, 0}; - double geodeticLatRad = (sensorValues->gpsSet.latitude.value) * PI / 180; - double longitudeRad = (sensorValues->gpsSet.longitude.value) * PI / 180; - MathOperations::cartesianFromLatLongAlt(geodeticLatRad, longitudeRad, - sensorValues->gpsSet.altitude.value, posSatE); + std::memcpy(posSatE, gpsDataProcessed->gpsPosition.value, 3 * sizeof(double)); double targetDirE[3] = {0, 0, 0}; VectorOperations::subtract(targetCart, posSatE, targetDirE, 3); @@ -406,34 +407,28 @@ void Guidance::sunQuatPtg(ACS::SensorValues *sensorValues, acsctrl::MekfData *me double zAxis[3] = {0, 0, 0}; VectorOperations::normalize(sunDirB, zAxis, 3); - // Position of the satellite in the earth/fixed frame via GPS and body - // velocity + // Position of satellite in ECEF double posSatE[3] = {0, 0, 0}; - double geodeticLatRad = (sensorValues->gpsSet.latitude.value) * PI / 180; - double longitudeRad = (sensorValues->gpsSet.longitude.value) * PI / 180; - MathOperations::cartesianFromLatLongAlt(geodeticLatRad, longitudeRad, - sensorValues->gpsSet.altitude.value, posSatE); - double velocityE[3]; - std::memcpy(velocityE, gpsDataProcessed->gpsVelocity.value, 3 * sizeof(double)); - double velocityJ[3] = {0, 0, 0}, velPart1[3] = {0, 0, 0}, velPart2[3] = {0, 0, 0}; - MatrixOperations::multiply(*dcmJE, velocityE, velPart1, 3, 3, 1); - MatrixOperations::multiply(*dcmJEDot, posSatE, velPart2, 3, 3, 1); - VectorOperations::add(velPart1, velPart2, velocityJ, 3); - double velocityB[3] = {0, 0, 0}; - MatrixOperations::multiply(*dcmBJ, velocityJ, velocityB, 3, 3, 1); + std::memcpy(gpsDataProcessed->gpsPosition.value, posSatE, 3 * sizeof(double)); - // Normal to velocity and sunDir - double crossVelSun[3] = {0, 0, 0}; - VectorOperations::cross(velocityB, sunDirB, crossVelSun); + // Check whether Sat is above or below equator + // Assign helper vector (north pole inertial) accordingly + double helperVec[3] = {0, 0, 0}; + if (posSatE[2] > 0) { + double helperVec[2] = 1; + } else { + double helperVec[2] = -1; + } - // y- Axis as cross of normal velSun and zAxis + // double yAxis[3] = {0, 0, 0}; - VectorOperations::cross(crossVelSun, sunDirB, yAxis); + VectorOperations::cross(zAxis, helperVec, yAxis); VectorOperations::normalize(yAxis, yAxis, 3); - // complete RHS for x-Axis + // double xAxis[3] = {0, 0, 0}; VectorOperations::cross(yAxis, zAxis, xAxis); + VectorOperations::normalize(xAxis, xAxis, 3); // Transformation matrix to Sun, no further transforamtions, reference is already // the EIVE body frame From 4090941c3ea723cdc8949e3f2bc12881507712bb Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Thu, 12 Jan 2023 13:33:06 +0100 Subject: [PATCH 083/330] bugfix --- mission/controller/acs/Guidance.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index 16d4341c..2196d71b 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -415,9 +415,9 @@ void Guidance::sunQuatPtg(ACS::SensorValues *sensorValues, acsctrl::MekfData *me // Assign helper vector (north pole inertial) accordingly double helperVec[3] = {0, 0, 0}; if (posSatE[2] > 0) { - double helperVec[2] = 1; + helperVec[2] = 1; } else { - double helperVec[2] = -1; + helperVec[2] = -1; } // From 5e557d2d46b3ffdc37c788916cbc2f77ec3c25b4 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Thu, 12 Jan 2023 14:49:37 +0100 Subject: [PATCH 084/330] first version of safe mode solar vector for leop --- mission/controller/acs/Guidance.cpp | 20 +++++++++++--------- mission/controller/acs/Guidance.h | 3 +++ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index 2196d71b..9027392e 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -13,6 +13,8 @@ #include #include +#include + #include "string.h" #include "util/CholeskyDecomposition.h" #include "util/MathOperations.h" @@ -22,16 +24,16 @@ Guidance::Guidance(AcsParameters *acsParameters_) { acsParameters = *acsParamete Guidance::~Guidance() {} void Guidance::getTargetParamsSafe(double sunTargetSafe[3], double satRateSafe[3]) { - for (int i = 0; i < 3; i++) { - if (false) { // ToDo: if file does not exist anymore - sunTargetSafe[i] = acsParameters.safeModeControllerParameters.sunTargetDir[i]; - } else { - sunTargetSafe[i] = acsParameters.safeModeControllerParameters.sunTargetDirLeop[i]; - } - satRateSafe[i] = acsParameters.safeModeControllerParameters.satRateRef[i]; + if (not std::filesystem::exists(SD_0_SKEWED_PTG_FILE) or + not std::filesystem::exists(SD_1_SKEWED_PTG_FILE)) { // ToDo: if file does not exist anymore + std::memcpy(sunTargetSafe, acsParameters.safeModeControllerParameters.sunTargetDir, + 3 * sizeof(double)); + } else { + std::memcpy(sunTargetSafe, acsParameters.safeModeControllerParameters.sunTargetDirLeop, + 3 * sizeof(double)); } - - // memcpy(sunTargetSafe, acsParameters.safeModeControllerParameters.sunTargetDir, 24); + std::memcpy(satRateSafe, acsParameters.safeModeControllerParameters.satRateRef, + 3 * sizeof(double)); } void Guidance::targetQuatPtgSingleAxis(ACS::SensorValues *sensorValues, acsctrl::MekfData *mekfData, diff --git a/mission/controller/acs/Guidance.h b/mission/controller/acs/Guidance.h index ae232b31..82ca2b77 100644 --- a/mission/controller/acs/Guidance.h +++ b/mission/controller/acs/Guidance.h @@ -73,6 +73,9 @@ class Guidance { timeval timeSavedQuaternionNadir; double savedQuaternionNadir[4] = {0, 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_ */ From d8c0ba19fd051380286cde94140c2c23a9b91097 Mon Sep 17 00:00:00 2001 From: Robin Marquardt Date: Thu, 12 Jan 2023 15:19:21 +0100 Subject: [PATCH 085/330] changed pointingParameters struct --- mission/controller/AcsController.cpp | 30 +++++++++- mission/controller/acs/AcsParameters.cpp | 15 ----- mission/controller/acs/AcsParameters.h | 66 ++++++++++++++-------- mission/controller/acs/Guidance.cpp | 66 +++++++++++----------- mission/controller/acs/Guidance.h | 10 ++-- mission/controller/acs/control/PtgCtrl.cpp | 19 ++++--- mission/controller/acs/control/PtgCtrl.h | 2 +- 7 files changed, 117 insertions(+), 91 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 362a5e1b..9b210369 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -269,30 +269,56 @@ void AcsController::performControlOperation() { &mekfData, &validMekf); double targetQuat[4] = {0, 0, 0, 0}, refSatRate[3] = {0, 0, 0}; + double quatRef[4] = {0, 0, 0, 0}; + uint8_t enableAntiStiction = true; switch (submode) { case SUBMODE_IDLE: guidance.sunQuatPtg(&sensorValues, &mekfData, &susDataProcessed, &gpsDataProcessed, now, targetQuat, refSatRate); + for ( uint8_t i = 0; i < 4; i++ ) { + quatRef[i] = acsParameters.targetModeControllerParameters.quatRef[i]; + } + enableAntiStiction = acsParameters.targetModeControllerParameters.enableAntiStiction; + break; case SUBMODE_PTG_TARGET: guidance.targetQuatPtgThreeAxes(&sensorValues, &gpsDataProcessed, &mekfData, now, targetQuat, refSatRate); + for ( uint8_t i = 0; i < 4; i++ ) { + quatRef[i] = acsParameters.targetModeControllerParameters.quatRef[i]; + } + enableAntiStiction = acsParameters.targetModeControllerParameters.enableAntiStiction; + break; case SUBMODE_PTG_TARGET_GS: guidance.targetQuatPtgGs(&sensorValues, &mekfData, &susDataProcessed, &gpsDataProcessed, now, targetQuat, refSatRate); + + for ( uint8_t i = 0; i < 4; i++ ) { + quatRef[i] = acsParameters.targetModeControllerParameters.quatRef[i]; + } + enableAntiStiction = acsParameters.targetModeControllerParameters.enableAntiStiction; break; case SUBMODE_PTG_NADIR: guidance.quatNadirPtgThreeAxes(&sensorValues, &gpsDataProcessed, &mekfData, now, targetQuat, refSatRate); + for ( uint8_t i = 0; i < 4; i++ ) { + quatRef[i] = acsParameters.nadirModeControllerParameters.quatRef[i]; + } + enableAntiStiction = acsParameters.nadirModeControllerParameters.enableAntiStiction; break; case SUBMODE_PTG_INERTIAL: guidance.inertialQuatPtg(targetQuat, refSatRate); + + for ( uint8_t i = 0; i < 4; i++ ) { + quatRef[i] = acsParameters.inertialModeControllerParameters.quatRef[i]; + } + enableAntiStiction = acsParameters.inertialModeControllerParameters.enableAntiStiction; break; } double quatErrorComplete[4] = {0, 0, 0, 0}, quatError[3] = {0, 0, 0}, deltaRate[3] = {0, 0, 0}; // ToDo: check if pointer needed - guidance.comparePtg(targetQuat, &mekfData, refSatRate, quatErrorComplete, quatError, deltaRate); + guidance.comparePtg(targetQuat, &mekfData, quatRef, refSatRate, quatErrorComplete, quatError, deltaRate); double rwPseudoInv[4][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; guidance.getDistributionMatrixRw(&sensorValues, *rwPseudoInv); double torquePtgRws[4] = {0, 0, 0, 0}, mode = 0; @@ -305,7 +331,7 @@ void AcsController::performControlOperation() { VectorOperations::add(torquePtgRws, rwTrqNs, torqueRws, 4); actuatorCmd.scalingTorqueRws(torqueRws, torqueRwsScaled); - if (acsParameters.pointingModeControllerParameters.enableAntiStiction) { + if ( enableAntiStiction ) { bool rwAvailable[4] = {true, true, true, true}; // WHICH INPUT SENSOR SET? int32_t rwSpeed[4] = { (sensorValues.rw1Set.currSpeed.value), (sensorValues.rw2Set.currSpeed.value), diff --git a/mission/controller/acs/AcsParameters.cpp b/mission/controller/acs/AcsParameters.cpp index 2479eb53..31480403 100644 --- a/mission/controller/acs/AcsParameters.cpp +++ b/mission/controller/acs/AcsParameters.cpp @@ -372,21 +372,6 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, case 0xE: parameterWrapper->set(targetModeControllerParameters.desatOn); break; - case 0xF: - parameterWrapper->set(targetModeControllerParameters.omegaEarth); - break; - case 0x10: - parameterWrapper->set(targetModeControllerParameters.nadirRefDirection); - break; - case 0x11: - parameterWrapper->set(targetModeControllerParameters.tgtQuatInertial); - break; - case 0x12: - parameterWrapper->set(targetModeControllerParameters.tgtRotRateInertial); - break; - case 0x13: - parameterWrapper->set(targetModeControllerParameters.nadirTimeElapsedMax); - break; default: return INVALID_IDENTIFIER_ID; } diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index df7b0882..80a3a65f 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -815,35 +815,51 @@ class AcsParameters : public HasParametersIF { } safeModeControllerParameters; - // ToDo: mutiple structs for different pointing mode controllers? - struct PointingModeControllerParameters { - double refDirection[3] = {-1, 0, 0}; // Antenna - double refRotRate[3] = {0, 0, 0}; - double quatRef[4] = {0, 0, 0, 1}; - uint8_t avoidBlindStr = true; - double blindAvoidStart = 1.5; - double blindAvoidStop = 2.5; - double blindRotRate = 1 * M_PI / 180; + struct PointingLawParameters { - double zeta = 0.3; - double om = 0.3; - double omMax = 1 * M_PI / 180; - double qiMin = 0.1; - double gainNullspace = 0.01; + double zeta = 0.3; + double om = 0.3; + double omMax = 1 * M_PI / 180; + double qiMin = 0.1; + double gainNullspace = 0.01; - double desatMomentumRef[3] = {0, 0, 0}; - double deSatGainFactor = 1000; - uint8_t desatOn = true; - uint8_t enableAntiStiction = true; + double desatMomentumRef[3] = {0, 0, 0}; + double deSatGainFactor = 1000; + uint8_t desatOn = true; + uint8_t enableAntiStiction = true; - double omegaEarth = 0.000072921158553; + } pointingLawParameters; - double nadirRefDirection[3] = {-1, 0, 0}; // Camera - double tgtQuatInertial[4] = {0, 0, 0, 1}; - double tgtRotRateInertial[3] = {0, 0, 0}; - int8_t nadirTimeElapsedMax = 10; - } pointingModeControllerParameters, inertialModeControllerParameters, - nadirModeControllerParameters, targetModeControllerParameters; + struct TargetModeControllerParameters : PointingLawParameters { + double refDirection[3] = {-1, 0, 0}; // Antenna + double refRotRate[3] = {0, 0, 0}; // Not used atm, do we want an option to + // give this as an input- currently en calculation is done + double quatRef[4] = {0, 0, 0, 1}; + int8_t timeElapsedMax = 10; // rot rate calculations + + // Default is Stuttgart GS + double latitudeTgt = 48.7495 * M_PI / 180.; // [rad] Latitude + double longitudeTgt = 9.10384 * M_PI / 180.; // [rad] Longitude + double altitudeTgt = 500; // [m] + + // For one-axis control: + uint8_t avoidBlindStr = true; + double blindAvoidStart = 1.5; + double blindAvoidStop = 2.5; + double blindRotRate = 1 * M_PI / 180; + } targetModeControllerParameters; + + struct NadirModeControllerParameters : PointingLawParameters { + double refDirection[3] = {-1, 0, 0}; // Antenna + double quatRef[4] = {0, 0, 0, 1}; + int8_t timeElapsedMax = 10; // rot rate calculations + } nadirModeControllerParameters; + + struct InertialModeControllerParameters : PointingLawParameters { + double tgtQuat[4] = {0, 0, 0, 1}; + double refRotRate[3] = {0, 0, 0}; + double quatRef[4] = {0, 0, 0, 1}; + } inertialModeControllerParameters; struct StrParameters { double exclusionAngle = 20 * M_PI / 180; diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index 14ea5412..700fd521 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -42,8 +42,8 @@ void Guidance::targetQuatPtgSingleAxis(ACS::SensorValues *sensorValues, acsctrl: double targetCart[3] = {0, 0, 0}; MathOperations::cartesianFromLatLongAlt( - acsParameters.ptgTargetParameters.latitudeTgt, acsParameters.ptgTargetParameters.longitudeTgt, - acsParameters.ptgTargetParameters.altitudeTgt, targetCart); + acsParameters.targetModeControllerParameters.latitudeTgt, acsParameters.targetModeControllerParameters.longitudeTgt, + acsParameters.targetModeControllerParameters.altitudeTgt, targetCart); // Position of the satellite in the earth/fixed frame via GPS double posSatE[3] = {0, 0, 0}; @@ -172,17 +172,17 @@ void Guidance::targetQuatPtgSingleAxis(ACS::SensorValues *sensorValues, acsctrl: } } -void Guidance::refRotationRate(timeval now, double quatInertialTarget[4], double *refSatRate) { +void Guidance::refRotationRate(int8_t timeElapsedMax, timeval now, double quatInertialTarget[4], double *refSatRate) { //------------------------------------------------------------------------------------- // Calculation of reference rotation rate //------------------------------------------------------------------------------------- double timeElapsed = now.tv_sec + now.tv_usec * pow(10, -6) - - (timeSavedQuaternionNadir.tv_sec + - timeSavedQuaternionNadir.tv_usec * pow((double)timeSavedQuaternionNadir.tv_usec, -6)); - if (timeElapsed < acsParameters.pointingModeControllerParameters.nadirTimeElapsedMax) { + (timeSavedQuaternion.tv_sec + + timeSavedQuaternion.tv_usec * pow((double)timeSavedQuaternion.tv_usec, -6)); + if (timeElapsed < timeElapsedMax) { double qDiff[4] = {0, 0, 0, 0}; - VectorOperations::subtract(quatInertialTarget, savedQuaternionNadir, qDiff, 4); + VectorOperations::subtract(quatInertialTarget, savedQuaternion, qDiff, 4); VectorOperations::mulScalar(qDiff, 1 / timeElapsed, qDiff, 4); double tgtQuatVec[3] = {quatInertialTarget[0], quatInertialTarget[1], quatInertialTarget[2]}, @@ -197,21 +197,21 @@ void Guidance::refRotationRate(timeval now, double quatInertialTarget[4], double VectorOperations::mulScalar(sum, -2, omegaRefNew, 3); VectorOperations::mulScalar(omegaRefNew, 2, refSatRate, 3); - VectorOperations::subtract(refSatRate, omegaRefSavedNadir, refSatRate, 3); - omegaRefSavedNadir[0] = omegaRefNew[0]; - omegaRefSavedNadir[1] = omegaRefNew[1]; - omegaRefSavedNadir[2] = omegaRefNew[2]; + VectorOperations::subtract(refSatRate, omegaRefSaved, refSatRate, 3); + omegaRefSaved[0] = omegaRefNew[0]; + omegaRefSaved[1] = omegaRefNew[1]; + omegaRefSaved[2] = omegaRefNew[2]; } else { refSatRate[0] = 0; refSatRate[1] = 0; refSatRate[2] = 0; } - timeSavedQuaternionNadir = now; - savedQuaternionNadir[0] = quatInertialTarget[0]; - savedQuaternionNadir[1] = quatInertialTarget[1]; - savedQuaternionNadir[2] = quatInertialTarget[2]; - savedQuaternionNadir[3] = quatInertialTarget[3]; + timeSavedQuaternion = now; + savedQuaternion[0] = quatInertialTarget[0]; + savedQuaternion[1] = quatInertialTarget[1]; + savedQuaternion[2] = quatInertialTarget[2]; + savedQuaternion[3] = quatInertialTarget[3]; } void Guidance::targetQuatPtgThreeAxes(ACS::SensorValues *sensorValues, @@ -226,8 +226,8 @@ void Guidance::targetQuatPtgThreeAxes(ACS::SensorValues *sensorValues, double targetCart[3] = {0, 0, 0}; MathOperations::cartesianFromLatLongAlt( - acsParameters.ptgTargetParameters.latitudeTgt, acsParameters.ptgTargetParameters.longitudeTgt, - acsParameters.ptgTargetParameters.altitudeTgt, targetCart); + acsParameters.targetModeControllerParameters.latitudeTgt, acsParameters.targetModeControllerParameters.longitudeTgt, + acsParameters.targetModeControllerParameters.altitudeTgt, targetCart); // Position of the satellite in the earth/fixed frame via GPS double posSatE[3] = {0, 0, 0}; double geodeticLatRad = (sensorValues->gpsSet.latitude.value) * PI / 180; @@ -286,7 +286,8 @@ void Guidance::targetQuatPtgThreeAxes(ACS::SensorValues *sensorValues, double quatInertialTarget[4] = {0, 0, 0, 0}; QuaternionOperations::fromDcm(dcmTgt, quatInertialTarget); - refRotationRate(now, quatInertialTarget, refSatRate); + int8_t timeElapsedMax = acsParameters.targetModeControllerParameters.timeElapsedMax; + refRotationRate(timeElapsedMax, now, quatInertialTarget, refSatRate); // Transform in system relative to satellite frame double quatBJ[4] = {0, 0, 0, 0}; @@ -306,8 +307,8 @@ void Guidance::targetQuatPtgGs(ACS::SensorValues *sensorValues, acsctrl::MekfDat double groundStationCart[3] = {0, 0, 0}; MathOperations::cartesianFromLatLongAlt( - acsParameters.ptgTargetParameters.latitudeTgt, acsParameters.ptgTargetParameters.longitudeTgt, - acsParameters.ptgTargetParameters.altitudeTgt, groundStationCart); + acsParameters.targetModeControllerParameters.latitudeTgt, acsParameters.targetModeControllerParameters.longitudeTgt, + acsParameters.targetModeControllerParameters.altitudeTgt, groundStationCart); // Position of the satellite in the earth/fixed frame via GPS double posSatE[3] = {0, 0, 0}; double geodeticLatRad = (sensorValues->gpsSet.latitude.value) * PI / 180; @@ -363,7 +364,8 @@ void Guidance::targetQuatPtgGs(ACS::SensorValues *sensorValues, acsctrl::MekfDat double quatInertialTarget[4] = {0, 0, 0, 0}; QuaternionOperations::fromDcm(dcmTgt, quatInertialTarget); - refRotationRate(now, quatInertialTarget, refSatRate); + int8_t timeElapsedMax = acsParameters.targetModeControllerParameters.timeElapsedMax; + refRotationRate(timeElapsedMax, now, quatInertialTarget, refSatRate); // Transform in system relative to satellite frame double quatBJ[4] = {0, 0, 0, 0}; @@ -495,9 +497,9 @@ void Guidance::quatNadirPtgSingleAxis(ACS::SensorValues *sensorValues, acsctrl:: // rotation quaternion from two vectors double refDir[3] = {0, 0, 0}; - refDir[0] = acsParameters.targetModeControllerParameters.nadirRefDirection[0]; - refDir[1] = acsParameters.targetModeControllerParameters.nadirRefDirection[1]; - refDir[2] = acsParameters.targetModeControllerParameters.nadirRefDirection[2]; + refDir[0] = acsParameters.nadirModeControllerParameters.refDirection[0]; + refDir[1] = acsParameters.nadirModeControllerParameters.refDirection[1]; + refDir[2] = acsParameters.nadirModeControllerParameters.refDirection[2]; double noramlizedTargetDirB[3] = {0, 0, 0}; VectorOperations::normalize(targetDirB, noramlizedTargetDirB, 3); VectorOperations::normalize(refDir, refDir, 3); @@ -576,7 +578,8 @@ void Guidance::quatNadirPtgThreeAxes(ACS::SensorValues *sensorValues, double quatInertialTarget[4] = {0, 0, 0, 0}; QuaternionOperations::fromDcm(dcmTgt, quatInertialTarget); - refRotationRate(now, quatInertialTarget, refSatRate); + int8_t timeElapsedMax = acsParameters.nadirModeControllerParameters.timeElapsedMax; + refRotationRate(timeElapsedMax, now, quatInertialTarget, refSatRate); // Transform in system relative to satellite frame double quatBJ[4] = {0, 0, 0, 0}; @@ -586,20 +589,15 @@ void Guidance::quatNadirPtgThreeAxes(ACS::SensorValues *sensorValues, void Guidance::inertialQuatPtg(double targetQuat[4], double refSatRate[3]) { for (int i = 0; i < 4; i++) { - targetQuat[i] = acsParameters.inertialModeControllerParameters.tgtQuatInertial[i]; + targetQuat[i] = acsParameters.inertialModeControllerParameters.tgtQuat[i]; } for (int i = 0; i < 3; i++) { - refSatRate[i] = acsParameters.inertialModeControllerParameters.tgtRotRateInertial[i]; + refSatRate[i] = acsParameters.inertialModeControllerParameters.refRotRate[i]; } } -void Guidance::comparePtg(double targetQuat[4], acsctrl::MekfData *mekfData, double refSatRate[3], +void Guidance::comparePtg(double targetQuat[4], acsctrl::MekfData *mekfData, double quatRef[4], double refSatRate[3], double quatErrorComplete[4], double quatError[3], double deltaRate[3]) { - double quatRef[4] = {0, 0, 0, 0}; - quatRef[0] = acsParameters.targetModeControllerParameters.quatRef[0]; - quatRef[1] = acsParameters.targetModeControllerParameters.quatRef[1]; - quatRef[2] = acsParameters.targetModeControllerParameters.quatRef[2]; - quatRef[3] = acsParameters.targetModeControllerParameters.quatRef[3]; double satRate[3] = {0, 0, 0}; std::memcpy(satRate, mekfData->satRotRateMekf.value, 3 * sizeof(double)); diff --git a/mission/controller/acs/Guidance.h b/mission/controller/acs/Guidance.h index ae232b31..e399af8a 100644 --- a/mission/controller/acs/Guidance.h +++ b/mission/controller/acs/Guidance.h @@ -58,10 +58,10 @@ class Guidance { // @note: compares target Quaternion and reference quaternion, also actual satellite rate and // desired - void comparePtg(double targetQuat[4], acsctrl::MekfData *mekfData, double refSatRate[3], + void comparePtg(double targetQuat[4], acsctrl::MekfData *mekfData, double quatRef[4], double refSatRate[3], double quatErrorComplete[4], double quatError[3], double deltaRate[3]); - void refRotationRate(timeval now, double quatInertialTarget[4], double *refSatRate); + void refRotationRate(int8_t timeElapsedMax, timeval now, double quatInertialTarget[4], double *refSatRate); // @note: will give back the pseudoinverse matrix for the reaction wheel depending on the valid // reation wheel maybe can be done in "commanding.h" @@ -70,9 +70,9 @@ class Guidance { private: AcsParameters acsParameters; bool strBlindAvoidFlag = false; - timeval timeSavedQuaternionNadir; - double savedQuaternionNadir[4] = {0, 0, 0, 0}; - double omegaRefSavedNadir[3] = {0, 0, 0}; + timeval timeSavedQuaternion; + double savedQuaternion[4] = {0, 0, 0, 0}; + double omegaRefSaved[3] = {0, 0, 0}; }; #endif /* ACS_GUIDANCE_H_ */ diff --git a/mission/controller/acs/control/PtgCtrl.cpp b/mission/controller/acs/control/PtgCtrl.cpp index 9d4f8d6d..53544b8c 100644 --- a/mission/controller/acs/control/PtgCtrl.cpp +++ b/mission/controller/acs/control/PtgCtrl.cpp @@ -21,7 +21,8 @@ PtgCtrl::PtgCtrl(AcsParameters *acsParameters_) { loadAcsParameters(acsParameter PtgCtrl::~PtgCtrl() {} void PtgCtrl::loadAcsParameters(AcsParameters *acsParameters_) { - pointingModeControllerParameters = &(acsParameters_->targetModeControllerParameters); + // TODO: Here correct Parameters have to be loaded according to current submode + pointingLawParameters = &(acsParameters_->targetModeControllerParameters); inertiaEIVE = &(acsParameters_->inertiaEIVE); rwHandlingParameters = &(acsParameters_->rwHandlingParameters); rwMatrices = &(acsParameters_->rwMatrices); @@ -32,10 +33,10 @@ void PtgCtrl::ptgLaw(const double mode, const double *qError, const double *delt //------------------------------------------------------------------------------------------------ // Compute gain matrix K and P matrix //------------------------------------------------------------------------------------------------ - double om = pointingModeControllerParameters->om; - double zeta = pointingModeControllerParameters->zeta; - double qErrorMin = pointingModeControllerParameters->qiMin; - double omMax = pointingModeControllerParameters->omMax; + double om = pointingLawParameters->om; + double zeta = pointingLawParameters->zeta; + double qErrorMin = pointingLawParameters->qiMin; + double omMax = pointingLawParameters->omMax; double cInt = 2 * om * zeta; double kInt = 2 * pow(om, 2); @@ -110,7 +111,7 @@ void PtgCtrl::ptgLaw(const double mode, const double *qError, const double *delt void PtgCtrl::ptgDesaturation(double *magFieldEst, bool magFieldEstValid, double *satRate, int32_t *speedRw0, int32_t *speedRw1, int32_t *speedRw2, int32_t *speedRw3, double *mgtDpDes) { - if (!(magFieldEstValid) || !(pointingModeControllerParameters->desatOn)) { + if (!(magFieldEstValid) || !(pointingLawParameters->desatOn)) { mgtDpDes[0] = 0; mgtDpDes[1] = 0; mgtDpDes[2] = 0; @@ -129,12 +130,12 @@ void PtgCtrl::ptgDesaturation(double *magFieldEst, bool magFieldEstValid, double // calculating momentum error double deltaMomentum[3] = {0, 0, 0}; VectorOperations::subtract( - momentumTotal, pointingModeControllerParameters->desatMomentumRef, deltaMomentum, 3); + momentumTotal, pointingLawParameters->desatMomentumRef, deltaMomentum, 3); // resulting magnetic dipole command double crossMomentumMagField[3] = {0, 0, 0}; VectorOperations::cross(deltaMomentum, magFieldEst, crossMomentumMagField); double normMag = VectorOperations::norm(magFieldEst, 3), factor = 0; - factor = (pointingModeControllerParameters->deSatGainFactor) / normMag; + factor = (pointingLawParameters->deSatGainFactor) / normMag; VectorOperations::mulScalar(crossMomentumMagField, factor, mgtDpDes, 3); } @@ -150,7 +151,7 @@ void PtgCtrl::ptgNullspace(const int32_t *speedRw0, const int32_t *speedRw1, VectorOperations::subtract(speedRws, rpmOffset, diffRwSpeed, 4); VectorOperations::mulScalar(diffRwSpeed, rwHandlingParameters->inertiaWheel, wheelMomentum, 4); - double gainNs = pointingModeControllerParameters->gainNullspace; + double gainNs = pointingLawParameters->gainNullspace; double nullSpaceMatrix[4][4] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; MathOperations::vecTransposeVecMatrix(rwMatrices->nullspace, rwMatrices->nullspace, *nullSpaceMatrix, 4); diff --git a/mission/controller/acs/control/PtgCtrl.h b/mission/controller/acs/control/PtgCtrl.h index c493b383..85f13a7a 100644 --- a/mission/controller/acs/control/PtgCtrl.h +++ b/mission/controller/acs/control/PtgCtrl.h @@ -59,7 +59,7 @@ class PtgCtrl { void rwAntistiction(const bool *rwAvailable, const int32_t *omegaRw, double *torqueCommand); private: - AcsParameters::PointingModeControllerParameters *pointingModeControllerParameters; + AcsParameters::PointingLawParameters *pointingLawParameters; AcsParameters::RwHandlingParameters *rwHandlingParameters; AcsParameters::InertiaEIVE *inertiaEIVE; AcsParameters::RwMatrices *rwMatrices; From 2f0eace82279d6b73166ea37aa7fc41d39554dda Mon Sep 17 00:00:00 2001 From: Robin Marquardt Date: Thu, 12 Jan 2023 17:10:40 +0100 Subject: [PATCH 086/330] use std::memcpy --- mission/controller/acs/Guidance.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index 700fd521..4ba72674 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -588,12 +588,8 @@ void Guidance::quatNadirPtgThreeAxes(ACS::SensorValues *sensorValues, } void Guidance::inertialQuatPtg(double targetQuat[4], double refSatRate[3]) { - for (int i = 0; i < 4; i++) { - targetQuat[i] = acsParameters.inertialModeControllerParameters.tgtQuat[i]; - } - for (int i = 0; i < 3; i++) { - refSatRate[i] = acsParameters.inertialModeControllerParameters.refRotRate[i]; - } + std::memcpy(targetQuat, acsParameters.inertialModeControllerParameters.tgtQuat, 4 * sizeof(double)); + std::memcpy(refSatRate, acsParameters.inertialModeControllerParameters.refRotRate, 3 * sizeof(double)); } void Guidance::comparePtg(double targetQuat[4], acsctrl::MekfData *mekfData, double quatRef[4], double refSatRate[3], From ce3841a23d9c0011a92ef7e5552b261b15149fa2 Mon Sep 17 00:00:00 2001 From: Robin Marquardt Date: Thu, 12 Jan 2023 17:19:35 +0100 Subject: [PATCH 087/330] use std::memcpy --- mission/controller/AcsController.cpp | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 9b210369..dee2fb73 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -275,44 +275,32 @@ void AcsController::performControlOperation() { case SUBMODE_IDLE: guidance.sunQuatPtg(&sensorValues, &mekfData, &susDataProcessed, &gpsDataProcessed, now, targetQuat, refSatRate); - for ( uint8_t i = 0; i < 4; i++ ) { - quatRef[i] = acsParameters.targetModeControllerParameters.quatRef[i]; - } + std::memcpy(quatRef, acsParameters.targetModeControllerParameters.quatRef, 4 * sizeof(double)); enableAntiStiction = acsParameters.targetModeControllerParameters.enableAntiStiction; break; case SUBMODE_PTG_TARGET: guidance.targetQuatPtgThreeAxes(&sensorValues, &gpsDataProcessed, &mekfData, now, targetQuat, refSatRate); - for ( uint8_t i = 0; i < 4; i++ ) { - quatRef[i] = acsParameters.targetModeControllerParameters.quatRef[i]; - } + std::memcpy(quatRef, acsParameters.targetModeControllerParameters.quatRef, 4 * sizeof(double)); enableAntiStiction = acsParameters.targetModeControllerParameters.enableAntiStiction; break; case SUBMODE_PTG_TARGET_GS: guidance.targetQuatPtgGs(&sensorValues, &mekfData, &susDataProcessed, &gpsDataProcessed, now, targetQuat, refSatRate); - - for ( uint8_t i = 0; i < 4; i++ ) { - quatRef[i] = acsParameters.targetModeControllerParameters.quatRef[i]; - } + std::memcpy(quatRef, acsParameters.targetModeControllerParameters.quatRef, 4 * sizeof(double)); enableAntiStiction = acsParameters.targetModeControllerParameters.enableAntiStiction; break; case SUBMODE_PTG_NADIR: guidance.quatNadirPtgThreeAxes(&sensorValues, &gpsDataProcessed, &mekfData, now, targetQuat, refSatRate); - for ( uint8_t i = 0; i < 4; i++ ) { - quatRef[i] = acsParameters.nadirModeControllerParameters.quatRef[i]; - } + std::memcpy(quatRef, acsParameters.nadirModeControllerParameters.quatRef, 4 * sizeof(double)); enableAntiStiction = acsParameters.nadirModeControllerParameters.enableAntiStiction; break; case SUBMODE_PTG_INERTIAL: guidance.inertialQuatPtg(targetQuat, refSatRate); - - for ( uint8_t i = 0; i < 4; i++ ) { - quatRef[i] = acsParameters.inertialModeControllerParameters.quatRef[i]; - } + std::memcpy(quatRef, acsParameters.inertialModeControllerParameters.quatRef, 4 * sizeof(double)); enableAntiStiction = acsParameters.inertialModeControllerParameters.enableAntiStiction; break; } From db763e394dd90e42a53ffb28a281b538981f96ec Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Mon, 16 Jan 2023 09:54:03 +0100 Subject: [PATCH 088/330] corrected MGM raw set size and sus processed pool ids --- .../controller/controllerdefinitions/AcsCtrlDefinitions.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h b/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h index 0955581b..e3908bd0 100644 --- a/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h +++ b/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h @@ -101,7 +101,7 @@ enum PoolIds : lp_id_t { MTQ_TARGET_DIPOLE, }; -static constexpr uint8_t MGM_SET_RAW_ENTRIES = 10; +static constexpr uint8_t MGM_SET_RAW_ENTRIES = 6; static constexpr uint8_t MGM_SET_PROCESSED_ENTRIES = 8; static constexpr uint8_t SUS_SET_RAW_ENTRIES = 12; static constexpr uint8_t SUS_SET_PROCESSED_ENTRIES = 15; @@ -184,9 +184,9 @@ class SusDataProcessed : public StaticLocalDataSet { lp_vec_t sus6vec = lp_vec_t(sid.objectId, SUS_6_VEC, this); lp_vec_t sus7vec = lp_vec_t(sid.objectId, SUS_7_VEC, this); lp_vec_t sus8vec = lp_vec_t(sid.objectId, SUS_8_VEC, this); - lp_vec_t sus9vec = lp_vec_t(sid.objectId, SUS_8_VEC, this); - lp_vec_t sus10vec = lp_vec_t(sid.objectId, SUS_8_VEC, this); - lp_vec_t sus11vec = lp_vec_t(sid.objectId, SUS_8_VEC, this); + lp_vec_t sus9vec = lp_vec_t(sid.objectId, SUS_9_VEC, this); + lp_vec_t sus10vec = lp_vec_t(sid.objectId, SUS_10_VEC, this); + lp_vec_t sus11vec = lp_vec_t(sid.objectId, SUS_11_VEC, this); lp_vec_t susVecTot = lp_vec_t(sid.objectId, SUS_VEC_TOT, this); lp_vec_t susVecTotDerivative = lp_vec_t(sid.objectId, SUS_VEC_TOT_DERIVATIVE, this); From 153c62337fca414e1075ae1d297534ccfaf31a88 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Mon, 16 Jan 2023 10:07:14 +0100 Subject: [PATCH 089/330] fixed determinant init --- mission/controller/acs/util/MathOperations.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/controller/acs/util/MathOperations.h b/mission/controller/acs/util/MathOperations.h index 56665c4d..b8d1fa4d 100644 --- a/mission/controller/acs/util/MathOperations.h +++ b/mission/controller/acs/util/MathOperations.h @@ -279,7 +279,7 @@ class MathOperations { } static void inverseMatrixDimThree(const T1 *matrix, T1 *output) { int i, j; - double determinant; + double determinant = 0; double mat[3][3] = {{matrix[0], matrix[1], matrix[2]}, {matrix[3], matrix[4], matrix[5]}, {matrix[6], matrix[7], matrix[8]}}; From 9791c11c993bd663c437b97ec274b0689dcfca93 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Mon, 16 Jan 2023 10:25:55 +0100 Subject: [PATCH 090/330] fix --- mission/controller/acs/SensorProcessing.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mission/controller/acs/SensorProcessing.cpp b/mission/controller/acs/SensorProcessing.cpp index 5d68bc44..dabe62ee 100644 --- a/mission/controller/acs/SensorProcessing.cpp +++ b/mission/controller/acs/SensorProcessing.cpp @@ -590,12 +590,12 @@ void SensorProcessing::process(timeval now, ACS::SensorValues *sensorValues, acsctrl::GpsDataProcessed *gpsDataProcessed, const AcsParameters *acsParameters) { sensorValues->update(); - processGps(sensorValues->gpsSet.latitude.value, sensorValues->gpsSet.longitude.value, - sensorValues->gpsSet.altitude.value, sensorValues->gpsSet.unixSeconds.value, - (sensorValues->gpsSet.latitude.isValid() && sensorValues->gpsSet.longitude.isValid() && - sensorValues->gpsSet.altitude.isValid() && sensorValues->gpsSet.altitude.isValid() && - sensorValues->gpsSet.unixSeconds.isValid()), - &acsParameters->gpsParameters, gpsDataProcessed); + processGps( + sensorValues->gpsSet.latitude.value, sensorValues->gpsSet.longitude.value, + sensorValues->gpsSet.altitude.value, sensorValues->gpsSet.unixSeconds.value, + (sensorValues->gpsSet.latitude.isValid() && sensorValues->gpsSet.longitude.isValid() && + sensorValues->gpsSet.altitude.isValid() && sensorValues->gpsSet.unixSeconds.isValid()), + &acsParameters->gpsParameters, gpsDataProcessed); processMgm(sensorValues->mgm0Lis3Set.fieldStrengths.value, sensorValues->mgm0Lis3Set.fieldStrengths.isValid(), From 8fa1d69db3b313235f4a660876cd3fbb05acbf5a Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Mon, 16 Jan 2023 15:23:20 +0100 Subject: [PATCH 091/330] removed rotation for sun pointing --- mission/controller/acs/Guidance.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index 9027392e..af9909c1 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -413,14 +413,8 @@ void Guidance::sunQuatPtg(ACS::SensorValues *sensorValues, acsctrl::MekfData *me double posSatE[3] = {0, 0, 0}; std::memcpy(gpsDataProcessed->gpsPosition.value, posSatE, 3 * sizeof(double)); - // Check whether Sat is above or below equator - // Assign helper vector (north pole inertial) accordingly - double helperVec[3] = {0, 0, 0}; - if (posSatE[2] > 0) { - helperVec[2] = 1; - } else { - helperVec[2] = -1; - } + // Assign helper vector (north pole inertial) + double helperVec[3] = {0, 0, 1}; // double yAxis[3] = {0, 0, 0}; From 673c24a34d9b1e075f0b5a65934828aeb55f6615 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Mon, 16 Jan 2023 15:43:40 +0100 Subject: [PATCH 092/330] frmt --- mission/controller/AcsController.cpp | 1092 +++++++++++++------------- 1 file changed, 544 insertions(+), 548 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 362a5e1b..85ef8d7a 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -26,7 +26,7 @@ AcsController::AcsController(object_id_t objectId) ctrlValData(this), actuatorCmdData(this) {} -ReturnValue_t AcsController::handleCommandMessage(CommandMessage *message) { +ReturnValue_t AcsController::handleCommandMessage(CommandMessage* message) { ReturnValue_t result = actionHelper.handleActionMessage(message); if (result == returnvalue::OK) { return result; @@ -103,581 +103,577 @@ void AcsController::performControlOperation() { copyGyrData(); } } - } +} - void AcsController::performSafe() { - ACS::SensorValues sensorValues; +void AcsController::performSafe() { + ACS::SensorValues sensorValues; - timeval now; - Clock::getClock_timeval(&now); + timeval now; + Clock::getClock_timeval(&now); - sensorProcessing.process(now, &sensorValues, &mgmDataProcessed, &susDataProcessed, - &gyrDataProcessed, &gpsDataProcessed, &acsParameters); - ReturnValue_t validMekf; - navigation.useMekf(&sensorValues, &gyrDataProcessed, &mgmDataProcessed, &susDataProcessed, - &mekfData, &validMekf); + sensorProcessing.process(now, &sensorValues, &mgmDataProcessed, &susDataProcessed, + &gyrDataProcessed, &gpsDataProcessed, &acsParameters); + ReturnValue_t validMekf; + navigation.useMekf(&sensorValues, &gyrDataProcessed, &mgmDataProcessed, &susDataProcessed, + &mekfData, &validMekf); - // Give desired satellite rate and sun direction to align - double satRateSafe[3] = {0, 0, 0}, sunTargetDir[3] = {0, 0, 0}; - guidance.getTargetParamsSafe(sunTargetDir, satRateSafe); - // IF MEKF is working - double magMomMtq[3] = {0, 0, 0}, errAng = 0.0; - bool magMomMtqValid = false; - if (validMekf == returnvalue::OK) { - safeCtrl.safeMekf(now, mekfData.quatMekf.value, mekfData.quatMekf.isValid(), - mgmDataProcessed.magIgrfModel.value, - mgmDataProcessed.magIgrfModel.isValid(), susDataProcessed.sunIjkModel.value, - susDataProcessed.isValid(), mekfData.satRotRateMekf.value, - mekfData.satRotRateMekf.isValid(), sunTargetDir, satRateSafe, &errAng, - magMomMtq, &magMomMtqValid); - } else { - safeCtrl.safeNoMekf( - now, susDataProcessed.susVecTot.value, susDataProcessed.susVecTot.isValid(), - susDataProcessed.susVecTotDerivative.value, - susDataProcessed.susVecTotDerivative.isValid(), mgmDataProcessed.mgmVecTot.value, - mgmDataProcessed.mgmVecTot.isValid(), mgmDataProcessed.mgmVecTotDerivative.value, - mgmDataProcessed.mgmVecTotDerivative.isValid(), sunTargetDir, satRateSafe, &errAng, - magMomMtq, &magMomMtqValid); - } - - double dipolCmdUnits[3] = {0, 0, 0}; - actuatorCmd.cmdDipolMtq(magMomMtq, dipolCmdUnits); - - { - PoolReadGuard pg(&ctrlValData); - if (pg.getReadResult() == returnvalue::OK) { - double unitQuat[4] = {0, 0, 0, 1}; - std::memcpy(ctrlValData.tgtQuat.value, unitQuat, 4 * sizeof(double)); - ctrlValData.tgtQuat.setValid(false); - std::memcpy(ctrlValData.errQuat.value, unitQuat, 4 * sizeof(double)); - ctrlValData.errQuat.setValid(false); - ctrlValData.errAng.value = errAng; - ctrlValData.errAng.setValid(true); - ctrlValData.setValidity(true, false); - } - } - - // Detumble check and switch - if (mekfData.satRotRateMekf.isValid() && - VectorOperations::norm(mekfData.satRotRateMekf.value, 3) > - acsParameters.detumbleParameter.omegaDetumbleStart) { - detumbleCounter++; - } else if (gyrDataProcessed.gyrVecTot.isValid() && - VectorOperations::norm(gyrDataProcessed.gyrVecTot.value, 3) > - acsParameters.detumbleParameter.omegaDetumbleStart) { - detumbleCounter++; - } else { - detumbleCounter = 0; - } - if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) { - submode = SUBMODE_DETUMBLE; - detumbleCounter = 0; - triggerEvent(SAFE_RATE_VIOLATION); - } - - { - PoolReadGuard pg(&actuatorCmdData); - if (pg.getReadResult() == returnvalue::OK) { - std::memset(actuatorCmdData.rwTargetTorque.value, 0, 4 * sizeof(int32_t)); - actuatorCmdData.rwTargetTorque.setValid(false); - std::memset(actuatorCmdData.rwTargetSpeed.value, 0, 4 * sizeof(int32_t)); - actuatorCmdData.rwTargetSpeed.setValid(false); - std::memcpy(actuatorCmdData.mtqTargetDipole.value, dipolCmdUnits, 3 * sizeof(int16_t)); - actuatorCmdData.mtqTargetDipole.setValid(true); - actuatorCmdData.setValidity(true, false); - } - } - // { - // PoolReadGuard pg(&dipoleSet); - // MutexGuard mg(torquer::lazyLock()); - // torquer::NEW_ACTUATION_FLAG = true; - // dipoleSet.setDipoles(cmdDipolUnits[0], cmdDipolUnits[1], cmdDipolUnits[2], - // torqueDuration); - // } - } - - void AcsController::performDetumble() { - ACS::SensorValues sensorValues; - - timeval now; - Clock::getClock_timeval(&now); - - sensorProcessing.process(now, &sensorValues, &mgmDataProcessed, &susDataProcessed, - &gyrDataProcessed, &gpsDataProcessed, &acsParameters); - ReturnValue_t validMekf; - navigation.useMekf(&sensorValues, &gyrDataProcessed, &mgmDataProcessed, &susDataProcessed, - &mekfData, &validMekf); - - double magMomMtq[3] = {0, 0, 0}; - detumble.bDotLaw( + // Give desired satellite rate and sun direction to align + double satRateSafe[3] = {0, 0, 0}, sunTargetDir[3] = {0, 0, 0}; + guidance.getTargetParamsSafe(sunTargetDir, satRateSafe); + // IF MEKF is working + double magMomMtq[3] = {0, 0, 0}, errAng = 0.0; + bool magMomMtqValid = false; + if (validMekf == returnvalue::OK) { + safeCtrl.safeMekf(now, mekfData.quatMekf.value, mekfData.quatMekf.isValid(), + mgmDataProcessed.magIgrfModel.value, mgmDataProcessed.magIgrfModel.isValid(), + susDataProcessed.sunIjkModel.value, susDataProcessed.isValid(), + mekfData.satRotRateMekf.value, mekfData.satRotRateMekf.isValid(), + sunTargetDir, satRateSafe, &errAng, magMomMtq, &magMomMtqValid); + } else { + safeCtrl.safeNoMekf( + now, susDataProcessed.susVecTot.value, susDataProcessed.susVecTot.isValid(), + susDataProcessed.susVecTotDerivative.value, susDataProcessed.susVecTotDerivative.isValid(), + mgmDataProcessed.mgmVecTot.value, mgmDataProcessed.mgmVecTot.isValid(), mgmDataProcessed.mgmVecTotDerivative.value, mgmDataProcessed.mgmVecTotDerivative.isValid(), - mgmDataProcessed.mgmVecTot.value, mgmDataProcessed.mgmVecTot.isValid(), magMomMtq); - double dipolCmdUnits[3] = {0, 0, 0}; - actuatorCmd.cmdDipolMtq(magMomMtq, dipolCmdUnits); - - if (mekfData.satRotRateMekf.isValid() && - VectorOperations::norm(mekfData.satRotRateMekf.value, 3) < - acsParameters.detumbleParameter.omegaDetumbleEnd) { - detumbleCounter++; - } else if (gyrDataProcessed.gyrVecTot.isValid() && - VectorOperations::norm(gyrDataProcessed.gyrVecTot.value, 3) < - acsParameters.detumbleParameter.omegaDetumbleEnd) { - detumbleCounter++; - } else { - detumbleCounter = 0; - } - if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) { - submode = SUBMODE_SAFE; - detumbleCounter = 0; - } - - int16_t cmdDipolUnitsInt[3] = {0, 0, 0}; - for (int i = 0; i < 3; ++i) { - cmdDipolUnitsInt[i] = std::round(dipolCmdUnits[i]); - } - { - PoolReadGuard pg(&actuatorCmdData); - if (pg.getReadResult() == returnvalue::OK) { - std::memset(actuatorCmdData.rwTargetTorque.value, 0, 4 * sizeof(double)); - actuatorCmdData.rwTargetTorque.setValid(false); - std::memset(actuatorCmdData.rwTargetSpeed.value, 0, 4 * sizeof(int32_t)); - actuatorCmdData.rwTargetSpeed.setValid(false); - std::memcpy(actuatorCmdData.mtqTargetDipole.value, cmdDipolUnitsInt, 3 * sizeof(int16_t)); - actuatorCmdData.mtqTargetDipole.setValid(true); - actuatorCmdData.setValidity(true, false); - } - } - // { - // PoolReadGuard pg(&dipoleSet); - // MutexGuard mg(torquer::lazyLock()); - // torquer::NEW_ACTUATION_FLAG = true; - // dipoleSet.setDipoles(cmdDipolUnitsInt[0], cmdDipolUnitsInt[1], cmdDipolUnitsInt[2], - // torqueDuration); - // } + sunTargetDir, satRateSafe, &errAng, magMomMtq, &magMomMtqValid); } - void AcsController::performPointingCtrl() { - ACS::SensorValues sensorValues; + double dipolCmdUnits[3] = {0, 0, 0}; + actuatorCmd.cmdDipolMtq(magMomMtq, dipolCmdUnits); - timeval now; - Clock::getClock_timeval(&now); - - sensorProcessing.process(now, &sensorValues, &mgmDataProcessed, &susDataProcessed, - &gyrDataProcessed, &gpsDataProcessed, &acsParameters); - ReturnValue_t validMekf; - navigation.useMekf(&sensorValues, &gyrDataProcessed, &mgmDataProcessed, &susDataProcessed, - &mekfData, &validMekf); - - double targetQuat[4] = {0, 0, 0, 0}, refSatRate[3] = {0, 0, 0}; - switch (submode) { - case SUBMODE_IDLE: - guidance.sunQuatPtg(&sensorValues, &mekfData, &susDataProcessed, &gpsDataProcessed, now, - targetQuat, refSatRate); - break; - case SUBMODE_PTG_TARGET: - guidance.targetQuatPtgThreeAxes(&sensorValues, &gpsDataProcessed, &mekfData, now, - targetQuat, refSatRate); - break; - case SUBMODE_PTG_TARGET_GS: - guidance.targetQuatPtgGs(&sensorValues, &mekfData, &susDataProcessed, &gpsDataProcessed, - now, targetQuat, refSatRate); - break; - case SUBMODE_PTG_NADIR: - guidance.quatNadirPtgThreeAxes(&sensorValues, &gpsDataProcessed, &mekfData, now, targetQuat, - refSatRate); - break; - case SUBMODE_PTG_INERTIAL: - guidance.inertialQuatPtg(targetQuat, refSatRate); - break; + { + PoolReadGuard pg(&ctrlValData); + if (pg.getReadResult() == returnvalue::OK) { + double unitQuat[4] = {0, 0, 0, 1}; + std::memcpy(ctrlValData.tgtQuat.value, unitQuat, 4 * sizeof(double)); + ctrlValData.tgtQuat.setValid(false); + std::memcpy(ctrlValData.errQuat.value, unitQuat, 4 * sizeof(double)); + ctrlValData.errQuat.setValid(false); + ctrlValData.errAng.value = errAng; + ctrlValData.errAng.setValid(true); + ctrlValData.setValidity(true, false); } - double quatErrorComplete[4] = {0, 0, 0, 0}, quatError[3] = {0, 0, 0}, - deltaRate[3] = {0, 0, 0}; // ToDo: check if pointer needed - guidance.comparePtg(targetQuat, &mekfData, refSatRate, quatErrorComplete, quatError, deltaRate); - double rwPseudoInv[4][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; - guidance.getDistributionMatrixRw(&sensorValues, *rwPseudoInv); - double torquePtgRws[4] = {0, 0, 0, 0}, mode = 0; - ptgCtrl.ptgLaw(mode, quatError, deltaRate, *rwPseudoInv, torquePtgRws); - double rwTrqNs[4] = {0, 0, 0, 0}; - ptgCtrl.ptgNullspace( - &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), - &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), rwTrqNs); - double torqueRws[4] = {0, 0, 0, 0}, torqueRwsScaled[4] = {0, 0, 0, 0}; - VectorOperations::add(torquePtgRws, rwTrqNs, torqueRws, 4); - actuatorCmd.scalingTorqueRws(torqueRws, torqueRwsScaled); + } - if (acsParameters.pointingModeControllerParameters.enableAntiStiction) { - bool rwAvailable[4] = {true, true, true, true}; // WHICH INPUT SENSOR SET? - int32_t rwSpeed[4] = { - (sensorValues.rw1Set.currSpeed.value), (sensorValues.rw2Set.currSpeed.value), - (sensorValues.rw3Set.currSpeed.value), (sensorValues.rw4Set.currSpeed.value)}; - ptgCtrl.rwAntistiction(rwAvailable, rwSpeed, torqueRwsScaled); + // Detumble check and switch + if (mekfData.satRotRateMekf.isValid() && + VectorOperations::norm(mekfData.satRotRateMekf.value, 3) > + acsParameters.detumbleParameter.omegaDetumbleStart) { + detumbleCounter++; + } else if (gyrDataProcessed.gyrVecTot.isValid() && + VectorOperations::norm(gyrDataProcessed.gyrVecTot.value, 3) > + acsParameters.detumbleParameter.omegaDetumbleStart) { + detumbleCounter++; + } else { + detumbleCounter = 0; + } + if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) { + submode = SUBMODE_DETUMBLE; + detumbleCounter = 0; + triggerEvent(SAFE_RATE_VIOLATION); + } + + { + PoolReadGuard pg(&actuatorCmdData); + if (pg.getReadResult() == returnvalue::OK) { + std::memset(actuatorCmdData.rwTargetTorque.value, 0, 4 * sizeof(int32_t)); + actuatorCmdData.rwTargetTorque.setValid(false); + std::memset(actuatorCmdData.rwTargetSpeed.value, 0, 4 * sizeof(int32_t)); + actuatorCmdData.rwTargetSpeed.setValid(false); + std::memcpy(actuatorCmdData.mtqTargetDipole.value, dipolCmdUnits, 3 * sizeof(int16_t)); + actuatorCmdData.mtqTargetDipole.setValid(true); + actuatorCmdData.setValidity(true, false); } + } + // { + // PoolReadGuard pg(&dipoleSet); + // MutexGuard mg(torquer::lazyLock()); + // torquer::NEW_ACTUATION_FLAG = true; + // dipoleSet.setDipoles(cmdDipolUnits[0], cmdDipolUnits[1], cmdDipolUnits[2], + // torqueDuration); + // } +} - double cmdSpeedRws[4] = {0, 0, 0, - 0}; // Should be given to the actuator reaction wheel as input - actuatorCmd.cmdSpeedToRws(&(sensorValues.rw1Set.currSpeed.value), - &(sensorValues.rw2Set.currSpeed.value), - &(sensorValues.rw3Set.currSpeed.value), - &(sensorValues.rw4Set.currSpeed.value), torqueRwsScaled, cmdSpeedRws); - double mgtDpDes[3] = {0, 0, 0}, dipolUnits[3] = {0, 0, 0}; // Desaturation Dipol - ptgCtrl.ptgDesaturation(mgmDataProcessed.mgmVecTot.value, mgmDataProcessed.mgmVecTot.isValid(), - mekfData.satRotRateMekf.value, &(sensorValues.rw1Set.currSpeed.value), +void AcsController::performDetumble() { + ACS::SensorValues sensorValues; + + timeval now; + Clock::getClock_timeval(&now); + + sensorProcessing.process(now, &sensorValues, &mgmDataProcessed, &susDataProcessed, + &gyrDataProcessed, &gpsDataProcessed, &acsParameters); + ReturnValue_t validMekf; + navigation.useMekf(&sensorValues, &gyrDataProcessed, &mgmDataProcessed, &susDataProcessed, + &mekfData, &validMekf); + + double magMomMtq[3] = {0, 0, 0}; + detumble.bDotLaw(mgmDataProcessed.mgmVecTotDerivative.value, + mgmDataProcessed.mgmVecTotDerivative.isValid(), mgmDataProcessed.mgmVecTot.value, + mgmDataProcessed.mgmVecTot.isValid(), magMomMtq); + double dipolCmdUnits[3] = {0, 0, 0}; + actuatorCmd.cmdDipolMtq(magMomMtq, dipolCmdUnits); + + if (mekfData.satRotRateMekf.isValid() && + VectorOperations::norm(mekfData.satRotRateMekf.value, 3) < + acsParameters.detumbleParameter.omegaDetumbleEnd) { + detumbleCounter++; + } else if (gyrDataProcessed.gyrVecTot.isValid() && + VectorOperations::norm(gyrDataProcessed.gyrVecTot.value, 3) < + acsParameters.detumbleParameter.omegaDetumbleEnd) { + detumbleCounter++; + } else { + detumbleCounter = 0; + } + if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) { + submode = SUBMODE_SAFE; + detumbleCounter = 0; + } + + int16_t cmdDipolUnitsInt[3] = {0, 0, 0}; + for (int i = 0; i < 3; ++i) { + cmdDipolUnitsInt[i] = std::round(dipolCmdUnits[i]); + } + { + PoolReadGuard pg(&actuatorCmdData); + if (pg.getReadResult() == returnvalue::OK) { + std::memset(actuatorCmdData.rwTargetTorque.value, 0, 4 * sizeof(double)); + actuatorCmdData.rwTargetTorque.setValid(false); + std::memset(actuatorCmdData.rwTargetSpeed.value, 0, 4 * sizeof(int32_t)); + actuatorCmdData.rwTargetSpeed.setValid(false); + std::memcpy(actuatorCmdData.mtqTargetDipole.value, cmdDipolUnitsInt, 3 * sizeof(int16_t)); + actuatorCmdData.mtqTargetDipole.setValid(true); + actuatorCmdData.setValidity(true, false); + } + } + // { + // PoolReadGuard pg(&dipoleSet); + // MutexGuard mg(torquer::lazyLock()); + // torquer::NEW_ACTUATION_FLAG = true; + // dipoleSet.setDipoles(cmdDipolUnitsInt[0], cmdDipolUnitsInt[1], cmdDipolUnitsInt[2], + // torqueDuration); + // } +} + +void AcsController::performPointingCtrl() { + ACS::SensorValues sensorValues; + + timeval now; + Clock::getClock_timeval(&now); + + sensorProcessing.process(now, &sensorValues, &mgmDataProcessed, &susDataProcessed, + &gyrDataProcessed, &gpsDataProcessed, &acsParameters); + ReturnValue_t validMekf; + navigation.useMekf(&sensorValues, &gyrDataProcessed, &mgmDataProcessed, &susDataProcessed, + &mekfData, &validMekf); + + double targetQuat[4] = {0, 0, 0, 0}, refSatRate[3] = {0, 0, 0}; + switch (submode) { + case SUBMODE_IDLE: + guidance.sunQuatPtg(&sensorValues, &mekfData, &susDataProcessed, &gpsDataProcessed, now, + targetQuat, refSatRate); + break; + case SUBMODE_PTG_TARGET: + guidance.targetQuatPtgThreeAxes(&sensorValues, &gpsDataProcessed, &mekfData, now, targetQuat, + refSatRate); + break; + case SUBMODE_PTG_TARGET_GS: + guidance.targetQuatPtgGs(&sensorValues, &mekfData, &susDataProcessed, &gpsDataProcessed, now, + targetQuat, refSatRate); + break; + case SUBMODE_PTG_NADIR: + guidance.quatNadirPtgThreeAxes(&sensorValues, &gpsDataProcessed, &mekfData, now, targetQuat, + refSatRate); + break; + case SUBMODE_PTG_INERTIAL: + guidance.inertialQuatPtg(targetQuat, refSatRate); + break; + } + double quatErrorComplete[4] = {0, 0, 0, 0}, quatError[3] = {0, 0, 0}, + deltaRate[3] = {0, 0, 0}; // ToDo: check if pointer needed + guidance.comparePtg(targetQuat, &mekfData, refSatRate, quatErrorComplete, quatError, deltaRate); + double rwPseudoInv[4][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + guidance.getDistributionMatrixRw(&sensorValues, *rwPseudoInv); + double torquePtgRws[4] = {0, 0, 0, 0}, mode = 0; + ptgCtrl.ptgLaw(mode, quatError, deltaRate, *rwPseudoInv, torquePtgRws); + double rwTrqNs[4] = {0, 0, 0, 0}; + ptgCtrl.ptgNullspace( + &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), + &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), rwTrqNs); + double torqueRws[4] = {0, 0, 0, 0}, torqueRwsScaled[4] = {0, 0, 0, 0}; + VectorOperations::add(torquePtgRws, rwTrqNs, torqueRws, 4); + actuatorCmd.scalingTorqueRws(torqueRws, torqueRwsScaled); + + if (acsParameters.pointingModeControllerParameters.enableAntiStiction) { + bool rwAvailable[4] = {true, true, true, true}; // WHICH INPUT SENSOR SET? + int32_t rwSpeed[4] = { + (sensorValues.rw1Set.currSpeed.value), (sensorValues.rw2Set.currSpeed.value), + (sensorValues.rw3Set.currSpeed.value), (sensorValues.rw4Set.currSpeed.value)}; + ptgCtrl.rwAntistiction(rwAvailable, rwSpeed, torqueRwsScaled); + } + + double cmdSpeedRws[4] = {0, 0, 0, 0}; // Should be given to the actuator reaction wheel as input + actuatorCmd.cmdSpeedToRws(&(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), &(sensorValues.rw3Set.currSpeed.value), - &(sensorValues.rw4Set.currSpeed.value), mgtDpDes); - actuatorCmd.cmdDipolMtq(mgtDpDes, dipolUnits); + &(sensorValues.rw4Set.currSpeed.value), torqueRwsScaled, cmdSpeedRws); + double mgtDpDes[3] = {0, 0, 0}, dipolUnits[3] = {0, 0, 0}; // Desaturation Dipol + ptgCtrl.ptgDesaturation(mgmDataProcessed.mgmVecTot.value, mgmDataProcessed.mgmVecTot.isValid(), + mekfData.satRotRateMekf.value, &(sensorValues.rw1Set.currSpeed.value), + &(sensorValues.rw2Set.currSpeed.value), + &(sensorValues.rw3Set.currSpeed.value), + &(sensorValues.rw4Set.currSpeed.value), mgtDpDes); + actuatorCmd.cmdDipolMtq(mgtDpDes, dipolUnits); - int16_t cmdDipolUnitsInt[3] = {0, 0, 0}; - for (int i = 0; i < 3; ++i) { - cmdDipolUnitsInt[i] = std::round(dipolUnits[i]); - } - int32_t cmdRwSpeedInt[4] = {0, 0, 0, 0}; - for (int i = 0; i < 4; ++i) { - cmdRwSpeedInt[i] = std::round(cmdSpeedRws[i]); - } - - { - PoolReadGuard pg(&actuatorCmdData); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(actuatorCmdData.rwTargetTorque.value, rwTrqNs, 4 * sizeof(double)); - std::memcpy(actuatorCmdData.rwTargetSpeed.value, cmdRwSpeedInt, 4 * sizeof(int32_t)); - std::memcpy(actuatorCmdData.mtqTargetDipole.value, cmdDipolUnitsInt, 3 * sizeof(int16_t)); - actuatorCmdData.setValidity(true, true); - } - } - // { - // PoolReadGuard pg(&dipoleSet); - // MutexGuard mg(torquer::lazyLock()); - // torquer::NEW_ACTUATION_FLAG = true; - // dipoleSet.setDipoles(cmdDipolUnitsInt[0], cmdDipolUnitsInt[1], cmdDipolUnitsInt[2], - // torqueDuration); - // } + int16_t cmdDipolUnitsInt[3] = {0, 0, 0}; + for (int i = 0; i < 3; ++i) { + cmdDipolUnitsInt[i] = std::round(dipolUnits[i]); + } + int32_t cmdRwSpeedInt[4] = {0, 0, 0, 0}; + for (int i = 0; i < 4; ++i) { + cmdRwSpeedInt[i] = std::round(cmdSpeedRws[i]); } - ReturnValue_t AcsController::initializeLocalDataPool(localpool::DataPool & localDataPoolMap, - LocalDataPoolManager & poolManager) { - // MGM Raw - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_0_LIS3_UT, &mgm0VecRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_1_RM3100_UT, &mgm1VecRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_2_LIS3_UT, &mgm2VecRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_3_RM3100_UT, &mgm3VecRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_IMTQ_CAL_NT, &imtqMgmVecRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_IMTQ_CAL_ACT_STATUS, &imtqCalActStatus); - poolManager.subscribeForRegularPeriodicPacket({mgmDataRaw.getSid(), false, 5.0}); - // MGM Processed - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_0_VEC, &mgm0VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_1_VEC, &mgm1VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_2_VEC, &mgm2VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_3_VEC, &mgm3VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_4_VEC, &mgm4VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_VEC_TOT, &mgmVecTot); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_VEC_TOT_DERIVATIVE, &mgmVecTotDer); - localDataPoolMap.emplace(acsctrl::PoolIds::MAG_IGRF_MODEL, &magIgrf); - poolManager.subscribeForRegularPeriodicPacket({mgmDataProcessed.getSid(), false, 5.0}); - // SUS Raw - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_0_N_LOC_XFYFZM_PT_XF, &sus0ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_1_N_LOC_XBYFZM_PT_XB, &sus1ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_2_N_LOC_XFYBZB_PT_YB, &sus2ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_3_N_LOC_XFYBZF_PT_YF, &sus3ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_4_N_LOC_XMYFZF_PT_ZF, &sus4ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_5_N_LOC_XFYMZB_PT_ZB, &sus5ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_6_R_LOC_XFYBZM_PT_XF, &sus6ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_7_R_LOC_XBYBZM_PT_XB, &sus7ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_8_R_LOC_XBYBZB_PT_YB, &sus8ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_9_R_LOC_XBYBZB_PT_YF, &sus9ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_10_N_LOC_XMYBZF_PT_ZF, &sus10ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_11_R_LOC_XBYMZB_PT_ZB, &sus11ValRaw); - poolManager.subscribeForRegularPeriodicPacket({susDataRaw.getSid(), false, 5.0}); - // SUS Processed - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_0_VEC, &sus0VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_1_VEC, &sus1VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_2_VEC, &sus2VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_3_VEC, &sus3VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_4_VEC, &sus4VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_5_VEC, &sus5VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_6_VEC, &sus6VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_7_VEC, &sus7VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_8_VEC, &sus8VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_9_VEC, &sus9VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_10_VEC, &sus10VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_11_VEC, &sus11VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_VEC_TOT, &susVecTot); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_VEC_TOT_DERIVATIVE, &susVecTotDer); - localDataPoolMap.emplace(acsctrl::PoolIds::SUN_IJK_MODEL, &sunIjk); - poolManager.subscribeForRegularPeriodicPacket({susDataProcessed.getSid(), false, 5.0}); - // GYR Raw - localDataPoolMap.emplace(acsctrl::PoolIds::GYR_0_ADIS, &gyr0VecRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::GYR_1_L3, &gyr1VecRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::GYR_2_ADIS, &gyr2VecRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::GYR_3_L3, &gyr3VecRaw); - poolManager.subscribeForRegularPeriodicPacket({gyrDataRaw.getSid(), false, 5.0}); - // GYR Processed - localDataPoolMap.emplace(acsctrl::PoolIds::GYR_0_VEC, &gyr0VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::GYR_1_VEC, &gyr1VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::GYR_2_VEC, &gyr2VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::GYR_3_VEC, &gyr3VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::GYR_VEC_TOT, &gyrVecTot); - poolManager.subscribeForRegularPeriodicPacket({gyrDataProcessed.getSid(), false, 5.0}); - // GPS Processed - localDataPoolMap.emplace(acsctrl::PoolIds::GC_LATITUDE, &gcLatitude); - localDataPoolMap.emplace(acsctrl::PoolIds::GD_LONGITUDE, &gdLongitude); - localDataPoolMap.emplace(acsctrl::PoolIds::GPS_POSITION, &gpsPosition); - localDataPoolMap.emplace(acsctrl::PoolIds::GPS_VELOCITY, &gpsVelocity); - poolManager.subscribeForRegularPeriodicPacket({gpsDataProcessed.getSid(), false, 5.0}); - // MEKF - localDataPoolMap.emplace(acsctrl::PoolIds::QUAT_MEKF, &quatMekf); - localDataPoolMap.emplace(acsctrl::PoolIds::SAT_ROT_RATE_MEKF, &satRotRateMekf); - poolManager.subscribeForRegularPeriodicPacket({mekfData.getSid(), false, 5.0}); - // Ctrl Values - localDataPoolMap.emplace(acsctrl::PoolIds::TGT_QUAT, &tgtQuat); - localDataPoolMap.emplace(acsctrl::PoolIds::ERROR_QUAT, &errQuat); - localDataPoolMap.emplace(acsctrl::PoolIds::ERROR_ANG, &errAng); - poolManager.subscribeForRegularPeriodicPacket({ctrlValData.getSid(), false, 5.0}); - // Actuator CMD - localDataPoolMap.emplace(acsctrl::PoolIds::RW_TARGET_TORQUE, &rwTargetTorque); - localDataPoolMap.emplace(acsctrl::PoolIds::RW_TARGET_SPEED, &rwTargetSpeed); - localDataPoolMap.emplace(acsctrl::PoolIds::MTQ_TARGET_DIPOLE, &mtqTargetDipole); - poolManager.subscribeForRegularPeriodicPacket({actuatorCmdData.getSid(), false, 5.0}); - return returnvalue::OK; + { + PoolReadGuard pg(&actuatorCmdData); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(actuatorCmdData.rwTargetTorque.value, rwTrqNs, 4 * sizeof(double)); + std::memcpy(actuatorCmdData.rwTargetSpeed.value, cmdRwSpeedInt, 4 * sizeof(int32_t)); + std::memcpy(actuatorCmdData.mtqTargetDipole.value, cmdDipolUnitsInt, 3 * sizeof(int16_t)); + actuatorCmdData.setValidity(true, true); + } } + // { + // PoolReadGuard pg(&dipoleSet); + // MutexGuard mg(torquer::lazyLock()); + // torquer::NEW_ACTUATION_FLAG = true; + // dipoleSet.setDipoles(cmdDipolUnitsInt[0], cmdDipolUnitsInt[1], cmdDipolUnitsInt[2], + // torqueDuration); + // } +} - LocalPoolDataSetBase *AcsController::getDataSetHandle(sid_t sid) { - switch (sid.ownerSetId) { - case acsctrl::MGM_SENSOR_DATA: - return &mgmDataRaw; - case acsctrl::MGM_PROCESSED_DATA: - return &mgmDataProcessed; - case acsctrl::SUS_SENSOR_DATA: - return &susDataRaw; - case acsctrl::SUS_PROCESSED_DATA: - return &susDataProcessed; - case acsctrl::GYR_SENSOR_DATA: - return &gyrDataRaw; - case acsctrl::GYR_PROCESSED_DATA: - return &gyrDataProcessed; - case acsctrl::GPS_PROCESSED_DATA: - return &gpsDataProcessed; - case acsctrl::MEKF_DATA: - return &mekfData; - case acsctrl::CTRL_VAL_DATA: - return &ctrlValData; - case acsctrl::ACTUATOR_CMD_DATA: - return &actuatorCmdData; - default: - return nullptr; - } - return nullptr; - } +ReturnValue_t AcsController::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, + LocalDataPoolManager& poolManager) { + // MGM Raw + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_0_LIS3_UT, &mgm0VecRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_1_RM3100_UT, &mgm1VecRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_2_LIS3_UT, &mgm2VecRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_3_RM3100_UT, &mgm3VecRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_IMTQ_CAL_NT, &imtqMgmVecRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_IMTQ_CAL_ACT_STATUS, &imtqCalActStatus); + poolManager.subscribeForRegularPeriodicPacket({mgmDataRaw.getSid(), false, 5.0}); + // MGM Processed + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_0_VEC, &mgm0VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_1_VEC, &mgm1VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_2_VEC, &mgm2VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_3_VEC, &mgm3VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_4_VEC, &mgm4VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_VEC_TOT, &mgmVecTot); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_VEC_TOT_DERIVATIVE, &mgmVecTotDer); + localDataPoolMap.emplace(acsctrl::PoolIds::MAG_IGRF_MODEL, &magIgrf); + poolManager.subscribeForRegularPeriodicPacket({mgmDataProcessed.getSid(), false, 5.0}); + // SUS Raw + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_0_N_LOC_XFYFZM_PT_XF, &sus0ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_1_N_LOC_XBYFZM_PT_XB, &sus1ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_2_N_LOC_XFYBZB_PT_YB, &sus2ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_3_N_LOC_XFYBZF_PT_YF, &sus3ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_4_N_LOC_XMYFZF_PT_ZF, &sus4ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_5_N_LOC_XFYMZB_PT_ZB, &sus5ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_6_R_LOC_XFYBZM_PT_XF, &sus6ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_7_R_LOC_XBYBZM_PT_XB, &sus7ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_8_R_LOC_XBYBZB_PT_YB, &sus8ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_9_R_LOC_XBYBZB_PT_YF, &sus9ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_10_N_LOC_XMYBZF_PT_ZF, &sus10ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_11_R_LOC_XBYMZB_PT_ZB, &sus11ValRaw); + poolManager.subscribeForRegularPeriodicPacket({susDataRaw.getSid(), false, 5.0}); + // SUS Processed + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_0_VEC, &sus0VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_1_VEC, &sus1VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_2_VEC, &sus2VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_3_VEC, &sus3VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_4_VEC, &sus4VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_5_VEC, &sus5VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_6_VEC, &sus6VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_7_VEC, &sus7VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_8_VEC, &sus8VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_9_VEC, &sus9VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_10_VEC, &sus10VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_11_VEC, &sus11VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_VEC_TOT, &susVecTot); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_VEC_TOT_DERIVATIVE, &susVecTotDer); + localDataPoolMap.emplace(acsctrl::PoolIds::SUN_IJK_MODEL, &sunIjk); + poolManager.subscribeForRegularPeriodicPacket({susDataProcessed.getSid(), false, 5.0}); + // GYR Raw + localDataPoolMap.emplace(acsctrl::PoolIds::GYR_0_ADIS, &gyr0VecRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::GYR_1_L3, &gyr1VecRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::GYR_2_ADIS, &gyr2VecRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::GYR_3_L3, &gyr3VecRaw); + poolManager.subscribeForRegularPeriodicPacket({gyrDataRaw.getSid(), false, 5.0}); + // GYR Processed + localDataPoolMap.emplace(acsctrl::PoolIds::GYR_0_VEC, &gyr0VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::GYR_1_VEC, &gyr1VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::GYR_2_VEC, &gyr2VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::GYR_3_VEC, &gyr3VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::GYR_VEC_TOT, &gyrVecTot); + poolManager.subscribeForRegularPeriodicPacket({gyrDataProcessed.getSid(), false, 5.0}); + // GPS Processed + localDataPoolMap.emplace(acsctrl::PoolIds::GC_LATITUDE, &gcLatitude); + localDataPoolMap.emplace(acsctrl::PoolIds::GD_LONGITUDE, &gdLongitude); + localDataPoolMap.emplace(acsctrl::PoolIds::GPS_POSITION, &gpsPosition); + localDataPoolMap.emplace(acsctrl::PoolIds::GPS_VELOCITY, &gpsVelocity); + poolManager.subscribeForRegularPeriodicPacket({gpsDataProcessed.getSid(), false, 5.0}); + // MEKF + localDataPoolMap.emplace(acsctrl::PoolIds::QUAT_MEKF, &quatMekf); + localDataPoolMap.emplace(acsctrl::PoolIds::SAT_ROT_RATE_MEKF, &satRotRateMekf); + poolManager.subscribeForRegularPeriodicPacket({mekfData.getSid(), false, 5.0}); + // Ctrl Values + localDataPoolMap.emplace(acsctrl::PoolIds::TGT_QUAT, &tgtQuat); + localDataPoolMap.emplace(acsctrl::PoolIds::ERROR_QUAT, &errQuat); + localDataPoolMap.emplace(acsctrl::PoolIds::ERROR_ANG, &errAng); + poolManager.subscribeForRegularPeriodicPacket({ctrlValData.getSid(), false, 5.0}); + // Actuator CMD + localDataPoolMap.emplace(acsctrl::PoolIds::RW_TARGET_TORQUE, &rwTargetTorque); + localDataPoolMap.emplace(acsctrl::PoolIds::RW_TARGET_SPEED, &rwTargetSpeed); + localDataPoolMap.emplace(acsctrl::PoolIds::MTQ_TARGET_DIPOLE, &mtqTargetDipole); + poolManager.subscribeForRegularPeriodicPacket({actuatorCmdData.getSid(), false, 5.0}); + return returnvalue::OK; +} - ReturnValue_t AcsController::checkModeCommand(Mode_t mode, Submode_t submode, - uint32_t * msToReachTheMode) { - if (mode == MODE_OFF) { - if (submode == SUBMODE_NONE) { - return returnvalue::OK; - } else { - return INVALID_SUBMODE; - } - } else if ((mode == MODE_ON) || (mode == MODE_NORMAL)) { - if ((submode > 8) || (submode < 2)) { - return INVALID_SUBMODE; - } else { - return returnvalue::OK; - } - } - return INVALID_MODE; +LocalPoolDataSetBase* AcsController::getDataSetHandle(sid_t sid) { + switch (sid.ownerSetId) { + case acsctrl::MGM_SENSOR_DATA: + return &mgmDataRaw; + case acsctrl::MGM_PROCESSED_DATA: + return &mgmDataProcessed; + case acsctrl::SUS_SENSOR_DATA: + return &susDataRaw; + case acsctrl::SUS_PROCESSED_DATA: + return &susDataProcessed; + case acsctrl::GYR_SENSOR_DATA: + return &gyrDataRaw; + case acsctrl::GYR_PROCESSED_DATA: + return &gyrDataProcessed; + case acsctrl::GPS_PROCESSED_DATA: + return &gpsDataProcessed; + case acsctrl::MEKF_DATA: + return &mekfData; + case acsctrl::CTRL_VAL_DATA: + return &ctrlValData; + case acsctrl::ACTUATOR_CMD_DATA: + return &actuatorCmdData; + default: + return nullptr; } + return nullptr; +} - void AcsController::copyMgmData() { - ACS::SensorValues sensorValues; - { - PoolReadGuard pg(&sensorValues.mgm0Lis3Set); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(mgmDataRaw.mgm0Lis3.value, sensorValues.mgm0Lis3Set.fieldStrengths.value, - 3 * sizeof(float)); - mgmDataRaw.mgm0Lis3.setValid(sensorValues.mgm0Lis3Set.fieldStrengths.isValid()); - } +ReturnValue_t AcsController::checkModeCommand(Mode_t mode, Submode_t submode, + uint32_t* msToReachTheMode) { + if (mode == MODE_OFF) { + if (submode == SUBMODE_NONE) { + return returnvalue::OK; + } else { + return INVALID_SUBMODE; } - { - PoolReadGuard pg(&sensorValues.mgm1Rm3100Set); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(mgmDataRaw.mgm1Rm3100.value, sensorValues.mgm1Rm3100Set.fieldStrengths.value, - 3 * sizeof(float)); - mgmDataRaw.mgm1Rm3100.setValid(sensorValues.mgm1Rm3100Set.fieldStrengths.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.mgm2Lis3Set); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(mgmDataRaw.mgm2Lis3.value, sensorValues.mgm2Lis3Set.fieldStrengths.value, - 3 * sizeof(float)); - mgmDataRaw.mgm2Lis3.setValid(sensorValues.mgm2Lis3Set.fieldStrengths.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.mgm3Rm3100Set); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(mgmDataRaw.mgm3Rm3100.value, sensorValues.mgm3Rm3100Set.fieldStrengths.value, - 3 * sizeof(float)); - mgmDataRaw.mgm3Rm3100.setValid(sensorValues.mgm3Rm3100Set.fieldStrengths.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.imtqMgmSet); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(mgmDataRaw.imtqRaw.value, sensorValues.imtqMgmSet.mtmRawNt.value, - 3 * sizeof(float)); - mgmDataRaw.imtqRaw.setValid(sensorValues.imtqMgmSet.mtmRawNt.isValid()); - mgmDataRaw.actuationCalStatus.value = sensorValues.imtqMgmSet.coilActuationStatus.value; - mgmDataRaw.actuationCalStatus.setValid( - sensorValues.imtqMgmSet.coilActuationStatus.isValid()); - } + } else if ((mode == MODE_ON) || (mode == MODE_NORMAL)) { + if ((submode > 8) || (submode < 2)) { + return INVALID_SUBMODE; + } else { + return returnvalue::OK; } } + return INVALID_MODE; +} - void AcsController::copySusData() { - ACS::SensorValues sensorValues; - { - PoolReadGuard pg(&sensorValues.susSets[0]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus0.value, sensorValues.susSets[0].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus0.setValid(sensorValues.susSets[0].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[1]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus1.value, sensorValues.susSets[1].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus1.setValid(sensorValues.susSets[1].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[2]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus2.value, sensorValues.susSets[2].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus2.setValid(sensorValues.susSets[2].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[3]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus3.value, sensorValues.susSets[3].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus3.setValid(sensorValues.susSets[3].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[4]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus4.value, sensorValues.susSets[4].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus4.setValid(sensorValues.susSets[4].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[5]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus5.value, sensorValues.susSets[5].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus5.setValid(sensorValues.susSets[5].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[6]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus6.value, sensorValues.susSets[6].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus6.setValid(sensorValues.susSets[6].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[7]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus7.value, sensorValues.susSets[7].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus7.setValid(sensorValues.susSets[7].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[8]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus8.value, sensorValues.susSets[8].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus8.setValid(sensorValues.susSets[8].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[9]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus9.value, sensorValues.susSets[9].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus9.setValid(sensorValues.susSets[9].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[10]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus10.value, sensorValues.susSets[10].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus10.setValid(sensorValues.susSets[10].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[11]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus11.value, sensorValues.susSets[11].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus11.setValid(sensorValues.susSets[11].channels.isValid()); - } +void AcsController::copyMgmData() { + ACS::SensorValues sensorValues; + { + PoolReadGuard pg(&sensorValues.mgm0Lis3Set); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(mgmDataRaw.mgm0Lis3.value, sensorValues.mgm0Lis3Set.fieldStrengths.value, + 3 * sizeof(float)); + mgmDataRaw.mgm0Lis3.setValid(sensorValues.mgm0Lis3Set.fieldStrengths.isValid()); } } + { + PoolReadGuard pg(&sensorValues.mgm1Rm3100Set); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(mgmDataRaw.mgm1Rm3100.value, sensorValues.mgm1Rm3100Set.fieldStrengths.value, + 3 * sizeof(float)); + mgmDataRaw.mgm1Rm3100.setValid(sensorValues.mgm1Rm3100Set.fieldStrengths.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.mgm2Lis3Set); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(mgmDataRaw.mgm2Lis3.value, sensorValues.mgm2Lis3Set.fieldStrengths.value, + 3 * sizeof(float)); + mgmDataRaw.mgm2Lis3.setValid(sensorValues.mgm2Lis3Set.fieldStrengths.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.mgm3Rm3100Set); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(mgmDataRaw.mgm3Rm3100.value, sensorValues.mgm3Rm3100Set.fieldStrengths.value, + 3 * sizeof(float)); + mgmDataRaw.mgm3Rm3100.setValid(sensorValues.mgm3Rm3100Set.fieldStrengths.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.imtqMgmSet); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(mgmDataRaw.imtqRaw.value, sensorValues.imtqMgmSet.mtmRawNt.value, + 3 * sizeof(float)); + mgmDataRaw.imtqRaw.setValid(sensorValues.imtqMgmSet.mtmRawNt.isValid()); + mgmDataRaw.actuationCalStatus.value = sensorValues.imtqMgmSet.coilActuationStatus.value; + mgmDataRaw.actuationCalStatus.setValid(sensorValues.imtqMgmSet.coilActuationStatus.isValid()); + } + } +} - void AcsController::copyGyrData() { - ACS::SensorValues sensorValues; - { - PoolReadGuard pg(&sensorValues.gyr0AdisSet); - if (pg.getReadResult() == returnvalue::OK) { - gyrDataRaw.gyr0Adis.value[0] = sensorValues.gyr0AdisSet.angVelocX.value; - gyrDataRaw.gyr0Adis.value[1] = sensorValues.gyr0AdisSet.angVelocY.value; - gyrDataRaw.gyr0Adis.value[2] = sensorValues.gyr0AdisSet.angVelocZ.value; - gyrDataRaw.gyr0Adis.setValid(sensorValues.gyr0AdisSet.angVelocX.isValid() && - sensorValues.gyr0AdisSet.angVelocY.isValid() && - sensorValues.gyr0AdisSet.angVelocZ.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.gyr1L3gSet); - if (pg.getReadResult() == returnvalue::OK) { - gyrDataRaw.gyr1L3.value[0] = sensorValues.gyr1L3gSet.angVelocX.value; - gyrDataRaw.gyr1L3.value[1] = sensorValues.gyr1L3gSet.angVelocY.value; - gyrDataRaw.gyr1L3.value[2] = sensorValues.gyr1L3gSet.angVelocZ.value; - gyrDataRaw.gyr1L3.setValid(sensorValues.gyr1L3gSet.angVelocX.isValid() && - sensorValues.gyr1L3gSet.angVelocY.isValid() && - sensorValues.gyr1L3gSet.angVelocZ.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.gyr2AdisSet); - if (pg.getReadResult() == returnvalue::OK) { - gyrDataRaw.gyr2Adis.value[0] = sensorValues.gyr2AdisSet.angVelocX.value; - gyrDataRaw.gyr2Adis.value[1] = sensorValues.gyr2AdisSet.angVelocY.value; - gyrDataRaw.gyr2Adis.value[2] = sensorValues.gyr2AdisSet.angVelocZ.value; - gyrDataRaw.gyr2Adis.setValid(sensorValues.gyr2AdisSet.angVelocX.isValid() && - sensorValues.gyr2AdisSet.angVelocY.isValid() && - sensorValues.gyr2AdisSet.angVelocZ.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.gyr3L3gSet); - if (pg.getReadResult() == returnvalue::OK) { - gyrDataRaw.gyr3L3.value[0] = sensorValues.gyr3L3gSet.angVelocX.value; - gyrDataRaw.gyr3L3.value[1] = sensorValues.gyr3L3gSet.angVelocY.value; - gyrDataRaw.gyr3L3.value[2] = sensorValues.gyr3L3gSet.angVelocZ.value; - gyrDataRaw.gyr3L3.setValid(sensorValues.gyr3L3gSet.angVelocX.isValid() && - sensorValues.gyr3L3gSet.angVelocY.isValid() && - sensorValues.gyr3L3gSet.angVelocZ.isValid()); - } +void AcsController::copySusData() { + ACS::SensorValues sensorValues; + { + PoolReadGuard pg(&sensorValues.susSets[0]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus0.value, sensorValues.susSets[0].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus0.setValid(sensorValues.susSets[0].channels.isValid()); } } + { + PoolReadGuard pg(&sensorValues.susSets[1]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus1.value, sensorValues.susSets[1].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus1.setValid(sensorValues.susSets[1].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[2]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus2.value, sensorValues.susSets[2].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus2.setValid(sensorValues.susSets[2].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[3]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus3.value, sensorValues.susSets[3].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus3.setValid(sensorValues.susSets[3].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[4]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus4.value, sensorValues.susSets[4].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus4.setValid(sensorValues.susSets[4].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[5]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus5.value, sensorValues.susSets[5].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus5.setValid(sensorValues.susSets[5].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[6]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus6.value, sensorValues.susSets[6].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus6.setValid(sensorValues.susSets[6].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[7]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus7.value, sensorValues.susSets[7].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus7.setValid(sensorValues.susSets[7].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[8]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus8.value, sensorValues.susSets[8].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus8.setValid(sensorValues.susSets[8].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[9]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus9.value, sensorValues.susSets[9].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus9.setValid(sensorValues.susSets[9].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[10]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus10.value, sensorValues.susSets[10].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus10.setValid(sensorValues.susSets[10].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[11]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus11.value, sensorValues.susSets[11].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus11.setValid(sensorValues.susSets[11].channels.isValid()); + } + } +} + +void AcsController::copyGyrData() { + ACS::SensorValues sensorValues; + { + PoolReadGuard pg(&sensorValues.gyr0AdisSet); + if (pg.getReadResult() == returnvalue::OK) { + gyrDataRaw.gyr0Adis.value[0] = sensorValues.gyr0AdisSet.angVelocX.value; + gyrDataRaw.gyr0Adis.value[1] = sensorValues.gyr0AdisSet.angVelocY.value; + gyrDataRaw.gyr0Adis.value[2] = sensorValues.gyr0AdisSet.angVelocZ.value; + gyrDataRaw.gyr0Adis.setValid(sensorValues.gyr0AdisSet.angVelocX.isValid() && + sensorValues.gyr0AdisSet.angVelocY.isValid() && + sensorValues.gyr0AdisSet.angVelocZ.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.gyr1L3gSet); + if (pg.getReadResult() == returnvalue::OK) { + gyrDataRaw.gyr1L3.value[0] = sensorValues.gyr1L3gSet.angVelocX.value; + gyrDataRaw.gyr1L3.value[1] = sensorValues.gyr1L3gSet.angVelocY.value; + gyrDataRaw.gyr1L3.value[2] = sensorValues.gyr1L3gSet.angVelocZ.value; + gyrDataRaw.gyr1L3.setValid(sensorValues.gyr1L3gSet.angVelocX.isValid() && + sensorValues.gyr1L3gSet.angVelocY.isValid() && + sensorValues.gyr1L3gSet.angVelocZ.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.gyr2AdisSet); + if (pg.getReadResult() == returnvalue::OK) { + gyrDataRaw.gyr2Adis.value[0] = sensorValues.gyr2AdisSet.angVelocX.value; + gyrDataRaw.gyr2Adis.value[1] = sensorValues.gyr2AdisSet.angVelocY.value; + gyrDataRaw.gyr2Adis.value[2] = sensorValues.gyr2AdisSet.angVelocZ.value; + gyrDataRaw.gyr2Adis.setValid(sensorValues.gyr2AdisSet.angVelocX.isValid() && + sensorValues.gyr2AdisSet.angVelocY.isValid() && + sensorValues.gyr2AdisSet.angVelocZ.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.gyr3L3gSet); + if (pg.getReadResult() == returnvalue::OK) { + gyrDataRaw.gyr3L3.value[0] = sensorValues.gyr3L3gSet.angVelocX.value; + gyrDataRaw.gyr3L3.value[1] = sensorValues.gyr3L3gSet.angVelocY.value; + gyrDataRaw.gyr3L3.value[2] = sensorValues.gyr3L3gSet.angVelocZ.value; + gyrDataRaw.gyr3L3.setValid(sensorValues.gyr3L3gSet.angVelocX.isValid() && + sensorValues.gyr3L3gSet.angVelocY.isValid() && + sensorValues.gyr3L3gSet.angVelocZ.isValid()); + } + } +} From 42b570a274da402154681e218b8491da49089ca4 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Mon, 16 Jan 2023 17:53:02 +0100 Subject: [PATCH 093/330] comments --- fsfw | 2 +- mission/controller/ThermalController.cpp | 2 +- mission/controller/ThermalController.h | 2 +- tmtc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fsfw b/fsfw index accaf855..05cad893 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit accaf855ee53d3dc429d7bcdf1b7b89768c166b6 +Subproject commit 05cad893a2b713827cf4cdc9afe49675f18afcc7 diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 5857bc17..e0e9b3bd 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -1130,7 +1130,7 @@ void ThermalController::ctrlHeater(heater::Switchers switchNr, heater::Switchers struct TempLimits* tempLimit) { // Heater off if (not heaterHandler.checkSwitchState(switchNr)) { - // TODO: check if OP or NOP + // TODO: check if OP if (sensorTemp < (*tempLimit).opLowerLimit) { heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::ON); } diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 668095de..afffea90 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -160,7 +160,7 @@ class ThermalController : public ExtendedControllerBase { void ctrlComponentTemperature(heater::Switchers switchNr, heater::Switchers redSwitchNr, const lp_float_t& sensor1, const lp_float_t& sensor2, const lp_float_t& sensor3, TempLimits* tempLimit, - bool moreThan3Sensors = false); + bool moreThan3Sensors = false); //TODO sensor 4, 5 = default argument, if not available void ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, TempLimits* tempLimit); void chooseHeater(heater::Switchers& switchNr, heater::Switchers redSwitchNr); void chooseSensor(heater::Switchers switchNr, const lp_float_t& sensor1, diff --git a/tmtc b/tmtc index d652c466..56d0f26c 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit d652c4663b6e738345799026a16d6d2f00d7e65d +Subproject commit 56d0f26cbffbfbf4e790d3a19858162291104934 From 9c4b2872e336c2ee91c65f81b03f212d7d1957db Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Tue, 17 Jan 2023 11:50:52 +0100 Subject: [PATCH 094/330] fixed susVecTotDerivative valid flag --- mission/controller/acs/SensorProcessing.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/mission/controller/acs/SensorProcessing.cpp b/mission/controller/acs/SensorProcessing.cpp index dabe62ee..815b3a6b 100644 --- a/mission/controller/acs/SensorProcessing.cpp +++ b/mission/controller/acs/SensorProcessing.cpp @@ -397,6 +397,7 @@ void SensorProcessing::processSus( for (uint8_t i = 0; i < 3; i++) { susVecTotDerivative[i] = (susVecTot[i] - savedSusVecTot[i]) / timeDiff; savedSusVecTot[i] = susVecTot[i]; + susVecTotDerivativeValid = true; } } timeOfSavedSusDirEst = timeOfSusMeasurement; From 5e7a088da9f157b6da350a090ac3e28dd177629a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 17 Jan 2023 15:45:54 +0100 Subject: [PATCH 095/330] try to understand the thermal stuff --- bsp_q7s/core/ObjectFactory.cpp | 1 + bsp_q7s/obsw.cpp | 12 ++++++------ mission/controller/ThermalController.cpp | 7 ++++++- mission/controller/ThermalController.h | 10 ++++++---- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 31c027d1..d182caa2 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -914,6 +914,7 @@ void ObjectFactory::createImtqComponents(PowerSwitchIF* pwrSwitcher) { I2cCookie* imtqI2cCookie = new I2cCookie(addresses::IMTQ, IMTQ::MAX_REPLY_SIZE, q7s::I2C_PL_EIVE); auto imtqHandler = new ImtqHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie, pcdu::Switches::PDU1_CH3_MGT_5V); + imtqHandler->setThermalStateRequestPoolIds(); imtqHandler->setPowerSwitcher(pwrSwitcher); imtqHandler->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); static_cast(imtqHandler); diff --git a/bsp_q7s/obsw.cpp b/bsp_q7s/obsw.cpp index dd0c486b..91bad041 100644 --- a/bsp_q7s/obsw.cpp +++ b/bsp_q7s/obsw.cpp @@ -1,13 +1,13 @@ #include "obsw.h" +#include +#include +#include + #include #include #include -#include -#include -#include - #include "OBSWConfig.h" #include "commonConfig.h" #include "core/scheduling.h" @@ -44,8 +44,8 @@ int obsw::obsw() { const char* homedir = nullptr; homedir = getenv("HOME"); - if(homedir == nullptr) { - homedir = getpwuid(getuid())->pw_dir; + if (homedir == nullptr) { + homedir = getpwuid(getuid())->pw_dir; } std::filesystem::path bootDelayFile = std::filesystem::path(homedir) / "boot_delay_secs.txt"; // Init delay handling. diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index e0e9b3bd..a14f4f13 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -2,6 +2,8 @@ #include #include +#include +#include #include #include #include @@ -20,6 +22,7 @@ ThermalController::ThermalController(object_id_t objectId, HeaterHandler& heater sensorTemperatures(this), susTemperatures(this), deviceTemperatures(this), + imtqThermalSet(objects::IMTQ_HANDLER), max31865Set0(objects::RTD_0_IC3_PLOC_HEATSPREADER, EiveMax31855::RtdCommands::EXCHANGE_SET_ID), max31865Set1(objects::RTD_1_IC4_PLOC_MISSIONBOARD, @@ -990,6 +993,8 @@ void ThermalController::ctrlAcsBoard() { void ThermalController::ctrlMgt() { // TODO: cast deviceTemperatures.mgt + PoolReadGuard pg(&imtqThermalSet); + ThermalComponentIF::StateRequest heaterReq = imtqThermalSet.heaterRequest.value; // ctrlComponentTemperature(heater::HEATER_2_ACS_BRD, heater::HEATER_3_PCDU_PDU, // sensorTemperatures.sensor_magnettorquer, deviceTemperatures.mgt, // sensorTemperatures.sensor_plpcdu_heatspreader, &mgtLimits); @@ -1206,4 +1211,4 @@ void ThermalController::ctrlComponentTemperature(heater::Switchers switchNr, ctrlHeater(switchNr, redSwitchNr, tempLimit); } } -} \ No newline at end of file +} diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index afffea90..96f0c60a 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -73,6 +73,8 @@ class ThermalController : public ExtendedControllerBase { thermalControllerDefinitions::SusTemperatures susTemperatures; thermalControllerDefinitions::DeviceTemperatures deviceTemperatures; + DeviceHandlerThermalSet imtqThermalSet; + // Temperature Sensors MAX31865::PrimarySet max31865Set0; MAX31865::PrimarySet max31865Set1; @@ -157,10 +159,10 @@ class ThermalController : public ExtendedControllerBase { void copySus(); void copyDevices(); - void ctrlComponentTemperature(heater::Switchers switchNr, heater::Switchers redSwitchNr, - const lp_float_t& sensor1, const lp_float_t& sensor2, - const lp_float_t& sensor3, TempLimits* tempLimit, - bool moreThan3Sensors = false); //TODO sensor 4, 5 = default argument, if not available + void ctrlComponentTemperature( + heater::Switchers switchNr, heater::Switchers redSwitchNr, const lp_float_t& sensor1, + const lp_float_t& sensor2, const lp_float_t& sensor3, TempLimits* tempLimit, + bool moreThan3Sensors = false); // TODO sensor 4, 5 = default argument, if not available void ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, TempLimits* tempLimit); void chooseHeater(heater::Switchers& switchNr, heater::Switchers redSwitchNr); void chooseSensor(heater::Switchers switchNr, const lp_float_t& sensor1, From d447f4ba42d1fa3f17c2cbb2c0ac8ea56e3afdfb Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 17 Jan 2023 15:55:36 +0100 Subject: [PATCH 096/330] now it compiles --- common/config/eive/eventSubsystemIds.h | 1 + mission/controller/ThermalController.cpp | 5 +++-- mission/controller/ThermalController.h | 9 +++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/common/config/eive/eventSubsystemIds.h b/common/config/eive/eventSubsystemIds.h index 8785f599..29afe97e 100644 --- a/common/config/eive/eventSubsystemIds.h +++ b/common/config/eive/eventSubsystemIds.h @@ -35,6 +35,7 @@ enum : uint8_t { SYRLINKS = 137, SCEX_HANDLER = 138, CONFIGHANDLER = 139, + TCS_CONTROLLER = 140, COMMON_SUBSYSTEM_ID_END }; diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index a14f4f13..0861c08a 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -994,7 +994,8 @@ void ThermalController::ctrlAcsBoard() { void ThermalController::ctrlMgt() { // TODO: cast deviceTemperatures.mgt PoolReadGuard pg(&imtqThermalSet); - ThermalComponentIF::StateRequest heaterReq = imtqThermalSet.heaterRequest.value; + ThermalComponentIF::StateRequest heaterReq = + static_cast(imtqThermalSet.heaterRequest.value); // ctrlComponentTemperature(heater::HEATER_2_ACS_BRD, heater::HEATER_3_PCDU_PDU, // sensorTemperatures.sensor_magnettorquer, deviceTemperatures.mgt, // sensorTemperatures.sensor_plpcdu_heatspreader, &mgtLimits); @@ -1162,7 +1163,7 @@ void ThermalController::chooseHeater(heater::Switchers& switchNr, heater::Switch redSwitchNrInUse = true; } else { heaterAvailable = false; - // TODO: triggerEvent(NO_HEALTHY_HEATER_AVAILABLE, switchNr, redSwitchNr); + triggerEvent(NO_HEALTHY_HEATER_AVAILABLE, switchNr, redSwitchNr); sif::error << "ThermalController::chooseSensor: Both heater: " << switchNr << " + " << redSwitchNr << " not healthy" << std::endl; } diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 96f0c60a..c97b3fdc 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -2,6 +2,7 @@ #define MISSION_CONTROLLER_THERMALCONTROLLER_H_ #include +#include #include #include #include @@ -54,9 +55,9 @@ class ThermalController : public ExtendedControllerBase { uint32_t* msToReachTheMode) override; private: - static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::HEATER_HANDLER; - static constexpr Event NO_VALID_SENSOR_TEMPERATURE = MAKE_EVENT(8, severity::MEDIUM); - static constexpr Event NO_HEALTHY_HEATER_AVAILABLE = MAKE_EVENT(9, severity::MEDIUM); + static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::TCS_CONTROLLER; + static constexpr Event NO_VALID_SENSOR_TEMPERATURE = MAKE_EVENT(0, severity::MEDIUM); + static constexpr Event NO_HEALTHY_HEATER_AVAILABLE = MAKE_EVENT(1, severity::MEDIUM); static const uint32_t DELAY = 500; @@ -139,7 +140,7 @@ class ThermalController : public ExtendedControllerBase { TempLimits mpaLimits = TempLimits(-40.0, -30.0, -75.0, 80.0, 90.0); TempLimits scexBoardLimits = TempLimits(-60.0, -40.0, 80.0, 85.0, 150.0); - static float sensorTemp; + float sensorTemp = 0.0; bool sensorTempAvailable = true; bool heaterAvailable = true; bool redSwitchNrInUse = false; From 58f1c93de5fd8167f27a346c932f1c6952c653c8 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 17 Jan 2023 16:16:59 +0100 Subject: [PATCH 097/330] add some stuff --- dummies/DummyHeaterHandler.cpp | 4 ---- dummies/DummyHeaterHandler.h | 13 ------------- dummies/Max31865Dummy.cpp | 5 +++++ dummies/Max31865Dummy.h | 1 + dummies/TemperatureSensorInserter.cpp | 14 ++++++++------ dummies/TemperatureSensorInserter.h | 11 +++++++---- dummies/helpers.cpp | 5 ++++- 7 files changed, 25 insertions(+), 28 deletions(-) delete mode 100644 dummies/DummyHeaterHandler.cpp delete mode 100644 dummies/DummyHeaterHandler.h diff --git a/dummies/DummyHeaterHandler.cpp b/dummies/DummyHeaterHandler.cpp deleted file mode 100644 index 59c49bde..00000000 --- a/dummies/DummyHeaterHandler.cpp +++ /dev/null @@ -1,4 +0,0 @@ -// -// Created by irini on 24.11.22. -// -#include "DummyHeaterHandler.h" diff --git a/dummies/DummyHeaterHandler.h b/dummies/DummyHeaterHandler.h deleted file mode 100644 index 8fb1e80b..00000000 --- a/dummies/DummyHeaterHandler.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// Created by irini on 24.11.22. -// - -#ifndef EIVE_OBSW_DUMMYHEATERHANDLER_H -#define EIVE_OBSW_DUMMYHEATERHANDLER_H - -#include "mission/devices/HeaterHandler.h" -class DummyHeaterHandler : public HeaterHandler { - public: - // DummyHeaterHandler(); -}; -#endif // EIVE_OBSW_DUMMYHEATERHANDLER_H diff --git a/dummies/Max31865Dummy.cpp b/dummies/Max31865Dummy.cpp index 5cbd1dec..687620ba 100644 --- a/dummies/Max31865Dummy.cpp +++ b/dummies/Max31865Dummy.cpp @@ -34,6 +34,11 @@ ReturnValue_t Max31865Dummy::initializeLocalDataPool(localpool::DataPool &localD localDataPoolMap.emplace(static_cast(PoolIds::FAULT_BYTE), new PoolEntry({0})); return OK; } + +void Max31865Dummy::setTemperature(float temperature) { + set.temperatureCelcius.value = temperature; +} + LocalPoolDataSetBase *Max31865Dummy::getDataSetHandle(sid_t sid) { return &set; } Max31865Dummy::Max31865Dummy(object_id_t objectId, CookieIF *cookie) : DeviceHandlerBase(objectId, objects::DUMMY_COM_IF, cookie), diff --git a/dummies/Max31865Dummy.h b/dummies/Max31865Dummy.h index 011296d6..58655870 100644 --- a/dummies/Max31865Dummy.h +++ b/dummies/Max31865Dummy.h @@ -9,6 +9,7 @@ class Max31865Dummy : public DeviceHandlerBase { Max31865Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie); Max31865Dummy(object_id_t objectId, CookieIF *comCookie); + void setTemperature(float temperature); private: MAX31865::PrimarySet set; diff --git a/dummies/TemperatureSensorInserter.cpp b/dummies/TemperatureSensorInserter.cpp index 314f7496..028f95ee 100644 --- a/dummies/TemperatureSensorInserter.cpp +++ b/dummies/TemperatureSensorInserter.cpp @@ -6,14 +6,14 @@ #include TemperatureSensorInserter::TemperatureSensorInserter(object_id_t objectId) - : SystemObject(objects::THERMAL_TEMP_INSERTER), - max31865PlocHeatspreaderSet(objects::RTD_0_IC3_PLOC_HEATSPREADER, MAX31865::MAX31865_SET_ID), - max31865PlocMissionboardSet(objects::RTD_1_IC4_PLOC_MISSIONBOARD, MAX31865::MAX31865_SET_ID) { -} + : SystemObject(objects::THERMAL_TEMP_INSERTER) {} ReturnValue_t TemperatureSensorInserter::initialize() { - max31865PlocHeatspreaderSet.temperatureCelcius = 20.0; - max31865PlocMissionboardSet.temperatureCelcius = 20.0; + if (performTest) { + if(testCase == TestCase::OVERCOOL_SYRLINKS) { + + } + } return returnvalue::OK; } @@ -21,6 +21,7 @@ ReturnValue_t TemperatureSensorInserter::performOperation(uint8_t opCode) { iteration++; value = sin(iteration / 80. * M_PI) * 10; + /* ReturnValue_t result = max31865PlocHeatspreaderSet.read(); if (result != returnvalue::OK) { sif::warning << "Failed to read temperature from MAX31865 dataset" << std::endl; @@ -33,5 +34,6 @@ ReturnValue_t TemperatureSensorInserter::performOperation(uint8_t opCode) { max31865PlocHeatspreaderSet.setValidity(true, true); } max31865PlocHeatspreaderSet.commit(); + */ return returnvalue::OK; } diff --git a/dummies/TemperatureSensorInserter.h b/dummies/TemperatureSensorInserter.h index 8c87176d..38604b6d 100644 --- a/dummies/TemperatureSensorInserter.h +++ b/dummies/TemperatureSensorInserter.h @@ -13,10 +13,13 @@ class TemperatureSensorInserter : public ExecutableObjectIF, public SystemObject ReturnValue_t performOperation(uint8_t opCode) override; private: - int iteration = 0; - float value = 0; - MAX31865::PrimarySet max31865PlocHeatspreaderSet; - MAX31865::PrimarySet max31865PlocMissionboardSet; + enum TestCase { + OVERCOOL_SYRLINKS = 0 + }; + int iteration = 0; + bool performTest = false; + float value = 0; + TestCase testCase; // void noise(); }; diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index a9e34e2f..470f6b29 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -82,7 +82,9 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) { } if (cfg.addTempSensorDummies) { - new Max31865Dummy(objects::RTD_0_IC3_PLOC_HEATSPREADER, objects::DUMMY_COM_IF, comCookieDummy); + + std::map tempSensorDummies; + tempSensorDummies.emplace(objects::RTD_0_IC3_PLOC_HEATSPREADER, new Max31865Dummy(objects::RTD_0_IC3_PLOC_HEATSPREADER, objects::DUMMY_COM_IF, comCookieDummy)); new Max31865Dummy(objects::RTD_1_IC4_PLOC_MISSIONBOARD, objects::DUMMY_COM_IF, comCookieDummy); new Max31865Dummy(objects::RTD_2_IC5_4K_CAMERA, objects::DUMMY_COM_IF, comCookieDummy); new Max31865Dummy(objects::RTD_3_IC6_DAC_HEATSPREADER, objects::DUMMY_COM_IF, comCookieDummy); @@ -104,6 +106,7 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) { new Tmp1075Dummy(objects::TMP1075_HANDLER_PLPCDU_0, objects::DUMMY_COM_IF, comCookieDummy); new Tmp1075Dummy(objects::TMP1075_HANDLER_PLPCDU_1, objects::DUMMY_COM_IF, comCookieDummy); new Tmp1075Dummy(objects::TMP1075_HANDLER_IF_BOARD, objects::DUMMY_COM_IF, comCookieDummy); + new TemperatureSensorInserter(objects::THERMAL_TEMP_INSERTER); } new CamSwitcher(objects::CAM_SWITCHER, pwrSwitch, power::NO_SWITCH); From 44b384cd17d20be0d1168d26905e5a0ffc9a761c Mon Sep 17 00:00:00 2001 From: Robin Marquardt Date: Tue, 17 Jan 2023 20:11:45 +0100 Subject: [PATCH 098/330] access to different paramset for every pointing mode --- mission/controller/AcsController.cpp | 89 +++++++++++++++++----- mission/controller/acs/control/PtgCtrl.cpp | 8 +- mission/controller/acs/control/PtgCtrl.h | 11 ++- 3 files changed, 76 insertions(+), 32 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index dee2fb73..f829c3e3 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -271,53 +271,106 @@ void AcsController::performControlOperation() { double targetQuat[4] = {0, 0, 0, 0}, refSatRate[3] = {0, 0, 0}; double quatRef[4] = {0, 0, 0, 0}; uint8_t enableAntiStiction = true; + + double quatErrorComplete[4] = {0, 0, 0, 0}, quatError[3] = {0, 0, 0}, + deltaRate[3] = {0, 0, 0}; // ToDo: check if pointer needed + double rwPseudoInv[4][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + guidance.getDistributionMatrixRw(&sensorValues, *rwPseudoInv); + double torquePtgRws[4] = {0, 0, 0, 0}, rwTrqNs[4] = {0, 0, 0, 0}; + double torqueRws[4] = {0, 0, 0, 0}, torqueRwsScaled[4] = {0, 0, 0, 0}; + double mgtDpDes[3] = {0, 0, 0}, dipolUnits[3] = {0, 0, 0}; // Desaturation Dipol + switch (submode) { case SUBMODE_IDLE: guidance.sunQuatPtg(&sensorValues, &mekfData, &susDataProcessed, &gpsDataProcessed, now, targetQuat, refSatRate); std::memcpy(quatRef, acsParameters.targetModeControllerParameters.quatRef, 4 * sizeof(double)); enableAntiStiction = acsParameters.targetModeControllerParameters.enableAntiStiction; + guidance.comparePtg(targetQuat, &mekfData, quatRef, refSatRate, quatErrorComplete, quatError, deltaRate); + ptgCtrl.ptgLaw(&acsParameters.targetModeControllerParameters, quatError, deltaRate, *rwPseudoInv, torquePtgRws); + ptgCtrl.ptgNullspace(&acsParameters.targetModeControllerParameters, + &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), + &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), rwTrqNs); + VectorOperations::add(torquePtgRws, rwTrqNs, torqueRws, 4); + actuatorCmd.scalingTorqueRws(torqueRws, torqueRwsScaled); + ptgCtrl.ptgDesaturation(&acsParameters.targetModeControllerParameters, mgmDataProcessed.mgmVecTot.value, + mgmDataProcessed.mgmVecTot.isValid(), mekfData.satRotRateMekf.value, + &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), + &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), mgtDpDes); break; + case SUBMODE_PTG_TARGET: guidance.targetQuatPtgThreeAxes(&sensorValues, &gpsDataProcessed, &mekfData, now, targetQuat, refSatRate); std::memcpy(quatRef, acsParameters.targetModeControllerParameters.quatRef, 4 * sizeof(double)); enableAntiStiction = acsParameters.targetModeControllerParameters.enableAntiStiction; - + guidance.comparePtg(targetQuat, &mekfData, quatRef, refSatRate, quatErrorComplete, quatError, deltaRate); + ptgCtrl.ptgLaw(&acsParameters.targetModeControllerParameters, quatError, deltaRate, *rwPseudoInv, torquePtgRws); + ptgCtrl.ptgNullspace(&acsParameters.targetModeControllerParameters, + &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), + &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), rwTrqNs); + VectorOperations::add(torquePtgRws, rwTrqNs, torqueRws, 4); + actuatorCmd.scalingTorqueRws(torqueRws, torqueRwsScaled); + ptgCtrl.ptgDesaturation(&acsParameters.targetModeControllerParameters, mgmDataProcessed.mgmVecTot.value, + mgmDataProcessed.mgmVecTot.isValid(), mekfData.satRotRateMekf.value, + &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), + &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), mgtDpDes); break; + case SUBMODE_PTG_TARGET_GS: guidance.targetQuatPtgGs(&sensorValues, &mekfData, &susDataProcessed, &gpsDataProcessed, now, targetQuat, refSatRate); std::memcpy(quatRef, acsParameters.targetModeControllerParameters.quatRef, 4 * sizeof(double)); enableAntiStiction = acsParameters.targetModeControllerParameters.enableAntiStiction; + guidance.comparePtg(targetQuat, &mekfData, quatRef, refSatRate, quatErrorComplete, quatError, deltaRate); + ptgCtrl.ptgLaw(&acsParameters.targetModeControllerParameters, quatError, deltaRate, *rwPseudoInv, torquePtgRws); + ptgCtrl.ptgNullspace(&acsParameters.targetModeControllerParameters, + &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), + &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), rwTrqNs); + VectorOperations::add(torquePtgRws, rwTrqNs, torqueRws, 4); + actuatorCmd.scalingTorqueRws(torqueRws, torqueRwsScaled); + ptgCtrl.ptgDesaturation(&acsParameters.targetModeControllerParameters, mgmDataProcessed.mgmVecTot.value, + mgmDataProcessed.mgmVecTot.isValid(), mekfData.satRotRateMekf.value, + &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), + &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), mgtDpDes); break; + case SUBMODE_PTG_NADIR: guidance.quatNadirPtgThreeAxes(&sensorValues, &gpsDataProcessed, &mekfData, now, targetQuat, refSatRate); std::memcpy(quatRef, acsParameters.nadirModeControllerParameters.quatRef, 4 * sizeof(double)); enableAntiStiction = acsParameters.nadirModeControllerParameters.enableAntiStiction; + guidance.comparePtg(targetQuat, &mekfData, quatRef, refSatRate, quatErrorComplete, quatError, deltaRate); + ptgCtrl.ptgLaw(&acsParameters.nadirModeControllerParameters, quatError, deltaRate, *rwPseudoInv, torquePtgRws); + ptgCtrl.ptgNullspace(&acsParameters.nadirModeControllerParameters, + &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), + &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), rwTrqNs); + VectorOperations::add(torquePtgRws, rwTrqNs, torqueRws, 4); + actuatorCmd.scalingTorqueRws(torqueRws, torqueRwsScaled); + ptgCtrl.ptgDesaturation(&acsParameters.nadirModeControllerParameters, mgmDataProcessed.mgmVecTot.value, + mgmDataProcessed.mgmVecTot.isValid(), mekfData.satRotRateMekf.value, + &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), + &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), mgtDpDes); break; + case SUBMODE_PTG_INERTIAL: guidance.inertialQuatPtg(targetQuat, refSatRate); std::memcpy(quatRef, acsParameters.inertialModeControllerParameters.quatRef, 4 * sizeof(double)); enableAntiStiction = acsParameters.inertialModeControllerParameters.enableAntiStiction; + guidance.comparePtg(targetQuat, &mekfData, quatRef, refSatRate, quatErrorComplete, quatError, deltaRate); + ptgCtrl.ptgLaw(&acsParameters.inertialModeControllerParameters, quatError, deltaRate, *rwPseudoInv, torquePtgRws); + ptgCtrl.ptgNullspace(&acsParameters.inertialModeControllerParameters, + &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), + &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), rwTrqNs); + VectorOperations::add(torquePtgRws, rwTrqNs, torqueRws, 4); + actuatorCmd.scalingTorqueRws(torqueRws, torqueRwsScaled); + ptgCtrl.ptgDesaturation(&acsParameters.inertialModeControllerParameters, mgmDataProcessed.mgmVecTot.value, + mgmDataProcessed.mgmVecTot.isValid(), mekfData.satRotRateMekf.value, + &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), + &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), mgtDpDes); break; } - double quatErrorComplete[4] = {0, 0, 0, 0}, quatError[3] = {0, 0, 0}, - deltaRate[3] = {0, 0, 0}; // ToDo: check if pointer needed - guidance.comparePtg(targetQuat, &mekfData, quatRef, refSatRate, quatErrorComplete, quatError, deltaRate); - double rwPseudoInv[4][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; - guidance.getDistributionMatrixRw(&sensorValues, *rwPseudoInv); - double torquePtgRws[4] = {0, 0, 0, 0}, mode = 0; - ptgCtrl.ptgLaw(mode, quatError, deltaRate, *rwPseudoInv, torquePtgRws); - double rwTrqNs[4] = {0, 0, 0, 0}; - ptgCtrl.ptgNullspace( - &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), - &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), rwTrqNs); - double torqueRws[4] = {0, 0, 0, 0}, torqueRwsScaled[4] = {0, 0, 0, 0}; - VectorOperations::add(torquePtgRws, rwTrqNs, torqueRws, 4); - actuatorCmd.scalingTorqueRws(torqueRws, torqueRwsScaled); if ( enableAntiStiction ) { bool rwAvailable[4] = {true, true, true, true}; // WHICH INPUT SENSOR SET? @@ -333,12 +386,6 @@ void AcsController::performControlOperation() { &(sensorValues.rw2Set.currSpeed.value), &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), torqueRwsScaled, cmdSpeedRws); - double mgtDpDes[3] = {0, 0, 0}, dipolUnits[3] = {0, 0, 0}; // Desaturation Dipol - ptgCtrl.ptgDesaturation(mgmDataProcessed.mgmVecTot.value, mgmDataProcessed.mgmVecTot.isValid(), - mekfData.satRotRateMekf.value, &(sensorValues.rw1Set.currSpeed.value), - &(sensorValues.rw2Set.currSpeed.value), - &(sensorValues.rw3Set.currSpeed.value), - &(sensorValues.rw4Set.currSpeed.value), mgtDpDes); actuatorCmd.cmdDipolMtq(mgtDpDes, dipolUnits); int16_t cmdDipolUnitsInt[3] = {0, 0, 0}; diff --git a/mission/controller/acs/control/PtgCtrl.cpp b/mission/controller/acs/control/PtgCtrl.cpp index 53544b8c..6d41e85d 100644 --- a/mission/controller/acs/control/PtgCtrl.cpp +++ b/mission/controller/acs/control/PtgCtrl.cpp @@ -21,14 +21,12 @@ PtgCtrl::PtgCtrl(AcsParameters *acsParameters_) { loadAcsParameters(acsParameter PtgCtrl::~PtgCtrl() {} void PtgCtrl::loadAcsParameters(AcsParameters *acsParameters_) { - // TODO: Here correct Parameters have to be loaded according to current submode - pointingLawParameters = &(acsParameters_->targetModeControllerParameters); inertiaEIVE = &(acsParameters_->inertiaEIVE); rwHandlingParameters = &(acsParameters_->rwHandlingParameters); rwMatrices = &(acsParameters_->rwMatrices); } -void PtgCtrl::ptgLaw(const double mode, const double *qError, const double *deltaRate, +void PtgCtrl::ptgLaw(AcsParameters::PointingLawParameters * pointingLawParameters, const double *qError, const double *deltaRate, const double *rwPseudoInv, double *torqueRws) { //------------------------------------------------------------------------------------------------ // Compute gain matrix K and P matrix @@ -108,7 +106,7 @@ void PtgCtrl::ptgLaw(const double mode, const double *qError, const double *delt VectorOperations::mulScalar(torqueRws, -1, torqueRws, 4); } -void PtgCtrl::ptgDesaturation(double *magFieldEst, bool magFieldEstValid, double *satRate, +void PtgCtrl::ptgDesaturation(AcsParameters::PointingLawParameters * pointingLawParameters, double *magFieldEst, bool magFieldEstValid, double *satRate, int32_t *speedRw0, int32_t *speedRw1, int32_t *speedRw2, int32_t *speedRw3, double *mgtDpDes) { if (!(magFieldEstValid) || !(pointingLawParameters->desatOn)) { @@ -139,7 +137,7 @@ void PtgCtrl::ptgDesaturation(double *magFieldEst, bool magFieldEstValid, double VectorOperations::mulScalar(crossMomentumMagField, factor, mgtDpDes, 3); } -void PtgCtrl::ptgNullspace(const int32_t *speedRw0, const int32_t *speedRw1, +void PtgCtrl::ptgNullspace(AcsParameters::PointingLawParameters * pointingLawParameters, const int32_t *speedRw0, const int32_t *speedRw1, const int32_t *speedRw2, const int32_t *speedRw3, double *rwTrqNs) { double speedRws[4] = {(double)*speedRw0, (double)*speedRw1, (double)*speedRw2, (double)*speedRw3}; double wheelMomentum[4] = {0, 0, 0, 0}; diff --git a/mission/controller/acs/control/PtgCtrl.h b/mission/controller/acs/control/PtgCtrl.h index 85f13a7a..b036d180 100644 --- a/mission/controller/acs/control/PtgCtrl.h +++ b/mission/controller/acs/control/PtgCtrl.h @@ -41,14 +41,14 @@ class PtgCtrl { /* @brief: Calculates the needed torque for the pointing control mechanism * @param: acsParameters_ Pointer to object which defines the ACS configuration parameters */ - void ptgLaw(const double mode, const double *qError, const double *deltaRate, + void ptgLaw(AcsParameters::PointingLawParameters * pointingLawParameters, const double *qError, const double *deltaRate, const double *rwPseudoInv, double *torqueRws); - void ptgDesaturation(double *magFieldEst, bool magFieldEstValid, double *satRate, - int32_t *speedRw0, int32_t *speedRw1, int32_t *speedRw2, int32_t *speedRw3, - double *mgtDpDes); + void ptgDesaturation(AcsParameters::PointingLawParameters * pointingLawParameters, double *magFieldEst, + bool magFieldEstValid, double *satRate, int32_t *speedRw0, int32_t *speedRw1, + int32_t *speedRw2, int32_t *speedRw3, double *mgtDpDes); - void ptgNullspace(const int32_t *speedRw0, const int32_t *speedRw1, const int32_t *speedRw2, + void ptgNullspace(AcsParameters::PointingLawParameters * pointingLawParameters, const int32_t *speedRw0, const int32_t *speedRw1, const int32_t *speedRw2, const int32_t *speedRw3, double *rwTrqNs); /* @brief: Commands the stiction torque in case wheel speed is to low @@ -59,7 +59,6 @@ class PtgCtrl { void rwAntistiction(const bool *rwAvailable, const int32_t *omegaRw, double *torqueCommand); private: - AcsParameters::PointingLawParameters *pointingLawParameters; AcsParameters::RwHandlingParameters *rwHandlingParameters; AcsParameters::InertiaEIVE *inertiaEIVE; AcsParameters::RwMatrices *rwMatrices; From 19c8703e15d745f1d910d3d1c78e8235ed2cff17 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Wed, 18 Jan 2023 11:38:09 +0100 Subject: [PATCH 099/330] corrected to actual used devicedef for L3 gyt --- mission/controller/acs/SensorValues.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/controller/acs/SensorValues.h b/mission/controller/acs/SensorValues.h index ef897207..ec1795fc 100644 --- a/mission/controller/acs/SensorValues.h +++ b/mission/controller/acs/SensorValues.h @@ -1,12 +1,12 @@ #ifndef SENSORVALUES_H_ #define SENSORVALUES_H_ +#include "fsfw_hal/devicehandlers/GyroL3GD20Handler.h" #include "fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h" #include "fsfw_hal/devicehandlers/MgmRM3100Handler.h" #include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" #include "mission/devices/devicedefinitions/GPSDefinitions.h" #include "mission/devices/devicedefinitions/GyroADIS1650XDefinitions.h" -#include "mission/devices/devicedefinitions/GyroL3GD20Definitions.h" #include "mission/devices/devicedefinitions/RwDefinitions.h" #include "mission/devices/devicedefinitions/SusDefinitions.h" #include "mission/devices/devicedefinitions/imtqHandlerDefinitions.h" From 638573757b8f691960fafac9981d6db1fc3966dd Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Thu, 19 Jan 2023 11:39:59 +0100 Subject: [PATCH 100/330] swapped SUS0 and SUS6 in ObjectFactory --- bsp_q7s/fmObjectFactory.cpp | 2 +- linux/ObjectFactory.cpp | 17 +++++++++++++---- linux/ObjectFactory.h | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index 239b3639..44b53225 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -39,7 +39,7 @@ void ObjectFactory::produce(void* args) { createRadSensorComponent(gpioComIF, *stackHandler); #endif #if OBSW_ADD_SUN_SENSORS == 1 - createSunSensorComponents(gpioComIF, spiMainComIF, pwrSwitcher, q7s::SPI_DEFAULT_DEV); + createSunSensorComponents(gpioComIF, spiMainComIF, pwrSwitcher, q7s::SPI_DEFAULT_DEV, true); #endif #if OBSW_ADD_ACS_BOARD == 1 diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index e35d7e96..af968ddd 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -30,7 +30,8 @@ #include "mission/system/tree/payloadModeTree.h" void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiComIF, - PowerSwitchIF* pwrSwitcher, std::string spiDev) { + PowerSwitchIF* pwrSwitcher, std::string spiDev, + bool swap0And6) { using namespace gpio; GpioCookie* gpioCookieSus = new GpioCookie(); GpioCallback* susgpio = nullptr; @@ -77,7 +78,11 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo #if OBSW_ADD_SUN_SENSORS == 1 SusFdir* fdir = nullptr; std::array susHandlers = {}; - SpiCookie* spiCookie = new SpiCookie(addresses::SUS_0, gpioIds::CS_SUS_0, SUS::MAX_CMD_SIZE, + gpioId_t gpioId = gpioIds::CS_SUS_0; + if (swap0And6) { + gpioId = gpioIds::CS_SUS_6; + } + SpiCookie* spiCookie = new SpiCookie(addresses::SUS_0, gpioId, SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); susHandlers[0] = new SusHandler(objects::SUS_0_N_LOC_XFYFZM_PT_XF, 0, objects::SPI_MAIN_COM_IF, spiCookie); @@ -119,8 +124,12 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo fdir = new SusFdir(objects::SUS_5_N_LOC_XFYMZB_PT_ZB); susHandlers[5]->setCustomFdir(fdir); - spiCookie = new SpiCookie(addresses::SUS_6, gpioIds::CS_SUS_6, SUS::MAX_CMD_SIZE, - spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); + gpioId = gpioIds::CS_SUS_6; + if (swap0And6) { + gpioId = gpioIds::CS_SUS_0; + } + spiCookie = new SpiCookie(addresses::SUS_6, gpioId, SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, + spi::SUS_MAX1227_SPI_FREQ); susHandlers[6] = new SusHandler(objects::SUS_6_R_LOC_XFYBZM_PT_XF, 6, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_6_R_LOC_XFYBZM_PT_XF); diff --git a/linux/ObjectFactory.h b/linux/ObjectFactory.h index 3704e9bd..bdfa846f 100644 --- a/linux/ObjectFactory.h +++ b/linux/ObjectFactory.h @@ -19,7 +19,7 @@ class AcsController; namespace ObjectFactory { void createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiComIF, PowerSwitchIF* pwrSwitcher, - std::string spiDev); + std::string spiDev, bool swap0And6); void createRtdComponents(std::string spiDev, GpioIF* gpioComIF, PowerSwitchIF* pwrSwitcher, SpiComIF* comIF); From fdcd8e2800f41a026be456a1e183a1fc5d2d09e0 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Sat, 21 Jan 2023 16:51:32 +0100 Subject: [PATCH 101/330] tempSensorDummies map --- dummies/Max31865Dummy.cpp | 2 +- dummies/Max31865Dummy.h | 1 + dummies/TemperatureSensorInserter.cpp | 13 ++-- dummies/TemperatureSensorInserter.h | 16 +++-- dummies/helpers.cpp | 91 ++++++++++++++++++++------- 5 files changed, 88 insertions(+), 35 deletions(-) diff --git a/dummies/Max31865Dummy.cpp b/dummies/Max31865Dummy.cpp index 687620ba..43198bba 100644 --- a/dummies/Max31865Dummy.cpp +++ b/dummies/Max31865Dummy.cpp @@ -36,7 +36,7 @@ ReturnValue_t Max31865Dummy::initializeLocalDataPool(localpool::DataPool &localD } void Max31865Dummy::setTemperature(float temperature) { - set.temperatureCelcius.value = temperature; + set.temperatureCelcius.value = temperature; } LocalPoolDataSetBase *Max31865Dummy::getDataSetHandle(sid_t sid) { return &set; } diff --git a/dummies/Max31865Dummy.h b/dummies/Max31865Dummy.h index 58655870..79f4ddb4 100644 --- a/dummies/Max31865Dummy.h +++ b/dummies/Max31865Dummy.h @@ -10,6 +10,7 @@ class Max31865Dummy : public DeviceHandlerBase { Max31865Dummy(object_id_t objectId, CookieIF *comCookie); void setTemperature(float temperature); + private: MAX31865::PrimarySet set; diff --git a/dummies/TemperatureSensorInserter.cpp b/dummies/TemperatureSensorInserter.cpp index 028f95ee..791a1d51 100644 --- a/dummies/TemperatureSensorInserter.cpp +++ b/dummies/TemperatureSensorInserter.cpp @@ -5,14 +5,17 @@ #include #include -TemperatureSensorInserter::TemperatureSensorInserter(object_id_t objectId) - : SystemObject(objects::THERMAL_TEMP_INSERTER) {} +TemperatureSensorInserter::TemperatureSensorInserter( + object_id_t objectId, std::map tempSensorDummies_, + std::map tempTmpSensorDummies_) + : SystemObject(objects::THERMAL_TEMP_INSERTER), + tempSensorDummies(tempSensorDummies_), + tempTmpSensorDummies(tempTmpSensorDummies_) {} ReturnValue_t TemperatureSensorInserter::initialize() { if (performTest) { - if(testCase == TestCase::OVERCOOL_SYRLINKS) { - - } + if (testCase == TestCase::OVERCOOL_SYRLINKS) { + } } return returnvalue::OK; } diff --git a/dummies/TemperatureSensorInserter.h b/dummies/TemperatureSensorInserter.h index 38604b6d..18bac79c 100644 --- a/dummies/TemperatureSensorInserter.h +++ b/dummies/TemperatureSensorInserter.h @@ -3,9 +3,14 @@ #include #include +#include "Max31865Dummy.h" +#include "Tmp1075Dummy.h" + class TemperatureSensorInserter : public ExecutableObjectIF, public SystemObject { public: - explicit TemperatureSensorInserter(object_id_t objectId); + explicit TemperatureSensorInserter(object_id_t objectId, + std::map tempSensorDummies_, + std::map tempTmpSensorDummies_); ReturnValue_t initialize() override; @@ -13,13 +18,14 @@ class TemperatureSensorInserter : public ExecutableObjectIF, public SystemObject ReturnValue_t performOperation(uint8_t opCode) override; private: - - enum TestCase { - OVERCOOL_SYRLINKS = 0 - }; + enum TestCase { OVERCOOL_SYRLINKS = 0 }; int iteration = 0; bool performTest = false; float value = 0; TestCase testCase; + + std::map tempSensorDummies; + std::map tempTmpSensorDummies; + // void noise(); }; diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index 470f6b29..db57d5ff 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -82,32 +82,75 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) { } if (cfg.addTempSensorDummies) { - std::map tempSensorDummies; - tempSensorDummies.emplace(objects::RTD_0_IC3_PLOC_HEATSPREADER, new Max31865Dummy(objects::RTD_0_IC3_PLOC_HEATSPREADER, objects::DUMMY_COM_IF, comCookieDummy)); - new Max31865Dummy(objects::RTD_1_IC4_PLOC_MISSIONBOARD, objects::DUMMY_COM_IF, comCookieDummy); - new Max31865Dummy(objects::RTD_2_IC5_4K_CAMERA, objects::DUMMY_COM_IF, comCookieDummy); - new Max31865Dummy(objects::RTD_3_IC6_DAC_HEATSPREADER, objects::DUMMY_COM_IF, comCookieDummy); - new Max31865Dummy(objects::RTD_4_IC7_STARTRACKER, objects::DUMMY_COM_IF, comCookieDummy); - new Max31865Dummy(objects::RTD_5_IC8_RW1_MX_MY, objects::DUMMY_COM_IF, comCookieDummy); - new Max31865Dummy(objects::RTD_6_IC9_DRO, objects::DUMMY_COM_IF, comCookieDummy); - new Max31865Dummy(objects::RTD_7_IC10_SCEX, objects::DUMMY_COM_IF, comCookieDummy); - new Max31865Dummy(objects::RTD_8_IC11_X8, objects::DUMMY_COM_IF, comCookieDummy); - new Max31865Dummy(objects::RTD_9_IC12_HPA, objects::DUMMY_COM_IF, comCookieDummy); - new Max31865Dummy(objects::RTD_10_IC13_PL_TX, objects::DUMMY_COM_IF, comCookieDummy); - new Max31865Dummy(objects::RTD_11_IC14_MPA, objects::DUMMY_COM_IF, comCookieDummy); - new Max31865Dummy(objects::RTD_12_IC15_ACU, objects::DUMMY_COM_IF, comCookieDummy); - new Max31865Dummy(objects::RTD_13_IC16_PLPCDU_HEATSPREADER, objects::DUMMY_COM_IF, - comCookieDummy); - new Max31865Dummy(objects::RTD_14_IC17_TCS_BOARD, objects::DUMMY_COM_IF, comCookieDummy); - new Max31865Dummy(objects::RTD_15_IC18_IMTQ, objects::DUMMY_COM_IF, comCookieDummy); - new Tmp1075Dummy(objects::TMP1075_HANDLER_TCS_0, objects::DUMMY_COM_IF, comCookieDummy); - new Tmp1075Dummy(objects::TMP1075_HANDLER_TCS_1, objects::DUMMY_COM_IF, comCookieDummy); - new Tmp1075Dummy(objects::TMP1075_HANDLER_PLPCDU_0, objects::DUMMY_COM_IF, comCookieDummy); - new Tmp1075Dummy(objects::TMP1075_HANDLER_PLPCDU_1, objects::DUMMY_COM_IF, comCookieDummy); - new Tmp1075Dummy(objects::TMP1075_HANDLER_IF_BOARD, objects::DUMMY_COM_IF, comCookieDummy); + tempSensorDummies.emplace(objects::RTD_0_IC3_PLOC_HEATSPREADER, + new Max31865Dummy(objects::RTD_0_IC3_PLOC_HEATSPREADER, + objects::DUMMY_COM_IF, comCookieDummy)); + tempSensorDummies.emplace(objects::RTD_1_IC4_PLOC_MISSIONBOARD, + new Max31865Dummy(objects::RTD_1_IC4_PLOC_MISSIONBOARD, + objects::DUMMY_COM_IF, comCookieDummy)); + tempSensorDummies.emplace( + objects::RTD_2_IC5_4K_CAMERA, + new Max31865Dummy(objects::RTD_2_IC5_4K_CAMERA, objects::DUMMY_COM_IF, comCookieDummy)); + tempSensorDummies.emplace(objects::RTD_3_IC6_DAC_HEATSPREADER, + new Max31865Dummy(objects::RTD_3_IC6_DAC_HEATSPREADER, + objects::DUMMY_COM_IF, comCookieDummy)); + tempSensorDummies.emplace( + objects::RTD_4_IC7_STARTRACKER, + new Max31865Dummy(objects::RTD_4_IC7_STARTRACKER, objects::DUMMY_COM_IF, comCookieDummy)); + tempSensorDummies.emplace( + objects::RTD_5_IC8_RW1_MX_MY, + new Max31865Dummy(objects::RTD_5_IC8_RW1_MX_MY, objects::DUMMY_COM_IF, comCookieDummy)); + tempSensorDummies.emplace( + objects::RTD_6_IC9_DRO, + new Max31865Dummy(objects::RTD_6_IC9_DRO, objects::DUMMY_COM_IF, comCookieDummy)); + tempSensorDummies.emplace( + objects::RTD_7_IC10_SCEX, + new Max31865Dummy(objects::RTD_7_IC10_SCEX, objects::DUMMY_COM_IF, comCookieDummy)); + tempSensorDummies.emplace( + objects::RTD_8_IC11_X8, + new Max31865Dummy(objects::RTD_8_IC11_X8, objects::DUMMY_COM_IF, comCookieDummy)); + tempSensorDummies.emplace( + objects::RTD_9_IC12_HPA, + new Max31865Dummy(objects::RTD_9_IC12_HPA, objects::DUMMY_COM_IF, comCookieDummy)); + tempSensorDummies.emplace( + objects::RTD_10_IC13_PL_TX, + new Max31865Dummy(objects::RTD_10_IC13_PL_TX, objects::DUMMY_COM_IF, comCookieDummy)); + tempSensorDummies.emplace( + objects::RTD_11_IC14_MPA, + new Max31865Dummy(objects::RTD_11_IC14_MPA, objects::DUMMY_COM_IF, comCookieDummy)); + tempSensorDummies.emplace( + objects::RTD_12_IC15_ACU, + new Max31865Dummy(objects::RTD_12_IC15_ACU, objects::DUMMY_COM_IF, comCookieDummy)); + tempSensorDummies.emplace(objects::RTD_13_IC16_PLPCDU_HEATSPREADER, + new Max31865Dummy(objects::RTD_13_IC16_PLPCDU_HEATSPREADER, + objects::DUMMY_COM_IF, comCookieDummy)); + tempSensorDummies.emplace( + objects::RTD_14_IC17_TCS_BOARD, + new Max31865Dummy(objects::RTD_14_IC17_TCS_BOARD, objects::DUMMY_COM_IF, comCookieDummy)); + tempSensorDummies.emplace( + objects::RTD_15_IC18_IMTQ, + new Max31865Dummy(objects::RTD_15_IC18_IMTQ, objects::DUMMY_COM_IF, comCookieDummy)); - new TemperatureSensorInserter(objects::THERMAL_TEMP_INSERTER); + std::map tempTmpSensorDummies; + tempTmpSensorDummies.emplace( + objects::TMP1075_HANDLER_TCS_0, + new Tmp1075Dummy(objects::TMP1075_HANDLER_TCS_0, objects::DUMMY_COM_IF, comCookieDummy)); + tempTmpSensorDummies.emplace( + objects::TMP1075_HANDLER_TCS_1, + new Tmp1075Dummy(objects::TMP1075_HANDLER_TCS_1, objects::DUMMY_COM_IF, comCookieDummy)); + tempTmpSensorDummies.emplace( + objects::TMP1075_HANDLER_PLPCDU_0, + new Tmp1075Dummy(objects::TMP1075_HANDLER_PLPCDU_0, objects::DUMMY_COM_IF, comCookieDummy)); + tempTmpSensorDummies.emplace( + objects::TMP1075_HANDLER_PLPCDU_1, + new Tmp1075Dummy(objects::TMP1075_HANDLER_PLPCDU_1, objects::DUMMY_COM_IF, comCookieDummy)); + tempTmpSensorDummies.emplace( + objects::TMP1075_HANDLER_IF_BOARD, + new Tmp1075Dummy(objects::TMP1075_HANDLER_IF_BOARD, objects::DUMMY_COM_IF, comCookieDummy)); + + new TemperatureSensorInserter(objects::THERMAL_TEMP_INSERTER, tempSensorDummies, + tempTmpSensorDummies); } new CamSwitcher(objects::CAM_SWITCHER, pwrSwitch, power::NO_SWITCH); new PlPcduDummy(objects::PLPCDU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); From 2b3fe93906e3f31f352ef74a531a915311f78e49 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Sun, 22 Jan 2023 20:07:10 +0100 Subject: [PATCH 102/330] constructor TemperatureSensorInserter + temSensorDummies-map --- dummies/CMakeLists.txt | 3 +-- dummies/TemperatureSensorInserter.cpp | 8 +++----- dummies/TemperatureSensorInserter.h | 9 +++------ 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/dummies/CMakeLists.txt b/dummies/CMakeLists.txt index 51d4d4a2..330aecfe 100644 --- a/dummies/CMakeLists.txt +++ b/dummies/CMakeLists.txt @@ -22,5 +22,4 @@ target_sources( CoreControllerDummy.cpp helpers.cpp MgmRm3100Dummy.cpp - Tmp1075Dummy.cpp - DummyHeaterHandler.cpp) + Tmp1075Dummy.cpp) diff --git a/dummies/TemperatureSensorInserter.cpp b/dummies/TemperatureSensorInserter.cpp index 791a1d51..4852440f 100644 --- a/dummies/TemperatureSensorInserter.cpp +++ b/dummies/TemperatureSensorInserter.cpp @@ -6,11 +6,9 @@ #include TemperatureSensorInserter::TemperatureSensorInserter( - object_id_t objectId, std::map tempSensorDummies_, - std::map tempTmpSensorDummies_) - : SystemObject(objects::THERMAL_TEMP_INSERTER), - tempSensorDummies(tempSensorDummies_), - tempTmpSensorDummies(tempTmpSensorDummies_) {} + object_id_t objectId, const std::map& tempSensorDummies_, + const std::map& tempTmpSensorDummies_) + : SystemObject(objects::THERMAL_TEMP_INSERTER) {} ReturnValue_t TemperatureSensorInserter::initialize() { if (performTest) { diff --git a/dummies/TemperatureSensorInserter.h b/dummies/TemperatureSensorInserter.h index 18bac79c..1cf49e01 100644 --- a/dummies/TemperatureSensorInserter.h +++ b/dummies/TemperatureSensorInserter.h @@ -8,9 +8,9 @@ class TemperatureSensorInserter : public ExecutableObjectIF, public SystemObject { public: - explicit TemperatureSensorInserter(object_id_t objectId, - std::map tempSensorDummies_, - std::map tempTmpSensorDummies_); + explicit TemperatureSensorInserter( + object_id_t objectId, const std::map& tempSensorDummies_, + const std::map& tempTmpSensorDummies_); ReturnValue_t initialize() override; @@ -24,8 +24,5 @@ class TemperatureSensorInserter : public ExecutableObjectIF, public SystemObject float value = 0; TestCase testCase; - std::map tempSensorDummies; - std::map tempTmpSensorDummies; - // void noise(); }; From 6fd10e718093f4b17f9ca3c4dff61dc628e89d2e Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Sun, 22 Jan 2023 20:37:51 +0100 Subject: [PATCH 103/330] bug fixed --- dummies/TemperatureSensorInserter.cpp | 4 +- dummies/TemperatureSensorInserter.h | 4 +- dummies/helpers.cpp | 4 +- mission/controller/ThermalController.cpp | 59 ++++++++++++++++-------- mission/controller/ThermalController.h | 7 +-- 5 files changed, 51 insertions(+), 27 deletions(-) diff --git a/dummies/TemperatureSensorInserter.cpp b/dummies/TemperatureSensorInserter.cpp index 4852440f..58748e87 100644 --- a/dummies/TemperatureSensorInserter.cpp +++ b/dummies/TemperatureSensorInserter.cpp @@ -6,8 +6,8 @@ #include TemperatureSensorInserter::TemperatureSensorInserter( - object_id_t objectId, const std::map& tempSensorDummies_, - const std::map& tempTmpSensorDummies_) + object_id_t objectId, const std::map& tempSensorDummies_, + const std::map& tempTmpSensorDummies_) : SystemObject(objects::THERMAL_TEMP_INSERTER) {} ReturnValue_t TemperatureSensorInserter::initialize() { diff --git a/dummies/TemperatureSensorInserter.h b/dummies/TemperatureSensorInserter.h index 1cf49e01..cf858576 100644 --- a/dummies/TemperatureSensorInserter.h +++ b/dummies/TemperatureSensorInserter.h @@ -9,8 +9,8 @@ class TemperatureSensorInserter : public ExecutableObjectIF, public SystemObject { public: explicit TemperatureSensorInserter( - object_id_t objectId, const std::map& tempSensorDummies_, - const std::map& tempTmpSensorDummies_); + object_id_t objectId, const std::map& tempSensorDummies_, + const std::map& tempTmpSensorDummies_); ReturnValue_t initialize() override; diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index db57d5ff..91e61aa4 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -82,7 +82,7 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) { } if (cfg.addTempSensorDummies) { - std::map tempSensorDummies; + std::map tempSensorDummies; tempSensorDummies.emplace(objects::RTD_0_IC3_PLOC_HEATSPREADER, new Max31865Dummy(objects::RTD_0_IC3_PLOC_HEATSPREADER, objects::DUMMY_COM_IF, comCookieDummy)); @@ -132,7 +132,7 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) { objects::RTD_15_IC18_IMTQ, new Max31865Dummy(objects::RTD_15_IC18_IMTQ, objects::DUMMY_COM_IF, comCookieDummy)); - std::map tempTmpSensorDummies; + std::map tempTmpSensorDummies; tempTmpSensorDummies.emplace( objects::TMP1075_HANDLER_TCS_0, new Tmp1075Dummy(objects::TMP1075_HANDLER_TCS_0, objects::DUMMY_COM_IF, comCookieDummy)); diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 0861c08a..d11eda72 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -984,11 +984,20 @@ void ThermalController::copyDevices() { } void ThermalController::ctrlAcsBoard() { - ctrlComponentTemperature(heater::HEATER_2_ACS_BRD, heater::HEATER_0_OBC_BRD, - deviceTemperatures.gyro0SideA, deviceTemperatures.mgm0SideA, - deviceTemperatures.gyro1SideA, // mgm1(int), - // sensorTemperatures.sensor_tcs_board, - &acsBoardLimits); // TODO: add red sensors +// TODO: add red sensors, check sensor 4 + heater::Switchers switchNr = heater::HEATER_2_ACS_BRD; + heater::Switchers redSwitchNr = heater::HEATER_0_OBC_BRD; + chooseHeater(switchNr, redSwitchNr); + + if (heaterAvailable) { + /*chooseOf5Sensors(switchNr, deviceTemperatures.gyro0SideA, deviceTemperatures.mgm0SideA, + deviceTemperatures.gyro1SideA, deviceTemperatures.mgt, + sensorTemperatures.sensor_tcs_board);*/ + + if (sensorTempAvailable) { + ctrlHeater(switchNr, redSwitchNr, &acsBoardLimits); + } + } } void ThermalController::ctrlMgt() { @@ -1164,8 +1173,6 @@ void ThermalController::chooseHeater(heater::Switchers& switchNr, heater::Switch } else { heaterAvailable = false; triggerEvent(NO_HEALTHY_HEATER_AVAILABLE, switchNr, redSwitchNr); - sif::error << "ThermalController::chooseSensor: Both heater: " << switchNr << " + " - << redSwitchNr << " not healthy" << std::endl; } } else { redSwitchNrInUse = false; @@ -1173,8 +1180,7 @@ void ThermalController::chooseHeater(heater::Switchers& switchNr, heater::Switch } void ThermalController::chooseSensor(heater::Switchers switchNr, const lp_float_t& sensor1, - const lp_float_t& sensor2, const lp_float_t& sensor3, - bool moreThan3Sensors) { + const lp_float_t& sensor2, const lp_float_t& sensor3) { sensorTempAvailable = true; if (sensor1.isValid()) { @@ -1183,16 +1189,11 @@ void ThermalController::chooseSensor(heater::Switchers switchNr, const lp_float_ sensorTemp = sensor2.value; } else if (sensor3.isValid()) { sensorTemp = sensor3.value; - /*} else if (moreThan3Sensors and sensor4.isValid()) { - sensorTemp = sensor4.value; - } else if (moreThan3Sensors and sensor5.isValid()) { - sensorTemp = sensor5.value; */ } else { if (heaterHandler.checkSwitchState(switchNr)) { heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); } - // TODO: triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); - sif::error << "ThermalController::chooseSensor: No valid Sensor found" << std::endl; + triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); sensorTempAvailable = false; } } @@ -1201,15 +1202,37 @@ void ThermalController::ctrlComponentTemperature(heater::Switchers switchNr, heater::Switchers redSwitchNr, const lp_float_t& sensor1, const lp_float_t& sensor2, - const lp_float_t& sensor3, TempLimits* tempLimit, - bool moreThan3Sensors) { + const lp_float_t& sensor3, TempLimits* tempLimit) { chooseHeater(switchNr, redSwitchNr); if (heaterAvailable) { - chooseSensor(switchNr, sensor1, sensor2, sensor3, moreThan3Sensors); + chooseSensor(switchNr, sensor1, sensor2, sensor3); if (sensorTempAvailable) { ctrlHeater(switchNr, redSwitchNr, tempLimit); } } } +void ThermalController::chooseOf5Sensors(heater::Switchers switchNr, const lp_float_t& sensor1, + const lp_float_t& sensor2, const lp_float_t& sensor3, + const lp_float_t& sensor4, const lp_float_t& sensor5) { + sensorTempAvailable = true; + + if (sensor1.isValid()) { + sensorTemp = sensor1.value; + } else if (sensor2.isValid()) { + sensorTemp = sensor2.value; + } else if (sensor3.isValid()) { + sensorTemp = sensor3.value; + } else if (sensor4.isValid()) { + sensorTemp = sensor4.value; + } else if (sensor5.isValid()) { + sensorTemp = sensor5.value; + } else { + if (heaterHandler.checkSwitchState(switchNr)) { + heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); + } + triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); + sensorTempAvailable = false; + } +} diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index c97b3fdc..7f3e8ac7 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -162,12 +162,13 @@ class ThermalController : public ExtendedControllerBase { void ctrlComponentTemperature( heater::Switchers switchNr, heater::Switchers redSwitchNr, const lp_float_t& sensor1, - const lp_float_t& sensor2, const lp_float_t& sensor3, TempLimits* tempLimit, - bool moreThan3Sensors = false); // TODO sensor 4, 5 = default argument, if not available + const lp_float_t& sensor2, const lp_float_t& sensor3, TempLimits* tempLimit); // TODO sensor 4, 5 = default argument, if not available void ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, TempLimits* tempLimit); void chooseHeater(heater::Switchers& switchNr, heater::Switchers redSwitchNr); void chooseSensor(heater::Switchers switchNr, const lp_float_t& sensor1, - const lp_float_t& sensor2, const lp_float_t& sensor3, bool moreThan3Sensors); + const lp_float_t& sensor2, const lp_float_t& sensor3); + void chooseOf5Sensors(heater::Switchers switchNr, const lp_float_t& sensor1, + const lp_float_t& sensor2, const lp_float_t& sensor3, const lp_float_t& sensor4, const lp_float_t& sensor5); void ctrlAcsBoard(); void ctrlMgt(); From 0e2ae50fc5e58208f1877c106462b6244401068f Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Sun, 22 Jan 2023 21:04:55 +0100 Subject: [PATCH 104/330] ThermalController changes --- mission/controller/ThermalController.cpp | 59 +++++++++++++++++++++--- 1 file changed, 52 insertions(+), 7 deletions(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index d11eda72..b05b3a07 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -1059,9 +1059,31 @@ void ThermalController::ctrlPcduP60Board() { } void ThermalController::ctrlPcduAcu() { - // TODO: check sensors (float,3) - // ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, - // deviceTemperatures.acu, deviceTemperatures.acu, sensorTemperatures.sensor_acu, &pcduAcuLimits); + heater::Switchers switchNr = heater::HEATER_3_PCDU_PDU; + heater::Switchers redSwitchNr = heater::HEATER_2_ACS_BRD; + + chooseHeater(switchNr, redSwitchNr); + + if (heaterAvailable) { + sensorTempAvailable = true; + + if (deviceTemperatures.acu.isValid()) { // TODO: how to check the different values + sensorTemp = deviceTemperatures.acu.value[0]; // TODO: check if right + } else if (deviceTemperatures.acu.isValid()) { + sensorTemp = deviceTemperatures.acu.value[1]; + } else if (sensorTemperatures.sensor_acu.isValid()) { + sensorTemp = sensorTemperatures.sensor_acu.value; + } else { + if (heaterHandler.checkSwitchState(switchNr)) { + heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); + } + triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); + sensorTempAvailable = false; + if (sensorTempAvailable) { + ctrlHeater(switchNr, redSwitchNr, &pcduAcuLimits); + } + } + } } void ThermalController::ctrlPcduPdu() { @@ -1072,10 +1094,33 @@ void ThermalController::ctrlPcduPdu() { } void ThermalController::ctrlPlPcduBoard() { - // TODO: add sensor 4: sensorTemperatures.sensor_plpcdu_heatspreader - ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, - sensorTemperatures.tmp1075PlPcdu0, sensorTemperatures.tmp1075PlPcdu1, - deviceTemperatures.adcPayloadPcdu, &plPcduBoardLimits); + heater::Switchers switchNr = heater::HEATER_3_PCDU_PDU; + heater::Switchers redSwitchNr = heater::HEATER_2_ACS_BRD; + + chooseHeater(switchNr, redSwitchNr); + + if (heaterAvailable) { + sensorTempAvailable = true; + + if (sensorTemperatures.tmp1075PlPcdu0.isValid()) { + sensorTemp = sensorTemperatures.tmp1075PlPcdu0.value; + } else if (sensorTemperatures.tmp1075PlPcdu1.isValid()) { + sensorTemp = sensorTemperatures.tmp1075PlPcdu1.value; + } else if (deviceTemperatures.adcPayloadPcdu.isValid()) { + sensorTemp = deviceTemperatures.adcPayloadPcdu.value; + } else if (sensorTemperatures.sensor_plpcdu_heatspreader.isValid()) { + sensorTemp = sensorTemperatures.sensor_plpcdu_heatspreader.value; + } else { + if (heaterHandler.checkSwitchState(switchNr)) { + heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); + } + triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); + sensorTempAvailable = false; + if (sensorTempAvailable) { + ctrlHeater(switchNr, redSwitchNr, &plPcduBoardLimits); + } + } + } } void ThermalController::ctrlPlocMissionBoard() { From e5b297a513c4238b87bced71eaa17d113d4c412a Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Mon, 23 Jan 2023 15:58:57 +0100 Subject: [PATCH 105/330] removed deprecated code --- mission/controller/acs/Guidance.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index af9909c1..56355b42 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -409,10 +409,6 @@ void Guidance::sunQuatPtg(ACS::SensorValues *sensorValues, acsctrl::MekfData *me double zAxis[3] = {0, 0, 0}; VectorOperations::normalize(sunDirB, zAxis, 3); - // Position of satellite in ECEF - double posSatE[3] = {0, 0, 0}; - std::memcpy(gpsDataProcessed->gpsPosition.value, posSatE, 3 * sizeof(double)); - // Assign helper vector (north pole inertial) double helperVec[3] = {0, 0, 1}; From adef468c0bc902923f396a92bda4d68a99e7c880 Mon Sep 17 00:00:00 2001 From: Robin Marquardt Date: Mon, 23 Jan 2023 16:34:52 +0100 Subject: [PATCH 106/330] applyed CppStyle Format --- mission/controller/AcsController.cpp | 1270 ++++++++++---------- mission/controller/acs/AcsParameters.h | 59 +- mission/controller/acs/Guidance.cpp | 31 +- mission/controller/acs/Guidance.h | 8 +- mission/controller/acs/control/PtgCtrl.cpp | 15 +- mission/controller/acs/control/PtgCtrl.h | 14 +- 6 files changed, 714 insertions(+), 683 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index f829c3e3..61ddae44 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -26,7 +26,7 @@ AcsController::AcsController(object_id_t objectId) ctrlValData(this), actuatorCmdData(this) {} -ReturnValue_t AcsController::handleCommandMessage(CommandMessage *message) { +ReturnValue_t AcsController::handleCommandMessage(CommandMessage* message) { ReturnValue_t result = actionHelper.handleActionMessage(message); if (result == returnvalue::OK) { return result; @@ -103,642 +103,662 @@ void AcsController::performControlOperation() { copyGyrData(); } } - } +} - void AcsController::performSafe() { - ACS::SensorValues sensorValues; +void AcsController::performSafe() { + ACS::SensorValues sensorValues; - timeval now; - Clock::getClock_timeval(&now); + timeval now; + Clock::getClock_timeval(&now); - sensorProcessing.process(now, &sensorValues, &mgmDataProcessed, &susDataProcessed, - &gyrDataProcessed, &gpsDataProcessed, &acsParameters); - ReturnValue_t validMekf; - navigation.useMekf(&sensorValues, &gyrDataProcessed, &mgmDataProcessed, &susDataProcessed, - &mekfData, &validMekf); + sensorProcessing.process(now, &sensorValues, &mgmDataProcessed, &susDataProcessed, + &gyrDataProcessed, &gpsDataProcessed, &acsParameters); + ReturnValue_t validMekf; + navigation.useMekf(&sensorValues, &gyrDataProcessed, &mgmDataProcessed, &susDataProcessed, + &mekfData, &validMekf); - // Give desired satellite rate and sun direction to align - double satRateSafe[3] = {0, 0, 0}, sunTargetDir[3] = {0, 0, 0}; - guidance.getTargetParamsSafe(sunTargetDir, satRateSafe); - // IF MEKF is working - double magMomMtq[3] = {0, 0, 0}, errAng = 0.0; - bool magMomMtqValid = false; - if (validMekf == returnvalue::OK) { - safeCtrl.safeMekf(now, mekfData.quatMekf.value, mekfData.quatMekf.isValid(), - mgmDataProcessed.magIgrfModel.value, - mgmDataProcessed.magIgrfModel.isValid(), susDataProcessed.sunIjkModel.value, - susDataProcessed.isValid(), mekfData.satRotRateMekf.value, - mekfData.satRotRateMekf.isValid(), sunTargetDir, satRateSafe, &errAng, - magMomMtq, &magMomMtqValid); - } else { - safeCtrl.safeNoMekf( - now, susDataProcessed.susVecTot.value, susDataProcessed.susVecTot.isValid(), - susDataProcessed.susVecTotDerivative.value, - susDataProcessed.susVecTotDerivative.isValid(), mgmDataProcessed.mgmVecTot.value, - mgmDataProcessed.mgmVecTot.isValid(), mgmDataProcessed.mgmVecTotDerivative.value, - mgmDataProcessed.mgmVecTotDerivative.isValid(), sunTargetDir, satRateSafe, &errAng, - magMomMtq, &magMomMtqValid); - } - - double dipolCmdUnits[3] = {0, 0, 0}; - actuatorCmd.cmdDipolMtq(magMomMtq, dipolCmdUnits); - - { - PoolReadGuard pg(&ctrlValData); - if (pg.getReadResult() == returnvalue::OK) { - double unitQuat[4] = {0, 0, 0, 1}; - std::memcpy(ctrlValData.tgtQuat.value, unitQuat, 4 * sizeof(double)); - ctrlValData.tgtQuat.setValid(false); - std::memcpy(ctrlValData.errQuat.value, unitQuat, 4 * sizeof(double)); - ctrlValData.errQuat.setValid(false); - ctrlValData.errAng.value = errAng; - ctrlValData.errAng.setValid(true); - ctrlValData.setValidity(true, false); - } - } - - // Detumble check and switch - if (mekfData.satRotRateMekf.isValid() && - VectorOperations::norm(mekfData.satRotRateMekf.value, 3) > - acsParameters.detumbleParameter.omegaDetumbleStart) { - detumbleCounter++; - } else if (gyrDataProcessed.gyrVecTot.isValid() && - VectorOperations::norm(gyrDataProcessed.gyrVecTot.value, 3) > - acsParameters.detumbleParameter.omegaDetumbleStart) { - detumbleCounter++; - } else { - detumbleCounter = 0; - } - if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) { - submode = SUBMODE_DETUMBLE; - detumbleCounter = 0; - triggerEvent(SAFE_RATE_VIOLATION); - } - - { - PoolReadGuard pg(&actuatorCmdData); - if (pg.getReadResult() == returnvalue::OK) { - std::memset(actuatorCmdData.rwTargetTorque.value, 0, 4 * sizeof(int32_t)); - actuatorCmdData.rwTargetTorque.setValid(false); - std::memset(actuatorCmdData.rwTargetSpeed.value, 0, 4 * sizeof(int32_t)); - actuatorCmdData.rwTargetSpeed.setValid(false); - std::memcpy(actuatorCmdData.mtqTargetDipole.value, dipolCmdUnits, 3 * sizeof(int16_t)); - actuatorCmdData.mtqTargetDipole.setValid(true); - actuatorCmdData.setValidity(true, false); - } - } - // { - // PoolReadGuard pg(&dipoleSet); - // MutexGuard mg(torquer::lazyLock()); - // torquer::NEW_ACTUATION_FLAG = true; - // dipoleSet.setDipoles(cmdDipolUnits[0], cmdDipolUnits[1], cmdDipolUnits[2], - // torqueDuration); - // } - } - - void AcsController::performDetumble() { - ACS::SensorValues sensorValues; - - timeval now; - Clock::getClock_timeval(&now); - - sensorProcessing.process(now, &sensorValues, &mgmDataProcessed, &susDataProcessed, - &gyrDataProcessed, &gpsDataProcessed, &acsParameters); - ReturnValue_t validMekf; - navigation.useMekf(&sensorValues, &gyrDataProcessed, &mgmDataProcessed, &susDataProcessed, - &mekfData, &validMekf); - - double magMomMtq[3] = {0, 0, 0}; - detumble.bDotLaw( + // Give desired satellite rate and sun direction to align + double satRateSafe[3] = {0, 0, 0}, sunTargetDir[3] = {0, 0, 0}; + guidance.getTargetParamsSafe(sunTargetDir, satRateSafe); + // IF MEKF is working + double magMomMtq[3] = {0, 0, 0}, errAng = 0.0; + bool magMomMtqValid = false; + if (validMekf == returnvalue::OK) { + safeCtrl.safeMekf(now, mekfData.quatMekf.value, mekfData.quatMekf.isValid(), + mgmDataProcessed.magIgrfModel.value, mgmDataProcessed.magIgrfModel.isValid(), + susDataProcessed.sunIjkModel.value, susDataProcessed.isValid(), + mekfData.satRotRateMekf.value, mekfData.satRotRateMekf.isValid(), + sunTargetDir, satRateSafe, &errAng, magMomMtq, &magMomMtqValid); + } else { + safeCtrl.safeNoMekf( + now, susDataProcessed.susVecTot.value, susDataProcessed.susVecTot.isValid(), + susDataProcessed.susVecTotDerivative.value, susDataProcessed.susVecTotDerivative.isValid(), + mgmDataProcessed.mgmVecTot.value, mgmDataProcessed.mgmVecTot.isValid(), mgmDataProcessed.mgmVecTotDerivative.value, mgmDataProcessed.mgmVecTotDerivative.isValid(), - mgmDataProcessed.mgmVecTot.value, mgmDataProcessed.mgmVecTot.isValid(), magMomMtq); - double dipolCmdUnits[3] = {0, 0, 0}; - actuatorCmd.cmdDipolMtq(magMomMtq, dipolCmdUnits); + sunTargetDir, satRateSafe, &errAng, magMomMtq, &magMomMtqValid); + } - if (mekfData.satRotRateMekf.isValid() && - VectorOperations::norm(mekfData.satRotRateMekf.value, 3) < - acsParameters.detumbleParameter.omegaDetumbleEnd) { - detumbleCounter++; - } else if (gyrDataProcessed.gyrVecTot.isValid() && - VectorOperations::norm(gyrDataProcessed.gyrVecTot.value, 3) < - acsParameters.detumbleParameter.omegaDetumbleEnd) { - detumbleCounter++; + double dipolCmdUnits[3] = {0, 0, 0}; + actuatorCmd.cmdDipolMtq(magMomMtq, dipolCmdUnits); + + { + PoolReadGuard pg(&ctrlValData); + if (pg.getReadResult() == returnvalue::OK) { + double unitQuat[4] = {0, 0, 0, 1}; + std::memcpy(ctrlValData.tgtQuat.value, unitQuat, 4 * sizeof(double)); + ctrlValData.tgtQuat.setValid(false); + std::memcpy(ctrlValData.errQuat.value, unitQuat, 4 * sizeof(double)); + ctrlValData.errQuat.setValid(false); + ctrlValData.errAng.value = errAng; + ctrlValData.errAng.setValid(true); + ctrlValData.setValidity(true, false); + } + } + + // Detumble check and switch + if (mekfData.satRotRateMekf.isValid() && + VectorOperations::norm(mekfData.satRotRateMekf.value, 3) > + acsParameters.detumbleParameter.omegaDetumbleStart) { + detumbleCounter++; + } else if (gyrDataProcessed.gyrVecTot.isValid() && + VectorOperations::norm(gyrDataProcessed.gyrVecTot.value, 3) > + acsParameters.detumbleParameter.omegaDetumbleStart) { + detumbleCounter++; + } else { + detumbleCounter = 0; + } + if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) { + submode = SUBMODE_DETUMBLE; + detumbleCounter = 0; + triggerEvent(SAFE_RATE_VIOLATION); + } + + { + PoolReadGuard pg(&actuatorCmdData); + if (pg.getReadResult() == returnvalue::OK) { + std::memset(actuatorCmdData.rwTargetTorque.value, 0, 4 * sizeof(int32_t)); + actuatorCmdData.rwTargetTorque.setValid(false); + std::memset(actuatorCmdData.rwTargetSpeed.value, 0, 4 * sizeof(int32_t)); + actuatorCmdData.rwTargetSpeed.setValid(false); + std::memcpy(actuatorCmdData.mtqTargetDipole.value, dipolCmdUnits, 3 * sizeof(int16_t)); + actuatorCmdData.mtqTargetDipole.setValid(true); + actuatorCmdData.setValidity(true, false); + } + } + // { + // PoolReadGuard pg(&dipoleSet); + // MutexGuard mg(torquer::lazyLock()); + // torquer::NEW_ACTUATION_FLAG = true; + // dipoleSet.setDipoles(cmdDipolUnits[0], cmdDipolUnits[1], cmdDipolUnits[2], + // torqueDuration); + // } +} + +void AcsController::performDetumble() { + ACS::SensorValues sensorValues; + + timeval now; + Clock::getClock_timeval(&now); + + sensorProcessing.process(now, &sensorValues, &mgmDataProcessed, &susDataProcessed, + &gyrDataProcessed, &gpsDataProcessed, &acsParameters); + ReturnValue_t validMekf; + navigation.useMekf(&sensorValues, &gyrDataProcessed, &mgmDataProcessed, &susDataProcessed, + &mekfData, &validMekf); + + double magMomMtq[3] = {0, 0, 0}; + detumble.bDotLaw(mgmDataProcessed.mgmVecTotDerivative.value, + mgmDataProcessed.mgmVecTotDerivative.isValid(), mgmDataProcessed.mgmVecTot.value, + mgmDataProcessed.mgmVecTot.isValid(), magMomMtq); + double dipolCmdUnits[3] = {0, 0, 0}; + actuatorCmd.cmdDipolMtq(magMomMtq, dipolCmdUnits); + + if (mekfData.satRotRateMekf.isValid() && + VectorOperations::norm(mekfData.satRotRateMekf.value, 3) < + acsParameters.detumbleParameter.omegaDetumbleEnd) { + detumbleCounter++; + } else if (gyrDataProcessed.gyrVecTot.isValid() && + VectorOperations::norm(gyrDataProcessed.gyrVecTot.value, 3) < + acsParameters.detumbleParameter.omegaDetumbleEnd) { + detumbleCounter++; + } else { + detumbleCounter = 0; + } + if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) { + submode = SUBMODE_SAFE; + detumbleCounter = 0; + } + + int16_t cmdDipolUnitsInt[3] = {0, 0, 0}; + for (int i = 0; i < 3; ++i) { + cmdDipolUnitsInt[i] = std::round(dipolCmdUnits[i]); + } + { + PoolReadGuard pg(&actuatorCmdData); + if (pg.getReadResult() == returnvalue::OK) { + std::memset(actuatorCmdData.rwTargetTorque.value, 0, 4 * sizeof(double)); + actuatorCmdData.rwTargetTorque.setValid(false); + std::memset(actuatorCmdData.rwTargetSpeed.value, 0, 4 * sizeof(int32_t)); + actuatorCmdData.rwTargetSpeed.setValid(false); + std::memcpy(actuatorCmdData.mtqTargetDipole.value, cmdDipolUnitsInt, 3 * sizeof(int16_t)); + actuatorCmdData.mtqTargetDipole.setValid(true); + actuatorCmdData.setValidity(true, false); + } + } + // { + // PoolReadGuard pg(&dipoleSet); + // MutexGuard mg(torquer::lazyLock()); + // torquer::NEW_ACTUATION_FLAG = true; + // dipoleSet.setDipoles(cmdDipolUnitsInt[0], cmdDipolUnitsInt[1], cmdDipolUnitsInt[2], + // torqueDuration); + // } +} + +void AcsController::performPointingCtrl() { + ACS::SensorValues sensorValues; + + timeval now; + Clock::getClock_timeval(&now); + + sensorProcessing.process(now, &sensorValues, &mgmDataProcessed, &susDataProcessed, + &gyrDataProcessed, &gpsDataProcessed, &acsParameters); + ReturnValue_t validMekf; + navigation.useMekf(&sensorValues, &gyrDataProcessed, &mgmDataProcessed, &susDataProcessed, + &mekfData, &validMekf); + + double targetQuat[4] = {0, 0, 0, 0}, refSatRate[3] = {0, 0, 0}; + double quatRef[4] = {0, 0, 0, 0}; + uint8_t enableAntiStiction = true; + + double quatErrorComplete[4] = {0, 0, 0, 0}, quatError[3] = {0, 0, 0}, + deltaRate[3] = {0, 0, 0}; // ToDo: check if pointer needed + double rwPseudoInv[4][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + guidance.getDistributionMatrixRw(&sensorValues, *rwPseudoInv); + double torquePtgRws[4] = {0, 0, 0, 0}, rwTrqNs[4] = {0, 0, 0, 0}; + double torqueRws[4] = {0, 0, 0, 0}, torqueRwsScaled[4] = {0, 0, 0, 0}; + double mgtDpDes[3] = {0, 0, 0}, dipolUnits[3] = {0, 0, 0}; // Desaturation Dipol + + switch (submode) { + case SUBMODE_IDLE: + guidance.sunQuatPtg(&sensorValues, &mekfData, &susDataProcessed, &gpsDataProcessed, now, + targetQuat, refSatRate); + std::memcpy(quatRef, acsParameters.targetModeControllerParameters.quatRef, + 4 * sizeof(double)); + enableAntiStiction = acsParameters.targetModeControllerParameters.enableAntiStiction; + guidance.comparePtg(targetQuat, &mekfData, quatRef, refSatRate, quatErrorComplete, quatError, + deltaRate); + ptgCtrl.ptgLaw(&acsParameters.targetModeControllerParameters, quatError, deltaRate, + *rwPseudoInv, torquePtgRws); + ptgCtrl.ptgNullspace( + &acsParameters.targetModeControllerParameters, &(sensorValues.rw1Set.currSpeed.value), + &(sensorValues.rw2Set.currSpeed.value), &(sensorValues.rw3Set.currSpeed.value), + &(sensorValues.rw4Set.currSpeed.value), rwTrqNs); + VectorOperations::add(torquePtgRws, rwTrqNs, torqueRws, 4); + actuatorCmd.scalingTorqueRws(torqueRws, torqueRwsScaled); + ptgCtrl.ptgDesaturation( + &acsParameters.targetModeControllerParameters, mgmDataProcessed.mgmVecTot.value, + mgmDataProcessed.mgmVecTot.isValid(), mekfData.satRotRateMekf.value, + &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), + &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), mgtDpDes); + + break; + + case SUBMODE_PTG_TARGET: + guidance.targetQuatPtgThreeAxes(&sensorValues, &gpsDataProcessed, &mekfData, now, targetQuat, + refSatRate); + std::memcpy(quatRef, acsParameters.targetModeControllerParameters.quatRef, + 4 * sizeof(double)); + enableAntiStiction = acsParameters.targetModeControllerParameters.enableAntiStiction; + guidance.comparePtg(targetQuat, &mekfData, quatRef, refSatRate, quatErrorComplete, quatError, + deltaRate); + ptgCtrl.ptgLaw(&acsParameters.targetModeControllerParameters, quatError, deltaRate, + *rwPseudoInv, torquePtgRws); + ptgCtrl.ptgNullspace( + &acsParameters.targetModeControllerParameters, &(sensorValues.rw1Set.currSpeed.value), + &(sensorValues.rw2Set.currSpeed.value), &(sensorValues.rw3Set.currSpeed.value), + &(sensorValues.rw4Set.currSpeed.value), rwTrqNs); + VectorOperations::add(torquePtgRws, rwTrqNs, torqueRws, 4); + actuatorCmd.scalingTorqueRws(torqueRws, torqueRwsScaled); + ptgCtrl.ptgDesaturation( + &acsParameters.targetModeControllerParameters, mgmDataProcessed.mgmVecTot.value, + mgmDataProcessed.mgmVecTot.isValid(), mekfData.satRotRateMekf.value, + &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), + &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), mgtDpDes); + break; + + case SUBMODE_PTG_TARGET_GS: + guidance.targetQuatPtgGs(&sensorValues, &mekfData, &susDataProcessed, &gpsDataProcessed, now, + targetQuat, refSatRate); + std::memcpy(quatRef, acsParameters.targetModeControllerParameters.quatRef, + 4 * sizeof(double)); + enableAntiStiction = acsParameters.targetModeControllerParameters.enableAntiStiction; + guidance.comparePtg(targetQuat, &mekfData, quatRef, refSatRate, quatErrorComplete, quatError, + deltaRate); + ptgCtrl.ptgLaw(&acsParameters.targetModeControllerParameters, quatError, deltaRate, + *rwPseudoInv, torquePtgRws); + ptgCtrl.ptgNullspace( + &acsParameters.targetModeControllerParameters, &(sensorValues.rw1Set.currSpeed.value), + &(sensorValues.rw2Set.currSpeed.value), &(sensorValues.rw3Set.currSpeed.value), + &(sensorValues.rw4Set.currSpeed.value), rwTrqNs); + VectorOperations::add(torquePtgRws, rwTrqNs, torqueRws, 4); + actuatorCmd.scalingTorqueRws(torqueRws, torqueRwsScaled); + ptgCtrl.ptgDesaturation( + &acsParameters.targetModeControllerParameters, mgmDataProcessed.mgmVecTot.value, + mgmDataProcessed.mgmVecTot.isValid(), mekfData.satRotRateMekf.value, + &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), + &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), mgtDpDes); + break; + + case SUBMODE_PTG_NADIR: + guidance.quatNadirPtgThreeAxes(&sensorValues, &gpsDataProcessed, &mekfData, now, targetQuat, + refSatRate); + std::memcpy(quatRef, acsParameters.nadirModeControllerParameters.quatRef, 4 * sizeof(double)); + enableAntiStiction = acsParameters.nadirModeControllerParameters.enableAntiStiction; + guidance.comparePtg(targetQuat, &mekfData, quatRef, refSatRate, quatErrorComplete, quatError, + deltaRate); + ptgCtrl.ptgLaw(&acsParameters.nadirModeControllerParameters, quatError, deltaRate, + *rwPseudoInv, torquePtgRws); + ptgCtrl.ptgNullspace( + &acsParameters.nadirModeControllerParameters, &(sensorValues.rw1Set.currSpeed.value), + &(sensorValues.rw2Set.currSpeed.value), &(sensorValues.rw3Set.currSpeed.value), + &(sensorValues.rw4Set.currSpeed.value), rwTrqNs); + VectorOperations::add(torquePtgRws, rwTrqNs, torqueRws, 4); + actuatorCmd.scalingTorqueRws(torqueRws, torqueRwsScaled); + ptgCtrl.ptgDesaturation( + &acsParameters.nadirModeControllerParameters, mgmDataProcessed.mgmVecTot.value, + mgmDataProcessed.mgmVecTot.isValid(), mekfData.satRotRateMekf.value, + &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), + &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), mgtDpDes); + break; + + case SUBMODE_PTG_INERTIAL: + guidance.inertialQuatPtg(targetQuat, refSatRate); + std::memcpy(quatRef, acsParameters.inertialModeControllerParameters.quatRef, + 4 * sizeof(double)); + enableAntiStiction = acsParameters.inertialModeControllerParameters.enableAntiStiction; + guidance.comparePtg(targetQuat, &mekfData, quatRef, refSatRate, quatErrorComplete, quatError, + deltaRate); + ptgCtrl.ptgLaw(&acsParameters.inertialModeControllerParameters, quatError, deltaRate, + *rwPseudoInv, torquePtgRws); + ptgCtrl.ptgNullspace( + &acsParameters.inertialModeControllerParameters, &(sensorValues.rw1Set.currSpeed.value), + &(sensorValues.rw2Set.currSpeed.value), &(sensorValues.rw3Set.currSpeed.value), + &(sensorValues.rw4Set.currSpeed.value), rwTrqNs); + VectorOperations::add(torquePtgRws, rwTrqNs, torqueRws, 4); + actuatorCmd.scalingTorqueRws(torqueRws, torqueRwsScaled); + ptgCtrl.ptgDesaturation( + &acsParameters.inertialModeControllerParameters, mgmDataProcessed.mgmVecTot.value, + mgmDataProcessed.mgmVecTot.isValid(), mekfData.satRotRateMekf.value, + &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), + &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), mgtDpDes); + break; + } + + if (enableAntiStiction) { + bool rwAvailable[4] = {true, true, true, true}; // WHICH INPUT SENSOR SET? + int32_t rwSpeed[4] = { + (sensorValues.rw1Set.currSpeed.value), (sensorValues.rw2Set.currSpeed.value), + (sensorValues.rw3Set.currSpeed.value), (sensorValues.rw4Set.currSpeed.value)}; + ptgCtrl.rwAntistiction(rwAvailable, rwSpeed, torqueRwsScaled); + } + + double cmdSpeedRws[4] = {0, 0, 0, 0}; // Should be given to the actuator reaction wheel as input + actuatorCmd.cmdSpeedToRws(&(sensorValues.rw1Set.currSpeed.value), + &(sensorValues.rw2Set.currSpeed.value), + &(sensorValues.rw3Set.currSpeed.value), + &(sensorValues.rw4Set.currSpeed.value), torqueRwsScaled, cmdSpeedRws); + actuatorCmd.cmdDipolMtq(mgtDpDes, dipolUnits); + + int16_t cmdDipolUnitsInt[3] = {0, 0, 0}; + for (int i = 0; i < 3; ++i) { + cmdDipolUnitsInt[i] = std::round(dipolUnits[i]); + } + int32_t cmdRwSpeedInt[4] = {0, 0, 0, 0}; + for (int i = 0; i < 4; ++i) { + cmdRwSpeedInt[i] = std::round(cmdSpeedRws[i]); + } + + { + PoolReadGuard pg(&actuatorCmdData); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(actuatorCmdData.rwTargetTorque.value, rwTrqNs, 4 * sizeof(double)); + std::memcpy(actuatorCmdData.rwTargetSpeed.value, cmdRwSpeedInt, 4 * sizeof(int32_t)); + std::memcpy(actuatorCmdData.mtqTargetDipole.value, cmdDipolUnitsInt, 3 * sizeof(int16_t)); + actuatorCmdData.setValidity(true, true); + } + } + // { + // PoolReadGuard pg(&dipoleSet); + // MutexGuard mg(torquer::lazyLock()); + // torquer::NEW_ACTUATION_FLAG = true; + // dipoleSet.setDipoles(cmdDipolUnitsInt[0], cmdDipolUnitsInt[1], cmdDipolUnitsInt[2], + // torqueDuration); + // } +} + +ReturnValue_t AcsController::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, + LocalDataPoolManager& poolManager) { + // MGM Raw + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_0_LIS3_UT, &mgm0VecRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_1_RM3100_UT, &mgm1VecRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_2_LIS3_UT, &mgm2VecRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_3_RM3100_UT, &mgm3VecRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_IMTQ_CAL_NT, &imtqMgmVecRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_IMTQ_CAL_ACT_STATUS, &imtqCalActStatus); + poolManager.subscribeForRegularPeriodicPacket({mgmDataRaw.getSid(), false, 5.0}); + // MGM Processed + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_0_VEC, &mgm0VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_1_VEC, &mgm1VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_2_VEC, &mgm2VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_3_VEC, &mgm3VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_4_VEC, &mgm4VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_VEC_TOT, &mgmVecTot); + localDataPoolMap.emplace(acsctrl::PoolIds::MGM_VEC_TOT_DERIVATIVE, &mgmVecTotDer); + localDataPoolMap.emplace(acsctrl::PoolIds::MAG_IGRF_MODEL, &magIgrf); + poolManager.subscribeForRegularPeriodicPacket({mgmDataProcessed.getSid(), false, 5.0}); + // SUS Raw + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_0_N_LOC_XFYFZM_PT_XF, &sus0ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_1_N_LOC_XBYFZM_PT_XB, &sus1ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_2_N_LOC_XFYBZB_PT_YB, &sus2ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_3_N_LOC_XFYBZF_PT_YF, &sus3ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_4_N_LOC_XMYFZF_PT_ZF, &sus4ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_5_N_LOC_XFYMZB_PT_ZB, &sus5ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_6_R_LOC_XFYBZM_PT_XF, &sus6ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_7_R_LOC_XBYBZM_PT_XB, &sus7ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_8_R_LOC_XBYBZB_PT_YB, &sus8ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_9_R_LOC_XBYBZB_PT_YF, &sus9ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_10_N_LOC_XMYBZF_PT_ZF, &sus10ValRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_11_R_LOC_XBYMZB_PT_ZB, &sus11ValRaw); + poolManager.subscribeForRegularPeriodicPacket({susDataRaw.getSid(), false, 5.0}); + // SUS Processed + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_0_VEC, &sus0VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_1_VEC, &sus1VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_2_VEC, &sus2VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_3_VEC, &sus3VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_4_VEC, &sus4VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_5_VEC, &sus5VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_6_VEC, &sus6VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_7_VEC, &sus7VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_8_VEC, &sus8VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_9_VEC, &sus9VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_10_VEC, &sus10VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_11_VEC, &sus11VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_VEC_TOT, &susVecTot); + localDataPoolMap.emplace(acsctrl::PoolIds::SUS_VEC_TOT_DERIVATIVE, &susVecTotDer); + localDataPoolMap.emplace(acsctrl::PoolIds::SUN_IJK_MODEL, &sunIjk); + poolManager.subscribeForRegularPeriodicPacket({susDataProcessed.getSid(), false, 5.0}); + // GYR Raw + localDataPoolMap.emplace(acsctrl::PoolIds::GYR_0_ADIS, &gyr0VecRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::GYR_1_L3, &gyr1VecRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::GYR_2_ADIS, &gyr2VecRaw); + localDataPoolMap.emplace(acsctrl::PoolIds::GYR_3_L3, &gyr3VecRaw); + poolManager.subscribeForRegularPeriodicPacket({gyrDataRaw.getSid(), false, 5.0}); + // GYR Processed + localDataPoolMap.emplace(acsctrl::PoolIds::GYR_0_VEC, &gyr0VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::GYR_1_VEC, &gyr1VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::GYR_2_VEC, &gyr2VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::GYR_3_VEC, &gyr3VecProc); + localDataPoolMap.emplace(acsctrl::PoolIds::GYR_VEC_TOT, &gyrVecTot); + poolManager.subscribeForRegularPeriodicPacket({gyrDataProcessed.getSid(), false, 5.0}); + // GPS Processed + localDataPoolMap.emplace(acsctrl::PoolIds::GC_LATITUDE, &gcLatitude); + localDataPoolMap.emplace(acsctrl::PoolIds::GD_LONGITUDE, &gdLongitude); + localDataPoolMap.emplace(acsctrl::PoolIds::GPS_POSITION, &gpsPosition); + localDataPoolMap.emplace(acsctrl::PoolIds::GPS_VELOCITY, &gpsVelocity); + poolManager.subscribeForRegularPeriodicPacket({gpsDataProcessed.getSid(), false, 5.0}); + // MEKF + localDataPoolMap.emplace(acsctrl::PoolIds::QUAT_MEKF, &quatMekf); + localDataPoolMap.emplace(acsctrl::PoolIds::SAT_ROT_RATE_MEKF, &satRotRateMekf); + poolManager.subscribeForRegularPeriodicPacket({mekfData.getSid(), false, 5.0}); + // Ctrl Values + localDataPoolMap.emplace(acsctrl::PoolIds::TGT_QUAT, &tgtQuat); + localDataPoolMap.emplace(acsctrl::PoolIds::ERROR_QUAT, &errQuat); + localDataPoolMap.emplace(acsctrl::PoolIds::ERROR_ANG, &errAng); + poolManager.subscribeForRegularPeriodicPacket({ctrlValData.getSid(), false, 5.0}); + // Actuator CMD + localDataPoolMap.emplace(acsctrl::PoolIds::RW_TARGET_TORQUE, &rwTargetTorque); + localDataPoolMap.emplace(acsctrl::PoolIds::RW_TARGET_SPEED, &rwTargetSpeed); + localDataPoolMap.emplace(acsctrl::PoolIds::MTQ_TARGET_DIPOLE, &mtqTargetDipole); + poolManager.subscribeForRegularPeriodicPacket({actuatorCmdData.getSid(), false, 5.0}); + return returnvalue::OK; +} + +LocalPoolDataSetBase* AcsController::getDataSetHandle(sid_t sid) { + switch (sid.ownerSetId) { + case acsctrl::MGM_SENSOR_DATA: + return &mgmDataRaw; + case acsctrl::MGM_PROCESSED_DATA: + return &mgmDataProcessed; + case acsctrl::SUS_SENSOR_DATA: + return &susDataRaw; + case acsctrl::SUS_PROCESSED_DATA: + return &susDataProcessed; + case acsctrl::GYR_SENSOR_DATA: + return &gyrDataRaw; + case acsctrl::GYR_PROCESSED_DATA: + return &gyrDataProcessed; + case acsctrl::GPS_PROCESSED_DATA: + return &gpsDataProcessed; + case acsctrl::MEKF_DATA: + return &mekfData; + case acsctrl::CTRL_VAL_DATA: + return &ctrlValData; + case acsctrl::ACTUATOR_CMD_DATA: + return &actuatorCmdData; + default: + return nullptr; + } + return nullptr; +} + +ReturnValue_t AcsController::checkModeCommand(Mode_t mode, Submode_t submode, + uint32_t* msToReachTheMode) { + if (mode == MODE_OFF) { + if (submode == SUBMODE_NONE) { + return returnvalue::OK; } else { - detumbleCounter = 0; + return INVALID_SUBMODE; } - if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) { - submode = SUBMODE_SAFE; - detumbleCounter = 0; - } - - int16_t cmdDipolUnitsInt[3] = {0, 0, 0}; - for (int i = 0; i < 3; ++i) { - cmdDipolUnitsInt[i] = std::round(dipolCmdUnits[i]); - } - { - PoolReadGuard pg(&actuatorCmdData); - if (pg.getReadResult() == returnvalue::OK) { - std::memset(actuatorCmdData.rwTargetTorque.value, 0, 4 * sizeof(double)); - actuatorCmdData.rwTargetTorque.setValid(false); - std::memset(actuatorCmdData.rwTargetSpeed.value, 0, 4 * sizeof(int32_t)); - actuatorCmdData.rwTargetSpeed.setValid(false); - std::memcpy(actuatorCmdData.mtqTargetDipole.value, cmdDipolUnitsInt, 3 * sizeof(int16_t)); - actuatorCmdData.mtqTargetDipole.setValid(true); - actuatorCmdData.setValidity(true, false); - } - } - // { - // PoolReadGuard pg(&dipoleSet); - // MutexGuard mg(torquer::lazyLock()); - // torquer::NEW_ACTUATION_FLAG = true; - // dipoleSet.setDipoles(cmdDipolUnitsInt[0], cmdDipolUnitsInt[1], cmdDipolUnitsInt[2], - // torqueDuration); - // } - } - - void AcsController::performPointingCtrl() { - ACS::SensorValues sensorValues; - - timeval now; - Clock::getClock_timeval(&now); - - sensorProcessing.process(now, &sensorValues, &mgmDataProcessed, &susDataProcessed, - &gyrDataProcessed, &gpsDataProcessed, &acsParameters); - ReturnValue_t validMekf; - navigation.useMekf(&sensorValues, &gyrDataProcessed, &mgmDataProcessed, &susDataProcessed, - &mekfData, &validMekf); - - double targetQuat[4] = {0, 0, 0, 0}, refSatRate[3] = {0, 0, 0}; - double quatRef[4] = {0, 0, 0, 0}; - uint8_t enableAntiStiction = true; - - double quatErrorComplete[4] = {0, 0, 0, 0}, quatError[3] = {0, 0, 0}, - deltaRate[3] = {0, 0, 0}; // ToDo: check if pointer needed - double rwPseudoInv[4][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; - guidance.getDistributionMatrixRw(&sensorValues, *rwPseudoInv); - double torquePtgRws[4] = {0, 0, 0, 0}, rwTrqNs[4] = {0, 0, 0, 0}; - double torqueRws[4] = {0, 0, 0, 0}, torqueRwsScaled[4] = {0, 0, 0, 0}; - double mgtDpDes[3] = {0, 0, 0}, dipolUnits[3] = {0, 0, 0}; // Desaturation Dipol - - switch (submode) { - case SUBMODE_IDLE: - guidance.sunQuatPtg(&sensorValues, &mekfData, &susDataProcessed, &gpsDataProcessed, now, - targetQuat, refSatRate); - std::memcpy(quatRef, acsParameters.targetModeControllerParameters.quatRef, 4 * sizeof(double)); - enableAntiStiction = acsParameters.targetModeControllerParameters.enableAntiStiction; - guidance.comparePtg(targetQuat, &mekfData, quatRef, refSatRate, quatErrorComplete, quatError, deltaRate); - ptgCtrl.ptgLaw(&acsParameters.targetModeControllerParameters, quatError, deltaRate, *rwPseudoInv, torquePtgRws); - ptgCtrl.ptgNullspace(&acsParameters.targetModeControllerParameters, - &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), - &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), rwTrqNs); - VectorOperations::add(torquePtgRws, rwTrqNs, torqueRws, 4); - actuatorCmd.scalingTorqueRws(torqueRws, torqueRwsScaled); - ptgCtrl.ptgDesaturation(&acsParameters.targetModeControllerParameters, mgmDataProcessed.mgmVecTot.value, - mgmDataProcessed.mgmVecTot.isValid(), mekfData.satRotRateMekf.value, - &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), - &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), mgtDpDes); - - break; - - case SUBMODE_PTG_TARGET: - guidance.targetQuatPtgThreeAxes(&sensorValues, &gpsDataProcessed, &mekfData, now, - targetQuat, refSatRate); - std::memcpy(quatRef, acsParameters.targetModeControllerParameters.quatRef, 4 * sizeof(double)); - enableAntiStiction = acsParameters.targetModeControllerParameters.enableAntiStiction; - guidance.comparePtg(targetQuat, &mekfData, quatRef, refSatRate, quatErrorComplete, quatError, deltaRate); - ptgCtrl.ptgLaw(&acsParameters.targetModeControllerParameters, quatError, deltaRate, *rwPseudoInv, torquePtgRws); - ptgCtrl.ptgNullspace(&acsParameters.targetModeControllerParameters, - &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), - &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), rwTrqNs); - VectorOperations::add(torquePtgRws, rwTrqNs, torqueRws, 4); - actuatorCmd.scalingTorqueRws(torqueRws, torqueRwsScaled); - ptgCtrl.ptgDesaturation(&acsParameters.targetModeControllerParameters, mgmDataProcessed.mgmVecTot.value, - mgmDataProcessed.mgmVecTot.isValid(), mekfData.satRotRateMekf.value, - &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), - &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), mgtDpDes); - break; - - case SUBMODE_PTG_TARGET_GS: - guidance.targetQuatPtgGs(&sensorValues, &mekfData, &susDataProcessed, &gpsDataProcessed, - now, targetQuat, refSatRate); - std::memcpy(quatRef, acsParameters.targetModeControllerParameters.quatRef, 4 * sizeof(double)); - enableAntiStiction = acsParameters.targetModeControllerParameters.enableAntiStiction; - guidance.comparePtg(targetQuat, &mekfData, quatRef, refSatRate, quatErrorComplete, quatError, deltaRate); - ptgCtrl.ptgLaw(&acsParameters.targetModeControllerParameters, quatError, deltaRate, *rwPseudoInv, torquePtgRws); - ptgCtrl.ptgNullspace(&acsParameters.targetModeControllerParameters, - &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), - &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), rwTrqNs); - VectorOperations::add(torquePtgRws, rwTrqNs, torqueRws, 4); - actuatorCmd.scalingTorqueRws(torqueRws, torqueRwsScaled); - ptgCtrl.ptgDesaturation(&acsParameters.targetModeControllerParameters, mgmDataProcessed.mgmVecTot.value, - mgmDataProcessed.mgmVecTot.isValid(), mekfData.satRotRateMekf.value, - &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), - &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), mgtDpDes); - break; - - case SUBMODE_PTG_NADIR: - guidance.quatNadirPtgThreeAxes(&sensorValues, &gpsDataProcessed, &mekfData, now, targetQuat, - refSatRate); - std::memcpy(quatRef, acsParameters.nadirModeControllerParameters.quatRef, 4 * sizeof(double)); - enableAntiStiction = acsParameters.nadirModeControllerParameters.enableAntiStiction; - guidance.comparePtg(targetQuat, &mekfData, quatRef, refSatRate, quatErrorComplete, quatError, deltaRate); - ptgCtrl.ptgLaw(&acsParameters.nadirModeControllerParameters, quatError, deltaRate, *rwPseudoInv, torquePtgRws); - ptgCtrl.ptgNullspace(&acsParameters.nadirModeControllerParameters, - &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), - &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), rwTrqNs); - VectorOperations::add(torquePtgRws, rwTrqNs, torqueRws, 4); - actuatorCmd.scalingTorqueRws(torqueRws, torqueRwsScaled); - ptgCtrl.ptgDesaturation(&acsParameters.nadirModeControllerParameters, mgmDataProcessed.mgmVecTot.value, - mgmDataProcessed.mgmVecTot.isValid(), mekfData.satRotRateMekf.value, - &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), - &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), mgtDpDes); - break; - - case SUBMODE_PTG_INERTIAL: - guidance.inertialQuatPtg(targetQuat, refSatRate); - std::memcpy(quatRef, acsParameters.inertialModeControllerParameters.quatRef, 4 * sizeof(double)); - enableAntiStiction = acsParameters.inertialModeControllerParameters.enableAntiStiction; - guidance.comparePtg(targetQuat, &mekfData, quatRef, refSatRate, quatErrorComplete, quatError, deltaRate); - ptgCtrl.ptgLaw(&acsParameters.inertialModeControllerParameters, quatError, deltaRate, *rwPseudoInv, torquePtgRws); - ptgCtrl.ptgNullspace(&acsParameters.inertialModeControllerParameters, - &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), - &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), rwTrqNs); - VectorOperations::add(torquePtgRws, rwTrqNs, torqueRws, 4); - actuatorCmd.scalingTorqueRws(torqueRws, torqueRwsScaled); - ptgCtrl.ptgDesaturation(&acsParameters.inertialModeControllerParameters, mgmDataProcessed.mgmVecTot.value, - mgmDataProcessed.mgmVecTot.isValid(), mekfData.satRotRateMekf.value, - &(sensorValues.rw1Set.currSpeed.value), &(sensorValues.rw2Set.currSpeed.value), - &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), mgtDpDes); - break; - } - - if ( enableAntiStiction ) { - bool rwAvailable[4] = {true, true, true, true}; // WHICH INPUT SENSOR SET? - int32_t rwSpeed[4] = { - (sensorValues.rw1Set.currSpeed.value), (sensorValues.rw2Set.currSpeed.value), - (sensorValues.rw3Set.currSpeed.value), (sensorValues.rw4Set.currSpeed.value)}; - ptgCtrl.rwAntistiction(rwAvailable, rwSpeed, torqueRwsScaled); - } - - double cmdSpeedRws[4] = {0, 0, 0, - 0}; // Should be given to the actuator reaction wheel as input - actuatorCmd.cmdSpeedToRws(&(sensorValues.rw1Set.currSpeed.value), - &(sensorValues.rw2Set.currSpeed.value), - &(sensorValues.rw3Set.currSpeed.value), - &(sensorValues.rw4Set.currSpeed.value), torqueRwsScaled, cmdSpeedRws); - actuatorCmd.cmdDipolMtq(mgtDpDes, dipolUnits); - - int16_t cmdDipolUnitsInt[3] = {0, 0, 0}; - for (int i = 0; i < 3; ++i) { - cmdDipolUnitsInt[i] = std::round(dipolUnits[i]); - } - int32_t cmdRwSpeedInt[4] = {0, 0, 0, 0}; - for (int i = 0; i < 4; ++i) { - cmdRwSpeedInt[i] = std::round(cmdSpeedRws[i]); - } - - { - PoolReadGuard pg(&actuatorCmdData); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(actuatorCmdData.rwTargetTorque.value, rwTrqNs, 4 * sizeof(double)); - std::memcpy(actuatorCmdData.rwTargetSpeed.value, cmdRwSpeedInt, 4 * sizeof(int32_t)); - std::memcpy(actuatorCmdData.mtqTargetDipole.value, cmdDipolUnitsInt, 3 * sizeof(int16_t)); - actuatorCmdData.setValidity(true, true); - } - } - // { - // PoolReadGuard pg(&dipoleSet); - // MutexGuard mg(torquer::lazyLock()); - // torquer::NEW_ACTUATION_FLAG = true; - // dipoleSet.setDipoles(cmdDipolUnitsInt[0], cmdDipolUnitsInt[1], cmdDipolUnitsInt[2], - // torqueDuration); - // } - } - - ReturnValue_t AcsController::initializeLocalDataPool(localpool::DataPool & localDataPoolMap, - LocalDataPoolManager & poolManager) { - // MGM Raw - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_0_LIS3_UT, &mgm0VecRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_1_RM3100_UT, &mgm1VecRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_2_LIS3_UT, &mgm2VecRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_3_RM3100_UT, &mgm3VecRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_IMTQ_CAL_NT, &imtqMgmVecRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_IMTQ_CAL_ACT_STATUS, &imtqCalActStatus); - poolManager.subscribeForRegularPeriodicPacket({mgmDataRaw.getSid(), false, 5.0}); - // MGM Processed - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_0_VEC, &mgm0VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_1_VEC, &mgm1VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_2_VEC, &mgm2VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_3_VEC, &mgm3VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_4_VEC, &mgm4VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_VEC_TOT, &mgmVecTot); - localDataPoolMap.emplace(acsctrl::PoolIds::MGM_VEC_TOT_DERIVATIVE, &mgmVecTotDer); - localDataPoolMap.emplace(acsctrl::PoolIds::MAG_IGRF_MODEL, &magIgrf); - poolManager.subscribeForRegularPeriodicPacket({mgmDataProcessed.getSid(), false, 5.0}); - // SUS Raw - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_0_N_LOC_XFYFZM_PT_XF, &sus0ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_1_N_LOC_XBYFZM_PT_XB, &sus1ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_2_N_LOC_XFYBZB_PT_YB, &sus2ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_3_N_LOC_XFYBZF_PT_YF, &sus3ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_4_N_LOC_XMYFZF_PT_ZF, &sus4ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_5_N_LOC_XFYMZB_PT_ZB, &sus5ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_6_R_LOC_XFYBZM_PT_XF, &sus6ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_7_R_LOC_XBYBZM_PT_XB, &sus7ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_8_R_LOC_XBYBZB_PT_YB, &sus8ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_9_R_LOC_XBYBZB_PT_YF, &sus9ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_10_N_LOC_XMYBZF_PT_ZF, &sus10ValRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_11_R_LOC_XBYMZB_PT_ZB, &sus11ValRaw); - poolManager.subscribeForRegularPeriodicPacket({susDataRaw.getSid(), false, 5.0}); - // SUS Processed - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_0_VEC, &sus0VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_1_VEC, &sus1VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_2_VEC, &sus2VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_3_VEC, &sus3VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_4_VEC, &sus4VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_5_VEC, &sus5VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_6_VEC, &sus6VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_7_VEC, &sus7VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_8_VEC, &sus8VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_9_VEC, &sus9VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_10_VEC, &sus10VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_11_VEC, &sus11VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_VEC_TOT, &susVecTot); - localDataPoolMap.emplace(acsctrl::PoolIds::SUS_VEC_TOT_DERIVATIVE, &susVecTotDer); - localDataPoolMap.emplace(acsctrl::PoolIds::SUN_IJK_MODEL, &sunIjk); - poolManager.subscribeForRegularPeriodicPacket({susDataProcessed.getSid(), false, 5.0}); - // GYR Raw - localDataPoolMap.emplace(acsctrl::PoolIds::GYR_0_ADIS, &gyr0VecRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::GYR_1_L3, &gyr1VecRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::GYR_2_ADIS, &gyr2VecRaw); - localDataPoolMap.emplace(acsctrl::PoolIds::GYR_3_L3, &gyr3VecRaw); - poolManager.subscribeForRegularPeriodicPacket({gyrDataRaw.getSid(), false, 5.0}); - // GYR Processed - localDataPoolMap.emplace(acsctrl::PoolIds::GYR_0_VEC, &gyr0VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::GYR_1_VEC, &gyr1VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::GYR_2_VEC, &gyr2VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::GYR_3_VEC, &gyr3VecProc); - localDataPoolMap.emplace(acsctrl::PoolIds::GYR_VEC_TOT, &gyrVecTot); - poolManager.subscribeForRegularPeriodicPacket({gyrDataProcessed.getSid(), false, 5.0}); - // GPS Processed - localDataPoolMap.emplace(acsctrl::PoolIds::GC_LATITUDE, &gcLatitude); - localDataPoolMap.emplace(acsctrl::PoolIds::GD_LONGITUDE, &gdLongitude); - localDataPoolMap.emplace(acsctrl::PoolIds::GPS_POSITION, &gpsPosition); - localDataPoolMap.emplace(acsctrl::PoolIds::GPS_VELOCITY, &gpsVelocity); - poolManager.subscribeForRegularPeriodicPacket({gpsDataProcessed.getSid(), false, 5.0}); - // MEKF - localDataPoolMap.emplace(acsctrl::PoolIds::QUAT_MEKF, &quatMekf); - localDataPoolMap.emplace(acsctrl::PoolIds::SAT_ROT_RATE_MEKF, &satRotRateMekf); - poolManager.subscribeForRegularPeriodicPacket({mekfData.getSid(), false, 5.0}); - // Ctrl Values - localDataPoolMap.emplace(acsctrl::PoolIds::TGT_QUAT, &tgtQuat); - localDataPoolMap.emplace(acsctrl::PoolIds::ERROR_QUAT, &errQuat); - localDataPoolMap.emplace(acsctrl::PoolIds::ERROR_ANG, &errAng); - poolManager.subscribeForRegularPeriodicPacket({ctrlValData.getSid(), false, 5.0}); - // Actuator CMD - localDataPoolMap.emplace(acsctrl::PoolIds::RW_TARGET_TORQUE, &rwTargetTorque); - localDataPoolMap.emplace(acsctrl::PoolIds::RW_TARGET_SPEED, &rwTargetSpeed); - localDataPoolMap.emplace(acsctrl::PoolIds::MTQ_TARGET_DIPOLE, &mtqTargetDipole); - poolManager.subscribeForRegularPeriodicPacket({actuatorCmdData.getSid(), false, 5.0}); - return returnvalue::OK; - } - - LocalPoolDataSetBase *AcsController::getDataSetHandle(sid_t sid) { - switch (sid.ownerSetId) { - case acsctrl::MGM_SENSOR_DATA: - return &mgmDataRaw; - case acsctrl::MGM_PROCESSED_DATA: - return &mgmDataProcessed; - case acsctrl::SUS_SENSOR_DATA: - return &susDataRaw; - case acsctrl::SUS_PROCESSED_DATA: - return &susDataProcessed; - case acsctrl::GYR_SENSOR_DATA: - return &gyrDataRaw; - case acsctrl::GYR_PROCESSED_DATA: - return &gyrDataProcessed; - case acsctrl::GPS_PROCESSED_DATA: - return &gpsDataProcessed; - case acsctrl::MEKF_DATA: - return &mekfData; - case acsctrl::CTRL_VAL_DATA: - return &ctrlValData; - case acsctrl::ACTUATOR_CMD_DATA: - return &actuatorCmdData; - default: - return nullptr; - } - return nullptr; - } - - ReturnValue_t AcsController::checkModeCommand(Mode_t mode, Submode_t submode, - uint32_t * msToReachTheMode) { - if (mode == MODE_OFF) { - if (submode == SUBMODE_NONE) { - return returnvalue::OK; - } else { - return INVALID_SUBMODE; - } - } else if ((mode == MODE_ON) || (mode == MODE_NORMAL)) { - if ((submode > 8) || (submode < 2)) { - return INVALID_SUBMODE; - } else { - return returnvalue::OK; - } - } - return INVALID_MODE; - } - - void AcsController::copyMgmData() { - ACS::SensorValues sensorValues; - { - PoolReadGuard pg(&sensorValues.mgm0Lis3Set); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(mgmDataRaw.mgm0Lis3.value, sensorValues.mgm0Lis3Set.fieldStrengths.value, - 3 * sizeof(float)); - mgmDataRaw.mgm0Lis3.setValid(sensorValues.mgm0Lis3Set.fieldStrengths.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.mgm1Rm3100Set); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(mgmDataRaw.mgm1Rm3100.value, sensorValues.mgm1Rm3100Set.fieldStrengths.value, - 3 * sizeof(float)); - mgmDataRaw.mgm1Rm3100.setValid(sensorValues.mgm1Rm3100Set.fieldStrengths.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.mgm2Lis3Set); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(mgmDataRaw.mgm2Lis3.value, sensorValues.mgm2Lis3Set.fieldStrengths.value, - 3 * sizeof(float)); - mgmDataRaw.mgm2Lis3.setValid(sensorValues.mgm2Lis3Set.fieldStrengths.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.mgm3Rm3100Set); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(mgmDataRaw.mgm3Rm3100.value, sensorValues.mgm3Rm3100Set.fieldStrengths.value, - 3 * sizeof(float)); - mgmDataRaw.mgm3Rm3100.setValid(sensorValues.mgm3Rm3100Set.fieldStrengths.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.imtqMgmSet); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(mgmDataRaw.imtqRaw.value, sensorValues.imtqMgmSet.mtmRawNt.value, - 3 * sizeof(float)); - mgmDataRaw.imtqRaw.setValid(sensorValues.imtqMgmSet.mtmRawNt.isValid()); - mgmDataRaw.actuationCalStatus.value = sensorValues.imtqMgmSet.coilActuationStatus.value; - mgmDataRaw.actuationCalStatus.setValid( - sensorValues.imtqMgmSet.coilActuationStatus.isValid()); - } + } else if ((mode == MODE_ON) || (mode == MODE_NORMAL)) { + if ((submode > 8) || (submode < 2)) { + return INVALID_SUBMODE; + } else { + return returnvalue::OK; } } + return INVALID_MODE; +} - void AcsController::copySusData() { - ACS::SensorValues sensorValues; - { - PoolReadGuard pg(&sensorValues.susSets[0]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus0.value, sensorValues.susSets[0].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus0.setValid(sensorValues.susSets[0].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[1]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus1.value, sensorValues.susSets[1].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus1.setValid(sensorValues.susSets[1].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[2]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus2.value, sensorValues.susSets[2].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus2.setValid(sensorValues.susSets[2].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[3]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus3.value, sensorValues.susSets[3].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus3.setValid(sensorValues.susSets[3].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[4]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus4.value, sensorValues.susSets[4].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus4.setValid(sensorValues.susSets[4].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[5]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus5.value, sensorValues.susSets[5].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus5.setValid(sensorValues.susSets[5].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[6]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus6.value, sensorValues.susSets[6].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus6.setValid(sensorValues.susSets[6].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[7]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus7.value, sensorValues.susSets[7].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus7.setValid(sensorValues.susSets[7].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[8]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus8.value, sensorValues.susSets[8].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus8.setValid(sensorValues.susSets[8].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[9]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus9.value, sensorValues.susSets[9].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus9.setValid(sensorValues.susSets[9].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[10]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus10.value, sensorValues.susSets[10].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus10.setValid(sensorValues.susSets[10].channels.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.susSets[11]); - if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(susDataRaw.sus11.value, sensorValues.susSets[11].channels.value, - 6 * sizeof(uint16_t)); - susDataRaw.sus11.setValid(sensorValues.susSets[11].channels.isValid()); - } +void AcsController::copyMgmData() { + ACS::SensorValues sensorValues; + { + PoolReadGuard pg(&sensorValues.mgm0Lis3Set); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(mgmDataRaw.mgm0Lis3.value, sensorValues.mgm0Lis3Set.fieldStrengths.value, + 3 * sizeof(float)); + mgmDataRaw.mgm0Lis3.setValid(sensorValues.mgm0Lis3Set.fieldStrengths.isValid()); } } - - void AcsController::copyGyrData() { - ACS::SensorValues sensorValues; - { - PoolReadGuard pg(&sensorValues.gyr0AdisSet); - if (pg.getReadResult() == returnvalue::OK) { - gyrDataRaw.gyr0Adis.value[0] = sensorValues.gyr0AdisSet.angVelocX.value; - gyrDataRaw.gyr0Adis.value[1] = sensorValues.gyr0AdisSet.angVelocY.value; - gyrDataRaw.gyr0Adis.value[2] = sensorValues.gyr0AdisSet.angVelocZ.value; - gyrDataRaw.gyr0Adis.setValid(sensorValues.gyr0AdisSet.angVelocX.isValid() && - sensorValues.gyr0AdisSet.angVelocY.isValid() && - sensorValues.gyr0AdisSet.angVelocZ.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.gyr1L3gSet); - if (pg.getReadResult() == returnvalue::OK) { - gyrDataRaw.gyr1L3.value[0] = sensorValues.gyr1L3gSet.angVelocX.value; - gyrDataRaw.gyr1L3.value[1] = sensorValues.gyr1L3gSet.angVelocY.value; - gyrDataRaw.gyr1L3.value[2] = sensorValues.gyr1L3gSet.angVelocZ.value; - gyrDataRaw.gyr1L3.setValid(sensorValues.gyr1L3gSet.angVelocX.isValid() && - sensorValues.gyr1L3gSet.angVelocY.isValid() && - sensorValues.gyr1L3gSet.angVelocZ.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.gyr2AdisSet); - if (pg.getReadResult() == returnvalue::OK) { - gyrDataRaw.gyr2Adis.value[0] = sensorValues.gyr2AdisSet.angVelocX.value; - gyrDataRaw.gyr2Adis.value[1] = sensorValues.gyr2AdisSet.angVelocY.value; - gyrDataRaw.gyr2Adis.value[2] = sensorValues.gyr2AdisSet.angVelocZ.value; - gyrDataRaw.gyr2Adis.setValid(sensorValues.gyr2AdisSet.angVelocX.isValid() && - sensorValues.gyr2AdisSet.angVelocY.isValid() && - sensorValues.gyr2AdisSet.angVelocZ.isValid()); - } - } - { - PoolReadGuard pg(&sensorValues.gyr3L3gSet); - if (pg.getReadResult() == returnvalue::OK) { - gyrDataRaw.gyr3L3.value[0] = sensorValues.gyr3L3gSet.angVelocX.value; - gyrDataRaw.gyr3L3.value[1] = sensorValues.gyr3L3gSet.angVelocY.value; - gyrDataRaw.gyr3L3.value[2] = sensorValues.gyr3L3gSet.angVelocZ.value; - gyrDataRaw.gyr3L3.setValid(sensorValues.gyr3L3gSet.angVelocX.isValid() && - sensorValues.gyr3L3gSet.angVelocY.isValid() && - sensorValues.gyr3L3gSet.angVelocZ.isValid()); - } + { + PoolReadGuard pg(&sensorValues.mgm1Rm3100Set); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(mgmDataRaw.mgm1Rm3100.value, sensorValues.mgm1Rm3100Set.fieldStrengths.value, + 3 * sizeof(float)); + mgmDataRaw.mgm1Rm3100.setValid(sensorValues.mgm1Rm3100Set.fieldStrengths.isValid()); } } + { + PoolReadGuard pg(&sensorValues.mgm2Lis3Set); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(mgmDataRaw.mgm2Lis3.value, sensorValues.mgm2Lis3Set.fieldStrengths.value, + 3 * sizeof(float)); + mgmDataRaw.mgm2Lis3.setValid(sensorValues.mgm2Lis3Set.fieldStrengths.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.mgm3Rm3100Set); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(mgmDataRaw.mgm3Rm3100.value, sensorValues.mgm3Rm3100Set.fieldStrengths.value, + 3 * sizeof(float)); + mgmDataRaw.mgm3Rm3100.setValid(sensorValues.mgm3Rm3100Set.fieldStrengths.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.imtqMgmSet); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(mgmDataRaw.imtqRaw.value, sensorValues.imtqMgmSet.mtmRawNt.value, + 3 * sizeof(float)); + mgmDataRaw.imtqRaw.setValid(sensorValues.imtqMgmSet.mtmRawNt.isValid()); + mgmDataRaw.actuationCalStatus.value = sensorValues.imtqMgmSet.coilActuationStatus.value; + mgmDataRaw.actuationCalStatus.setValid(sensorValues.imtqMgmSet.coilActuationStatus.isValid()); + } + } +} + +void AcsController::copySusData() { + ACS::SensorValues sensorValues; + { + PoolReadGuard pg(&sensorValues.susSets[0]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus0.value, sensorValues.susSets[0].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus0.setValid(sensorValues.susSets[0].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[1]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus1.value, sensorValues.susSets[1].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus1.setValid(sensorValues.susSets[1].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[2]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus2.value, sensorValues.susSets[2].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus2.setValid(sensorValues.susSets[2].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[3]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus3.value, sensorValues.susSets[3].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus3.setValid(sensorValues.susSets[3].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[4]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus4.value, sensorValues.susSets[4].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus4.setValid(sensorValues.susSets[4].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[5]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus5.value, sensorValues.susSets[5].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus5.setValid(sensorValues.susSets[5].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[6]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus6.value, sensorValues.susSets[6].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus6.setValid(sensorValues.susSets[6].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[7]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus7.value, sensorValues.susSets[7].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus7.setValid(sensorValues.susSets[7].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[8]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus8.value, sensorValues.susSets[8].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus8.setValid(sensorValues.susSets[8].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[9]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus9.value, sensorValues.susSets[9].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus9.setValid(sensorValues.susSets[9].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[10]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus10.value, sensorValues.susSets[10].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus10.setValid(sensorValues.susSets[10].channels.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.susSets[11]); + if (pg.getReadResult() == returnvalue::OK) { + std::memcpy(susDataRaw.sus11.value, sensorValues.susSets[11].channels.value, + 6 * sizeof(uint16_t)); + susDataRaw.sus11.setValid(sensorValues.susSets[11].channels.isValid()); + } + } +} + +void AcsController::copyGyrData() { + ACS::SensorValues sensorValues; + { + PoolReadGuard pg(&sensorValues.gyr0AdisSet); + if (pg.getReadResult() == returnvalue::OK) { + gyrDataRaw.gyr0Adis.value[0] = sensorValues.gyr0AdisSet.angVelocX.value; + gyrDataRaw.gyr0Adis.value[1] = sensorValues.gyr0AdisSet.angVelocY.value; + gyrDataRaw.gyr0Adis.value[2] = sensorValues.gyr0AdisSet.angVelocZ.value; + gyrDataRaw.gyr0Adis.setValid(sensorValues.gyr0AdisSet.angVelocX.isValid() && + sensorValues.gyr0AdisSet.angVelocY.isValid() && + sensorValues.gyr0AdisSet.angVelocZ.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.gyr1L3gSet); + if (pg.getReadResult() == returnvalue::OK) { + gyrDataRaw.gyr1L3.value[0] = sensorValues.gyr1L3gSet.angVelocX.value; + gyrDataRaw.gyr1L3.value[1] = sensorValues.gyr1L3gSet.angVelocY.value; + gyrDataRaw.gyr1L3.value[2] = sensorValues.gyr1L3gSet.angVelocZ.value; + gyrDataRaw.gyr1L3.setValid(sensorValues.gyr1L3gSet.angVelocX.isValid() && + sensorValues.gyr1L3gSet.angVelocY.isValid() && + sensorValues.gyr1L3gSet.angVelocZ.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.gyr2AdisSet); + if (pg.getReadResult() == returnvalue::OK) { + gyrDataRaw.gyr2Adis.value[0] = sensorValues.gyr2AdisSet.angVelocX.value; + gyrDataRaw.gyr2Adis.value[1] = sensorValues.gyr2AdisSet.angVelocY.value; + gyrDataRaw.gyr2Adis.value[2] = sensorValues.gyr2AdisSet.angVelocZ.value; + gyrDataRaw.gyr2Adis.setValid(sensorValues.gyr2AdisSet.angVelocX.isValid() && + sensorValues.gyr2AdisSet.angVelocY.isValid() && + sensorValues.gyr2AdisSet.angVelocZ.isValid()); + } + } + { + PoolReadGuard pg(&sensorValues.gyr3L3gSet); + if (pg.getReadResult() == returnvalue::OK) { + gyrDataRaw.gyr3L3.value[0] = sensorValues.gyr3L3gSet.angVelocX.value; + gyrDataRaw.gyr3L3.value[1] = sensorValues.gyr3L3gSet.angVelocY.value; + gyrDataRaw.gyr3L3.value[2] = sensorValues.gyr3L3gSet.angVelocZ.value; + gyrDataRaw.gyr3L3.setValid(sensorValues.gyr3L3gSet.angVelocX.isValid() && + sensorValues.gyr3L3gSet.angVelocY.isValid() && + sensorValues.gyr3L3gSet.angVelocZ.isValid()); + } + } +} diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index 80a3a65f..a0e8af0f 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -816,49 +816,48 @@ class AcsParameters : public HasParametersIF { } safeModeControllerParameters; struct PointingLawParameters { + double zeta = 0.3; + double om = 0.3; + double omMax = 1 * M_PI / 180; + double qiMin = 0.1; + double gainNullspace = 0.01; - double zeta = 0.3; - double om = 0.3; - double omMax = 1 * M_PI / 180; - double qiMin = 0.1; - double gainNullspace = 0.01; - - double desatMomentumRef[3] = {0, 0, 0}; - double deSatGainFactor = 1000; - uint8_t desatOn = true; - uint8_t enableAntiStiction = true; + double desatMomentumRef[3] = {0, 0, 0}; + double deSatGainFactor = 1000; + uint8_t desatOn = true; + uint8_t enableAntiStiction = true; } pointingLawParameters; struct TargetModeControllerParameters : PointingLawParameters { - double refDirection[3] = {-1, 0, 0}; // Antenna - double refRotRate[3] = {0, 0, 0}; // Not used atm, do we want an option to - // give this as an input- currently en calculation is done - double quatRef[4] = {0, 0, 0, 1}; - int8_t timeElapsedMax = 10; // rot rate calculations + double refDirection[3] = {-1, 0, 0}; // Antenna + double refRotRate[3] = {0, 0, 0}; // Not used atm, do we want an option to + // give this as an input- currently en calculation is done + double quatRef[4] = {0, 0, 0, 1}; + int8_t timeElapsedMax = 10; // rot rate calculations - // Default is Stuttgart GS - double latitudeTgt = 48.7495 * M_PI / 180.; // [rad] Latitude - double longitudeTgt = 9.10384 * M_PI / 180.; // [rad] Longitude - double altitudeTgt = 500; // [m] + // Default is Stuttgart GS + double latitudeTgt = 48.7495 * M_PI / 180.; // [rad] Latitude + double longitudeTgt = 9.10384 * M_PI / 180.; // [rad] Longitude + double altitudeTgt = 500; // [m] - // For one-axis control: - uint8_t avoidBlindStr = true; - double blindAvoidStart = 1.5; - double blindAvoidStop = 2.5; - double blindRotRate = 1 * M_PI / 180; + // For one-axis control: + uint8_t avoidBlindStr = true; + double blindAvoidStart = 1.5; + double blindAvoidStop = 2.5; + double blindRotRate = 1 * M_PI / 180; } targetModeControllerParameters; struct NadirModeControllerParameters : PointingLawParameters { - double refDirection[3] = {-1, 0, 0}; // Antenna - double quatRef[4] = {0, 0, 0, 1}; - int8_t timeElapsedMax = 10; // rot rate calculations + double refDirection[3] = {-1, 0, 0}; // Antenna + double quatRef[4] = {0, 0, 0, 1}; + int8_t timeElapsedMax = 10; // rot rate calculations } nadirModeControllerParameters; struct InertialModeControllerParameters : PointingLawParameters { - double tgtQuat[4] = {0, 0, 0, 1}; - double refRotRate[3] = {0, 0, 0}; - double quatRef[4] = {0, 0, 0, 1}; + double tgtQuat[4] = {0, 0, 0, 1}; + double refRotRate[3] = {0, 0, 0}; + double quatRef[4] = {0, 0, 0, 1}; } inertialModeControllerParameters; struct StrParameters { diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index 4ba72674..48c148c9 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -42,7 +42,8 @@ void Guidance::targetQuatPtgSingleAxis(ACS::SensorValues *sensorValues, acsctrl: double targetCart[3] = {0, 0, 0}; MathOperations::cartesianFromLatLongAlt( - acsParameters.targetModeControllerParameters.latitudeTgt, acsParameters.targetModeControllerParameters.longitudeTgt, + acsParameters.targetModeControllerParameters.latitudeTgt, + acsParameters.targetModeControllerParameters.longitudeTgt, acsParameters.targetModeControllerParameters.altitudeTgt, targetCart); // Position of the satellite in the earth/fixed frame via GPS @@ -172,14 +173,14 @@ void Guidance::targetQuatPtgSingleAxis(ACS::SensorValues *sensorValues, acsctrl: } } -void Guidance::refRotationRate(int8_t timeElapsedMax, timeval now, double quatInertialTarget[4], double *refSatRate) { +void Guidance::refRotationRate(int8_t timeElapsedMax, timeval now, double quatInertialTarget[4], + double *refSatRate) { //------------------------------------------------------------------------------------- // Calculation of reference rotation rate //------------------------------------------------------------------------------------- - double timeElapsed = - now.tv_sec + now.tv_usec * pow(10, -6) - - (timeSavedQuaternion.tv_sec + - timeSavedQuaternion.tv_usec * pow((double)timeSavedQuaternion.tv_usec, -6)); + double timeElapsed = now.tv_sec + now.tv_usec * pow(10, -6) - + (timeSavedQuaternion.tv_sec + + timeSavedQuaternion.tv_usec * pow((double)timeSavedQuaternion.tv_usec, -6)); if (timeElapsed < timeElapsedMax) { double qDiff[4] = {0, 0, 0, 0}; VectorOperations::subtract(quatInertialTarget, savedQuaternion, qDiff, 4); @@ -226,7 +227,8 @@ void Guidance::targetQuatPtgThreeAxes(ACS::SensorValues *sensorValues, double targetCart[3] = {0, 0, 0}; MathOperations::cartesianFromLatLongAlt( - acsParameters.targetModeControllerParameters.latitudeTgt, acsParameters.targetModeControllerParameters.longitudeTgt, + acsParameters.targetModeControllerParameters.latitudeTgt, + acsParameters.targetModeControllerParameters.longitudeTgt, acsParameters.targetModeControllerParameters.altitudeTgt, targetCart); // Position of the satellite in the earth/fixed frame via GPS double posSatE[3] = {0, 0, 0}; @@ -307,7 +309,8 @@ void Guidance::targetQuatPtgGs(ACS::SensorValues *sensorValues, acsctrl::MekfDat double groundStationCart[3] = {0, 0, 0}; MathOperations::cartesianFromLatLongAlt( - acsParameters.targetModeControllerParameters.latitudeTgt, acsParameters.targetModeControllerParameters.longitudeTgt, + acsParameters.targetModeControllerParameters.latitudeTgt, + acsParameters.targetModeControllerParameters.longitudeTgt, acsParameters.targetModeControllerParameters.altitudeTgt, groundStationCart); // Position of the satellite in the earth/fixed frame via GPS double posSatE[3] = {0, 0, 0}; @@ -588,13 +591,15 @@ void Guidance::quatNadirPtgThreeAxes(ACS::SensorValues *sensorValues, } void Guidance::inertialQuatPtg(double targetQuat[4], double refSatRate[3]) { - std::memcpy(targetQuat, acsParameters.inertialModeControllerParameters.tgtQuat, 4 * sizeof(double)); - std::memcpy(refSatRate, acsParameters.inertialModeControllerParameters.refRotRate, 3 * sizeof(double)); + std::memcpy(targetQuat, acsParameters.inertialModeControllerParameters.tgtQuat, + 4 * sizeof(double)); + std::memcpy(refSatRate, acsParameters.inertialModeControllerParameters.refRotRate, + 3 * sizeof(double)); } -void Guidance::comparePtg(double targetQuat[4], acsctrl::MekfData *mekfData, double quatRef[4], double refSatRate[3], - double quatErrorComplete[4], double quatError[3], double deltaRate[3]) { - +void Guidance::comparePtg(double targetQuat[4], acsctrl::MekfData *mekfData, double quatRef[4], + double refSatRate[3], double quatErrorComplete[4], double quatError[3], + double deltaRate[3]) { double satRate[3] = {0, 0, 0}; std::memcpy(satRate, mekfData->satRotRateMekf.value, 3 * sizeof(double)); VectorOperations::subtract(satRate, refSatRate, deltaRate, 3); diff --git a/mission/controller/acs/Guidance.h b/mission/controller/acs/Guidance.h index e399af8a..5203ee48 100644 --- a/mission/controller/acs/Guidance.h +++ b/mission/controller/acs/Guidance.h @@ -58,10 +58,12 @@ class Guidance { // @note: compares target Quaternion and reference quaternion, also actual satellite rate and // desired - void comparePtg(double targetQuat[4], acsctrl::MekfData *mekfData, double quatRef[4], double refSatRate[3], - double quatErrorComplete[4], double quatError[3], double deltaRate[3]); + void comparePtg(double targetQuat[4], acsctrl::MekfData *mekfData, double quatRef[4], + double refSatRate[3], double quatErrorComplete[4], double quatError[3], + double deltaRate[3]); - void refRotationRate(int8_t timeElapsedMax, timeval now, double quatInertialTarget[4], double *refSatRate); + void refRotationRate(int8_t timeElapsedMax, timeval now, double quatInertialTarget[4], + double *refSatRate); // @note: will give back the pseudoinverse matrix for the reaction wheel depending on the valid // reation wheel maybe can be done in "commanding.h" diff --git a/mission/controller/acs/control/PtgCtrl.cpp b/mission/controller/acs/control/PtgCtrl.cpp index 6d41e85d..352c0319 100644 --- a/mission/controller/acs/control/PtgCtrl.cpp +++ b/mission/controller/acs/control/PtgCtrl.cpp @@ -26,8 +26,9 @@ void PtgCtrl::loadAcsParameters(AcsParameters *acsParameters_) { rwMatrices = &(acsParameters_->rwMatrices); } -void PtgCtrl::ptgLaw(AcsParameters::PointingLawParameters * pointingLawParameters, const double *qError, const double *deltaRate, - const double *rwPseudoInv, double *torqueRws) { +void PtgCtrl::ptgLaw(AcsParameters::PointingLawParameters *pointingLawParameters, + const double *qError, const double *deltaRate, const double *rwPseudoInv, + double *torqueRws) { //------------------------------------------------------------------------------------------------ // Compute gain matrix K and P matrix //------------------------------------------------------------------------------------------------ @@ -106,7 +107,8 @@ void PtgCtrl::ptgLaw(AcsParameters::PointingLawParameters * pointingLawParameter VectorOperations::mulScalar(torqueRws, -1, torqueRws, 4); } -void PtgCtrl::ptgDesaturation(AcsParameters::PointingLawParameters * pointingLawParameters, double *magFieldEst, bool magFieldEstValid, double *satRate, +void PtgCtrl::ptgDesaturation(AcsParameters::PointingLawParameters *pointingLawParameters, + double *magFieldEst, bool magFieldEstValid, double *satRate, int32_t *speedRw0, int32_t *speedRw1, int32_t *speedRw2, int32_t *speedRw3, double *mgtDpDes) { if (!(magFieldEstValid) || !(pointingLawParameters->desatOn)) { @@ -127,8 +129,8 @@ void PtgCtrl::ptgDesaturation(AcsParameters::PointingLawParameters * pointingLaw VectorOperations::add(momentumSat, momentumRw, momentumTotal, 3); // calculating momentum error double deltaMomentum[3] = {0, 0, 0}; - VectorOperations::subtract( - momentumTotal, pointingLawParameters->desatMomentumRef, deltaMomentum, 3); + VectorOperations::subtract(momentumTotal, pointingLawParameters->desatMomentumRef, + deltaMomentum, 3); // resulting magnetic dipole command double crossMomentumMagField[3] = {0, 0, 0}; VectorOperations::cross(deltaMomentum, magFieldEst, crossMomentumMagField); @@ -137,7 +139,8 @@ void PtgCtrl::ptgDesaturation(AcsParameters::PointingLawParameters * pointingLaw VectorOperations::mulScalar(crossMomentumMagField, factor, mgtDpDes, 3); } -void PtgCtrl::ptgNullspace(AcsParameters::PointingLawParameters * pointingLawParameters, const int32_t *speedRw0, const int32_t *speedRw1, +void PtgCtrl::ptgNullspace(AcsParameters::PointingLawParameters *pointingLawParameters, + const int32_t *speedRw0, const int32_t *speedRw1, const int32_t *speedRw2, const int32_t *speedRw3, double *rwTrqNs) { double speedRws[4] = {(double)*speedRw0, (double)*speedRw1, (double)*speedRw2, (double)*speedRw3}; double wheelMomentum[4] = {0, 0, 0, 0}; diff --git a/mission/controller/acs/control/PtgCtrl.h b/mission/controller/acs/control/PtgCtrl.h index b036d180..559216f7 100644 --- a/mission/controller/acs/control/PtgCtrl.h +++ b/mission/controller/acs/control/PtgCtrl.h @@ -41,14 +41,16 @@ class PtgCtrl { /* @brief: Calculates the needed torque for the pointing control mechanism * @param: acsParameters_ Pointer to object which defines the ACS configuration parameters */ - void ptgLaw(AcsParameters::PointingLawParameters * pointingLawParameters, const double *qError, const double *deltaRate, - const double *rwPseudoInv, double *torqueRws); + void ptgLaw(AcsParameters::PointingLawParameters *pointingLawParameters, const double *qError, + const double *deltaRate, const double *rwPseudoInv, double *torqueRws); - void ptgDesaturation(AcsParameters::PointingLawParameters * pointingLawParameters, double *magFieldEst, - bool magFieldEstValid, double *satRate, int32_t *speedRw0, int32_t *speedRw1, - int32_t *speedRw2, int32_t *speedRw3, double *mgtDpDes); + void ptgDesaturation(AcsParameters::PointingLawParameters *pointingLawParameters, + double *magFieldEst, bool magFieldEstValid, double *satRate, + int32_t *speedRw0, int32_t *speedRw1, int32_t *speedRw2, int32_t *speedRw3, + double *mgtDpDes); - void ptgNullspace(AcsParameters::PointingLawParameters * pointingLawParameters, const int32_t *speedRw0, const int32_t *speedRw1, const int32_t *speedRw2, + void ptgNullspace(AcsParameters::PointingLawParameters *pointingLawParameters, + const int32_t *speedRw0, const int32_t *speedRw1, const int32_t *speedRw2, const int32_t *speedRw3, double *rwTrqNs); /* @brief: Commands the stiction torque in case wheel speed is to low From 95fe06a09b7d279254a458eda6a6389086771d0c Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Mon, 23 Jan 2023 22:29:29 +0100 Subject: [PATCH 107/330] ThermalController additions --- mission/controller/ThermalController.cpp | 206 ++++++++++++++++++----- mission/controller/ThermalController.h | 12 +- 2 files changed, 174 insertions(+), 44 deletions(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index b05b3a07..7d4ee75b 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -109,9 +109,9 @@ void ThermalController::performControlOperation() { } // TODO: Heater control - // ctrlCameraBody(); - // ctrlAcsBoard(); - /*ctrlMgt(); + ctrlCameraBody(); + ctrlAcsBoard(); + ctrlMgt(); ctrlRw(); ctrlStr(); ctrlIfBoard(); @@ -132,7 +132,7 @@ void ThermalController::performControlOperation() { ctrlHpa(); ctrlTx(); ctrlMpa(); - ctrlScexBoard();*/ + ctrlScexBoard(); } ReturnValue_t ThermalController::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, @@ -984,16 +984,23 @@ void ThermalController::copyDevices() { } void ThermalController::ctrlAcsBoard() { -// TODO: add red sensors, check sensor 4 + // TODO: check sensor 4; A:MGM1(int); B: MGM3(int) heater::Switchers switchNr = heater::HEATER_2_ACS_BRD; heater::Switchers redSwitchNr = heater::HEATER_0_OBC_BRD; chooseHeater(switchNr, redSwitchNr); if (heaterAvailable) { - /*chooseOf5Sensors(switchNr, deviceTemperatures.gyro0SideA, deviceTemperatures.mgm0SideA, - deviceTemperatures.gyro1SideA, deviceTemperatures.mgt, - sensorTemperatures.sensor_tcs_board);*/ - + // A side + chooseOf5Sensors(switchNr, deviceTemperatures.gyro0SideA, deviceTemperatures.mgm0SideA, + deviceTemperatures.gyro1SideA, deviceTemperatures.mgm0SideA, + sensorTemperatures.sensor_tcs_board); + if (sensorTempAvailable) { + ctrlHeater(switchNr, redSwitchNr, &acsBoardLimits); + } + // B side + chooseOf5Sensors(switchNr, deviceTemperatures.gyro2SideB, deviceTemperatures.mgm2SideB, + deviceTemperatures.gyro3SideB, deviceTemperatures.mgm2SideB, + sensorTemperatures.sensor_tcs_board); if (sensorTempAvailable) { ctrlHeater(switchNr, redSwitchNr, &acsBoardLimits); } @@ -1001,18 +1008,129 @@ void ThermalController::ctrlAcsBoard() { } void ThermalController::ctrlMgt() { - // TODO: cast deviceTemperatures.mgt + // TODO: use heaterReq PoolReadGuard pg(&imtqThermalSet); ThermalComponentIF::StateRequest heaterReq = static_cast(imtqThermalSet.heaterRequest.value); - // ctrlComponentTemperature(heater::HEATER_2_ACS_BRD, heater::HEATER_3_PCDU_PDU, - // sensorTemperatures.sensor_magnettorquer, deviceTemperatures.mgt, - // sensorTemperatures.sensor_plpcdu_heatspreader, &mgtLimits); + + if (heaterReq == ThermalComponentIF::STATE_REQUEST_OPERATIONAL) { + heater::Switchers switchNr = heater::HEATER_2_ACS_BRD; + heater::Switchers redSwitchNr = heater::HEATER_3_PCDU_PDU; + + chooseHeater(switchNr, redSwitchNr); + + if (heaterAvailable) { + sensorTempAvailable = true; + + if (sensorTemperatures.sensor_magnettorquer.isValid()) { + sensorTemp = sensorTemperatures.sensor_magnettorquer.value; + } else if (deviceTemperatures.mgt.isValid()) { + sensorTemp = deviceTemperatures.mgt.value; + } else if (sensorTemperatures.sensor_plpcdu_heatspreader.isValid()) { + sensorTemp = sensorTemperatures.sensor_plpcdu_heatspreader.value; + } else { + if (heaterHandler.checkSwitchState(switchNr)) { + heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); + } + triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); + sensorTempAvailable = false; + + } + if (sensorTempAvailable) { + ctrlHeater(switchNr, redSwitchNr, &mgtLimits); + } + } + } } void ThermalController::ctrlRw() { - // ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_6_DRO, - // sensorTemperatures.sensor_rw1, deviceTemperatures.rw1, deviceTemperatures.rw3, &rwLimits); + heater::Switchers switchNr = heater::HEATER_6_DRO; + heater::Switchers redSwitchNr = heater::HEATER_6_DRO; + redSwitchNrInUse = false; + + if (heaterHandler.getHealth(switchNr) == HasHealthIF::HEALTHY) { + // RW1 + sensorTempAvailable = true; + + if (sensorTemperatures.sensor_rw1.isValid()) { + sensorTemp = sensorTemperatures.sensor_rw1.value; + } else if (deviceTemperatures.rw1.isValid()) { + sensorTemp = deviceTemperatures.rw1.value; + } else if (deviceTemperatures.rw4.isValid()) { + sensorTemp = deviceTemperatures.rw4.value; + } else if (sensorTemperatures.sensor_dro.isValid()) { + sensorTemp = sensorTemperatures.sensor_dro.value; + } else { + if (heaterHandler.checkSwitchState(switchNr)) { + heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); + } + triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); + sensorTempAvailable = false; + } + if (sensorTempAvailable) { + ctrlHeater(switchNr, redSwitchNr, &rwLimits); + } + // RW2 + sensorTempAvailable = true; + if (deviceTemperatures.rw2.isValid()) { + sensorTemp = deviceTemperatures.rw2.value; + } else if (deviceTemperatures.rw3.isValid()) { + sensorTemp = deviceTemperatures.rw3.value; + } else if (sensorTemperatures.sensor_rw1.isValid()) { + sensorTemp = sensorTemperatures.sensor_rw1.value; + } else if (sensorTemperatures.sensor_dro.isValid()) { + sensorTemp = sensorTemperatures.sensor_dro.value; + } else { + if (heaterHandler.checkSwitchState(switchNr)) { + heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); + } + triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); + sensorTempAvailable = false; + } + if (sensorTempAvailable) { + ctrlHeater(switchNr, redSwitchNr, &rwLimits); + } + // RW3 + sensorTempAvailable = true; + if (deviceTemperatures.rw3.isValid()) { + sensorTemp = deviceTemperatures.rw3.value; + } else if (deviceTemperatures.rw4.isValid()) { + sensorTemp = deviceTemperatures.rw4.value; + } else if (sensorTemperatures.sensor_rw1.isValid()) { + sensorTemp = sensorTemperatures.sensor_rw1.value; + } else if (sensorTemperatures.sensor_dro.isValid()) { + sensorTemp = sensorTemperatures.sensor_dro.value; + } else { + if (heaterHandler.checkSwitchState(switchNr)) { + heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); + } + triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); + sensorTempAvailable = false; + } + if (sensorTempAvailable) { + ctrlHeater(switchNr, redSwitchNr, &rwLimits); + } + // RW4 + sensorTempAvailable = true; + if (deviceTemperatures.rw4.isValid()) { + sensorTemp = deviceTemperatures.rw4.value; + } else if (deviceTemperatures.rw1.isValid()) { + sensorTemp = deviceTemperatures.rw1.value; + } else if (sensorTemperatures.sensor_rw1.isValid()) { + sensorTemp = sensorTemperatures.sensor_rw1.value; + } else if (sensorTemperatures.sensor_dro.isValid()) { + sensorTemp = sensorTemperatures.sensor_dro.value; + } else { + if (heaterHandler.checkSwitchState(switchNr)) { + heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); + } + triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); + sensorTempAvailable = false; + } + if (sensorTempAvailable) { + ctrlHeater(switchNr, redSwitchNr, &rwLimits); + } + } } void ThermalController::ctrlStr() { @@ -1079,9 +1197,10 @@ void ThermalController::ctrlPcduAcu() { } triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); sensorTempAvailable = false; - if (sensorTempAvailable) { - ctrlHeater(switchNr, redSwitchNr, &pcduAcuLimits); - } + + } + if (sensorTempAvailable) { + ctrlHeater(switchNr, redSwitchNr, &pcduAcuLimits); } } } @@ -1100,26 +1219,12 @@ void ThermalController::ctrlPlPcduBoard() { chooseHeater(switchNr, redSwitchNr); if (heaterAvailable) { - sensorTempAvailable = true; - - if (sensorTemperatures.tmp1075PlPcdu0.isValid()) { - sensorTemp = sensorTemperatures.tmp1075PlPcdu0.value; - } else if (sensorTemperatures.tmp1075PlPcdu1.isValid()) { - sensorTemp = sensorTemperatures.tmp1075PlPcdu1.value; - } else if (deviceTemperatures.adcPayloadPcdu.isValid()) { - sensorTemp = deviceTemperatures.adcPayloadPcdu.value; - } else if (sensorTemperatures.sensor_plpcdu_heatspreader.isValid()) { - sensorTemp = sensorTemperatures.sensor_plpcdu_heatspreader.value; - } else { - if (heaterHandler.checkSwitchState(switchNr)) { - heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); - } - triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); - sensorTempAvailable = false; - if (sensorTempAvailable) { - ctrlHeater(switchNr, redSwitchNr, &plPcduBoardLimits); - } - } + chooseOf4Sensors(switchNr, sensorTemperatures.tmp1075PlPcdu0, sensorTemperatures.tmp1075PlPcdu1, + deviceTemperatures.adcPayloadPcdu, + sensorTemperatures.sensor_plpcdu_heatspreader); + if (sensorTempAvailable) { + ctrlHeater(switchNr, redSwitchNr, &plPcduBoardLimits); + } } } @@ -1258,6 +1363,27 @@ void ThermalController::ctrlComponentTemperature(heater::Switchers switchNr, } } } +void ThermalController::chooseOf4Sensors(heater::Switchers switchNr, const lp_float_t& sensor1, + const lp_float_t& sensor2, const lp_float_t& sensor3, + const lp_float_t& sensor4) { + sensorTempAvailable = true; + + if (sensor1.isValid()) { + sensorTemp = sensor1.value; + } else if (sensor2.isValid()) { + sensorTemp = sensor2.value; + } else if (sensor3.isValid()) { + sensorTemp = sensor3.value; + } else if (sensor4.isValid()) { + sensorTemp = sensor4.value; + } else { + if (heaterHandler.checkSwitchState(switchNr)) { + heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); + } + triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); + sensorTempAvailable = false; + } +} void ThermalController::chooseOf5Sensors(heater::Switchers switchNr, const lp_float_t& sensor1, const lp_float_t& sensor2, const lp_float_t& sensor3, const lp_float_t& sensor4, const lp_float_t& sensor5) { @@ -1270,9 +1396,9 @@ void ThermalController::chooseOf5Sensors(heater::Switchers switchNr, const lp_fl } else if (sensor3.isValid()) { sensorTemp = sensor3.value; } else if (sensor4.isValid()) { - sensorTemp = sensor4.value; + sensorTemp = sensor4.value; } else if (sensor5.isValid()) { - sensorTemp = sensor5.value; + sensorTemp = sensor5.value; } else { if (heaterHandler.checkSwitchState(switchNr)) { heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 7f3e8ac7..5f2fe371 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -160,15 +160,19 @@ class ThermalController : public ExtendedControllerBase { void copySus(); void copyDevices(); - void ctrlComponentTemperature( - heater::Switchers switchNr, heater::Switchers redSwitchNr, const lp_float_t& sensor1, - const lp_float_t& sensor2, const lp_float_t& sensor3, TempLimits* tempLimit); // TODO sensor 4, 5 = default argument, if not available + void ctrlComponentTemperature(heater::Switchers switchNr, heater::Switchers redSwitchNr, + const lp_float_t& sensor1, const lp_float_t& sensor2, + const lp_float_t& sensor3, TempLimits* tempLimit); void ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, TempLimits* tempLimit); void chooseHeater(heater::Switchers& switchNr, heater::Switchers redSwitchNr); void chooseSensor(heater::Switchers switchNr, const lp_float_t& sensor1, const lp_float_t& sensor2, const lp_float_t& sensor3); + void chooseOf4Sensors(heater::Switchers switchNr, const lp_float_t& sensor1, + const lp_float_t& sensor2, const lp_float_t& sensor3, + const lp_float_t& sensor4); void chooseOf5Sensors(heater::Switchers switchNr, const lp_float_t& sensor1, - const lp_float_t& sensor2, const lp_float_t& sensor3, const lp_float_t& sensor4, const lp_float_t& sensor5); + const lp_float_t& sensor2, const lp_float_t& sensor3, + const lp_float_t& sensor4, const lp_float_t& sensor5); void ctrlAcsBoard(); void ctrlMgt(); From 7e25f5012e81930d94a69ada71f324bc449b316c Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Thu, 26 Jan 2023 17:09:34 +0100 Subject: [PATCH 108/330] transformation before calibration --- mission/controller/acs/SensorProcessing.cpp | 67 +++++++++++---------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/mission/controller/acs/SensorProcessing.cpp b/mission/controller/acs/SensorProcessing.cpp index ac2e5752..a8fd1576 100644 --- a/mission/controller/acs/SensorProcessing.cpp +++ b/mission/controller/acs/SensorProcessing.cpp @@ -47,71 +47,72 @@ void SensorProcessing::processMgm(const float *mgm0Value, bool mgm0valid, const float mgm0ValueNoBias[3] = {0, 0, 0}, mgm1ValueNoBias[3] = {0, 0, 0}, mgm2ValueNoBias[3] = {0, 0, 0}, mgm3ValueNoBias[3] = {0, 0, 0}, mgm4ValueNoBias[3] = {0, 0, 0}; - float mgm0ValueCalib[3] = {0, 0, 0}, mgm1ValueCalib[3] = {0, 0, 0}, mgm2ValueCalib[3] = {0, 0, 0}, - mgm3ValueCalib[3] = {0, 0, 0}, mgm4ValueCalib[3] = {0, 0, 0}; float mgm0ValueBody[3] = {0, 0, 0}, mgm1ValueBody[3] = {0, 0, 0}, mgm2ValueBody[3] = {0, 0, 0}, mgm3ValueBody[3] = {0, 0, 0}, mgm4ValueBody[3] = {0, 0, 0}; + float mgm0ValueCalib[3] = {0, 0, 0}, mgm1ValueCalib[3] = {0, 0, 0}, mgm2ValueCalib[3] = {0, 0, 0}, + mgm3ValueCalib[3] = {0, 0, 0}, mgm4ValueCalib[3] = {0, 0, 0}; float sensorFusionNumerator[3] = {0, 0, 0}, sensorFusionDenominator[3] = {0, 0, 0}; if (mgm0valid) { - VectorOperations::subtract(mgm0Value, mgmParameters->mgm0hardIronOffset, mgm0ValueNoBias, - 3); + MatrixOperations::multiply(mgmParameters->mgm0orientationMatrix[0], mgm0Value, + mgm0ValueBody, 3, 3, 1); + VectorOperations::subtract(mgm0ValueBody, mgmParameters->mgm0hardIronOffset, + mgm0ValueNoBias, 3); MatrixOperations::multiply(mgmParameters->mgm0softIronInverse[0], mgm0ValueNoBias, mgm0ValueCalib, 3, 3, 1); - MatrixOperations::multiply(mgmParameters->mgm0orientationMatrix[0], mgm0ValueCalib, - mgm0ValueBody, 3, 3, 1); for (uint8_t i = 0; i < 3; i++) { - sensorFusionNumerator[i] += mgm0ValueBody[i] / mgmParameters->mgm02variance[i]; + sensorFusionNumerator[i] += mgm0ValueCalib[i] / mgmParameters->mgm02variance[i]; sensorFusionDenominator[i] += 1 / mgmParameters->mgm02variance[i]; } } if (mgm1valid) { - VectorOperations::subtract(mgm1Value, mgmParameters->mgm1hardIronOffset, mgm1ValueNoBias, - 3); + MatrixOperations::multiply(mgmParameters->mgm1orientationMatrix[0], mgm1Value, + mgm1ValueBody, 3, 3, 1); + VectorOperations::subtract(mgm1ValueBody, mgmParameters->mgm1hardIronOffset, + mgm1ValueNoBias, 3); MatrixOperations::multiply(mgmParameters->mgm1softIronInverse[0], mgm1ValueNoBias, mgm1ValueCalib, 3, 3, 1); - MatrixOperations::multiply(mgmParameters->mgm1orientationMatrix[0], mgm1ValueCalib, - mgm1ValueBody, 3, 3, 1); for (uint8_t i = 0; i < 3; i++) { - sensorFusionNumerator[i] += mgm1ValueBody[i] / mgmParameters->mgm13variance[i]; + sensorFusionNumerator[i] += mgm1ValueCalib[i] / mgmParameters->mgm13variance[i]; sensorFusionDenominator[i] += 1 / mgmParameters->mgm13variance[i]; } } if (mgm2valid) { - VectorOperations::subtract(mgm2Value, mgmParameters->mgm2hardIronOffset, mgm2ValueNoBias, - 3); + MatrixOperations::multiply(mgmParameters->mgm2orientationMatrix[0], mgm2Value, + mgm2ValueBody, 3, 3, 1); + VectorOperations::subtract(mgm2ValueBody, mgmParameters->mgm2hardIronOffset, + mgm2ValueNoBias, 3); MatrixOperations::multiply(mgmParameters->mgm2softIronInverse[0], mgm2ValueNoBias, mgm2ValueCalib, 3, 3, 1); - MatrixOperations::multiply(mgmParameters->mgm2orientationMatrix[0], mgm2ValueCalib, - mgm2ValueBody, 3, 3, 1); for (uint8_t i = 0; i < 3; i++) { - sensorFusionNumerator[i] += mgm2ValueBody[i] / mgmParameters->mgm02variance[i]; + sensorFusionNumerator[i] += mgm2ValueCalib[i] / mgmParameters->mgm02variance[i]; sensorFusionDenominator[i] += 1 / mgmParameters->mgm02variance[i]; } } if (mgm3valid) { - VectorOperations::subtract(mgm3Value, mgmParameters->mgm3hardIronOffset, mgm3ValueNoBias, - 3); + MatrixOperations::multiply(mgmParameters->mgm3orientationMatrix[0], mgm3Value, + mgm3ValueBody, 3, 3, 1); + VectorOperations::subtract(mgm3ValueBody, mgmParameters->mgm3hardIronOffset, + mgm3ValueNoBias, 3); MatrixOperations::multiply(mgmParameters->mgm3softIronInverse[0], mgm3ValueNoBias, mgm3ValueCalib, 3, 3, 1); - MatrixOperations::multiply(mgmParameters->mgm3orientationMatrix[0], mgm3ValueCalib, - mgm3ValueBody, 3, 3, 1); for (uint8_t i = 0; i < 3; i++) { - sensorFusionNumerator[i] += mgm3ValueBody[i] / mgmParameters->mgm13variance[i]; + sensorFusionNumerator[i] += mgm3ValueCalib[i] / mgmParameters->mgm13variance[i]; sensorFusionDenominator[i] += 1 / mgmParameters->mgm13variance[i]; } } if (mgm4valid) { - float mgm4ValueNT[3]; - VectorOperations::mulScalar(mgm4Value, 1e-3, mgm4ValueNT, 3); // uT to nT - VectorOperations::subtract(mgm4ValueNT, mgmParameters->mgm4hardIronOffset, + float mgm4ValueUT[3]; + VectorOperations::mulScalar(mgm4Value, 1e-3, mgm4ValueUT, 3); // nT to uT + MatrixOperations::multiply(mgmParameters->mgm4orientationMatrix[0], mgm4ValueUT, + mgm4ValueBody, 3, 3, 1); + VectorOperations::subtract(mgm4ValueBody, mgmParameters->mgm4hardIronOffset, mgm4ValueNoBias, 3); MatrixOperations::multiply(mgmParameters->mgm4softIronInverse[0], mgm4ValueNoBias, mgm4ValueCalib, 3, 3, 1); - MatrixOperations::multiply(mgmParameters->mgm4orientationMatrix[0], mgm4ValueCalib, - mgm4ValueBody, 3, 3, 1); + for (uint8_t i = 0; i < 3; i++) { - sensorFusionNumerator[i] += mgm4ValueBody[i] / mgmParameters->mgm4variance[i]; + sensorFusionNumerator[i] += mgm4ValueCalib[i] / mgmParameters->mgm4variance[i]; sensorFusionDenominator[i] += 1 / mgmParameters->mgm4variance[i]; } } @@ -148,15 +149,15 @@ void SensorProcessing::processMgm(const float *mgm0Value, bool mgm0valid, const { PoolReadGuard pg(mgmDataProcessed); if (pg.getReadResult() == returnvalue::OK) { - std::memcpy(mgmDataProcessed->mgm0vec.value, mgm0ValueBody, 3 * sizeof(float)); + std::memcpy(mgmDataProcessed->mgm0vec.value, mgm0ValueCalib, 3 * sizeof(float)); mgmDataProcessed->mgm0vec.setValid(mgm0valid); - std::memcpy(mgmDataProcessed->mgm1vec.value, mgm1ValueBody, 3 * sizeof(float)); + std::memcpy(mgmDataProcessed->mgm1vec.value, mgm1ValueCalib, 3 * sizeof(float)); mgmDataProcessed->mgm1vec.setValid(mgm1valid); - std::memcpy(mgmDataProcessed->mgm2vec.value, mgm2ValueBody, 3 * sizeof(float)); + std::memcpy(mgmDataProcessed->mgm2vec.value, mgm2ValueCalib, 3 * sizeof(float)); mgmDataProcessed->mgm2vec.setValid(mgm2valid); - std::memcpy(mgmDataProcessed->mgm3vec.value, mgm3ValueBody, 3 * sizeof(float)); + std::memcpy(mgmDataProcessed->mgm3vec.value, mgm3ValueCalib, 3 * sizeof(float)); mgmDataProcessed->mgm3vec.setValid(mgm3valid); - std::memcpy(mgmDataProcessed->mgm4vec.value, mgm4ValueBody, 3 * sizeof(float)); + std::memcpy(mgmDataProcessed->mgm4vec.value, mgm4ValueCalib, 3 * sizeof(float)); mgmDataProcessed->mgm4vec.setValid(mgm4valid); std::memcpy(mgmDataProcessed->mgmVecTot.value, mgmVecTot, 3 * sizeof(double)); mgmDataProcessed->mgmVecTot.setValid(true); From 03ec64672bfbaf6da0b7d517088f1518038a19a4 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Thu, 26 Jan 2023 17:15:04 +0100 Subject: [PATCH 109/330] also fixed validity flag --- mission/controller/acs/SensorProcessing.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/mission/controller/acs/SensorProcessing.cpp b/mission/controller/acs/SensorProcessing.cpp index a8fd1576..5b4ddc84 100644 --- a/mission/controller/acs/SensorProcessing.cpp +++ b/mission/controller/acs/SensorProcessing.cpp @@ -129,6 +129,7 @@ void SensorProcessing::processMgm(const float *mgm0Value, bool mgm0valid, const for (uint8_t i = 0; i < 3; i++) { mgmVecTotDerivative[i] = (mgmVecTot[i] - savedMgmVecTot[i]) / timeDiff; savedMgmVecTot[i] = mgmVecTot[i]; + mgmVecTotDerivativeValid = true; } } timeOfSavedMagFieldEst = timeOfMgmMeasurement; From 24d2405fc8f6841db776f2f1e7315ce60a497f24 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 27 Jan 2023 11:18:55 +0100 Subject: [PATCH 110/330] added calibration matrices for testing --- mission/controller/acs/AcsParameters.h | 36 ++++++++++++++------------ 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index a62b373d..2fd5ab27 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -37,23 +37,27 @@ class AcsParameters /*: public HasParametersIF*/ { float mgm3orientationMatrix[3][3] = {{0, 0, 1}, {0, -1, 0}, {1, 0, 0}}; float mgm4orientationMatrix[3][3] = {{0, 0, -1}, {-1, 0, 0}, {0, 1, 0}}; - float mgm0hardIronOffset[3] = {0.0, 0.0, 0.0};//{19.89364, -29.94111, -31.07508}; - float mgm1hardIronOffset[3] = {0.0, 0.0, 0.0};//{10.95500, -8.053403, -33.36383}; - float mgm2hardIronOffset[3] = {0.0, 0.0, 0.0};//{15.72181, -26.87090, -62.19010}; - float mgm3hardIronOffset[3] = {0.0, 0.0, 0.0}; - float mgm4hardIronOffset[3] = {0.0, 0.0, 0.0}; + float mgm0hardIronOffset[3] = {-3.009521e1, 1.600983e1, -3.025359e1}; + float mgm1hardIronOffset[3] = {-3.255443e1, 1.118625e1, -8.400313e0}; + float mgm2hardIronOffset[3] = {-6.194874e1, 1.561503e1, -2.911635e1}; + float mgm3hardIronOffset[3] = {-3.986654e1, 1.413371e1, -9.778686e0}; + float mgm4hardIronOffset[3] = {-3.046779e1, 1.690829e1, -6.597055e0}; - float mgm0softIronInverse[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};/*{{1420.727e-3, 9.352825e-3, -127.1979e-3}, - {9.352825e-3, 1031.965e-3, -80.02734e-3}, - {-127.1979e-3, -80.02734e-3, 934.8899e-3}};*/ - float mgm1softIronInverse[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};/*{{126.7325e-2, -4.146410e-2, -18.37963e-2}, - {-4.146410e-2, 109.3310e-2, -5.246314e-2}, - {-18.37963e-2, -5.246314e-2, 105.7300e-2}};*/ - float mgm2softIronInverse[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};/*{{143.0438e-2, 7.095763e-2, 15.67482e-2}, - {7.095763e-2, 99.65167e-2, -6.958760e-2}, - {15.67482e-2, -6.958760e-2, 94.50124e-2}};*/ - float mgm3softIronInverse[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}; - float mgm4softIronInverse[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}; + float mgm0softIronInverse[3][3] = {{9.385532e-1, -1.261877e-1, -8.086912e-2}, + {-1.261877e-1, 1.415967e0, -6.953750e-3}, + {-8.086912e-2, -6.953750e-3, 1.014963e0}}; + float mgm1softIronInverse[3][3] = {{1.054248e0, -1.867005e-1, -4.884622e-2}, + {-1.867005e-1, 1.272026e0, -4.212676e-2}, + {-4.884622e-2, -4.212676e-2, 1.091061e0}}; + float mgm2softIronInverse[3][3] = {{9.474586e-1, 1.506282e-1, -7.002351e-2}, + {1.506282e-1, 1.427704e0, 7.247630e-2}, + {-7.002351e-2, 7.247630e-2, 9.822354e-1}}; + float mgm3softIronInverse[3][3] = {{1.082337e0, 1.971590e-1, -6.910370e-2}, + {1.971590e-1, 1.265329e0, 1.301571e-2}, + {-6.910370e-2, 1.301571e-2, 1.072459e0}}; + float mgm4softIronInverse[3][3] = {{1.094184e0, -1.765240e-2, -3.580871e-2}, + {-1.765240e-2, 1.250533e0, 8.302781e-3}, + {-3.580871e-2, 8.302781e-3, 1.325068e0}}; float mgm02variance[3] = {1, 1, 1}; float mgm13variance[3] = {1, 1, 1}; float mgm4variance[3] = {1, 1, 1}; From fa7281794a6c7a4a5a24168da713f7d44e651322 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Sat, 28 Jan 2023 22:51:51 +0100 Subject: [PATCH 111/330] deleted comments fromm ThermalController --- linux/ObjectFactory.cpp | 5 ++-- linux/ObjectFactory.h | 1 + mission/controller/ThermalController.cpp | 31 +++++++++--------------- 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index 4ce69b2d..18c00745 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -24,6 +24,7 @@ #include "devices/addresses.h" #include "devices/gpioIds.h" #include "eive/definitions.h" +#include "mission/controller/ThermalController.h" #include "mission/system/tree/acsModeTree.h" #include "mission/system/tree/payloadModeTree.h" #include "mission/system/tree/tcsModeTree.h" @@ -348,8 +349,8 @@ void ObjectFactory::createScexComponents(std::string uartDev, PowerSwitchIF* pwr scexHandler->connectModeTreeParent(satsystem::pl::SUBSYSTEM); } -void ObjectFactory::createThermalController() { - auto* tcsCtrl = new ThermalController(objects::THERMAL_CONTROLLER); +void ObjectFactory::createThermalController(HeaterHandler& heaterHandler) { + auto* tcsCtrl = new ThermalController(objects::THERMAL_CONTROLLER, heaterHandler); tcsCtrl->connectModeTreeParent(satsystem::tcs::SUBSYSTEM); } diff --git a/linux/ObjectFactory.h b/linux/ObjectFactory.h index 4558aa78..a12617a6 100644 --- a/linux/ObjectFactory.h +++ b/linux/ObjectFactory.h @@ -36,4 +36,5 @@ AcsController* createAcsController(bool connectSubsystem); void addTmtcIpCoresToFunnels(CcsdsIpCoreHandler& ipCoreHandler, PusTmFunnel& pusFunnel, CfdpTmFunnel& cfdpFunnel); +void createThermalController(HeaterHandler& heaterHandler); } // namespace ObjectFactory diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 7d4ee75b..2d8a2b22 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -108,7 +108,6 @@ void ThermalController::performControlOperation() { deviceTemperatures.commit(); } - // TODO: Heater control ctrlCameraBody(); ctrlAcsBoard(); ctrlMgt(); @@ -984,7 +983,6 @@ void ThermalController::copyDevices() { } void ThermalController::ctrlAcsBoard() { - // TODO: check sensor 4; A:MGM1(int); B: MGM3(int) heater::Switchers switchNr = heater::HEATER_2_ACS_BRD; heater::Switchers redSwitchNr = heater::HEATER_0_OBC_BRD; chooseHeater(switchNr, redSwitchNr); @@ -1008,9 +1006,8 @@ void ThermalController::ctrlAcsBoard() { } void ThermalController::ctrlMgt() { - // TODO: use heaterReq PoolReadGuard pg(&imtqThermalSet); - ThermalComponentIF::StateRequest heaterReq = + auto heaterReq = static_cast(imtqThermalSet.heaterRequest.value); if (heaterReq == ThermalComponentIF::STATE_REQUEST_OPERATIONAL) { @@ -1034,7 +1031,6 @@ void ThermalController::ctrlMgt() { } triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); sensorTempAvailable = false; - } if (sensorTempAvailable) { ctrlHeater(switchNr, redSwitchNr, &mgtLimits); @@ -1055,9 +1051,9 @@ void ThermalController::ctrlRw() { if (sensorTemperatures.sensor_rw1.isValid()) { sensorTemp = sensorTemperatures.sensor_rw1.value; } else if (deviceTemperatures.rw1.isValid()) { - sensorTemp = deviceTemperatures.rw1.value; + sensorTemp = static_cast(deviceTemperatures.rw1.value); } else if (deviceTemperatures.rw4.isValid()) { - sensorTemp = deviceTemperatures.rw4.value; + sensorTemp = static_cast(deviceTemperatures.rw4.value); } else if (sensorTemperatures.sensor_dro.isValid()) { sensorTemp = sensorTemperatures.sensor_dro.value; } else { @@ -1073,9 +1069,9 @@ void ThermalController::ctrlRw() { // RW2 sensorTempAvailable = true; if (deviceTemperatures.rw2.isValid()) { - sensorTemp = deviceTemperatures.rw2.value; + sensorTemp = static_cast(deviceTemperatures.rw2.value); } else if (deviceTemperatures.rw3.isValid()) { - sensorTemp = deviceTemperatures.rw3.value; + sensorTemp = static_cast(deviceTemperatures.rw3.value); } else if (sensorTemperatures.sensor_rw1.isValid()) { sensorTemp = sensorTemperatures.sensor_rw1.value; } else if (sensorTemperatures.sensor_dro.isValid()) { @@ -1093,9 +1089,9 @@ void ThermalController::ctrlRw() { // RW3 sensorTempAvailable = true; if (deviceTemperatures.rw3.isValid()) { - sensorTemp = deviceTemperatures.rw3.value; + sensorTemp = static_cast(deviceTemperatures.rw3.value); } else if (deviceTemperatures.rw4.isValid()) { - sensorTemp = deviceTemperatures.rw4.value; + sensorTemp = static_cast(deviceTemperatures.rw4.value); } else if (sensorTemperatures.sensor_rw1.isValid()) { sensorTemp = sensorTemperatures.sensor_rw1.value; } else if (sensorTemperatures.sensor_dro.isValid()) { @@ -1113,9 +1109,9 @@ void ThermalController::ctrlRw() { // RW4 sensorTempAvailable = true; if (deviceTemperatures.rw4.isValid()) { - sensorTemp = deviceTemperatures.rw4.value; + sensorTemp = static_cast(deviceTemperatures.rw4.value); } else if (deviceTemperatures.rw1.isValid()) { - sensorTemp = deviceTemperatures.rw1.value; + sensorTemp = static_cast(deviceTemperatures.rw1.value); } else if (sensorTemperatures.sensor_rw1.isValid()) { sensorTemp = sensorTemperatures.sensor_rw1.value; } else if (sensorTemperatures.sensor_dro.isValid()) { @@ -1170,7 +1166,6 @@ void ThermalController::ctrlSBandTransceiver() { sensorTemperatures.sensor_4k_camera, &sBandTransceiverLimits); } void ThermalController::ctrlPcduP60Board() { - // TODO: remove sensor3 ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, deviceTemperatures.temp1P60dock, deviceTemperatures.temp2P60dock, deviceTemperatures.temp2P60dock, &pcduP60BoardLimits); @@ -1185,8 +1180,8 @@ void ThermalController::ctrlPcduAcu() { if (heaterAvailable) { sensorTempAvailable = true; - if (deviceTemperatures.acu.isValid()) { // TODO: how to check the different values - sensorTemp = deviceTemperatures.acu.value[0]; // TODO: check if right + if (deviceTemperatures.acu.isValid()) { + sensorTemp = deviceTemperatures.acu.value[0]; } else if (deviceTemperatures.acu.isValid()) { sensorTemp = deviceTemperatures.acu.value[1]; } else if (sensorTemperatures.sensor_acu.isValid()) { @@ -1197,7 +1192,6 @@ void ThermalController::ctrlPcduAcu() { } triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); sensorTempAvailable = false; - } if (sensorTempAvailable) { ctrlHeater(switchNr, redSwitchNr, &pcduAcuLimits); @@ -1206,7 +1200,6 @@ void ThermalController::ctrlPcduAcu() { } void ThermalController::ctrlPcduPdu() { - // TODO: remove sensor3 ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, deviceTemperatures.pdu1, deviceTemperatures.pdu2, deviceTemperatures.pdu2, &pcduPduLimits); @@ -1295,7 +1288,6 @@ void ThermalController::ctrlHeater(heater::Switchers switchNr, heater::Switchers struct TempLimits* tempLimit) { // Heater off if (not heaterHandler.checkSwitchState(switchNr)) { - // TODO: check if OP if (sensorTemp < (*tempLimit).opLowerLimit) { heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::ON); } @@ -1363,6 +1355,7 @@ void ThermalController::ctrlComponentTemperature(heater::Switchers switchNr, } } } + void ThermalController::chooseOf4Sensors(heater::Switchers switchNr, const lp_float_t& sensor1, const lp_float_t& sensor2, const lp_float_t& sensor3, const lp_float_t& sensor4) { From 617507b3d445309242567010d4f6e34052551a8e Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Sun, 29 Jan 2023 17:55:43 +0100 Subject: [PATCH 112/330] small changes ThermalController --- mission/controller/ThermalController.cpp | 6 ++++-- mission/controller/ThermalController.h | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 2d8a2b22..0f285530 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -1180,10 +1180,12 @@ void ThermalController::ctrlPcduAcu() { if (heaterAvailable) { sensorTempAvailable = true; - if (deviceTemperatures.acu.isValid()) { + if (deviceTemperatures.acu.value[0] != INVALID_TEMPERATURE) { sensorTemp = deviceTemperatures.acu.value[0]; - } else if (deviceTemperatures.acu.isValid()) { + } else if (deviceTemperatures.acu.value[1] != INVALID_TEMPERATURE) { sensorTemp = deviceTemperatures.acu.value[1]; + } else if (deviceTemperatures.acu.value[2] != INVALID_TEMPERATURE) { + sensorTemp = deviceTemperatures.acu.value[2]; } else if (sensorTemperatures.sensor_acu.isValid()) { sensorTemp = sensorTemperatures.sensor_acu.value; } else { diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 5f2fe371..1f977524 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -61,7 +61,6 @@ class ThermalController : public ExtendedControllerBase { static const uint32_t DELAY = 500; - // TODO to be changed static const uint32_t TEMP_OFFSET = 5; enum class InternalState { STARTUP, INITIAL_DELAY, READY }; From 45eadb8302ce00f9bd092d719492c08f8bcfdc62 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Tue, 31 Jan 2023 10:08:28 +0100 Subject: [PATCH 113/330] added new calibration matrices --- mission/controller/acs/AcsParameters.h | 40 +++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index 2fd5ab27..1fe5f29c 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -37,27 +37,27 @@ class AcsParameters /*: public HasParametersIF*/ { float mgm3orientationMatrix[3][3] = {{0, 0, 1}, {0, -1, 0}, {1, 0, 0}}; float mgm4orientationMatrix[3][3] = {{0, 0, -1}, {-1, 0, 0}, {0, 1, 0}}; - float mgm0hardIronOffset[3] = {-3.009521e1, 1.600983e1, -3.025359e1}; - float mgm1hardIronOffset[3] = {-3.255443e1, 1.118625e1, -8.400313e0}; - float mgm2hardIronOffset[3] = {-6.194874e1, 1.561503e1, -2.911635e1}; - float mgm3hardIronOffset[3] = {-3.986654e1, 1.413371e1, -9.778686e0}; - float mgm4hardIronOffset[3] = {-3.046779e1, 1.690829e1, -6.597055e0}; + float mgm0hardIronOffset[3] = {3.303907e0,4.009162e0,-1.677380e1}; + float mgm1hardIronOffset[3] = {-2.494258e0,3.526886e0,3.593006e0}; + float mgm2hardIronOffset[3] = {-1.630907e1,5.543566e0,-1.619287e1}; + float mgm3hardIronOffset[3] = {-8.612960e-1,2.752825e0,-1.101764e0}; + float mgm4hardIronOffset[3] = {1.696131e0,4.624440e0,2.449785e-1}; - float mgm0softIronInverse[3][3] = {{9.385532e-1, -1.261877e-1, -8.086912e-2}, - {-1.261877e-1, 1.415967e0, -6.953750e-3}, - {-8.086912e-2, -6.953750e-3, 1.014963e0}}; - float mgm1softIronInverse[3][3] = {{1.054248e0, -1.867005e-1, -4.884622e-2}, - {-1.867005e-1, 1.272026e0, -4.212676e-2}, - {-4.884622e-2, -4.212676e-2, 1.091061e0}}; - float mgm2softIronInverse[3][3] = {{9.474586e-1, 1.506282e-1, -7.002351e-2}, - {1.506282e-1, 1.427704e0, 7.247630e-2}, - {-7.002351e-2, 7.247630e-2, 9.822354e-1}}; - float mgm3softIronInverse[3][3] = {{1.082337e0, 1.971590e-1, -6.910370e-2}, - {1.971590e-1, 1.265329e0, 1.301571e-2}, - {-6.910370e-2, 1.301571e-2, 1.072459e0}}; - float mgm4softIronInverse[3][3] = {{1.094184e0, -1.765240e-2, -3.580871e-2}, - {-1.765240e-2, 1.250533e0, 8.302781e-3}, - {-3.580871e-2, 8.302781e-3, 1.325068e0}}; + float mgm0softIronInverse[3][3] = {{9.687712e-1,1.144510e-2,-9.601610e-2}, + {1.144510e-2,1.391574e0,-1.169994e-1}, + {-9.601610e-2,-1.169994e-1,1.025668e0}}; + float mgm1softIronInverse[3][3] = {{1.086339e0,-4.341287e-2,-5.870281e-2}, + {-4.341287e-2,1.274588e0,-1.893176e-1}, + {-5.870281e-2,-1.893176e-1,1.077651e0}}; + float mgm2softIronInverse[3][3] = {{9.554406e-1,7.009618e-2,-7.924296e-2}, + {7.009618e-2,1.428436e0,1.504623e-1}, + {-7.924296e-2,1.504623e-1,9.978038e-1}}; + float mgm3softIronInverse[3][3] = {{1.091974e0,1.492663e-2-5.993296e-2}, + {1.492663e-2,1.263068e0,2.013953e-1}, + {-5.993296e-2,2.013953e-1,1.055083e0}}; + float mgm4softIronInverse[3][3] = {{1.100341e0,-7.430518e-4,-3.810031e-2}, + {-7.430518e-4,1.259561e0,-1.951225e-2}, + {-3.810031e-2,-1.951225e-2,1.342584e0}}; float mgm02variance[3] = {1, 1, 1}; float mgm13variance[3] = {1, 1, 1}; float mgm4variance[3] = {1, 1, 1}; From 9a056e6ad5c156c83f0c77b3722a0ab1466467d5 Mon Sep 17 00:00:00 2001 From: Robin Marquardt Date: Wed, 1 Feb 2023 15:37:10 +0100 Subject: [PATCH 114/330] run clang formating script --- mission/controller/acs/control/Detumble.cpp | 23 +++++++++------------ 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/mission/controller/acs/control/Detumble.cpp b/mission/controller/acs/control/Detumble.cpp index 9053fc01..705bf599 100644 --- a/mission/controller/acs/control/Detumble.cpp +++ b/mission/controller/acs/control/Detumble.cpp @@ -48,20 +48,17 @@ ReturnValue_t Detumble::bangbangLaw(const double *magRate, const bool magRateVal magMom[i] = -dipolMax * sign(magRate[i]); } - return returnvalue::OK; - + return returnvalue::OK; } ReturnValue_t Detumble::bDotLawGyro(const double *satRate, const bool *satRateValid, - const double *magField, const bool *magFieldValid, - double *magMom) { - - if (!satRateValid || !magFieldValid) { - return DETUMBLE_NO_SENSORDATA; - } - double gain = detumbleParameter->gainD; - double factor = -gain / pow(VectorOperations::norm(magField,3),2); - VectorOperations::mulScalar(satRate, factor, magMom, 3); - return returnvalue::OK; - + const double *magField, const bool *magFieldValid, + double *magMom) { + if (!satRateValid || !magFieldValid) { + return DETUMBLE_NO_SENSORDATA; + } + double gain = detumbleParameter->gainD; + double factor = -gain / pow(VectorOperations::norm(magField, 3), 2); + VectorOperations::mulScalar(satRate, factor, magMom, 3); + return returnvalue::OK; } From acba821afd3f3b1adc42444626d1d3476dfd1db5 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Tue, 31 Jan 2023 19:12:39 +0100 Subject: [PATCH 115/330] fixed uint to int --- mission/devices/devicedefinitions/imtqHandlerDefinitions.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mission/devices/devicedefinitions/imtqHandlerDefinitions.h b/mission/devices/devicedefinitions/imtqHandlerDefinitions.h index b3598970..2abf1c21 100644 --- a/mission/devices/devicedefinitions/imtqHandlerDefinitions.h +++ b/mission/devices/devicedefinitions/imtqHandlerDefinitions.h @@ -489,7 +489,7 @@ class DipoleActuationSet : public StaticLocalDataSet<4> { // Refresh torque command without changing any of the set dipoles. void refreshTorqueing(uint16_t durationMs_) { currentTorqueDurationMs = durationMs_; } - void setDipoles(uint16_t xDipole_, uint16_t yDipole_, uint16_t zDipole_, + void setDipoles(int16_t xDipole_, int16_t yDipole_, int16_t zDipole_, uint16_t currentTorqueDurationMs_) { if (xDipole.value != xDipole_) { } @@ -503,7 +503,7 @@ class DipoleActuationSet : public StaticLocalDataSet<4> { currentTorqueDurationMs = currentTorqueDurationMs_; } - void getDipoles(uint16_t& xDipole_, uint16_t& yDipole_, uint16_t& zDipole_) { + void getDipoles(int16_t& xDipole_, int16_t& yDipole_, int16_t& zDipole_) { xDipole_ = xDipole.value; yDipole_ = yDipole.value; zDipole_ = zDipole.value; From 4bed0fd563ddf584b8001e273c064f2b513a90af Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 2 Feb 2023 10:47:58 +0100 Subject: [PATCH 116/330] scale dipole of controller to by the MTQ expected range --- mission/controller/acs/ActuatorCmd.cpp | 17 +++++++++-------- mission/controller/acs/ActuatorCmd.h | 4 ++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/mission/controller/acs/ActuatorCmd.cpp b/mission/controller/acs/ActuatorCmd.cpp index 2a0a9425..771f9d6f 100644 --- a/mission/controller/acs/ActuatorCmd.cpp +++ b/mission/controller/acs/ActuatorCmd.cpp @@ -54,21 +54,22 @@ void ActuatorCmd::cmdSpeedToRws(const int32_t *speedRw0, const int32_t *speedRw1 VectorOperations::add(speedRws, deltaSpeed, rwCmdSpeed, 4); } -void ActuatorCmd::cmdDipolMtq(const double *dipolMoment, double *dipolMomentUnits) { - // Convert to Unit frame +void ActuatorCmd::cmdDipolMtq(const double *dipolMoment, double *dipolMomentActuator) { + // Convert to actuator frame MatrixOperations::multiply(*acsParameters.magnetorquesParameter.inverseAlignment, - dipolMoment, dipolMomentUnits, 3, 3, 1); - // Scaling along largest element if dipol exceeds maximum + dipolMoment, dipolMomentActuator, 3, 3, 1); + // Scaling along largest element if dipol exceeds maximum double maxDipol = acsParameters.magnetorquesParameter.DipolMax; double maxValue = 0; for (int i = 0; i < 3; i++) { - if (abs(dipolMomentUnits[i]) > maxDipol) { - maxValue = abs(dipolMomentUnits[i]); + if (abs(dipolMomentActuator[i]) > maxDipol) { + maxValue = abs(dipolMomentActuator[i]); } } - if (maxValue > maxDipol) { double scalingFactor = maxDipol / maxValue; - VectorOperations::mulScalar(dipolMomentUnits, scalingFactor, dipolMomentUnits, 3); + VectorOperations::mulScalar(dipolMomentActuator, scalingFactor, dipolMomentActuator, 3); } + // scale dipole from 1 Am^2 to 1e^-4 Am^2 + VectorOperations::mulScalar(dipolMomentActuator, 1e4, dipolMomentActuator, 3); } diff --git a/mission/controller/acs/ActuatorCmd.h b/mission/controller/acs/ActuatorCmd.h index 5cb3ff00..181bf175 100644 --- a/mission/controller/acs/ActuatorCmd.h +++ b/mission/controller/acs/ActuatorCmd.h @@ -35,9 +35,9 @@ class ActuatorCmd { * @brief: cmdDipolMtq() gives the commanded dipol moment for the magnetorques * * @param: dipolMoment given dipol moment in spacecraft frame - * dipolMomentUnits resulting dipol moment for every unit + * dipolMomentActuator resulting dipol moment in actuator reference frame */ - void cmdDipolMtq(const double *dipolMoment, double *dipolMomentUnits); + void cmdDipolMtq(const double *dipolMoment, double *dipolMomentActuator); protected: private: From 8c03b2ec95171b8eefdd8f6e91f571f74034ba59 Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 2 Feb 2023 10:56:14 +0100 Subject: [PATCH 117/330] bump changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b15c4f12..03737313 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,8 @@ change warranting a new major release: - Bugfix in FSFW where the sequence flags of the PUS packets were set to continuation segment (0b00) instead of unsegmented (0b11). +- Fixed usage of uint instead of int for commanding MTQ. Also fixed the range in which the ACS Ctrl + commands the MTQ to match the actual commanding range. # [v1.23.0] 2023-02-01 From 2b00d3a56595f8f19f20d042a84fc9c565fa752b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 2 Feb 2023 16:27:50 +0100 Subject: [PATCH 118/330] ACS updates - Adapt ACS subsystem to handle events from ACS CTRL - Some fixes and updates for ACS subsystem --- CHANGELOG.md | 1 + fsfw | 2 +- linux/devices/GPSHyperionLinuxController.cpp | 3 + mission/acsDefs.h | 26 +++ mission/controller/AcsController.cpp | 19 +- mission/controller/AcsController.h | 10 - .../AcsControllerDefinitions.h | 14 -- mission/core/GenericFactory.cpp | 3 +- mission/system/objects/AcsSubsystem.cpp | 78 +++++++- mission/system/objects/AcsSubsystem.h | 6 + mission/system/tree/acsModeTree.cpp | 174 ++++++------------ mission/tmtc/CcsdsIpCoreHandler.cpp | 2 +- 12 files changed, 187 insertions(+), 151 deletions(-) create mode 100644 mission/acsDefs.h delete mode 100644 mission/controller/controllerdefinitions/AcsControllerDefinitions.h diff --git a/CHANGELOG.md b/CHANGELOG.md index b15c4f12..5cd9fc32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ change warranting a new major release: - Bugfix in FSFW where the sequence flags of the PUS packets were set to continuation segment (0b00) instead of unsegmented (0b11). +- Set GPS set entries to invalid on MODE_OFF command. # [v1.23.0] 2023-02-01 diff --git a/fsfw b/fsfw index 01cc619e..f2461cd7 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 01cc619e67b84cef514b045377771ff1e11caf80 +Subproject commit f2461cd7e9df449e9ea4a842ca820d5002ef6494 diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index 1799ef4a..d112d507 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -48,6 +48,9 @@ ReturnValue_t GPSHyperionLinuxController::checkModeCommand(Mode_t mode, Submode_ return HasModesIF::INVALID_MODE; } } + if (mode == MODE_OFF) { + gpsSet.setValidity(false, true); + } return returnvalue::OK; } diff --git a/mission/acsDefs.h b/mission/acsDefs.h new file mode 100644 index 00000000..ab182112 --- /dev/null +++ b/mission/acsDefs.h @@ -0,0 +1,26 @@ +#ifndef MISSION_ACSDEFS_H_ +#define MISSION_ACSDEFS_H_ + +#include + +namespace acs { + +enum CtrlSubmode { + OFF = HasModesIF::MODE_OFF, + SAFE = 2, + DETUMBLE = 3, + IDLE = 4, + PTG_NADIR = 5, + PTG_TARGET = 6, + PTG_TARGET_GS = 7, + PTG_INERTIAL = 8, +}; + +static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::ACS_SUBSYSTEM; +static const Event SAFE_RATE_VIOLATION = + MAKE_EVENT(0, severity::MEDIUM); //!< The limits for the rotation in safe mode were violated. +static constexpr Event SAFE_RATE_RECOVERY = MAKE_EVENT(1, severity::MEDIUM); + +} // namespace acs + +#endif /* MISSION_ACSDEFS_H_ */ diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index e684e4d4..2796bc8b 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -2,6 +2,7 @@ #include +#include "mission/acsDefs.h" #include "mission/config/torquer.h" AcsController::AcsController(object_id_t objectId) @@ -45,15 +46,15 @@ void AcsController::performControlOperation() { case InternalState::READY: { if (mode != MODE_OFF) { switch (submode) { - case SUBMODE_SAFE: + case acs::SAFE: performSafe(); break; - case SUBMODE_DETUMBLE: + case acs::DETUMBLE: performDetumble(); break; - case SUBMODE_PTG_TARGET: - case SUBMODE_PTG_NADIR: - case SUBMODE_PTG_INERTIAL: + case acs::PTG_TARGET: + case acs::PTG_NADIR: + case acs::PTG_INERTIAL: performPointingCtrl(); break; } @@ -151,9 +152,10 @@ void AcsController::performSafe() { detumbleCounter = 0; } if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) { - submode = SUBMODE_DETUMBLE; + // TODO: Trigger mode transition in ACS subsystem? + submode = acs::CtrlSubmode::DETUMBLE; detumbleCounter = 0; - triggerEvent(SAFE_RATE_VIOLATION); + triggerEvent(acs::SAFE_RATE_VIOLATION); } { @@ -208,7 +210,8 @@ void AcsController::performDetumble() { detumbleCounter = 0; } if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) { - submode = SUBMODE_SAFE; + // TODO: Trigger mode transition in subsystem instead + submode = acs::CtrlSubmode::DETUMBLE; detumbleCounter = 0; } diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index 1c4996b3..bc23fdaf 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -24,16 +24,6 @@ class AcsController : public ExtendedControllerBase { AcsController(object_id_t objectId); - static const Submode_t SUBMODE_SAFE = 2; - static const Submode_t SUBMODE_DETUMBLE = 3; - static const Submode_t SUBMODE_PTG_TARGET = 4; - static const Submode_t SUBMODE_PTG_NADIR = 5; - static const Submode_t SUBMODE_PTG_INERTIAL = 6; - - static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::ACS_SUBSYSTEM; - static const Event SAFE_RATE_VIOLATION = - MAKE_EVENT(0, severity::MEDIUM); //!< The limits for the rotation in safe mode were violated. - protected: void performSafe(); void performDetumble(); diff --git a/mission/controller/controllerdefinitions/AcsControllerDefinitions.h b/mission/controller/controllerdefinitions/AcsControllerDefinitions.h deleted file mode 100644 index 8122178d..00000000 --- a/mission/controller/controllerdefinitions/AcsControllerDefinitions.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCONTROLLERDEFINITIONS_H_ -#define MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCONTROLLERDEFINITIONS_H_ - -#include - -namespace acs { - -enum CtrlModes { OFF = HasModesIF::MODE_OFF, SAFE = 1, DETUMBLE = 2, IDLE = 3, TARGET_PT = 4 }; - -static constexpr Submode_t IDLE_CHARGE = 1; - -} // namespace acs - -#endif /* MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCONTROLLERDEFINITIONS_H_ */ diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index 9c08726c..a5acd734 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -162,7 +162,8 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun pus::PUS_SERVICE_20); new CService200ModeCommanding(objects::PUS_SERVICE_200_MODE_MGMT, config::EIVE_PUS_APID, pus::PUS_SERVICE_200, 8); - HealthServiceCfg healthCfg(objects::PUS_SERVICE_201_HEALTH, config::EIVE_PUS_APID, *healthTable, 20); + HealthServiceCfg healthCfg(objects::PUS_SERVICE_201_HEALTH, config::EIVE_PUS_APID, *healthTable, + 20); new CServiceHealthCommanding(healthCfg); #if OBSW_ADD_CFDP_COMPONENTS == 1 diff --git a/mission/system/objects/AcsSubsystem.cpp b/mission/system/objects/AcsSubsystem.cpp index 96735ae9..5ae387ac 100644 --- a/mission/system/objects/AcsSubsystem.cpp +++ b/mission/system/objects/AcsSubsystem.cpp @@ -1,5 +1,81 @@ #include "AcsSubsystem.h" +#include +#include + +#include "fsfw/modes/ModeMessage.h" +#include "mission/acsDefs.h" + AcsSubsystem::AcsSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables) - : Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) {} + : Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) { + auto mqArgs = MqArgs(getObjectId(), static_cast(this)); + eventQueue = + QueueFactory::instance()->createMessageQueue(10, EventMessage::EVENT_MESSAGE_SIZE, &mqArgs); +} + +ReturnValue_t AcsSubsystem::initialize() { + EventManagerIF* manager = ObjectManager::instance()->get(objects::EVENT_MANAGER); + if (manager == nullptr) { +#if FSFW_CPP_OSTREAM_ENABLED == 1 + sif::error << "AcsSubsystem::initialize: Invalid event manager" << std::endl; +#endif + return ObjectManagerIF::CHILD_INIT_FAILED; + } + ReturnValue_t result = manager->registerListener(eventQueue->getId()); + if (result != returnvalue::OK) { +#if FSFW_CPP_OSTREAM_ENABLED == 1 + sif::warning << "AcsSubsystem::registerListener: Failed to register as " + "listener" + << std::endl; +#endif + return ObjectManagerIF::CHILD_INIT_FAILED; + ; + } + result = manager->subscribeToEvent(eventQueue->getId(), event::getEventId(acs::SAFE_RATE_VIOLATION)); + if(result != returnvalue::OK) { + sif::error << "AcsSubsystem: Subscribing for acs::SAFE_RATE_VIOLATION failed" << std::endl; + } + result = manager->subscribeToEvent(eventQueue->getId(), event::getEventId(acs::SAFE_RATE_RECOVERY)); + if(result != returnvalue::OK) { + sif::error << "AcsSubsystem: Subscribing for acs::SAFE_RATE_RECOVERY failed" << std::endl; + } + return Subsystem::initialize(); +} + +void AcsSubsystem::performChildOperation() { + handleEventMessages(); + return Subsystem::performChildOperation(); +} + +void AcsSubsystem::handleEventMessages() { + EventMessage event; + for (ReturnValue_t result = eventQueue->receiveMessage(&event); result == returnvalue::OK; + result = eventQueue->receiveMessage(&event)) { + switch (event.getMessageId()) { + case EventMessage::EVENT_MESSAGE: + if (event.getEvent() == acs::SAFE_RATE_VIOLATION) { + CommandMessage msg; + ModeMessage::setCmdModeModeMessage(msg, acs::CtrlSubmode::DETUMBLE, 0); + ReturnValue_t result = commandQueue->sendMessage(commandQueue->getId(), &msg); + if (result != returnvalue::OK) { + sif::error << "AcsSubsystem: sending DETUMBLE mode cmd to self has failed" << std::endl; + } + } + if (event.getEvent() == acs::SAFE_RATE_RECOVERY) { + CommandMessage msg; + ModeMessage::setCmdModeModeMessage(msg, acs::CtrlSubmode::SAFE, 0); + ReturnValue_t result = commandQueue->sendMessage(commandQueue->getId(), &msg); + if (result != returnvalue::OK) { + sif::error << "AcsSubsystem: sending IDLE mode cmd to self has failed" << std::endl; + } + } + break; + default: + sif::debug << "AcsSubsystem::performChildOperation: Did not subscribe " + "to this event message" + << std::endl; + break; + } + } +} diff --git a/mission/system/objects/AcsSubsystem.h b/mission/system/objects/AcsSubsystem.h index 8673395a..df5bbbf3 100644 --- a/mission/system/objects/AcsSubsystem.h +++ b/mission/system/objects/AcsSubsystem.h @@ -8,6 +8,12 @@ class AcsSubsystem : public Subsystem { AcsSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables); private: + ReturnValue_t initialize() override; + void performChildOperation() override; + + void handleEventMessages(); + + MessageQueueIF* eventQueue = nullptr; }; #endif /* MISSION_SYSTEM_ACSSUBSYSTEM_H_ */ diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index 8eaf36d9..f5a1df23 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -7,7 +7,7 @@ #include #include "eive/objects.h" -#include "mission/controller/controllerdefinitions/AcsControllerDefinitions.h" +#include "mission/acsDefs.h" #include "util.h" Subsystem satsystem::acs::ACS_SUBSYSTEM(objects::ACS_SUBSYSTEM, 12, 24); @@ -20,64 +20,62 @@ void buildOffSequence(Subsystem& ss, ModeListEntry& eh); void buildDetumbleSequence(Subsystem& ss, ModeListEntry& entryHelper); void buildSafeSequence(Subsystem& ss, ModeListEntry& entryHelper); void buildIdleSequence(Subsystem& ss, ModeListEntry& entryHelper); -void buildIdleChargeSequence(Subsystem& ss, ModeListEntry& entryHelper); void buildTargetPtSequence(Subsystem& ss, ModeListEntry& entryHelper); } // namespace static const auto OFF = HasModesIF::MODE_OFF; static const auto NML = DeviceHandlerIF::MODE_NORMAL; -auto ACS_SEQUENCE_OFF = - std::make_pair(acs::CtrlModes::OFF << 24, FixedArrayList()); +auto ACS_SEQUENCE_OFF = std::make_pair(acs::CtrlSubmode::OFF, FixedArrayList()); auto ACS_TABLE_OFF_TGT = - std::make_pair((acs::CtrlModes::OFF << 24) | 1, FixedArrayList()); + std::make_pair((acs::CtrlSubmode::OFF << 24) | 1, FixedArrayList()); auto ACS_TABLE_OFF_TRANS = - std::make_pair((acs::CtrlModes::OFF << 24) | 2, FixedArrayList()); + std::make_pair((acs::CtrlSubmode::OFF << 24) | 2, FixedArrayList()); auto ACS_SEQUENCE_DETUMBLE = - std::make_pair(acs::CtrlModes::DETUMBLE << 24, FixedArrayList()); + std::make_pair(acs::CtrlSubmode::DETUMBLE, FixedArrayList()); auto ACS_TABLE_DETUMBLE_TGT = - std::make_pair((acs::CtrlModes::DETUMBLE << 24) | 1, FixedArrayList()); + std::make_pair((acs::CtrlSubmode::DETUMBLE << 24) | 1, FixedArrayList()); auto ACS_TABLE_DETUMBLE_TRANS_0 = - std::make_pair((acs::CtrlModes::DETUMBLE << 24) | 2, FixedArrayList()); + std::make_pair((acs::CtrlSubmode::DETUMBLE << 24) | 2, FixedArrayList()); auto ACS_TABLE_DETUMBLE_TRANS_1 = - std::make_pair((acs::CtrlModes::DETUMBLE << 24) | 3, FixedArrayList()); + std::make_pair((acs::CtrlSubmode::DETUMBLE << 24) | 3, FixedArrayList()); -auto ACS_SEQUENCE_SAFE = - std::make_pair(acs::CtrlModes::SAFE << 24, FixedArrayList()); +auto ACS_SEQUENCE_SAFE = std::make_pair(acs::CtrlSubmode::SAFE, FixedArrayList()); auto ACS_TABLE_SAFE_TGT = - std::make_pair((acs::CtrlModes::SAFE << 24) | 1, FixedArrayList()); + std::make_pair((acs::CtrlSubmode::SAFE << 24) | 1, FixedArrayList()); auto ACS_TABLE_SAFE_TRANS_0 = - std::make_pair((acs::CtrlModes::SAFE << 24) | 2, FixedArrayList()); + std::make_pair((acs::CtrlSubmode::SAFE << 24) | 2, FixedArrayList()); auto ACS_TABLE_SAFE_TRANS_1 = - std::make_pair((acs::CtrlModes::SAFE << 24) | 3, FixedArrayList()); + std::make_pair((acs::CtrlSubmode::SAFE << 24) | 3, FixedArrayList()); -auto ACS_SEQUENCE_IDLE = - std::make_pair(acs::CtrlModes::IDLE << 24, FixedArrayList()); +auto ACS_SEQUENCE_IDLE = std::make_pair(acs::CtrlSubmode::IDLE, FixedArrayList()); auto ACS_TABLE_IDLE_TGT = - std::make_pair((acs::CtrlModes::IDLE << 24) | 1, FixedArrayList()); + std::make_pair((acs::CtrlSubmode::IDLE << 24) | 1, FixedArrayList()); auto ACS_TABLE_IDLE_TRANS_0 = - std::make_pair((acs::CtrlModes::IDLE << 24) | 2, FixedArrayList()); + std::make_pair((acs::CtrlSubmode::IDLE << 24) | 2, FixedArrayList()); auto ACS_TABLE_IDLE_TRANS_1 = - std::make_pair((acs::CtrlModes::IDLE << 24) | 3, FixedArrayList()); + std::make_pair((acs::CtrlSubmode::IDLE << 24) | 3, FixedArrayList()); -auto ACS_SEQUENCE_IDLE_CHRG = std::make_pair(acs::CtrlModes::IDLE << 24 | (acs::IDLE_CHARGE << 8), - FixedArrayList()); -auto ACS_TABLE_IDLE_CHRG_TGT = std::make_pair( - (acs::CtrlModes::IDLE << 24) | (acs::IDLE_CHARGE << 8) | 1, FixedArrayList()); -auto ACS_TABLE_IDLE_CHRG_TRANS_0 = std::make_pair( - (acs::CtrlModes::IDLE << 24) | (acs::IDLE_CHARGE << 8) | 2, FixedArrayList()); -auto ACS_TABLE_IDLE_CHRG_TRANS_1 = std::make_pair( - (acs::CtrlModes::IDLE << 24) | (acs::IDLE_CHARGE << 8) | 3, FixedArrayList()); +auto ACS_SEQUENCE_PTG_TARGET = + std::make_pair(acs::CtrlSubmode::PTG_TARGET, FixedArrayList()); +auto ACS_TABLE_PTG_TARGET_TGT = + std::make_pair((acs::CtrlSubmode::PTG_TARGET << 24) | 1, FixedArrayList()); +auto ACS_TABLE_PTG_TARGET_TRANS_0 = + std::make_pair((acs::CtrlSubmode::PTG_TARGET << 24) | 2, FixedArrayList()); +auto ACS_TABLE_PTG_TARGET_TRANS_1 = + std::make_pair((acs::CtrlSubmode::PTG_TARGET << 24) | 3, FixedArrayList()); -auto ACS_SEQUENCE_TARGET_PT = - std::make_pair(acs::CtrlModes::TARGET_PT, FixedArrayList()); +/* +auto ACS_SEQUENCE_PTG_TARGET = + std::make_pair(acs::CtrlSubmode::TARGET_PT, FixedArrayList()); auto ACS_TABLE_TARGET_PT_TGT = - std::make_pair((acs::CtrlModes::TARGET_PT << 24) | 1, FixedArrayList()); + std::make_pair((acs::CtrlSubmode::TARGET_PT << 24) | 1, FixedArrayList()); auto ACS_TABLE_TARGET_PT_TRANS_0 = - std::make_pair((acs::CtrlModes::TARGET_PT << 24) | 2, FixedArrayList()); + std::make_pair((acs::CtrlSubmode::TARGET_PT << 24) | 2, FixedArrayList()); auto ACS_TABLE_TARGET_PT_TRANS_1 = - std::make_pair((acs::CtrlModes::TARGET_PT << 24) | 3, FixedArrayList()); + std::make_pair((acs::CtrlSubmode::TARGET_PT << 24) | 3, FixedArrayList()); +*/ void satsystem::acs::init() { ModeListEntry entry; @@ -85,9 +83,8 @@ void satsystem::acs::init() { buildSafeSequence(ACS_SUBSYSTEM, entry); buildDetumbleSequence(ACS_SUBSYSTEM, entry); buildIdleSequence(ACS_SUBSYSTEM, entry); - buildIdleChargeSequence(ACS_SUBSYSTEM, entry); buildTargetPtSequence(ACS_SUBSYSTEM, entry); - ACS_SUBSYSTEM.setInitialMode(HasModesIF::MODE_OFF); + ACS_SUBSYSTEM.setInitialMode(::acs::CtrlSubmode::SAFE); } namespace { @@ -151,7 +148,7 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) { check(sequence.insert(eh), ctxc); }; // Build SAFE target - iht(objects::ACS_CONTROLLER, acs::CtrlModes::SAFE, 0, ACS_TABLE_SAFE_TGT.second); + iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::SAFE, 0, ACS_TABLE_SAFE_TGT.second); iht(objects::IMTQ_HANDLER, 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); @@ -167,7 +164,7 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) { ctxc); // Build SAFE transition 1 - iht(objects::ACS_CONTROLLER, acs::CtrlModes::SAFE, 0, ACS_TABLE_SAFE_TRANS_1.second); + iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::SAFE, 0, ACS_TABLE_SAFE_TRANS_1.second); check(ss.addTable(&ACS_TABLE_SAFE_TRANS_1.second, ACS_TABLE_SAFE_TRANS_1.first, false, true), ctxc); @@ -200,7 +197,7 @@ void buildDetumbleSequence(Subsystem& ss, ModeListEntry& eh) { check(sequence.insert(eh), ctxc); }; // Build DETUMBLE target - iht(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TGT.second); + iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TGT.second); iht(objects::IMTQ_HANDLER, 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); @@ -218,7 +215,7 @@ void buildDetumbleSequence(Subsystem& ss, ModeListEntry& eh) { ctxc); // Build DETUMBLE transition 1 - iht(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TRANS_1.second); + iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TRANS_1.second); check(ss.addTable(&ACS_TABLE_DETUMBLE_TRANS_1.second, ACS_TABLE_DETUMBLE_TRANS_1.first, false, true), ctxc); @@ -252,7 +249,7 @@ void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) { check(sequence.insert(eh), ctxc); }; // Build IDLE target - iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, 0, ACS_TABLE_IDLE_TGT.second); + iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::IDLE, 0, ACS_TABLE_IDLE_TGT.second); iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_TGT.second); iht(objects::RW_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second); @@ -264,11 +261,11 @@ void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) { 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::RW_ASS, NML, 0, ACS_TABLE_IDLE_TRANS_0.second); - iht(objects::STAR_TRACKER, OFF, 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); // Build IDLE transition 1 - iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, 0, ACS_TABLE_IDLE_TRANS_1.second); + iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::IDLE, 0, ACS_TABLE_IDLE_TRANS_1.second); ss.addTable(&ACS_TABLE_IDLE_TRANS_1.second, ACS_TABLE_IDLE_TRANS_1.first, false, true); // Build IDLE sequence @@ -279,60 +276,6 @@ void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) { true); } -void buildIdleChargeSequence(Subsystem& ss, ModeListEntry& eh) { - std::string context = "satsystem::acs::buildIdleChargeSequence"; - auto ctxc = context.c_str(); - // Insert Helper Table - auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, - ArrayList& sequence) { - eh.setObject(obj); - eh.setMode(mode); - eh.setSubmode(submode); - check(sequence.insert(eh), ctxc); - }; - // Insert Helper Sequence - auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, - bool checkSuccess) { - eh.setTableId(tableId); - eh.setWaitSeconds(waitSeconds); - eh.setCheckSuccess(checkSuccess); - check(sequence.insert(eh), ctxc); - }; - // Build IDLE target - iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, acs::IDLE_CHARGE, - ACS_TABLE_IDLE_CHRG_TGT.second); - iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second); - iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second); - iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second); - check(ss.addTable(&ACS_TABLE_IDLE_CHRG_TGT.second, ACS_TABLE_IDLE_CHRG_TGT.first, false, true), - ctxc); - - // Build IDLE transition 0 - iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); - iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); - iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); - iht(objects::RW_ASS, OFF, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); - iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); - check(ss.addTable(&ACS_TABLE_IDLE_CHRG_TRANS_0.second, ACS_TABLE_IDLE_CHRG_TRANS_0.first, false, - true), - ctxc); - - // Build IDLE transition 1 - iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, acs::IDLE_CHARGE, - ACS_TABLE_IDLE_CHRG_TRANS_1.second); - check(ss.addTable(&ACS_TABLE_IDLE_CHRG_TRANS_1.second, ACS_TABLE_IDLE_CHRG_TRANS_1.first, false, - true), - ctxc); - - // Build IDLE sequence - ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TGT.first, 0, true); - ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TRANS_0.first, 0, true); - ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TRANS_1.first, 0, false); - check(ss.addSequence(&ACS_SEQUENCE_IDLE_CHRG.second, ACS_SEQUENCE_IDLE_CHRG.first, - ACS_SEQUENCE_SAFE.first, false, true), - ctxc); -} - void buildTargetPtSequence(Subsystem& ss, ModeListEntry& eh) { std::string context = "satsystem::acs::buildTargetPtSequence"; auto ctxc = context.c_str(); @@ -354,36 +297,37 @@ void buildTargetPtSequence(Subsystem& ss, ModeListEntry& eh) { }; // Build TARGET PT table - iht(objects::ACS_CONTROLLER, acs::CtrlModes::TARGET_PT, 0, ACS_TABLE_TARGET_PT_TGT.second); - iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); - iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); - iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); - iht(objects::RW_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); - iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); - check(ss.addTable(&ACS_TABLE_TARGET_PT_TGT.second, ACS_TABLE_TARGET_PT_TGT.first, false, true), + iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::PTG_TARGET, 0, ACS_TABLE_PTG_TARGET_TGT.second); + iht(objects::IMTQ_HANDLER, 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::RW_ASS, 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); // Build TARGET PT transition 0 - iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); - iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); - iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); - iht(objects::RW_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); - iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); - check(ss.addTable(&ACS_TABLE_TARGET_PT_TRANS_0.second, ACS_TABLE_TARGET_PT_TRANS_0.first, false, + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_PTG_TARGET_TRANS_0.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_TRANS_0.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_TRANS_0.second); + iht(objects::RW_ASS, NML, 0, ACS_TABLE_PTG_TARGET_TRANS_0.second); + iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_PTG_TARGET_TRANS_0.second); + check(ss.addTable(&ACS_TABLE_PTG_TARGET_TRANS_0.second, ACS_TABLE_PTG_TARGET_TRANS_0.first, false, true), ctxc); // Build TARGET PT transition 1 - iht(objects::ACS_CONTROLLER, acs::CtrlModes::TARGET_PT, 0, ACS_TABLE_TARGET_PT_TRANS_1.second); - check(ss.addTable(&ACS_TABLE_TARGET_PT_TRANS_1.second, ACS_TABLE_TARGET_PT_TRANS_1.first, false, + iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::PTG_TARGET, 0, + ACS_TABLE_PTG_TARGET_TRANS_1.second); + check(ss.addTable(&ACS_TABLE_PTG_TARGET_TRANS_1.second, ACS_TABLE_PTG_TARGET_TRANS_1.first, false, true), ctxc); // Build IDLE sequence - ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TGT.first, 0, true); - ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TRANS_0.first, 0, true); - ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TRANS_1.first, 0, false); - check(ss.addSequence(&ACS_SEQUENCE_TARGET_PT.second, ACS_SEQUENCE_TARGET_PT.first, + ihs(ACS_SEQUENCE_PTG_TARGET.second, ACS_TABLE_PTG_TARGET_TGT.first, 0, true); + ihs(ACS_SEQUENCE_PTG_TARGET.second, ACS_TABLE_PTG_TARGET_TRANS_0.first, 0, true); + ihs(ACS_SEQUENCE_PTG_TARGET.second, ACS_TABLE_PTG_TARGET_TRANS_1.first, 0, false); + check(ss.addSequence(&ACS_SEQUENCE_PTG_TARGET.second, ACS_SEQUENCE_PTG_TARGET.first, ACS_SEQUENCE_IDLE.first, false, true), ctxc); } diff --git a/mission/tmtc/CcsdsIpCoreHandler.cpp b/mission/tmtc/CcsdsIpCoreHandler.cpp index 85d1143b..02089da8 100644 --- a/mission/tmtc/CcsdsIpCoreHandler.cpp +++ b/mission/tmtc/CcsdsIpCoreHandler.cpp @@ -361,7 +361,7 @@ void CcsdsIpCoreHandler::checkTxTimer() { } if (transmitterCountdown.hasTimedOut()) { disableTransmit(); - //TODO: set mode to off (move timer to subsystem) + // TODO: set mode to off (move timer to subsystem) } } From c2fb224feadabacabd41ae1e199d7dc34af0fd78 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 2 Feb 2023 17:06:26 +0100 Subject: [PATCH 119/330] ACS Update scheduling --- bsp_q7s/core/scheduling.cpp | 70 +- .../pollingSequenceFactory.cpp | 822 +++++++++--------- .../pollingsequence/pollingSequenceFactory.h | 4 +- mission/system/objects/AcsSubsystem.cpp | 18 +- 4 files changed, 462 insertions(+), 452 deletions(-) diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index d8136d3a..ad8990de 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -144,11 +144,25 @@ void scheduling::initTasks() { #endif PeriodicTaskIF* comTask = factory->createPeriodicTask( - "CCSDS_HANDLER", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); + "COM_TASK", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, missedDeadlineFunc); result = comTask->addComponent(objects::COM_SUBSYSTEM); if (result != returnvalue::OK) { scheduling::printAddObjectError("COM subsystem", objects::COM_SUBSYSTEM); } + +#if OBSW_ADD_SYRLINKS == 1 + comTask->addComponent(objects::SYRLINKS_HANDLER, DeviceHandlerIF::PERFORM_OPERATION); + comTask->addComponent(objects::SYRLINKS_HANDLER, DeviceHandlerIF::SEND_WRITE); + comTask->addComponent(objects::SYRLINKS_HANDLER, DeviceHandlerIF::GET_WRITE); + comTask->addComponent(objects::SYRLINKS_HANDLER, DeviceHandlerIF::SEND_READ); + comTask->addComponent(objects::SYRLINKS_HANDLER, DeviceHandlerIF::GET_READ); + comTask->addComponent(objects::SYRLINKS_HANDLER, DeviceHandlerIF::PERFORM_OPERATION); + comTask->addComponent(objects::SYRLINKS_HANDLER, DeviceHandlerIF::SEND_WRITE); + comTask->addComponent(objects::SYRLINKS_HANDLER, DeviceHandlerIF::GET_WRITE); + comTask->addComponent(objects::SYRLINKS_HANDLER, DeviceHandlerIF::SEND_READ); + comTask->addComponent(objects::SYRLINKS_HANDLER, DeviceHandlerIF::GET_READ); +#endif + #if OBSW_ADD_CCSDS_IP_CORES == 1 result = comTask->addComponent(objects::CCSDS_HANDLER); if (result != returnvalue::OK) { @@ -182,12 +196,6 @@ void scheduling::initTasks() { } #endif /* OBSW_ADD_GPS_CTRL */ -#if OBSW_ADD_ACS_CTRL == 1 - acsCtrlTask->addComponent(objects::ACS_CONTROLLER); - if (result != returnvalue::OK) { - scheduling::printAddObjectError("ACS_CTRL", objects::ACS_CONTROLLER); - } -#endif #if OBSW_Q7S_EM == 1 acsCtrlTask->addComponent(objects::MGM_0_LIS3_HANDLER); acsCtrlTask->addComponent(objects::MGM_1_RM3100_HANDLER); @@ -438,10 +446,24 @@ void scheduling::initTasks() { void scheduling::createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc, std::vector& taskVec) { ReturnValue_t result = returnvalue::OK; + + FixedTimeslotTaskIF* acsPst = factory.createFixedTimeslotTask( + "ACS_PST", 85, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); + result = pst::pstAcs(acsPst); + if (result != returnvalue::OK) { + if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { + sif::warning << "scheduling::initTasks: ACS PST is empty" << std::endl; + } else { + sif::error << "scheduling::initTasks: Creating ACS PST failed!" << std::endl; + } + } else { + taskVec.push_back(acsPst); + } + /* Polling Sequence Table Default */ #if OBSW_ADD_SPI_TEST_CODE == 0 FixedTimeslotTaskIF* spiPst = factory.createFixedTimeslotTask( - "MAIN_SPI", 75, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.5, missedDeadlineFunc); + "MAIN_SPI", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.5, missedDeadlineFunc); result = pst::pstSpi(spiPst); if (result != returnvalue::OK) { if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { @@ -454,37 +476,9 @@ void scheduling::createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction } #endif -#if OBSW_ADD_RW == 1 - FixedTimeslotTaskIF* rwPstTask = factory.createFixedTimeslotTask( - "RW_SPI", 65, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 1.0, missedDeadlineFunc); - result = pst::pstSpiRw(rwPstTask); - if (result != returnvalue::OK) { - if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { - sif::warning << "scheduling::initTasks: SPI PST is empty" << std::endl; - } else { - sif::error << "scheduling::initTasks: Creating SPI PST failed!" << std::endl; - } - } else { - taskVec.push_back(rwPstTask); - } -#endif - - FixedTimeslotTaskIF* uartPst = factory.createFixedTimeslotTask( - "UART_PST", 65, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.2, missedDeadlineFunc); - result = pst::pstUart(uartPst); - if (result != returnvalue::OK) { - if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { - sif::warning << "scheduling::initTasks: UART PST is empty" << std::endl; - } else { - sif::error << "scheduling::initTasks: Creating UART PST failed!" << std::endl; - } - } else { - taskVec.push_back(uartPst); - } - #if OBSW_ADD_I2C_TEST_CODE == 0 FixedTimeslotTaskIF* i2cPst = factory.createFixedTimeslotTask( - "I2C_PST", 65, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.2, missedDeadlineFunc); + "I2C_PST", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.2, missedDeadlineFunc); result = pst::pstI2c(i2cPst); if (result != returnvalue::OK) { if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { @@ -499,7 +493,7 @@ void scheduling::createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction #if OBSW_ADD_GOMSPACE_PCDU == 1 FixedTimeslotTaskIF* gomSpacePstTask = factory.createFixedTimeslotTask( - "GS_PST_TASK", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 1.0, missedDeadlineFunc); + "GS_PST_TASK", 65, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 1.0, missedDeadlineFunc); result = pst::pstGompaceCan(gomSpacePstTask); if (result != returnvalue::OK) { if (result != FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 5fec0cd6..0fd6cbfd 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -15,36 +15,6 @@ #define RPI_TEST_GPS_HANDLER 0 #endif -ReturnValue_t pst::pstSpiRw(FixedTimeslotTaskIF *thisSequence) { - uint32_t length = thisSequence->getPeriodMs(); - static_cast(length); - thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - - thisSequence->addSlot(objects::RW1, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW2, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW3, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW4, length * 0.2, DeviceHandlerIF::SEND_WRITE); - - thisSequence->addSlot(objects::RW1, length * 0.8, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW2, length * 0.8, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW3, length * 0.8, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW4, length * 0.8, DeviceHandlerIF::GET_WRITE); - - thisSequence->addSlot(objects::RW1, length * 0.8, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW2, length * 0.8, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW3, length * 0.8, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW4, length * 0.8, DeviceHandlerIF::SEND_READ); - - thisSequence->addSlot(objects::RW1, length * 0.8, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RW2, length * 0.8, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RW3, length * 0.8, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RW4, length * 0.8, DeviceHandlerIF::GET_READ); - return thisSequence->checkSequence(); -} - ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) { uint32_t length = thisSequence->getPeriodMs(); static_cast(length); @@ -56,271 +26,6 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) { thisSequence->addSlot(objects::PLPCDU_HANDLER, length * 0, DeviceHandlerIF::GET_READ); #endif -#if OBSW_ADD_SUN_SENSORS == 1 - - bool addSus0 = true; - bool addSus1 = true; - bool addSus2 = true; - bool addSus3 = true; - bool addSus4 = true; - bool addSus5 = true; - bool addSus6 = true; - bool addSus7 = true; - bool addSus8 = true; - bool addSus9 = true; - bool addSus10 = true; - bool addSus11 = true; - - if (addSus0) { - /* Write setup */ - thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0.4, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0.4, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0.4, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0.4, - DeviceHandlerIF::GET_READ); - } - if (addSus1) { - thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0.4, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0.4, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0.4, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0.4, - DeviceHandlerIF::GET_READ); - } - if (addSus2) { - thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0.4, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0.4, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0.4, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0.4, - DeviceHandlerIF::GET_READ); - } - if (addSus3) { - thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0.4, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0.4, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0.4, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0.4, - DeviceHandlerIF::GET_READ); - } - if (addSus4) { - thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0.4, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0.4, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0.4, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0.4, - DeviceHandlerIF::GET_READ); - } - if (addSus5) { - thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0.4, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0.4, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0.4, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0.4, - DeviceHandlerIF::GET_READ); - } - - if (addSus6) { - thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0.4, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0.4, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0.4, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0.4, - DeviceHandlerIF::GET_READ); - } - - if (addSus7) { - thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0.4, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0.4, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0.4, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0.4, - DeviceHandlerIF::GET_READ); - } - - if (addSus8) { - thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0.4, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0.4, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0.4, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0.4, - DeviceHandlerIF::GET_READ); - } - - if (addSus9) { - thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0.4, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0.4, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0.4, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0.4, - DeviceHandlerIF::GET_READ); - } - - if (addSus10) { - thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0, - DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0.4, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0.4, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0.4, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0.4, - DeviceHandlerIF::GET_READ); - } - - if (addSus11) { - thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0, - DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0.4, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0.4, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0.4, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0.4, - DeviceHandlerIF::GET_READ); - } -#endif /* OBSW_ADD_SUN_SENSORS == 1 */ - #if OBSW_ADD_RAD_SENSORS == 1 /* Radiation sensor */ thisSequence->addSlot(objects::RAD_SENSOR, length * 0, DeviceHandlerIF::PERFORM_OPERATION); @@ -330,74 +35,6 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) { thisSequence->addSlot(objects::RAD_SENSOR, length * 0.8, DeviceHandlerIF::GET_READ); #endif -#if OBSW_ADD_ACS_BOARD == 1 - bool enableAside = true; - bool enableBside = true; - if (enableAside) { - // A side - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.25, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.6, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.7, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.85, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.25, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.6, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.7, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.85, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.25, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.6, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.7, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.85, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.25, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.6, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.7, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.85, DeviceHandlerIF::GET_READ); - } - - if (enableBside) { - // B side - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0.25, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0.6, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0.7, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0.85, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * 0.25, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * 0.6, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * 0.7, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * 0.85, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0.25, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0.6, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0.7, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0.85, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0.25, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0.6, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0.7, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0.85, DeviceHandlerIF::GET_READ); - } -#endif /* OBSW_ADD_ACS_BOARD == 1 */ - return thisSequence->checkSequence(); } @@ -407,23 +44,6 @@ ReturnValue_t pst::pstI2c(FixedTimeslotTaskIF *thisSequence) { // Length of a communication cycle uint32_t length = thisSequence->getPeriodMs(); static_cast(length); -#if OBSW_ADD_MGT == 1 - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::GET_READ); -#endif #if OBSW_ADD_BPX_BATTERY_HANDLER == 1 thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0.2, DeviceHandlerIF::PERFORM_OPERATION); @@ -481,29 +101,6 @@ ReturnValue_t pst::pstI2c(FixedTimeslotTaskIF *thisSequence) { return thisSequence->checkSequence(); } -ReturnValue_t pst::pstUart(FixedTimeslotTaskIF *thisSequence) { - // Length of a communication cycle - uint32_t length = thisSequence->getPeriodMs(); - static_cast(length); - -#if OBSW_ADD_SYRLINKS == 1 - thisSequence->addSlot(objects::SYRLINKS_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::SYRLINKS_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SYRLINKS_HANDLER, length * 0.4, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SYRLINKS_HANDLER, length * 0.6, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SYRLINKS_HANDLER, length * 0.8, DeviceHandlerIF::GET_READ); -#endif - -#if OBSW_ADD_STAR_TRACKER == 1 - thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::STAR_TRACKER, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::STAR_TRACKER, length * 0.4, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::STAR_TRACKER, length * 0.6, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::STAR_TRACKER, length * 0.8, DeviceHandlerIF::GET_READ); -#endif - return thisSequence->checkSequence(); -} - ReturnValue_t pst::pstGompaceCan(FixedTimeslotTaskIF *thisSequence) { uint32_t length = thisSequence->getPeriodMs(); // PCDU handlers receives two messages and both must be handled @@ -576,3 +173,422 @@ ReturnValue_t pst::pstTest(FixedTimeslotTaskIF *thisSequence) { } return returnvalue::OK; } + +ReturnValue_t pst::pstAcs(FixedTimeslotTaskIF *thisSequence) { + /* Length of a communication cycle */ + uint32_t length = thisSequence->getPeriodMs(); +#if OBSW_ADD_ACS_BOARD == 1 + bool enableAside = true; + bool enableBside = true; + if (enableAside) { + // A side + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.0625, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.0625, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.0625, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.0625, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.0625, DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.0625, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.0625, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.0625, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.0625, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.0625, + DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.0625, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.0625, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.0625, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.0625, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.0625, DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.0625, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.0625, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.0625, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.0625, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.0625, DeviceHandlerIF::GET_READ); + } + + if (enableBside) { + // B side + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0.0625, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0.0625, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0.0625, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0.0625, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0.0625, DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * 0.0625, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * 0.0625, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * 0.0625, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * 0.0625, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * 0.0625, + DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0.0625, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0.0625, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0.0625, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0.0625, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0.0625, DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0.0625, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0.0625, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0.0625, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0.0625, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0.0625, DeviceHandlerIF::GET_READ); + } +#endif /* OBSW_ADD_ACS_BOARD == 1 */ + // SUS: 16 ms +#if OBSW_ADD_SUN_SENSORS == 1 + + bool addSus0 = true; + bool addSus1 = true; + bool addSus2 = true; + bool addSus3 = true; + bool addSus4 = true; + bool addSus5 = true; + bool addSus6 = true; + bool addSus7 = true; + bool addSus8 = true; + bool addSus9 = true; + bool addSus10 = true; + bool addSus11 = true; + + if (addSus0) { + /* Write setup */ + thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0, DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0.0325, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0.0325, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0.0325, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0.0325, + DeviceHandlerIF::GET_READ); + } + if (addSus1) { + thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0, DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0.0325, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0.0325, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0.4, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0.0325, + DeviceHandlerIF::GET_READ); + } + if (addSus2) { + thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0, DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0.0325, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0.0325, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0.0325, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0.0325, + DeviceHandlerIF::GET_READ); + } + if (addSus3) { + thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0, DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0.0325, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0.0325, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0.0325, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0.0325, + DeviceHandlerIF::GET_READ); + } + if (addSus4) { + thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0, DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0.0325, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0.0325, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0.0325, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0.0325, + DeviceHandlerIF::GET_READ); + } + if (addSus5) { + thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0, DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0.0325, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0.0325, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0.0325, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0.0325, + DeviceHandlerIF::GET_READ); + } + + if (addSus6) { + thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0, DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0.0325, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0.0325, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0.0325, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0.0325, + DeviceHandlerIF::GET_READ); + } + + if (addSus7) { + thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0, DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0.0325, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0.0325, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0.0325, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0.0325, + DeviceHandlerIF::GET_READ); + } + + if (addSus8) { + thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0, DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0.0325, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0.0325, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0.0325, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0.0325, + DeviceHandlerIF::GET_READ); + } + + if (addSus9) { + thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0.0325, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0.0325, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0.0325, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0.0325, + DeviceHandlerIF::GET_READ); + } + + if (addSus10) { + thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0, + DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0.0325, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0.0325, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0.0325, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0.0325, + DeviceHandlerIF::GET_READ); + } + + if (addSus11) { + thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0, + DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0.0325, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0.0325, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0.0325, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0.0325, + DeviceHandlerIF::GET_READ); + } +#endif /* OBSW_ADD_SUN_SENSORS == 1 */ + +#if OBSW_ADD_STAR_TRACKER == 1 + thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::GET_READ); +#endif + +#if OBSW_ADD_MGT == 1 + // This is the MTM measurement cycle + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::GET_READ); +#endif + + thisSequence->addSlot(objects::ACS_CONTROLLER, length * 0.1, 0); + +#if OBSW_ADD_MGT == 1 + // This is the torquing cycle. + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.1125, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.1125, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.1125, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.1125, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.1125, DeviceHandlerIF::GET_READ); +#endif + +#if OBSW_ADD_RW == 1 + thisSequence->addSlot(objects::RW1, length * 0.1125, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RW2, length * 0.1125, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RW3, length * 0.1125, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RW4, length * 0.1125, DeviceHandlerIF::PERFORM_OPERATION); + + thisSequence->addSlot(objects::RW1, length * 0.1125, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RW2, length * 0.1125, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RW3, length * 0.1125, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RW4, length * 0.1125, DeviceHandlerIF::SEND_WRITE); + + thisSequence->addSlot(objects::RW1, length * 0.1125, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW2, length * 0.1125, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW3, length * 0.1125, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW4, length * 0.1125, DeviceHandlerIF::GET_WRITE); + + thisSequence->addSlot(objects::RW1, length * 0.1125, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW2, length * 0.1125, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW3, length * 0.1125, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW4, length * 0.1125, DeviceHandlerIF::SEND_READ); + + thisSequence->addSlot(objects::RW1, length * 0.1125, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RW2, length * 0.1125, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RW3, length * 0.1125, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RW4, length * 0.1125, DeviceHandlerIF::GET_READ); +#endif + return returnvalue::OK; +} diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h index 1b585d81..2eadd19d 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h @@ -39,11 +39,9 @@ namespace pst { */ ReturnValue_t pstGompaceCan(FixedTimeslotTaskIF* thisSequence); -ReturnValue_t pstUart(FixedTimeslotTaskIF* thisSequence); - ReturnValue_t pstSpi(FixedTimeslotTaskIF* thisSequence); -ReturnValue_t pstSpiRw(FixedTimeslotTaskIF* thisSequence); +ReturnValue_t pstAcs(FixedTimeslotTaskIF* thisSequence); ReturnValue_t pstI2c(FixedTimeslotTaskIF* thisSequence); diff --git a/mission/system/objects/AcsSubsystem.cpp b/mission/system/objects/AcsSubsystem.cpp index 5ae387ac..f5b8a0ce 100644 --- a/mission/system/objects/AcsSubsystem.cpp +++ b/mission/system/objects/AcsSubsystem.cpp @@ -32,20 +32,22 @@ ReturnValue_t AcsSubsystem::initialize() { return ObjectManagerIF::CHILD_INIT_FAILED; ; } - result = manager->subscribeToEvent(eventQueue->getId(), event::getEventId(acs::SAFE_RATE_VIOLATION)); - if(result != returnvalue::OK) { - sif::error << "AcsSubsystem: Subscribing for acs::SAFE_RATE_VIOLATION failed" << std::endl; + result = + manager->subscribeToEvent(eventQueue->getId(), event::getEventId(acs::SAFE_RATE_VIOLATION)); + if (result != returnvalue::OK) { + sif::error << "AcsSubsystem: Subscribing for acs::SAFE_RATE_VIOLATION failed" << std::endl; } - result = manager->subscribeToEvent(eventQueue->getId(), event::getEventId(acs::SAFE_RATE_RECOVERY)); - if(result != returnvalue::OK) { - sif::error << "AcsSubsystem: Subscribing for acs::SAFE_RATE_RECOVERY failed" << std::endl; + result = + manager->subscribeToEvent(eventQueue->getId(), event::getEventId(acs::SAFE_RATE_RECOVERY)); + if (result != returnvalue::OK) { + sif::error << "AcsSubsystem: Subscribing for acs::SAFE_RATE_RECOVERY failed" << std::endl; } return Subsystem::initialize(); } void AcsSubsystem::performChildOperation() { - handleEventMessages(); - return Subsystem::performChildOperation(); + handleEventMessages(); + return Subsystem::performChildOperation(); } void AcsSubsystem::handleEventMessages() { From f6abe2b466d814b77b197580f2e7659bcdc965f2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 2 Feb 2023 17:09:59 +0100 Subject: [PATCH 120/330] remove code --- mission/system/tree/acsModeTree.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index f5a1df23..4429d15c 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -66,17 +66,6 @@ auto ACS_TABLE_PTG_TARGET_TRANS_0 = auto ACS_TABLE_PTG_TARGET_TRANS_1 = std::make_pair((acs::CtrlSubmode::PTG_TARGET << 24) | 3, FixedArrayList()); -/* -auto ACS_SEQUENCE_PTG_TARGET = - std::make_pair(acs::CtrlSubmode::TARGET_PT, FixedArrayList()); -auto ACS_TABLE_TARGET_PT_TGT = - std::make_pair((acs::CtrlSubmode::TARGET_PT << 24) | 1, FixedArrayList()); -auto ACS_TABLE_TARGET_PT_TRANS_0 = - std::make_pair((acs::CtrlSubmode::TARGET_PT << 24) | 2, FixedArrayList()); -auto ACS_TABLE_TARGET_PT_TRANS_1 = - std::make_pair((acs::CtrlSubmode::TARGET_PT << 24) | 3, FixedArrayList()); -*/ - void satsystem::acs::init() { ModeListEntry entry; buildOffSequence(ACS_SUBSYSTEM, entry); From 4590e1d9c9d9b2d0265c2c5c9926b20e2cdfc1a5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 2 Feb 2023 17:12:22 +0100 Subject: [PATCH 121/330] host compiles --- mission/acsDefs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/mission/acsDefs.h b/mission/acsDefs.h index ab182112..d17351a6 100644 --- a/mission/acsDefs.h +++ b/mission/acsDefs.h @@ -1,6 +1,7 @@ #ifndef MISSION_ACSDEFS_H_ #define MISSION_ACSDEFS_H_ +#include #include namespace acs { From a5997c773f388338c5cf97f4ef4f65ea0a4ecbc7 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 2 Feb 2023 17:12:22 +0100 Subject: [PATCH 122/330] host compiles --- mission/acsDefs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/mission/acsDefs.h b/mission/acsDefs.h index ab182112..d17351a6 100644 --- a/mission/acsDefs.h +++ b/mission/acsDefs.h @@ -1,6 +1,7 @@ #ifndef MISSION_ACSDEFS_H_ #define MISSION_ACSDEFS_H_ +#include #include namespace acs { From aaac3b24b2ede8760b687751d70d0d98f1cc20f9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 2 Feb 2023 17:14:48 +0100 Subject: [PATCH 123/330] update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cd9fc32..fe417267 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,12 @@ change warranting a new major release: instead of unsegmented (0b11). - Set GPS set entries to invalid on MODE_OFF command. +## Changed + +- Update and tweak ACS subsystem to represent the actual ACS design +- Event handling in the ACS subsystem for events triggered by the ACS controller. + PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/365 + # [v1.23.0] 2023-02-01 TMTC version: v2.9.0 From 1e0d9561a29d9e97f08ff9ddb7980443098f32c8 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 2 Feb 2023 17:16:15 +0100 Subject: [PATCH 124/330] changelog update --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe417267..19d666a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,9 @@ change warranting a new major release: ## Changed +- Update ACS scheduling to represent the actual ACS design. There is one ACS PST now for all + timing sensitive ACS operations. + PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/365 - Update and tweak ACS subsystem to represent the actual ACS design - Event handling in the ACS subsystem for events triggered by the ACS controller. PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/365 From 7226f02d4b69962c7147e575fec7d50fa6521a91 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 2 Feb 2023 18:22:07 +0100 Subject: [PATCH 125/330] bump tmtc and fsfw --- fsfw | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fsfw b/fsfw index 01cc619e..f2461cd7 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 01cc619e67b84cef514b045377771ff1e11caf80 +Subproject commit f2461cd7e9df449e9ea4a842ca820d5002ef6494 diff --git a/tmtc b/tmtc index c633893d..b4e42280 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit c633893df43030bb26b8422604b569bf8419d454 +Subproject commit b4e4228040e5b77169fdd92c5577d6f58d318275 From 5a54d4e1ed2a6e8ed221301c3f7eb78bec16c25c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 2 Feb 2023 18:22:28 +0100 Subject: [PATCH 126/330] afmt --- mission/core/GenericFactory.cpp | 3 ++- mission/tmtc/CcsdsIpCoreHandler.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index 9c08726c..a5acd734 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -162,7 +162,8 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun pus::PUS_SERVICE_20); new CService200ModeCommanding(objects::PUS_SERVICE_200_MODE_MGMT, config::EIVE_PUS_APID, pus::PUS_SERVICE_200, 8); - HealthServiceCfg healthCfg(objects::PUS_SERVICE_201_HEALTH, config::EIVE_PUS_APID, *healthTable, 20); + HealthServiceCfg healthCfg(objects::PUS_SERVICE_201_HEALTH, config::EIVE_PUS_APID, *healthTable, + 20); new CServiceHealthCommanding(healthCfg); #if OBSW_ADD_CFDP_COMPONENTS == 1 diff --git a/mission/tmtc/CcsdsIpCoreHandler.cpp b/mission/tmtc/CcsdsIpCoreHandler.cpp index 85d1143b..02089da8 100644 --- a/mission/tmtc/CcsdsIpCoreHandler.cpp +++ b/mission/tmtc/CcsdsIpCoreHandler.cpp @@ -361,7 +361,7 @@ void CcsdsIpCoreHandler::checkTxTimer() { } if (transmitterCountdown.hasTimedOut()) { disableTransmit(); - //TODO: set mode to off (move timer to subsystem) + // TODO: set mode to off (move timer to subsystem) } } From e6bafd51dc1de3cb3221bef52e2e415b42869e06 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 2 Feb 2023 18:37:56 +0100 Subject: [PATCH 127/330] prepare v1.23.1 --- CHANGELOG.md | 6 ++++++ CMakeLists.txt | 2 +- fsfw | 2 +- tmtc | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b15c4f12..52d52e98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,10 +17,16 @@ change warranting a new major release: # [unreleased] +# [v1.23.1] 2023-02-02 + +TMTC rev: 15adb9bf2ec68304a4f87b8dd418c1a8353283a3 + ## Fixed - Bugfix in FSFW where the sequence flags of the PUS packets were set to continuation segment (0b00) instead of unsegmented (0b11). +- Bugfix in FSFW where the MGM RM3100 value Z axis data was parse incorrectly. + PR: https://egit.irs.uni-stuttgart.de/eive/fsfw/pulls/123 # [v1.23.0] 2023-02-01 diff --git a/CMakeLists.txt b/CMakeLists.txt index 55f4afe4..e9c51a6a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ cmake_minimum_required(VERSION 3.13) set(OBSW_VERSION_MAJOR_IF_GIT_FAILS 1) set(OBSW_VERSION_MINOR_IF_GIT_FAILS 23) -set(OBSW_VERSION_REVISION_IF_GIT_FAILS 0) +set(OBSW_VERSION_REVISION_IF_GIT_FAILS 1) # set(CMAKE_VERBOSE TRUE) diff --git a/fsfw b/fsfw index f2461cd7..3250bbf2 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit f2461cd7e9df449e9ea4a842ca820d5002ef6494 +Subproject commit 3250bbf269b3326683222bb87ce7faecae63ad97 diff --git a/tmtc b/tmtc index b4e42280..15adb9bf 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit b4e4228040e5b77169fdd92c5577d6f58d318275 +Subproject commit 15adb9bf2ec68304a4f87b8dd418c1a8353283a3 From daa7c6652dd09c9247a4791154faec3bdab337bb Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 3 Feb 2023 10:21:17 +0100 Subject: [PATCH 128/330] update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b40eaa46..666fb053 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,8 @@ TMTC rev: 15adb9bf2ec68304a4f87b8dd418c1a8353283a3 ## Changed +- ACS Subsystem Sequence Mode IDs updated. + PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/365 - Update and tweak ACS subsystem to represent the actual ACS design - Event handling in the ACS subsystem for events triggered by the ACS controller. PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/365 From 4615b2fe169ccde83e22ad050abbe95d358fca75 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 3 Feb 2023 10:51:08 +0100 Subject: [PATCH 129/330] bumpchangelog --- CHANGELOG.md | 1 + tmtc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 666fb053..2f36f965 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ TMTC rev: 15adb9bf2ec68304a4f87b8dd418c1a8353283a3 - ACS Subsystem Sequence Mode IDs updated. PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/365 + TMTC PR: https://egit.irs.uni-stuttgart.de/eive/eive-tmtc/pulls/130 - Update and tweak ACS subsystem to represent the actual ACS design - Event handling in the ACS subsystem for events triggered by the ACS controller. PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/365 diff --git a/tmtc b/tmtc index 28c367c6..b9f58e06 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 28c367c6fb959b180fa5ead858e508178454891e +Subproject commit b9f58e061275392a867701f67a13d0c718d652be From c2100cc7821a2dbff366a4ace595a8838193ac55 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 3 Feb 2023 10:51:56 +0100 Subject: [PATCH 130/330] overhead comment --- mission/acsDefs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mission/acsDefs.h b/mission/acsDefs.h index d17351a6..3c589f5c 100644 --- a/mission/acsDefs.h +++ b/mission/acsDefs.h @@ -18,9 +18,9 @@ enum CtrlSubmode { }; static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::ACS_SUBSYSTEM; +//!< The limits for the rotation in safe mode were violated. static const Event SAFE_RATE_VIOLATION = - MAKE_EVENT(0, severity::MEDIUM); //!< The limits for the rotation in safe mode were violated. -static constexpr Event SAFE_RATE_RECOVERY = MAKE_EVENT(1, severity::MEDIUM); + MAKE_EVENT(0, severity::MEDIUM); static constexpr Event SAFE_RATE_RECOVERY = MAKE_EVENT(1, severity::MEDIUM); } // namespace acs From ef0a78dedb781ff10fc10f31dccafc2be28b59c8 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 3 Feb 2023 10:52:39 +0100 Subject: [PATCH 131/330] afmt --- mission/acsDefs.h | 5 +++-- mission/system/objects/AcsSubsystem.cpp | 18 ++++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/mission/acsDefs.h b/mission/acsDefs.h index 3c589f5c..34d29ebf 100644 --- a/mission/acsDefs.h +++ b/mission/acsDefs.h @@ -19,8 +19,9 @@ enum CtrlSubmode { static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::ACS_SUBSYSTEM; //!< The limits for the rotation in safe mode were violated. -static const Event SAFE_RATE_VIOLATION = - MAKE_EVENT(0, severity::MEDIUM); static constexpr Event SAFE_RATE_RECOVERY = MAKE_EVENT(1, severity::MEDIUM); +static const Event SAFE_RATE_VIOLATION = MAKE_EVENT(0, severity::MEDIUM); +//!< The system has recovered from a safe rate rotation violation. +static constexpr Event SAFE_RATE_RECOVERY = MAKE_EVENT(1, severity::MEDIUM); } // namespace acs diff --git a/mission/system/objects/AcsSubsystem.cpp b/mission/system/objects/AcsSubsystem.cpp index 5ae387ac..f5b8a0ce 100644 --- a/mission/system/objects/AcsSubsystem.cpp +++ b/mission/system/objects/AcsSubsystem.cpp @@ -32,20 +32,22 @@ ReturnValue_t AcsSubsystem::initialize() { return ObjectManagerIF::CHILD_INIT_FAILED; ; } - result = manager->subscribeToEvent(eventQueue->getId(), event::getEventId(acs::SAFE_RATE_VIOLATION)); - if(result != returnvalue::OK) { - sif::error << "AcsSubsystem: Subscribing for acs::SAFE_RATE_VIOLATION failed" << std::endl; + result = + manager->subscribeToEvent(eventQueue->getId(), event::getEventId(acs::SAFE_RATE_VIOLATION)); + if (result != returnvalue::OK) { + sif::error << "AcsSubsystem: Subscribing for acs::SAFE_RATE_VIOLATION failed" << std::endl; } - result = manager->subscribeToEvent(eventQueue->getId(), event::getEventId(acs::SAFE_RATE_RECOVERY)); - if(result != returnvalue::OK) { - sif::error << "AcsSubsystem: Subscribing for acs::SAFE_RATE_RECOVERY failed" << std::endl; + result = + manager->subscribeToEvent(eventQueue->getId(), event::getEventId(acs::SAFE_RATE_RECOVERY)); + if (result != returnvalue::OK) { + sif::error << "AcsSubsystem: Subscribing for acs::SAFE_RATE_RECOVERY failed" << std::endl; } return Subsystem::initialize(); } void AcsSubsystem::performChildOperation() { - handleEventMessages(); - return Subsystem::performChildOperation(); + handleEventMessages(); + return Subsystem::performChildOperation(); } void AcsSubsystem::handleEventMessages() { From b3a5c94f02800a9c14ea7eba688f3f3df3cfb534 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 3 Feb 2023 10:53:16 +0100 Subject: [PATCH 132/330] update events --- generators/bsp_q7s_events.csv | 3 ++- generators/events/translateEvents.cpp | 7 +++++-- generators/objects/translateObjects.cpp | 2 +- linux/fsfwconfig/events/translateEvents.cpp | 7 +++++-- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- tmtc | 2 +- 6 files changed, 15 insertions(+), 8 deletions(-) diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index 666710e8..2e39b641 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -84,7 +84,8 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 10800;0x2a30;STORE_ERROR;LOW;;fsfw/src/fsfw/cfdp/handler/defs.h 10801;0x2a31;MSG_QUEUE_ERROR;LOW;;fsfw/src/fsfw/cfdp/handler/defs.h 10802;0x2a32;SERIALIZATION_ERROR;LOW;;fsfw/src/fsfw/cfdp/handler/defs.h -11200;0x2bc0;SAFE_RATE_VIOLATION;MEDIUM;;mission/controller/AcsController.h +11200;0x2bc0;SAFE_RATE_VIOLATION;MEDIUM;;mission/acsDefs.h +11201;0x2bc1;SAFE_RATE_RECOVERY;MEDIUM;;mission/acsDefs.h 11300;0x2c24;SWITCH_CMD_SENT;INFO;Indicates that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h 11301;0x2c25;SWITCH_HAS_CHANGED;INFO;Indicated that a switch state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h 11302;0x2c26;SWITCHING_Q7S_DENIED;MEDIUM;;mission/devices/devicedefinitions/powerDefinitions.h diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 65f118b2..e810f4d1 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 244 translations. + * @brief Auto-generated event translation file. Contains 245 translations. * @details - * Generated on: 2023-02-01 19:42:11 + * Generated on: 2023-02-03 10:52:53 */ #include "translateEvents.h" @@ -91,6 +91,7 @@ const char *STORE_ERROR_STRING = "STORE_ERROR"; const char *MSG_QUEUE_ERROR_STRING = "MSG_QUEUE_ERROR"; const char *SERIALIZATION_ERROR_STRING = "SERIALIZATION_ERROR"; const char *SAFE_RATE_VIOLATION_STRING = "SAFE_RATE_VIOLATION"; +const char *SAFE_RATE_RECOVERY_STRING = "SAFE_RATE_RECOVERY"; const char *SWITCH_CMD_SENT_STRING = "SWITCH_CMD_SENT"; const char *SWITCH_HAS_CHANGED_STRING = "SWITCH_HAS_CHANGED"; const char *SWITCHING_Q7S_DENIED_STRING = "SWITCHING_Q7S_DENIED"; @@ -419,6 +420,8 @@ const char *translateEvents(Event event) { return SERIALIZATION_ERROR_STRING; case (11200): return SAFE_RATE_VIOLATION_STRING; + case (11201): + return SAFE_RATE_RECOVERY_STRING; case (11300): return SWITCH_CMD_SENT_STRING; case (11301): diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index fdc28d47..9707189d 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 152 translations. - * Generated on: 2023-02-01 19:42:11 + * Generated on: 2023-02-03 10:52:53 */ #include "translateObjects.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 65f118b2..e810f4d1 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 244 translations. + * @brief Auto-generated event translation file. Contains 245 translations. * @details - * Generated on: 2023-02-01 19:42:11 + * Generated on: 2023-02-03 10:52:53 */ #include "translateEvents.h" @@ -91,6 +91,7 @@ const char *STORE_ERROR_STRING = "STORE_ERROR"; const char *MSG_QUEUE_ERROR_STRING = "MSG_QUEUE_ERROR"; const char *SERIALIZATION_ERROR_STRING = "SERIALIZATION_ERROR"; const char *SAFE_RATE_VIOLATION_STRING = "SAFE_RATE_VIOLATION"; +const char *SAFE_RATE_RECOVERY_STRING = "SAFE_RATE_RECOVERY"; const char *SWITCH_CMD_SENT_STRING = "SWITCH_CMD_SENT"; const char *SWITCH_HAS_CHANGED_STRING = "SWITCH_HAS_CHANGED"; const char *SWITCHING_Q7S_DENIED_STRING = "SWITCHING_Q7S_DENIED"; @@ -419,6 +420,8 @@ const char *translateEvents(Event event) { return SERIALIZATION_ERROR_STRING; case (11200): return SAFE_RATE_VIOLATION_STRING; + case (11201): + return SAFE_RATE_RECOVERY_STRING; case (11300): return SWITCH_CMD_SENT_STRING; case (11301): diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index fdc28d47..9707189d 100644 --- a/linux/fsfwconfig/objects/translateObjects.cpp +++ b/linux/fsfwconfig/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 152 translations. - * Generated on: 2023-02-01 19:42:11 + * Generated on: 2023-02-03 10:52:53 */ #include "translateObjects.h" diff --git a/tmtc b/tmtc index b9f58e06..a39e9427 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit b9f58e061275392a867701f67a13d0c718d652be +Subproject commit a39e94279b0d77b9d21a996d87090d69fd4b3222 From 2c2c73b23fa9b29d80c27f577e30193252129525 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 3 Feb 2023 11:25:03 +0100 Subject: [PATCH 133/330] fixes and updates for ACS mode tree --- mission/acsDefs.h | 4 +- mission/controller/AcsController.cpp | 4 +- mission/system/tree/acsModeTree.cpp | 172 ++++++++++++++++++++------- 3 files changed, 134 insertions(+), 46 deletions(-) diff --git a/mission/acsDefs.h b/mission/acsDefs.h index 34d29ebf..2bb536f2 100644 --- a/mission/acsDefs.h +++ b/mission/acsDefs.h @@ -11,10 +11,10 @@ enum CtrlSubmode { SAFE = 2, DETUMBLE = 3, IDLE = 4, - PTG_NADIR = 5, + PTG_TARGET_NADIR = 5, PTG_TARGET = 6, PTG_TARGET_GS = 7, - PTG_INERTIAL = 8, + PTG_TARGET_INERTIAL = 8, }; static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::ACS_SUBSYSTEM; diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 2796bc8b..a2ff9edf 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -53,8 +53,8 @@ void AcsController::performControlOperation() { performDetumble(); break; case acs::PTG_TARGET: - case acs::PTG_NADIR: - case acs::PTG_INERTIAL: + case acs::PTG_TARGET_NADIR: + case acs::PTG_TARGET_INERTIAL: performPointingCtrl(); break; } diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index f5a1df23..6c27b160 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -20,7 +20,11 @@ void buildOffSequence(Subsystem& ss, ModeListEntry& eh); void buildDetumbleSequence(Subsystem& ss, ModeListEntry& entryHelper); void buildSafeSequence(Subsystem& ss, ModeListEntry& entryHelper); void buildIdleSequence(Subsystem& ss, ModeListEntry& entryHelper); +void buildTargetPtNadirSequence(Subsystem& ss, ModeListEntry& eh); void buildTargetPtSequence(Subsystem& ss, ModeListEntry& entryHelper); +void buildTargetPtGsSequence(Subsystem& ss, ModeListEntry& entryHelper); +void buildTargetPtInertialSequence(Subsystem& ss, ModeListEntry& entryHelper); + } // namespace static const auto OFF = HasModesIF::MODE_OFF; @@ -29,8 +33,10 @@ static const auto NML = DeviceHandlerIF::MODE_NORMAL; auto ACS_SEQUENCE_OFF = std::make_pair(acs::CtrlSubmode::OFF, FixedArrayList()); auto ACS_TABLE_OFF_TGT = std::make_pair((acs::CtrlSubmode::OFF << 24) | 1, FixedArrayList()); -auto ACS_TABLE_OFF_TRANS = - std::make_pair((acs::CtrlSubmode::OFF << 24) | 2, FixedArrayList()); +auto ACS_TABLE_OFF_TRANS_0 = + std::make_pair((acs::CtrlSubmode::OFF << 24) | 2, FixedArrayList()); +auto ACS_TABLE_OFF_TRANS_1 = + std::make_pair((acs::CtrlSubmode::OFF << 24) | 3, FixedArrayList()); auto ACS_SEQUENCE_DETUMBLE = std::make_pair(acs::CtrlSubmode::DETUMBLE, FixedArrayList()); @@ -57,28 +63,59 @@ auto ACS_TABLE_IDLE_TRANS_0 = auto ACS_TABLE_IDLE_TRANS_1 = std::make_pair((acs::CtrlSubmode::IDLE << 24) | 3, FixedArrayList()); +auto ACS_TABLE_PTG_TRANS_0 = + std::make_pair((acs::CtrlSubmode::PTG_TARGET << 24) | 2, FixedArrayList()); + auto ACS_SEQUENCE_PTG_TARGET = std::make_pair(acs::CtrlSubmode::PTG_TARGET, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_TGT = std::make_pair((acs::CtrlSubmode::PTG_TARGET << 24) | 1, FixedArrayList()); -auto ACS_TABLE_PTG_TARGET_TRANS_0 = - std::make_pair((acs::CtrlSubmode::PTG_TARGET << 24) | 2, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_TRANS_1 = std::make_pair((acs::CtrlSubmode::PTG_TARGET << 24) | 3, FixedArrayList()); -/* -auto ACS_SEQUENCE_PTG_TARGET = - std::make_pair(acs::CtrlSubmode::TARGET_PT, FixedArrayList()); -auto ACS_TABLE_TARGET_PT_TGT = - std::make_pair((acs::CtrlSubmode::TARGET_PT << 24) | 1, FixedArrayList()); -auto ACS_TABLE_TARGET_PT_TRANS_0 = - std::make_pair((acs::CtrlSubmode::TARGET_PT << 24) | 2, FixedArrayList()); -auto ACS_TABLE_TARGET_PT_TRANS_1 = - std::make_pair((acs::CtrlSubmode::TARGET_PT << 24) | 3, FixedArrayList()); -*/ +auto ACS_SEQUENCE_PTG_TARGET_GS = + std::make_pair(acs::CtrlSubmode::PTG_TARGET_GS, FixedArrayList()); +auto ACS_TABLE_PTG_TARGET_GS_TGT = + std::make_pair((acs::CtrlSubmode::PTG_TARGET_GS << 24) | 1, FixedArrayList()); +auto ACS_TABLE_PTG_TARGET_GS_TRANS_0 = + std::make_pair((acs::CtrlSubmode::PTG_TARGET_GS << 24) | 2, FixedArrayList()); +auto ACS_TABLE_PTG_TARGET_GS_TRANS_1 = + std::make_pair((acs::CtrlSubmode::PTG_TARGET_GS << 24) | 3, FixedArrayList()); + +auto ACS_SEQUENCE_PTG_TARGET_NADIR = + std::make_pair(acs::CtrlSubmode::PTG_TARGET_NADIR, FixedArrayList()); +auto ACS_TABLE_PTG_TARGET_NADIR_TGT = std::make_pair((acs::CtrlSubmode::PTG_TARGET_NADIR << 24) | 1, + FixedArrayList()); +auto ACS_TABLE_PTG_TARGET_NADIR_TRANS_0 = std::make_pair( + (acs::CtrlSubmode::PTG_TARGET_NADIR << 24) | 2, FixedArrayList()); +auto ACS_TABLE_PTG_TARGET_NADIR_TRANS_1 = std::make_pair( + (acs::CtrlSubmode::PTG_TARGET_NADIR << 24) | 3, FixedArrayList()); + +auto ACS_SEQUENCE_PTG_TARGET_INERTIAL = + std::make_pair(acs::CtrlSubmode::PTG_TARGET_INERTIAL, FixedArrayList()); +auto ACS_TABLE_PTG_TARGET_INERTIAL_TGT = std::make_pair( + (acs::CtrlSubmode::PTG_TARGET_INERTIAL << 24) | 1, FixedArrayList()); +auto ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_0 = std::make_pair( + (acs::CtrlSubmode::PTG_TARGET_INERTIAL << 24) | 2, FixedArrayList()); +auto ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1 = std::make_pair( + (acs::CtrlSubmode::PTG_TARGET_INERTIAL << 24) | 3, FixedArrayList()); void satsystem::acs::init() { ModeListEntry entry; + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, ArrayList& table) { + entry.setObject(obj); + entry.setMode(mode); + entry.setSubmode(submode); + check(table.insert(entry), "satsystem::acs::init: generic target"); + }; + // Build TARGET PT transition 0 + iht(objects::IMTQ_HANDLER, 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::RW_ASS, NML, 0, ACS_TABLE_PTG_TRANS_0.second); + iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_PTG_TRANS_0.second); + buildOffSequence(ACS_SUBSYSTEM, entry); buildSafeSequence(ACS_SUBSYSTEM, entry); buildDetumbleSequence(ACS_SUBSYSTEM, entry); @@ -109,20 +146,24 @@ void buildOffSequence(Subsystem& ss, ModeListEntry& eh) { }; // OFF Target table is empty - check(ss.addTable(&ACS_TABLE_OFF_TGT.second, ACS_TABLE_OFF_TGT.first, false, true), ctxc); + check(ss.addTable(TableEntry(ACS_TABLE_OFF_TGT.first, &ACS_TABLE_OFF_TGT.second)), ctxc); - // Build OFF transition - iht(objects::ACS_CONTROLLER, OFF, 0, ACS_TABLE_OFF_TRANS.second); - iht(objects::IMTQ_HANDLER, OFF, 0, ACS_TABLE_OFF_TRANS.second); - iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_OFF_TRANS.second); - iht(objects::ACS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); - iht(objects::SUS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); - iht(objects::RW_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); - check(ss.addTable(&ACS_TABLE_OFF_TRANS.second, ACS_TABLE_OFF_TRANS.first, false, true), ctxc); + // Build OFF transition 0 + iht(objects::ACS_CONTROLLER, OFF, 0, ACS_TABLE_OFF_TRANS_0.second); + check(ss.addTable(TableEntry(ACS_TABLE_OFF_TRANS_0.first, &ACS_TABLE_OFF_TRANS_0.second)), ctxc); + + // Build OFF transition 1 + iht(objects::IMTQ_HANDLER, OFF, 0, ACS_TABLE_OFF_TRANS_1.second); + iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_OFF_TRANS_1.second); + iht(objects::ACS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS_1.second); + iht(objects::SUS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS_1.second); + iht(objects::RW_ASS, OFF, 0, ACS_TABLE_OFF_TRANS_1.second); + check(ss.addTable(TableEntry(ACS_TABLE_OFF_TRANS_1.first, &ACS_TABLE_OFF_TRANS_1.second)), ctxc); // Build OFF sequence ihs(ACS_SEQUENCE_OFF.second, ACS_TABLE_OFF_TGT.first, 0, false); - ihs(ACS_SEQUENCE_OFF.second, ACS_TABLE_OFF_TRANS.first, 0, false); + ihs(ACS_SEQUENCE_OFF.second, ACS_TABLE_OFF_TRANS_0.first, 0, false); + ihs(ACS_SEQUENCE_OFF.second, ACS_TABLE_OFF_TRANS_1.first, 0, false); check(ss.addSequence(&ACS_SEQUENCE_OFF.second, ACS_SEQUENCE_OFF.first, ACS_SEQUENCE_OFF.first, false, true), ctxc); @@ -148,7 +189,7 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) { check(sequence.insert(eh), ctxc); }; // Build SAFE target - iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::SAFE, 0, ACS_TABLE_SAFE_TGT.second); + iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::SAFE, ACS_TABLE_SAFE_TGT.second); iht(objects::IMTQ_HANDLER, 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); @@ -164,7 +205,7 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) { ctxc); // Build SAFE transition 1 - iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::SAFE, 0, ACS_TABLE_SAFE_TRANS_1.second); + iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::SAFE, ACS_TABLE_SAFE_TRANS_1.second); check(ss.addTable(&ACS_TABLE_SAFE_TRANS_1.second, ACS_TABLE_SAFE_TRANS_1.first, false, true), ctxc); @@ -197,7 +238,7 @@ void buildDetumbleSequence(Subsystem& ss, ModeListEntry& eh) { check(sequence.insert(eh), ctxc); }; // Build DETUMBLE target - iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TGT.second); + iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::DETUMBLE, ACS_TABLE_DETUMBLE_TGT.second); iht(objects::IMTQ_HANDLER, 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); @@ -215,7 +256,7 @@ void buildDetumbleSequence(Subsystem& ss, ModeListEntry& eh) { ctxc); // Build DETUMBLE transition 1 - iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TRANS_1.second); + iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::DETUMBLE, ACS_TABLE_DETUMBLE_TRANS_1.second); check(ss.addTable(&ACS_TABLE_DETUMBLE_TRANS_1.second, ACS_TABLE_DETUMBLE_TRANS_1.first, false, true), ctxc); @@ -249,7 +290,7 @@ void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) { check(sequence.insert(eh), ctxc); }; // Build IDLE target - iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::IDLE, 0, ACS_TABLE_IDLE_TGT.second); + iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::IDLE, ACS_TABLE_IDLE_TGT.second); iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_TGT.second); iht(objects::RW_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second); @@ -265,7 +306,7 @@ void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) { ss.addTable(&ACS_TABLE_IDLE_TRANS_0.second, ACS_TABLE_IDLE_TRANS_0.first, false, true); // Build IDLE transition 1 - iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::IDLE, 0, ACS_TABLE_IDLE_TRANS_1.second); + iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::IDLE, ACS_TABLE_IDLE_TRANS_1.second); ss.addTable(&ACS_TABLE_IDLE_TRANS_1.second, ACS_TABLE_IDLE_TRANS_1.first, false, true); // Build IDLE sequence @@ -297,7 +338,7 @@ void buildTargetPtSequence(Subsystem& ss, ModeListEntry& eh) { }; // Build TARGET PT table - iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::PTG_TARGET, 0, ACS_TABLE_PTG_TARGET_TGT.second); + iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET, ACS_TABLE_PTG_TARGET_TGT.second); iht(objects::IMTQ_HANDLER, 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); @@ -306,18 +347,10 @@ void buildTargetPtSequence(Subsystem& ss, ModeListEntry& eh) { check(ss.addTable(&ACS_TABLE_PTG_TARGET_TGT.second, ACS_TABLE_PTG_TARGET_TGT.first, false, true), ctxc); - // Build TARGET PT transition 0 - iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_PTG_TARGET_TRANS_0.second); - iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_TRANS_0.second); - iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_TRANS_0.second); - iht(objects::RW_ASS, NML, 0, ACS_TABLE_PTG_TARGET_TRANS_0.second); - iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_PTG_TARGET_TRANS_0.second); - check(ss.addTable(&ACS_TABLE_PTG_TARGET_TRANS_0.second, ACS_TABLE_PTG_TARGET_TRANS_0.first, false, - true), - ctxc); + check(ss.addTable(&ACS_TABLE_PTG_TRANS_0.second, ACS_TABLE_PTG_TRANS_0.first, false, true), ctxc); // Build TARGET PT transition 1 - iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::PTG_TARGET, 0, + iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET, ACS_TABLE_PTG_TARGET_TRANS_1.second); check(ss.addTable(&ACS_TABLE_PTG_TARGET_TRANS_1.second, ACS_TABLE_PTG_TARGET_TRANS_1.first, false, true), @@ -325,11 +358,66 @@ 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, ACS_TABLE_PTG_TARGET_TRANS_0.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, false); check(ss.addSequence(&ACS_SEQUENCE_PTG_TARGET.second, ACS_SEQUENCE_PTG_TARGET.first, ACS_SEQUENCE_IDLE.first, false, true), ctxc); } +void buildTargetPtNadirSequence(Subsystem& ss, ModeListEntry& eh) { + std::string context = "satsystem::acs::buildTargetPtNadirSequence"; + auto ctxc = context.c_str(); + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, + ArrayList& sequence) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + check(sequence.insert(eh), ctxc); + }; + // Insert Helper Sequence + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + check(sequence.insert(eh), ctxc); + }; + + // Build TARGET PT table + iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET, + ACS_TABLE_PTG_TARGET_NADIR_TGT.second); + iht(objects::IMTQ_HANDLER, 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::RW_ASS, 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, + &ACS_TABLE_PTG_TARGET_NADIR_TGT.second)), + ctxc); + + check(ss.addTable(TableEntry(ACS_TABLE_PTG_TRANS_0.first, &ACS_TABLE_PTG_TRANS_0.second)), ctxc); + + // Build TARGET PT transition 1 + iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET_NADIR, + ACS_TABLE_PTG_TARGET_NADIR_TRANS_1.second); + check(ss.addTable(TableEntry(ACS_TABLE_PTG_TARGET_NADIR_TRANS_1.first, + &ACS_TABLE_PTG_TARGET_NADIR_TRANS_1.second)), + ctxc); + + // Build IDLE sequence + ihs(ACS_SEQUENCE_PTG_TARGET_NADIR.second, ACS_TABLE_PTG_TARGET_NADIR_TGT.first, 0, true); + ihs(ACS_SEQUENCE_PTG_TARGET_NADIR.second, ACS_TABLE_PTG_TARGET_NADIR_TRANS_0.first, 0, true); + ihs(ACS_SEQUENCE_PTG_TARGET_NADIR.second, ACS_TABLE_PTG_TARGET_NADIR_TRANS_1.first, 0, false); + check( + ss.addSequence(SequenceEntry(ACS_SEQUENCE_PTG_TARGET_NADIR.first, + &ACS_SEQUENCE_PTG_TARGET_NADIR.second, ACS_SEQUENCE_IDLE.first)), + ctxc); +} + +void buildTargetPtGsSequence(Subsystem& ss, ModeListEntry& entryHelper) {} + +void buildTargetPtInertialSequence(Subsystem& ss, ModeListEntry& entryHelper) {} + } // namespace From 76d18a67bcb1c58e68e6b08dd3cc288a9d8d5a98 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 3 Feb 2023 11:33:18 +0100 Subject: [PATCH 134/330] almost done --- mission/system/tree/acsModeTree.cpp | 59 +++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 4 deletions(-) diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index 6c27b160..94c4a5c9 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -121,6 +121,9 @@ void satsystem::acs::init() { buildDetumbleSequence(ACS_SUBSYSTEM, entry); buildIdleSequence(ACS_SUBSYSTEM, entry); buildTargetPtSequence(ACS_SUBSYSTEM, entry); + buildTargetPtGsSequence(ACS_SUBSYSTEM, entry); + buildTargetPtNadirSequence(ACS_SUBSYSTEM, entry); + buildTargetPtInertialSequence(ACS_SUBSYSTEM, entry); ACS_SUBSYSTEM.setInitialMode(::acs::CtrlSubmode::SAFE); } @@ -312,7 +315,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, ACS_TABLE_IDLE_TRANS_0.first, 0, true); - ihs(ACS_SEQUENCE_IDLE.second, ACS_TABLE_IDLE_TRANS_1.first, 0, false); + 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, true); } @@ -359,7 +362,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, ACS_TABLE_PTG_TRANS_0.first, 0, true); - ihs(ACS_SEQUENCE_PTG_TARGET.second, ACS_TABLE_PTG_TARGET_TRANS_1.first, 0, false); + 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, ACS_SEQUENCE_IDLE.first, false, true), ctxc); @@ -409,14 +412,62 @@ void buildTargetPtNadirSequence(Subsystem& ss, ModeListEntry& eh) { // Build IDLE sequence ihs(ACS_SEQUENCE_PTG_TARGET_NADIR.second, ACS_TABLE_PTG_TARGET_NADIR_TGT.first, 0, true); ihs(ACS_SEQUENCE_PTG_TARGET_NADIR.second, ACS_TABLE_PTG_TARGET_NADIR_TRANS_0.first, 0, true); - ihs(ACS_SEQUENCE_PTG_TARGET_NADIR.second, ACS_TABLE_PTG_TARGET_NADIR_TRANS_1.first, 0, false); + ihs(ACS_SEQUENCE_PTG_TARGET_NADIR.second, ACS_TABLE_PTG_TARGET_NADIR_TRANS_1.first, 0, true); check( ss.addSequence(SequenceEntry(ACS_SEQUENCE_PTG_TARGET_NADIR.first, &ACS_SEQUENCE_PTG_TARGET_NADIR.second, ACS_SEQUENCE_IDLE.first)), ctxc); } -void buildTargetPtGsSequence(Subsystem& ss, ModeListEntry& entryHelper) {} +void buildTargetPtGsSequence(Subsystem& ss, ModeListEntry& eh) { + std::string context = "satsystem::acs::buildTargetPtGsSequence"; + auto ctxc = context.c_str(); + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, + ArrayList& sequence) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + check(sequence.insert(eh), ctxc); + }; + // Insert Helper Sequence + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + check(sequence.insert(eh), ctxc); + }; + + // Build TARGET PT table + iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET_GS, + ACS_TABLE_PTG_TARGET_NADIR_TGT.second); + iht(objects::IMTQ_HANDLER, 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::RW_ASS, 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( + TableEntry(ACS_TABLE_PTG_TARGET_GS_TGT.first, &ACS_TABLE_PTG_TARGET_GS_TGT.second)), + ctxc); + + check(ss.addTable(TableEntry(ACS_TABLE_PTG_TRANS_0.first, &ACS_TABLE_PTG_TRANS_0.second)), ctxc); + + // Build TARGET PT transition 1 + iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET_GS, + ACS_TABLE_PTG_TARGET_GS_TRANS_1.second); + check(ss.addTable(TableEntry(ACS_TABLE_PTG_TARGET_GS_TRANS_1.first, + &ACS_TABLE_PTG_TARGET_GS_TRANS_1.second)), + ctxc); + + // Build IDLE sequence + ihs(ACS_SEQUENCE_PTG_TARGET_GS.second, ACS_TABLE_PTG_TARGET_GS_TGT.first, 0, true); + ihs(ACS_SEQUENCE_PTG_TARGET_GS.second, ACS_TABLE_PTG_TARGET_GS_TRANS_0.first, 0, true); + ihs(ACS_SEQUENCE_PTG_TARGET_GS.second, ACS_TABLE_PTG_TARGET_GS_TRANS_1.first, 0, true); + check(ss.addSequence(SequenceEntry(ACS_SEQUENCE_PTG_TARGET_GS.first, + &ACS_SEQUENCE_PTG_TARGET_GS.second, ACS_SEQUENCE_IDLE.first)), + ctxc); +} void buildTargetPtInertialSequence(Subsystem& ss, ModeListEntry& entryHelper) {} From 519d55af4bc967b851b1e2944394b485b36c73cc Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Fri, 3 Feb 2023 13:19:39 +0100 Subject: [PATCH 135/330] ThermalController: events for overheating --- linux/ObjectFactory.cpp | 9 --- mission/controller/ThermalController.cpp | 70 +++++++++++------------- mission/controller/ThermalController.h | 9 ++- mission/devices/HeaterHandler.cpp | 1 - 4 files changed, 39 insertions(+), 50 deletions(-) diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index 67925a81..e684b7cb 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -9,25 +9,16 @@ #include #include #include -#include #include -#include #include -#include -#include -#include -#include -#include #include "OBSWConfig.h" #include "devConf.h" #include "devices/addresses.h" #include "devices/gpioIds.h" #include "eive/definitions.h" -#include "mission/controller/ThermalController.h" #include "mission/system/tree/acsModeTree.h" #include "mission/system/tree/payloadModeTree.h" -#include "mission/system/tree/tcsModeTree.h" void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiComIF, PowerSwitchIF* pwrSwitcher, std::string spiDev, diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 033e66b0..8535228a 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include @@ -989,16 +988,14 @@ void ThermalController::ctrlAcsBoard() { if (heaterAvailable) { // A side - chooseOf5Sensors(switchNr, deviceTemperatures.gyro0SideA, deviceTemperatures.mgm0SideA, - deviceTemperatures.gyro1SideA, deviceTemperatures.mgm0SideA, - sensorTemperatures.sensor_tcs_board); + chooseOf4Sensors(switchNr, deviceTemperatures.gyro0SideA, deviceTemperatures.mgm0SideA, + deviceTemperatures.gyro1SideA, sensorTemperatures.sensor_tcs_board); if (sensorTempAvailable) { ctrlHeater(switchNr, redSwitchNr, &acsBoardLimits); } // B side - chooseOf5Sensors(switchNr, deviceTemperatures.gyro2SideB, deviceTemperatures.mgm2SideB, - deviceTemperatures.gyro3SideB, deviceTemperatures.mgm2SideB, - sensorTemperatures.sensor_tcs_board); + chooseOf4Sensors(switchNr, deviceTemperatures.gyro2SideB, deviceTemperatures.mgm2SideB, + deviceTemperatures.gyro3SideB, sensorTemperatures.sensor_tcs_board); if (sensorTempAvailable) { ctrlHeater(switchNr, redSwitchNr, &acsBoardLimits); } @@ -1151,6 +1148,9 @@ void ThermalController::ctrlObc() { ctrlComponentTemperature(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, deviceTemperatures.q7s, sensorTemperatures.tmp1075Tcs1, sensorTemperatures.tmp1075Tcs0, &obcLimits); + if (componentOverheating) { + triggerEvent(OBC_OVERHEATING); + } } void ThermalController::ctrlObcIfBoard() { @@ -1164,6 +1164,9 @@ void ThermalController::ctrlSBandTransceiver() { deviceTemperatures.syrlinksPowerAmplifier, deviceTemperatures.syrlinksBasebandBoard, sensorTemperatures.sensor_4k_camera, &sBandTransceiverLimits); + if (componentOverheating) { + triggerEvent(SYRLINKS_OVERHEATING); + } } void ThermalController::ctrlPcduP60Board() { ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, @@ -1219,6 +1222,9 @@ void ThermalController::ctrlPlPcduBoard() { sensorTemperatures.sensor_plpcdu_heatspreader); if (sensorTempAvailable) { ctrlHeater(switchNr, redSwitchNr, &plPcduBoardLimits); + if (componentOverheating) { + triggerEvent(PLPCDU_OVERHEATING, switchNr); + } } } } @@ -1228,6 +1234,9 @@ void ThermalController::ctrlPlocMissionBoard() { sensorTemperatures.sensor_ploc_heatspreader, sensorTemperatures.sensor_ploc_missionboard, sensorTemperatures.sensor_dac_heatspreader, &plocMissionBoardLimits); + if (componentOverheating) { + triggerEvent(PLOC_OVERHEATING); + } } void ThermalController::ctrlPlocProcessingBoard() { @@ -1278,6 +1287,9 @@ void ThermalController::ctrlHpa() { ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, sensorTemperatures.sensor_hpa, sensorTemperatures.sensor_x8, sensorTemperatures.sensor_mpa, &hpaLimits); + if (componentOverheating) { + triggerEvent(HPA_OVERHEATING); + } } void ThermalController::ctrlScexBoard() { @@ -1288,20 +1300,25 @@ void ThermalController::ctrlScexBoard() { void ThermalController::ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, struct TempLimits* tempLimit) { + componentOverheating = false; // Heater off if (not heaterHandler.checkSwitchState(switchNr)) { if (sensorTemp < (*tempLimit).opLowerLimit) { heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::ON); + sif::info << "ThermalController::ctrlHeater: Heater" << switchNr << " ON" << std::endl; } // Heater on } else if (heaterHandler.checkSwitchState(switchNr)) { if (sensorTemp >= (*tempLimit).opLowerLimit + TEMP_OFFSET) { heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); + sif::info << "ThermalController::ctrlHeater: Heater" << switchNr << " OFF" << std::endl; } } else if (not redSwitchNrInUse) { if (heaterHandler.checkSwitchState(redSwitchNr)) { if (sensorTemp >= (*tempLimit).cutOffLimit) { + componentOverheating = true; heaterHandler.switchHeater(redSwitchNr, HeaterHandler::SwitchState::OFF); + sif::info << "ThermalController::ctrlHeater: Heater" << redSwitchNr << " OFF" << std::endl; } } } @@ -1327,15 +1344,16 @@ void ThermalController::chooseSensor(heater::Switchers switchNr, const lp_float_ const lp_float_t& sensor2, const lp_float_t& sensor3) { sensorTempAvailable = true; - if (sensor1.isValid()) { + if (sensor1.isValid() and sensor1.value != INVALID_TEMPERATURE) { sensorTemp = sensor1.value; - } else if (sensor2.isValid()) { + } else if (sensor2.isValid() and sensor2.value != INVALID_TEMPERATURE) { sensorTemp = sensor2.value; - } else if (sensor3.isValid()) { + } else if (sensor3.isValid() and sensor3.value != INVALID_TEMPERATURE) { sensorTemp = sensor3.value; } else { if (heaterHandler.checkSwitchState(switchNr)) { heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); + sif::info << "ThermalController::ctrlHeater: Heater" << switchNr << " OFF" << std::endl; } triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); sensorTempAvailable = false; @@ -1363,40 +1381,18 @@ void ThermalController::chooseOf4Sensors(heater::Switchers switchNr, const lp_fl const lp_float_t& sensor4) { sensorTempAvailable = true; - if (sensor1.isValid()) { + if (sensor1.isValid() and sensor1.value != INVALID_TEMPERATURE) { sensorTemp = sensor1.value; - } else if (sensor2.isValid()) { + } else if (sensor2.isValid() and sensor2.value != INVALID_TEMPERATURE) { sensorTemp = sensor2.value; - } else if (sensor3.isValid()) { + } else if (sensor3.isValid() and sensor3.value != INVALID_TEMPERATURE) { sensorTemp = sensor3.value; - } else if (sensor4.isValid()) { + } else if (sensor4.isValid() and sensor4.value != INVALID_TEMPERATURE) { sensorTemp = sensor4.value; } else { if (heaterHandler.checkSwitchState(switchNr)) { heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); - } - triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); - sensorTempAvailable = false; - } -} -void ThermalController::chooseOf5Sensors(heater::Switchers switchNr, const lp_float_t& sensor1, - const lp_float_t& sensor2, const lp_float_t& sensor3, - const lp_float_t& sensor4, const lp_float_t& sensor5) { - sensorTempAvailable = true; - - if (sensor1.isValid()) { - sensorTemp = sensor1.value; - } else if (sensor2.isValid()) { - sensorTemp = sensor2.value; - } else if (sensor3.isValid()) { - sensorTemp = sensor3.value; - } else if (sensor4.isValid()) { - sensorTemp = sensor4.value; - } else if (sensor5.isValid()) { - sensorTemp = sensor5.value; - } else { - if (heaterHandler.checkSwitchState(switchNr)) { - heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); + sif::info << "ThermalController::ctrlHeater: Heater" << switchNr << " OFF" << std::endl; } triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); sensorTempAvailable = false; diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 1f977524..421d0cb1 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -58,6 +58,11 @@ class ThermalController : public ExtendedControllerBase { static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::TCS_CONTROLLER; static constexpr Event NO_VALID_SENSOR_TEMPERATURE = MAKE_EVENT(0, severity::MEDIUM); static constexpr Event NO_HEALTHY_HEATER_AVAILABLE = MAKE_EVENT(1, severity::MEDIUM); + static constexpr Event SYRLINKS_OVERHEATING = MAKE_EVENT(2, severity::HIGH); + static constexpr Event PLOC_OVERHEATING = MAKE_EVENT(3, severity::HIGH); + static constexpr Event OBC_OVERHEATING = MAKE_EVENT(4, severity::HIGH); + static constexpr Event HPA_OVERHEATING = MAKE_EVENT(5, severity::HIGH); + static constexpr Event PLPCDU_OVERHEATING = MAKE_EVENT(6, severity::HIGH); static const uint32_t DELAY = 500; @@ -143,6 +148,7 @@ class ThermalController : public ExtendedControllerBase { bool sensorTempAvailable = true; bool heaterAvailable = true; bool redSwitchNrInUse = false; + bool componentOverheating = false; // Initial delay to make sure all pool variables have been initialized their owners Countdown initialCountdown = Countdown(DELAY); @@ -169,9 +175,6 @@ class ThermalController : public ExtendedControllerBase { void chooseOf4Sensors(heater::Switchers switchNr, const lp_float_t& sensor1, const lp_float_t& sensor2, const lp_float_t& sensor3, const lp_float_t& sensor4); - void chooseOf5Sensors(heater::Switchers switchNr, const lp_float_t& sensor1, - const lp_float_t& sensor2, const lp_float_t& sensor3, - const lp_float_t& sensor4, const lp_float_t& sensor5); void ctrlAcsBoard(); void ctrlMgt(); diff --git a/mission/devices/HeaterHandler.cpp b/mission/devices/HeaterHandler.cpp index 8fd166f0..43f53bf7 100644 --- a/mission/devices/HeaterHandler.cpp +++ b/mission/devices/HeaterHandler.cpp @@ -7,7 +7,6 @@ #include -#include "devices/gpioIds.h" #include "devices/powerSwitcherList.h" HeaterHandler::HeaterHandler(object_id_t setObjectId_, GpioIF* gpioInterface_, HeaterHelper helper, From 4ed1e2411a4e79559780d294d6b658d1005ee31b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 3 Feb 2023 14:21:36 +0100 Subject: [PATCH 136/330] works --- CHANGELOG.md | 7 +++ mission/controller/AcsController.cpp | 7 +-- mission/controller/acs/AcsParameters.h | 4 +- mission/system/tree/acsModeTree.cpp | 80 ++++++++++++++++++++------ mission/system/tree/acsModeTree.h | 5 +- tmtc | 2 +- 6 files changed, 77 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f36f965..c7d8bbd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,13 @@ change warranting a new major release: # [unreleased] +- `AcsSubsystem`: OFF, SAFE and DETUMBLE mode were tested. Auto-transitions SAFE <-> DETUMBLE tested + as well. Other modes still need to be tested. + +## Fixed + +- `AcsController`: Parameter fix in `DetumbleParameter`. + # [v1.23.1] 2023-02-02 TMTC rev: 15adb9bf2ec68304a4f87b8dd418c1a8353283a3 diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index a2ff9edf..8ed396c5 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -152,9 +152,8 @@ void AcsController::performSafe() { detumbleCounter = 0; } if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) { - // TODO: Trigger mode transition in ACS subsystem? - submode = acs::CtrlSubmode::DETUMBLE; detumbleCounter = 0; + // Triggers detubmle mode transition in subsystem triggerEvent(acs::SAFE_RATE_VIOLATION); } @@ -210,9 +209,9 @@ void AcsController::performDetumble() { detumbleCounter = 0; } if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) { - // TODO: Trigger mode transition in subsystem instead - submode = acs::CtrlSubmode::DETUMBLE; detumbleCounter = 0; + // Triggers safe mode transition in subsystem + triggerEvent(acs::SAFE_RATE_RECOVERY); } int16_t cmdDipolUnitsInt[3] = {0, 0, 0}; diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index 816e4c71..5d40f752 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -899,8 +899,8 @@ class AcsParameters /*: public HasParametersIF*/ { struct DetumbleParameter { uint8_t detumblecounter = 75; // 30 s - double omegaDetumbleStart = 2 * M_PI / 180; - double omegaDetumbleEnd = 0.4 * M_PI / 180; + double omegaDetumbleStart = 2; + double omegaDetumbleEnd = 0.4; double gainD = pow(10.0, -3.3); } detumbleParameter; }; diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index 94c4a5c9..849959f9 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -10,7 +10,7 @@ #include "mission/acsDefs.h" #include "util.h" -Subsystem satsystem::acs::ACS_SUBSYSTEM(objects::ACS_SUBSYSTEM, 12, 24); +AcsSubsystem satsystem::acs::ACS_SUBSYSTEM(objects::ACS_SUBSYSTEM, 12, 24); namespace { // Alias for checker function @@ -30,7 +30,7 @@ void buildTargetPtInertialSequence(Subsystem& ss, ModeListEntry& entryHelper); static const auto OFF = HasModesIF::MODE_OFF; static const auto NML = DeviceHandlerIF::MODE_NORMAL; -auto ACS_SEQUENCE_OFF = std::make_pair(acs::CtrlSubmode::OFF, FixedArrayList()); +auto ACS_SEQUENCE_OFF = std::make_pair(acs::CtrlSubmode::OFF, FixedArrayList()); auto ACS_TABLE_OFF_TGT = std::make_pair((acs::CtrlSubmode::OFF << 24) | 1, FixedArrayList()); auto ACS_TABLE_OFF_TRANS_0 = @@ -77,8 +77,6 @@ auto ACS_SEQUENCE_PTG_TARGET_GS = std::make_pair(acs::CtrlSubmode::PTG_TARGET_GS, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_GS_TGT = std::make_pair((acs::CtrlSubmode::PTG_TARGET_GS << 24) | 1, FixedArrayList()); -auto ACS_TABLE_PTG_TARGET_GS_TRANS_0 = - std::make_pair((acs::CtrlSubmode::PTG_TARGET_GS << 24) | 2, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_GS_TRANS_1 = std::make_pair((acs::CtrlSubmode::PTG_TARGET_GS << 24) | 3, FixedArrayList()); @@ -86,8 +84,6 @@ auto ACS_SEQUENCE_PTG_TARGET_NADIR = std::make_pair(acs::CtrlSubmode::PTG_TARGET_NADIR, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_NADIR_TGT = std::make_pair((acs::CtrlSubmode::PTG_TARGET_NADIR << 24) | 1, FixedArrayList()); -auto ACS_TABLE_PTG_TARGET_NADIR_TRANS_0 = std::make_pair( - (acs::CtrlSubmode::PTG_TARGET_NADIR << 24) | 2, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_NADIR_TRANS_1 = std::make_pair( (acs::CtrlSubmode::PTG_TARGET_NADIR << 24) | 3, FixedArrayList()); @@ -95,13 +91,12 @@ auto ACS_SEQUENCE_PTG_TARGET_INERTIAL = std::make_pair(acs::CtrlSubmode::PTG_TARGET_INERTIAL, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_INERTIAL_TGT = std::make_pair( (acs::CtrlSubmode::PTG_TARGET_INERTIAL << 24) | 1, FixedArrayList()); -auto ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_0 = std::make_pair( - (acs::CtrlSubmode::PTG_TARGET_INERTIAL << 24) | 2, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1 = std::make_pair( (acs::CtrlSubmode::PTG_TARGET_INERTIAL << 24) | 3, FixedArrayList()); void 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) { entry.setObject(obj); @@ -115,6 +110,9 @@ void satsystem::acs::init() { iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TRANS_0.second); iht(objects::RW_ASS, NML, 0, ACS_TABLE_PTG_TRANS_0.second); iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_PTG_TRANS_0.second); + check(ACS_SUBSYSTEM.addTable( + TableEntry(ACS_TABLE_PTG_TRANS_0.first, &ACS_TABLE_PTG_TRANS_0.second)), + ctxc); buildOffSequence(ACS_SUBSYSTEM, entry); buildSafeSequence(ACS_SUBSYSTEM, entry); @@ -350,8 +348,7 @@ void buildTargetPtSequence(Subsystem& ss, ModeListEntry& eh) { check(ss.addTable(&ACS_TABLE_PTG_TARGET_TGT.second, ACS_TABLE_PTG_TARGET_TGT.first, false, true), ctxc); - check(ss.addTable(&ACS_TABLE_PTG_TRANS_0.second, ACS_TABLE_PTG_TRANS_0.first, false, true), ctxc); - + // Transition 0 already built // Build TARGET PT transition 1 iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET, ACS_TABLE_PTG_TARGET_TRANS_1.second); @@ -400,8 +397,7 @@ void buildTargetPtNadirSequence(Subsystem& ss, ModeListEntry& eh) { &ACS_TABLE_PTG_TARGET_NADIR_TGT.second)), ctxc); - check(ss.addTable(TableEntry(ACS_TABLE_PTG_TRANS_0.first, &ACS_TABLE_PTG_TRANS_0.second)), ctxc); - + // Transition 0 already built // Build TARGET PT transition 1 iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET_NADIR, ACS_TABLE_PTG_TARGET_NADIR_TRANS_1.second); @@ -411,7 +407,7 @@ void buildTargetPtNadirSequence(Subsystem& ss, ModeListEntry& eh) { // Build IDLE sequence ihs(ACS_SEQUENCE_PTG_TARGET_NADIR.second, ACS_TABLE_PTG_TARGET_NADIR_TGT.first, 0, true); - ihs(ACS_SEQUENCE_PTG_TARGET_NADIR.second, ACS_TABLE_PTG_TARGET_NADIR_TRANS_0.first, 0, true); + ihs(ACS_SEQUENCE_PTG_TARGET_NADIR.second, ACS_TABLE_PTG_TRANS_0.first, 0, true); ihs(ACS_SEQUENCE_PTG_TARGET_NADIR.second, ACS_TABLE_PTG_TARGET_NADIR_TRANS_1.first, 0, true); check( ss.addSequence(SequenceEntry(ACS_SEQUENCE_PTG_TARGET_NADIR.first, @@ -441,7 +437,7 @@ void buildTargetPtGsSequence(Subsystem& ss, ModeListEntry& eh) { // Build TARGET PT table iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET_GS, - ACS_TABLE_PTG_TARGET_NADIR_TGT.second); + ACS_TABLE_PTG_TARGET_GS_TGT.second); iht(objects::IMTQ_HANDLER, 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); @@ -451,8 +447,7 @@ void buildTargetPtGsSequence(Subsystem& ss, ModeListEntry& eh) { TableEntry(ACS_TABLE_PTG_TARGET_GS_TGT.first, &ACS_TABLE_PTG_TARGET_GS_TGT.second)), ctxc); - check(ss.addTable(TableEntry(ACS_TABLE_PTG_TRANS_0.first, &ACS_TABLE_PTG_TRANS_0.second)), ctxc); - + // Transition 0 already built // Build TARGET PT transition 1 iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET_GS, ACS_TABLE_PTG_TARGET_GS_TRANS_1.second); @@ -462,13 +457,62 @@ void buildTargetPtGsSequence(Subsystem& ss, ModeListEntry& eh) { // Build IDLE sequence ihs(ACS_SEQUENCE_PTG_TARGET_GS.second, ACS_TABLE_PTG_TARGET_GS_TGT.first, 0, true); - ihs(ACS_SEQUENCE_PTG_TARGET_GS.second, ACS_TABLE_PTG_TARGET_GS_TRANS_0.first, 0, true); + ihs(ACS_SEQUENCE_PTG_TARGET_GS.second, ACS_TABLE_PTG_TRANS_0.first, 0, true); ihs(ACS_SEQUENCE_PTG_TARGET_GS.second, ACS_TABLE_PTG_TARGET_GS_TRANS_1.first, 0, true); check(ss.addSequence(SequenceEntry(ACS_SEQUENCE_PTG_TARGET_GS.first, &ACS_SEQUENCE_PTG_TARGET_GS.second, ACS_SEQUENCE_IDLE.first)), ctxc); } -void buildTargetPtInertialSequence(Subsystem& ss, ModeListEntry& entryHelper) {} +void buildTargetPtInertialSequence(Subsystem& ss, ModeListEntry& eh) { + std::string context = "satsystem::acs::buildTargetPtInertialSequence"; + auto ctxc = context.c_str(); + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, + ArrayList& sequence) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + check(sequence.insert(eh), ctxc); + }; + // Insert Helper Sequence + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + check(sequence.insert(eh), ctxc); + }; + + // Build TARGET PT table + iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET_INERTIAL, + ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second); + iht(objects::IMTQ_HANDLER, 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::RW_ASS, 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, + &ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second)), + ctxc); + + // Transition 0 already built + // Build TARGET PT transition 1 + iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET_INERTIAL, + ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1.second); + check(ss.addTable(TableEntry(ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1.first, + &ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1.second)), + ctxc); + + // Build IDLE sequence + ihs(ACS_SEQUENCE_PTG_TARGET_INERTIAL.second, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.first, 0, true); + ihs(ACS_SEQUENCE_PTG_TARGET_INERTIAL.second, ACS_TABLE_PTG_TRANS_0.first, 0, true); + ihs(ACS_SEQUENCE_PTG_TARGET_INERTIAL.second, ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1.first, 0, + true); + check(ss.addSequence(SequenceEntry(ACS_SEQUENCE_PTG_TARGET_INERTIAL.first, + &ACS_SEQUENCE_PTG_TARGET_INERTIAL.second, + ACS_SEQUENCE_IDLE.first)), + ctxc); +} } // namespace diff --git a/mission/system/tree/acsModeTree.h b/mission/system/tree/acsModeTree.h index 210f8dcd..c814ca3a 100644 --- a/mission/system/tree/acsModeTree.h +++ b/mission/system/tree/acsModeTree.h @@ -1,11 +1,10 @@ -#include +#include -class Subsystem; namespace satsystem { namespace acs { -extern Subsystem ACS_SUBSYSTEM; +extern AcsSubsystem ACS_SUBSYSTEM; void init(); } // namespace acs diff --git a/tmtc b/tmtc index a39e9427..c3c58b95 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit a39e94279b0d77b9d21a996d87090d69fd4b3222 +Subproject commit c3c58b95ada024e53a019c34b91f0552bfd487a7 From 825365263f95a3962d237ea26709293eb5c84565 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 3 Feb 2023 14:23:39 +0100 Subject: [PATCH 137/330] update changelog --- CHANGELOG.md | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7d8bbd6..661d5391 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,15 +23,6 @@ change warranting a new major release: ## Fixed - `AcsController`: Parameter fix in `DetumbleParameter`. - -# [v1.23.1] 2023-02-02 - -TMTC rev: 15adb9bf2ec68304a4f87b8dd418c1a8353283a3 - -## Fixed - -- Bugfix in FSFW where the sequence flags of the PUS packets were set to continuation segment (0b00) - instead of unsegmented (0b11). - Set GPS set entries to invalid on MODE_OFF command. ## Changed @@ -42,6 +33,18 @@ TMTC rev: 15adb9bf2ec68304a4f87b8dd418c1a8353283a3 - Update and tweak ACS subsystem to represent the actual ACS design - Event handling in the ACS subsystem for events triggered by the ACS controller. PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/365 + +# [v1.23.1] 2023-02-02 + +TMTC rev: 15adb9bf2ec68304a4f87b8dd418c1a8353283a3 + +## Fixed + +- Bugfix in FSFW where the sequence flags of the PUS packets were set to continuation segment (0b00) + instead of unsegmented (0b11). + +## Changed + - Bugfix in FSFW where the MGM RM3100 value Z axis data was parse incorrectly. PR: https://egit.irs.uni-stuttgart.de/eive/fsfw/pulls/123 From 777d67346571757a2985c8e479e890401360bab7 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 3 Feb 2023 14:24:27 +0100 Subject: [PATCH 138/330] small fix --- CHANGELOG.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 661d5391..2f0e4447 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,9 +42,6 @@ TMTC rev: 15adb9bf2ec68304a4f87b8dd418c1a8353283a3 - Bugfix in FSFW where the sequence flags of the PUS packets were set to continuation segment (0b00) instead of unsegmented (0b11). - -## Changed - - Bugfix in FSFW where the MGM RM3100 value Z axis data was parse incorrectly. PR: https://egit.irs.uni-stuttgart.de/eive/fsfw/pulls/123 From f9ae4860d94b751022343f0f86da875070e48b18 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 3 Feb 2023 14:31:22 +0100 Subject: [PATCH 139/330] typo --- mission/controller/AcsController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 8ed396c5..d1039f8f 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -153,7 +153,7 @@ void AcsController::performSafe() { } if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) { detumbleCounter = 0; - // Triggers detubmle mode transition in subsystem + // Triggers detumble mode transition in subsystem triggerEvent(acs::SAFE_RATE_VIOLATION); } From e4a227359ba510e3b1a8e0610eba3f039c06fa4a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 3 Feb 2023 15:02:08 +0100 Subject: [PATCH 140/330] some bugfixes, syrlinks needs to remain in PST cause of some bug --- bsp_q7s/core/scheduling.cpp | 15 +-------------- .../pollingsequence/pollingSequenceFactory.cpp | 13 +++++++++++-- .../pollingsequence/pollingSequenceFactory.h | 2 +- 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index ad8990de..f5c7c558 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -150,19 +150,6 @@ void scheduling::initTasks() { scheduling::printAddObjectError("COM subsystem", objects::COM_SUBSYSTEM); } -#if OBSW_ADD_SYRLINKS == 1 - comTask->addComponent(objects::SYRLINKS_HANDLER, DeviceHandlerIF::PERFORM_OPERATION); - comTask->addComponent(objects::SYRLINKS_HANDLER, DeviceHandlerIF::SEND_WRITE); - comTask->addComponent(objects::SYRLINKS_HANDLER, DeviceHandlerIF::GET_WRITE); - comTask->addComponent(objects::SYRLINKS_HANDLER, DeviceHandlerIF::SEND_READ); - comTask->addComponent(objects::SYRLINKS_HANDLER, DeviceHandlerIF::GET_READ); - comTask->addComponent(objects::SYRLINKS_HANDLER, DeviceHandlerIF::PERFORM_OPERATION); - comTask->addComponent(objects::SYRLINKS_HANDLER, DeviceHandlerIF::SEND_WRITE); - comTask->addComponent(objects::SYRLINKS_HANDLER, DeviceHandlerIF::GET_WRITE); - comTask->addComponent(objects::SYRLINKS_HANDLER, DeviceHandlerIF::SEND_READ); - comTask->addComponent(objects::SYRLINKS_HANDLER, DeviceHandlerIF::GET_READ); -#endif - #if OBSW_ADD_CCSDS_IP_CORES == 1 result = comTask->addComponent(objects::CCSDS_HANDLER); if (result != returnvalue::OK) { @@ -464,7 +451,7 @@ void scheduling::createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction #if OBSW_ADD_SPI_TEST_CODE == 0 FixedTimeslotTaskIF* spiPst = factory.createFixedTimeslotTask( "MAIN_SPI", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.5, missedDeadlineFunc); - result = pst::pstSpi(spiPst); + result = pst::pstSpiAndSyrlinks(spiPst); if (result != returnvalue::OK) { if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { sif::warning << "scheduling::initTasks: SPI PST is empty" << std::endl; diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 0fd6cbfd..efbb9578 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -15,8 +15,17 @@ #define RPI_TEST_GPS_HANDLER 0 #endif -ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) { +ReturnValue_t pst::pstSpiAndSyrlinks(FixedTimeslotTaskIF *thisSequence) { uint32_t length = thisSequence->getPeriodMs(); + +#if OBSW_ADD_SYRLINKS == 1 + thisSequence->addSlot(objects::SYRLINKS_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::SYRLINKS_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SYRLINKS_HANDLER, length * 0.4, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SYRLINKS_HANDLER, length * 0.6, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SYRLINKS_HANDLER, length * 0.8, DeviceHandlerIF::GET_READ); +#endif + static_cast(length); #if OBSW_ADD_PL_PCDU == 1 thisSequence->addSlot(objects::PLPCDU_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); @@ -312,7 +321,7 @@ ReturnValue_t pst::pstAcs(FixedTimeslotTaskIF *thisSequence) { DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0.0325, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0.4, + thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0.0325, DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0.0325, DeviceHandlerIF::GET_READ); diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h index 2eadd19d..1dcfc30a 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h @@ -39,7 +39,7 @@ namespace pst { */ ReturnValue_t pstGompaceCan(FixedTimeslotTaskIF* thisSequence); -ReturnValue_t pstSpi(FixedTimeslotTaskIF* thisSequence); +ReturnValue_t pstSpiAndSyrlinks(FixedTimeslotTaskIF* thisSequence); ReturnValue_t pstAcs(FixedTimeslotTaskIF* thisSequence); From b8130265cde105ed94aeafeca3206840d9c44705 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 3 Feb 2023 15:02:30 +0100 Subject: [PATCH 141/330] afmt --- mission/system/tree/acsModeTree.h | 1 - 1 file changed, 1 deletion(-) diff --git a/mission/system/tree/acsModeTree.h b/mission/system/tree/acsModeTree.h index c814ca3a..134a86a7 100644 --- a/mission/system/tree/acsModeTree.h +++ b/mission/system/tree/acsModeTree.h @@ -1,6 +1,5 @@ #include - namespace satsystem { namespace acs { From b9ed485d601ca1937312646ff4a5454c28eb0a94 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 3 Feb 2023 15:44:50 +0100 Subject: [PATCH 142/330] changed calibration matrices for SUS0 and SUS6 due to them being exchanged --- mission/controller/acs/AcsParameters.h | 220 ++++++++++++------------- 1 file changed, 110 insertions(+), 110 deletions(-) diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index 98997e2c..88802a46 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -78,13 +78,13 @@ class AcsParameters : public HasParametersIF { } mgmHandlingParameters; struct SusHandlingParameters { - float sus0orientationMatrix[3][3] = {{0, 0, 1}, {1, 0, 0}, {0, 1, 0}}; // FM07 + float sus0orientationMatrix[3][3] = {{0, 0, 1}, {1, 0, 0}, {0, 1, 0}}; // FM10 float sus1orientationMatrix[3][3] = {{0, 0, -1}, {-1, 0, 0}, {0, 1, 0}}; // FM06 float sus2orientationMatrix[3][3] = {{-1, 0, 0}, {0, 0, -1}, {0, -1, 0}}; // FM13 float sus3orientationMatrix[3][3] = {{1, 0, 0}, {0, 0, 1}, {0, -1, 0}}; // FM14 float sus4orientationMatrix[3][3] = {{0, -1, 0}, {1, 0, 0}, {0, 0, 1}}; // FM05 float sus5orientationMatrix[3][3] = {{1, 0, 0}, {0, -1, 0}, {0, 0, -1}}; // FM02 - float sus6orientationMatrix[3][3] = {{0, 0, 1}, {1, 0, 0}, {0, 1, 0}}; // FM10 + float sus6orientationMatrix[3][3] = {{0, 0, 1}, {1, 0, 0}, {0, 1, 0}}; // FM07 float sus7orientationMatrix[3][3] = {{0, 0, -1}, {-1, 0, 0}, {0, 1, 0}}; // FM01 float sus8orientationMatrix[3][3] = {{-1, 0, 0}, {0, 0, -1}, {0, -1, 0}}; // FM03 float sus9orientationMatrix[3][3] = {{1, 0, 0}, {0, 0, 1}, {0, -1, 0}}; // FM11 @@ -92,61 +92,61 @@ class AcsParameters : public HasParametersIF { float sus11orientationMatrix[3][3] = {{1, 0, 0}, {0, -1, 0}, {0, 0, -1}}; // FM08 float sus0coeffAlpha[9][10] = { - {10.4400948050067, 1.38202655603079, 0.975299591736672, 0.0172133914423707, - -0.0163482459492803, 0.035730152619911, 0.00021725657060767, -0.000181685375645396, - -0.000124096561459262, 0.00040790566176981}, - {6.38281281805793, 1.81388255990089, 0.28679524291736, 0.0218036823758417, - 0.010516766426651, 0.000446101708841615, 0.00020187044149361, 0.000114957457831415, - 1.63114413539632e-05, -2.0187452317724e-05}, - {-29.3049094555, -0.506844002611835, 1.64911970541112, -0.0336282997119334, - 0.053185806861685, -0.028164943139695, -0.00021098074590512, 0.000643681643489995, - -0.000249094601806692, 0.000231466668650876}, - {-4.76233790255328, 1.1780710601961, -0.194257188545164, 0.00471817228628384, - -0.00183773644319332, -0.00570261621182479, -7.99203367291902e-05, 7.75752247926601e-05, - -9.78534772816957e-06, -4.72083745991256e-05}, - {0.692159025649028, 1.11895461388667, 0.341706834956496, 0.000237989648019541, - -0.000188322779563912, 0.000227310789253953, 0.000133001646828401, -0.000305810826248463, - 0.00010150571088124, -0.000367705461590854}, - {3.38094203317731, 1.24778838596815, 0.067807236112956, -0.00379395536123526, - -0.00339180589343601, -0.00188754615986649, -7.52406312245606e-05, 4.58398750278147e-05, - 6.97244631313601e-05, 2.50519145070895e-05}, - {-7.10546287716029, 0.459472977452686, -1.12251049944014, 0.0175406972371191, - -0.0310525406867782, -0.0531315970690727, -0.000121107664597462, 0.000544665437051928, - -1.78466217018177e-05, -0.00058976234038192}, - {1.60633684055984, 1.1975095485662, 0.180159204664965, -0.00259157601062089, - -0.0038106317634397, 0.000956686555225968, 4.28416721502134e-06, 5.84532336259517e-06, - -2.73407888222758e-05, 5.45131881032866e-06}, - {43.3732235586222, 0.528096786861784, -3.41255850703983, -0.0161629934278675, - 0.0790998053536612, 0.0743822668655928, 0.000237176965460634, -0.000426691336904078, - -0.000889196131314391, -0.000509766491897672}}; + {13.0465222152293, 0.0639132159808454, 2.98083557560227, -0.0773202212713293, + 0.0949075412003712, 0.0503055998355815, -0.00104133434256204, 0.000633099036136146, + 0.00091428505258307, 0.000259857066722932}, + {1.66740227859888, 1.55804368674744, 0.209274741749388, 0.0123798418560859, + 0.00724950517167516, -0.000577445375457582, 8.94374551545955e-05, 6.94513586221567e-05, + -1.06065583714065e-05, -1.43899892666699e-05}, + {8.71610925597519, 1.42112818752419, -0.549859300501301, 0.0374581774684577, + 0.0617635595955198, 0.0447491072679598, 0.00069998577106559, 0.00101018723225412, + -4.88501228194031e-06, -0.000434861113274231}, + {-2.3555601314395, 1.29430213886389, 0.179499593411187, 0.00440896450927253, + 0.00352052300927628, 0.00434187143967281, -9.66615195654703e-05, 3.64923075694275e-05, + 6.09619017310129e-05, 4.23908862836885e-05}, + {-0.858019663974047, 1.10138705956076, 0.278789852526915, -0.000199798507752607, + 0.00112092406838628, -0.00177346866231588, 0.000217816070307086, -0.000240713988238257, + 0.000150795563555828, -0.000279246491927943}, + {7.93661480471297, 1.33902098855997, -0.64010306493848, -0.00307944184518557, + -0.00511421127083497, 0.0204008636376403, -9.50042323904954e-05, 6.01530207062221e-05, + 9.13233708460098e-05, -0.000206717750924323}, + {16.2658124154565, 0.191301571705827, 1.02390350838635, 0.0258487436355216, + -0.0219752092833362, 0.0236916776412211, -0.000350496453661261, -0.000123849795280597, + -0.000532190902882765, 9.36018171121253e-05}, + {-1.53023612303052, 1.29132951637076, 0.181159073530008, -0.0023490608317645, + -0.00370741703297037, -0.000229071300377431, -1.6634455407558e-05, 1.11387154630828e-05, + 1.02609175615251e-05, -9.64717658954667e-06}, + {-32.9918791079688, 0.093536793089853, 4.76858627395571, 0.0595845684553358, + -0.054845749101257, -0.133247382500001, -0.000688999201915199, 7.67286265747961e-05, + 0.000868163357631254, 0.00120099606910313}}; float sus0coeffBeta[9][10] = { - {1.03872648284911, -0.213507239271552, 1.43193059498181, -0.000972717820830235, - -0.00661046096415371, 0.00974284211491888, 2.96098456891215e-05, -8.2933115634257e-05, - -5.52178824394723e-06, 5.73935295303589e-05}, - {3.42242235823356, 0.0848392511283237, 1.24574390342586, 0.00356248195980133, - 0.00100415659893053, -0.00460120247716139, 3.84891005422427e-05, 2.70236417852327e-05, - -7.58501977656551e-05, -8.79809730730992e-05}, - {14.0092526123741, 1.03126714946215, 1.0611008563785, 0.04076462444523, 0.0114106419194518, - 0.00746959159048058, 0.000388033225774727, -0.000124645014888926, -0.000296639947532341, - -0.00020861690864945}, - {1.3562422681189, -0.241585615891602, 1.49170424068611, 0.000179184170448335, - -0.00712399257616284, 0.0121433526723498, 3.29770580642447e-05, 8.78960210966787e-06, - -6.00508568552101e-05, 0.000101583822589461}, - {-0.718855428908583, -0.344067476078684, 1.12397093701762, 0.000236505431484729, - -0.000406441415248947, 0.00032834991502413, 0.000359422093285086, 8.18895560425272e-05, - 0.000316835483508523, 0.000151442890664899}, - {-0.268764016434841, -0.275272048639511, 1.26239753050527, -0.000511224336925231, - 0.0095628568270856, -0.00397960092451418, 1.39587366293607e-05, 1.31409051361129e-05, - -9.83662017231755e-05, 1.87078667116619e-05}, - {27.168106989145, -2.43346872338192, 1.91135512970771, 0.0553180826818016, - -0.0481878292619383, 0.0052773235604729, -0.000428011927975304, 0.000528018208222772, - -0.000285438191474895, -5.71327627917386e-05}, - {-0.169494136517622, -0.350851545482921, 1.19922076033643, 0.0101120903675328, - -0.00151674465424115, 0.00548694086125656, -0.000108240000970513, 1.57202185024105e-05, - -9.77555098179959e-05, 2.09624089449761e-05}, - {-32.3807957489507, 1.8271436443167, 2.51530814328123, -0.0532334586403461, - -0.0355980127727253, -0.0213373892796204, 0.00045506092539885, 0.000545065581027688, - 0.000141998709314758, 0.000101051304611037}}; + {12.7380220453847, -0.6087309901836, 2.60957722462363, -0.0415319939920917, + 0.0444944768824276, 0.0223231464060241, -0.000421503508733887, -9.39560038638717e-05, + 0.000821479971871302, -4.5330528329465e-05}, + {1.96846333975847, -0.33921438143463, 1.23957110477613, -0.00948832495296823, + 0.00107211134687287, -0.00410820045700199, -9.33679611473279e-05, 3.72984782145427e-05, + -4.04514487800062e-05, -7.6296149087237e-05}, + {5.7454444934481, -1.58476383793609, -0.418479494289251, -0.0985177320630941, + -0.0862179276808015, 0.0126762052037897, -0.00118207758271301, -0.000190361442918412, + 0.0011723869613426, 0.000122882034141316}, + {2.11042287406433, -0.225942746245056, 1.18084080712528, -0.00103013931607172, + -0.00675606790663387, -0.00106646109062746, 1.7708839355979e-05, -3.13642668374253e-05, + -5.87601932564404e-05, -3.92033314627704e-05}, + {2.96049248725882, -0.286261455028255, 1.09122556181319, -0.000672369023155898, + 0.000574446975796023, 0.000120303729680796, 0.000292285799270644, 0.000170497873487264, + 0.000259925974231328, 0.000222437797823852}, + {1.65218061201483, -0.19535446105784, 1.39609640918411, 0.000961524354787167, + 0.00592400381724333, -0.0078500192096718, -7.02791628080906e-07, -2.07197580883822e-05, + -4.33518182614169e-05, 4.66993119419691e-05}, + {-19.56673237415, 1.06558565338761, 0.151160448373445, -0.0252628659378108, + 0.0281230551050938, -0.0217328869907185, 0.000241309440918385, -0.000116449585258429, + 0.000401546410974577, -0.000147563886502726}, + {1.56167171538684, -0.155299366654736, 1.20084049723279, 0.00457348893890231, + 0.00118888040006052, 0.0029920178735941, -5.583448120596e-05, -2.34496315691865e-05, + -5.3309466243918e-05, 6.20289310356821e-06}, + {1.95050549495182, -2.74909818412705, 3.80268788018641, 0.0629242254381785, + 0.0581479035315726, -0.111361283351269, -0.00047845777495158, -0.00075354297736741, + -0.000186887396585446, 0.00119710704771344}}; float sus1coeffAlpha[9][10] = { {-27.6783250420482, -0.964805032861791, -0.503974297997131, -0.0446471081874084, -0.048219538329297, 0.000958491361905381, -0.000290972187162876, -0.000657145721554176, @@ -428,61 +428,61 @@ class AcsParameters : public HasParametersIF { -0.0542697403292778, 0.0285360568428252, 0.000845084580479371, 0.00114184315411245, -0.000169538153750085, -0.000336529204350355}}; float sus6coeffAlpha[9][10] = { - {13.0465222152293, 0.0639132159808454, 2.98083557560227, -0.0773202212713293, - 0.0949075412003712, 0.0503055998355815, -0.00104133434256204, 0.000633099036136146, - 0.00091428505258307, 0.000259857066722932}, - {1.66740227859888, 1.55804368674744, 0.209274741749388, 0.0123798418560859, - 0.00724950517167516, -0.000577445375457582, 8.94374551545955e-05, 6.94513586221567e-05, - -1.06065583714065e-05, -1.43899892666699e-05}, - {8.71610925597519, 1.42112818752419, -0.549859300501301, 0.0374581774684577, - 0.0617635595955198, 0.0447491072679598, 0.00069998577106559, 0.00101018723225412, - -4.88501228194031e-06, -0.000434861113274231}, - {-2.3555601314395, 1.29430213886389, 0.179499593411187, 0.00440896450927253, - 0.00352052300927628, 0.00434187143967281, -9.66615195654703e-05, 3.64923075694275e-05, - 6.09619017310129e-05, 4.23908862836885e-05}, - {-0.858019663974047, 1.10138705956076, 0.278789852526915, -0.000199798507752607, - 0.00112092406838628, -0.00177346866231588, 0.000217816070307086, -0.000240713988238257, - 0.000150795563555828, -0.000279246491927943}, - {7.93661480471297, 1.33902098855997, -0.64010306493848, -0.00307944184518557, - -0.00511421127083497, 0.0204008636376403, -9.50042323904954e-05, 6.01530207062221e-05, - 9.13233708460098e-05, -0.000206717750924323}, - {16.2658124154565, 0.191301571705827, 1.02390350838635, 0.0258487436355216, - -0.0219752092833362, 0.0236916776412211, -0.000350496453661261, -0.000123849795280597, - -0.000532190902882765, 9.36018171121253e-05}, - {-1.53023612303052, 1.29132951637076, 0.181159073530008, -0.0023490608317645, - -0.00370741703297037, -0.000229071300377431, -1.6634455407558e-05, 1.11387154630828e-05, - 1.02609175615251e-05, -9.64717658954667e-06}, - {-32.9918791079688, 0.093536793089853, 4.76858627395571, 0.0595845684553358, - -0.054845749101257, -0.133247382500001, -0.000688999201915199, 7.67286265747961e-05, - 0.000868163357631254, 0.00120099606910313}}; + {10.4400948050067, 1.38202655603079, 0.975299591736672, 0.0172133914423707, + -0.0163482459492803, 0.035730152619911, 0.00021725657060767, -0.000181685375645396, + -0.000124096561459262, 0.00040790566176981}, + {6.38281281805793, 1.81388255990089, 0.28679524291736, 0.0218036823758417, + 0.010516766426651, 0.000446101708841615, 0.00020187044149361, 0.000114957457831415, + 1.63114413539632e-05, -2.0187452317724e-05}, + {-29.3049094555, -0.506844002611835, 1.64911970541112, -0.0336282997119334, + 0.053185806861685, -0.028164943139695, -0.00021098074590512, 0.000643681643489995, + -0.000249094601806692, 0.000231466668650876}, + {-4.76233790255328, 1.1780710601961, -0.194257188545164, 0.00471817228628384, + -0.00183773644319332, -0.00570261621182479, -7.99203367291902e-05, 7.75752247926601e-05, + -9.78534772816957e-06, -4.72083745991256e-05}, + {0.692159025649028, 1.11895461388667, 0.341706834956496, 0.000237989648019541, + -0.000188322779563912, 0.000227310789253953, 0.000133001646828401, -0.000305810826248463, + 0.00010150571088124, -0.000367705461590854}, + {3.38094203317731, 1.24778838596815, 0.067807236112956, -0.00379395536123526, + -0.00339180589343601, -0.00188754615986649, -7.52406312245606e-05, 4.58398750278147e-05, + 6.97244631313601e-05, 2.50519145070895e-05}, + {-7.10546287716029, 0.459472977452686, -1.12251049944014, 0.0175406972371191, + -0.0310525406867782, -0.0531315970690727, -0.000121107664597462, 0.000544665437051928, + -1.78466217018177e-05, -0.00058976234038192}, + {1.60633684055984, 1.1975095485662, 0.180159204664965, -0.00259157601062089, + -0.0038106317634397, 0.000956686555225968, 4.28416721502134e-06, 5.84532336259517e-06, + -2.73407888222758e-05, 5.45131881032866e-06}, + {43.3732235586222, 0.528096786861784, -3.41255850703983, -0.0161629934278675, + 0.0790998053536612, 0.0743822668655928, 0.000237176965460634, -0.000426691336904078, + -0.000889196131314391, -0.000509766491897672}}; float sus6coeffBeta[9][10] = { - {12.7380220453847, -0.6087309901836, 2.60957722462363, -0.0415319939920917, - 0.0444944768824276, 0.0223231464060241, -0.000421503508733887, -9.39560038638717e-05, - 0.000821479971871302, -4.5330528329465e-05}, - {1.96846333975847, -0.33921438143463, 1.23957110477613, -0.00948832495296823, - 0.00107211134687287, -0.00410820045700199, -9.33679611473279e-05, 3.72984782145427e-05, - -4.04514487800062e-05, -7.6296149087237e-05}, - {5.7454444934481, -1.58476383793609, -0.418479494289251, -0.0985177320630941, - -0.0862179276808015, 0.0126762052037897, -0.00118207758271301, -0.000190361442918412, - 0.0011723869613426, 0.000122882034141316}, - {2.11042287406433, -0.225942746245056, 1.18084080712528, -0.00103013931607172, - -0.00675606790663387, -0.00106646109062746, 1.7708839355979e-05, -3.13642668374253e-05, - -5.87601932564404e-05, -3.92033314627704e-05}, - {2.96049248725882, -0.286261455028255, 1.09122556181319, -0.000672369023155898, - 0.000574446975796023, 0.000120303729680796, 0.000292285799270644, 0.000170497873487264, - 0.000259925974231328, 0.000222437797823852}, - {1.65218061201483, -0.19535446105784, 1.39609640918411, 0.000961524354787167, - 0.00592400381724333, -0.0078500192096718, -7.02791628080906e-07, -2.07197580883822e-05, - -4.33518182614169e-05, 4.66993119419691e-05}, - {-19.56673237415, 1.06558565338761, 0.151160448373445, -0.0252628659378108, - 0.0281230551050938, -0.0217328869907185, 0.000241309440918385, -0.000116449585258429, - 0.000401546410974577, -0.000147563886502726}, - {1.56167171538684, -0.155299366654736, 1.20084049723279, 0.00457348893890231, - 0.00118888040006052, 0.0029920178735941, -5.583448120596e-05, -2.34496315691865e-05, - -5.3309466243918e-05, 6.20289310356821e-06}, - {1.95050549495182, -2.74909818412705, 3.80268788018641, 0.0629242254381785, - 0.0581479035315726, -0.111361283351269, -0.00047845777495158, -0.00075354297736741, - -0.000186887396585446, 0.00119710704771344}}; + {1.03872648284911, -0.213507239271552, 1.43193059498181, -0.000972717820830235, + -0.00661046096415371, 0.00974284211491888, 2.96098456891215e-05, -8.2933115634257e-05, + -5.52178824394723e-06, 5.73935295303589e-05}, + {3.42242235823356, 0.0848392511283237, 1.24574390342586, 0.00356248195980133, + 0.00100415659893053, -0.00460120247716139, 3.84891005422427e-05, 2.70236417852327e-05, + -7.58501977656551e-05, -8.79809730730992e-05}, + {14.0092526123741, 1.03126714946215, 1.0611008563785, 0.04076462444523, 0.0114106419194518, + 0.00746959159048058, 0.000388033225774727, -0.000124645014888926, -0.000296639947532341, + -0.00020861690864945}, + {1.3562422681189, -0.241585615891602, 1.49170424068611, 0.000179184170448335, + -0.00712399257616284, 0.0121433526723498, 3.29770580642447e-05, 8.78960210966787e-06, + -6.00508568552101e-05, 0.000101583822589461}, + {-0.718855428908583, -0.344067476078684, 1.12397093701762, 0.000236505431484729, + -0.000406441415248947, 0.00032834991502413, 0.000359422093285086, 8.18895560425272e-05, + 0.000316835483508523, 0.000151442890664899}, + {-0.268764016434841, -0.275272048639511, 1.26239753050527, -0.000511224336925231, + 0.0095628568270856, -0.00397960092451418, 1.39587366293607e-05, 1.31409051361129e-05, + -9.83662017231755e-05, 1.87078667116619e-05}, + {27.168106989145, -2.43346872338192, 1.91135512970771, 0.0553180826818016, + -0.0481878292619383, 0.0052773235604729, -0.000428011927975304, 0.000528018208222772, + -0.000285438191474895, -5.71327627917386e-05}, + {-0.169494136517622, -0.350851545482921, 1.19922076033643, 0.0101120903675328, + -0.00151674465424115, 0.00548694086125656, -0.000108240000970513, 1.57202185024105e-05, + -9.77555098179959e-05, 2.09624089449761e-05}, + {-32.3807957489507, 1.8271436443167, 2.51530814328123, -0.0532334586403461, + -0.0355980127727253, -0.0213373892796204, 0.00045506092539885, 0.000545065581027688, + 0.000141998709314758, 0.000101051304611037}}; float sus7coeffAlpha[9][10] = { {-92.1126183408754, -3.77261746189525, -4.50604668349213, -0.0909560776043523, -0.15646903318971, -0.0766293642415356, -0.00059452135473577, -0.00144790037129283, From d9514e418443c69809434925b23642d2175810d6 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 3 Feb 2023 16:08:34 +0100 Subject: [PATCH 143/330] a lot of bugfixes --- CHANGELOG.md | 5 +++++ common/config/devices/addresses.h | 2 +- fsfw | 2 +- linux/ObjectFactory.cpp | 12 ++---------- mission/controller/AcsController.cpp | 2 +- mission/controller/AcsController.h | 1 + mission/system/tree/acsModeTree.h | 1 - 7 files changed, 11 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f0e4447..0ab1a83d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,9 +24,14 @@ change warranting a new major release: - `AcsController`: Parameter fix in `DetumbleParameter`. - Set GPS set entries to invalid on MODE_OFF command. +- Bump FSFW for bugfix in `setNormalDatapoolEntriesInvalid` where the validity was not set to false + properly +- Regression: Revert swap of SUS0 and SUS6. Those devices are on separate power lines. In a + future fix, the calibration matrices of SUS0 and SUS6 will be swapped. ## Changed +- `ACS::SensorValues` is now an ACS controller member to reduce the risk of stack overflow. - ACS Subsystem Sequence Mode IDs updated. PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/365 TMTC PR: https://egit.irs.uni-stuttgart.de/eive/eive-tmtc/pulls/130 diff --git a/common/config/devices/addresses.h b/common/config/devices/addresses.h index d7056307..c1e65314 100644 --- a/common/config/devices/addresses.h +++ b/common/config/devices/addresses.h @@ -9,7 +9,7 @@ namespace addresses { /* Logical addresses have uint32_t datatype */ -enum logicalAddresses : address_t { +enum LogicAddress : address_t { PCDU, MGM_0_LIS3 = objects::MGM_0_LIS3_HANDLER, diff --git a/fsfw b/fsfw index 3250bbf2..38789e05 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 3250bbf269b3326683222bb87ce7faecae63ad97 +Subproject commit 38789e053b65cfa14604fc625e7bcc8ca03a3f17 diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index a147af26..cf27972f 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -79,11 +79,7 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo #if OBSW_ADD_SUN_SENSORS == 1 SusFdir* fdir = nullptr; std::array susHandlers = {}; - gpioId_t gpioId = gpioIds::CS_SUS_0; - if (swap0And6) { - gpioId = gpioIds::CS_SUS_6; - } - SpiCookie* spiCookie = new SpiCookie(addresses::SUS_0, gpioId, SUS::MAX_CMD_SIZE, + SpiCookie* spiCookie = new SpiCookie(addresses::SUS_0, gpioIds::CS_SUS_0, SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); susHandlers[0] = new SusHandler(objects::SUS_0_N_LOC_XFYFZM_PT_XF, 0, objects::SPI_MAIN_COM_IF, spiCookie); @@ -125,11 +121,7 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo fdir = new SusFdir(objects::SUS_5_N_LOC_XFYMZB_PT_ZB); susHandlers[5]->setCustomFdir(fdir); - gpioId = gpioIds::CS_SUS_6; - if (swap0And6) { - gpioId = gpioIds::CS_SUS_0; - } - spiCookie = new SpiCookie(addresses::SUS_6, gpioId, SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, + spiCookie = new SpiCookie(addresses::SUS_6, gpioIds::CS_SUS_6, SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); susHandlers[6] = new SusHandler(objects::SUS_6_R_LOC_XFYBZM_PT_XF, 6, objects::SPI_MAIN_COM_IF, spiCookie); diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 8ed396c5..8a58eb90 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -486,9 +486,9 @@ void AcsController::copyMgmData() { } void AcsController::copySusData() { - ACS::SensorValues sensorValues; { PoolReadGuard pg(&sensorValues.susSets[0]); + if (pg.getReadResult() == returnvalue::OK) { std::memcpy(susDataRaw.sus0.value, sensorValues.susSets[0].channels.value, 6 * sizeof(uint16_t)); diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index bc23fdaf..308700e4 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -60,6 +60,7 @@ class AcsController : public ExtendedControllerBase { void announceMode(bool recursive); /* ACS Datasets */ + ACS::SensorValues sensorValues; IMTQ::DipoleActuationSet dipoleSet = IMTQ::DipoleActuationSet(objects::IMTQ_HANDLER); // MGMs acsctrl::MgmDataRaw mgmDataRaw; diff --git a/mission/system/tree/acsModeTree.h b/mission/system/tree/acsModeTree.h index c814ca3a..134a86a7 100644 --- a/mission/system/tree/acsModeTree.h +++ b/mission/system/tree/acsModeTree.h @@ -1,6 +1,5 @@ #include - namespace satsystem { namespace acs { From a9bd792194ff5ace31450d6cd81949dd22a642c8 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 3 Feb 2023 16:11:28 +0100 Subject: [PATCH 144/330] changelog correction --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e73e4883..c05c05f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,9 @@ change warranting a new major release: - Set GPS set entries to invalid on MODE_OFF command. - Bump FSFW for bugfix in `setNormalDatapoolEntriesInvalid` where the validity was not set to false properly +- Fixed usage of uint instead of int for commanding MTQ. Also fixed the range in which the ACS Ctrl + commands the MTQ to match the actual commanding range. + PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/363 - Regression: Revert swap of SUS0 and SUS6. Those devices are on separate power lines. In a future fix, the calibration matrices of SUS0 and SUS6 will be swapped. @@ -47,9 +50,6 @@ TMTC rev: 15adb9bf2ec68304a4f87b8dd418c1a8353283a3 - Bugfix in FSFW where the sequence flags of the PUS packets were set to continuation segment (0b00) instead of unsegmented (0b11). -- Fixed usage of uint instead of int for commanding MTQ. Also fixed the range in which the ACS Ctrl - commands the MTQ to match the actual commanding range. - PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/363 - Bugfix in FSFW where the MGM RM3100 value Z axis data was parse incorrectly. PR: https://egit.irs.uni-stuttgart.de/eive/fsfw/pulls/123 From 9f28f32af9eae331d5ce79428b75743a15c71cbc Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 3 Feb 2023 16:12:11 +0100 Subject: [PATCH 145/330] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index c3c58b95..5ed3cec2 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit c3c58b95ada024e53a019c34b91f0552bfd487a7 +Subproject commit 5ed3cec20b609db435bd5663fd3edd5888fbb932 From 32042afccd29f7f84eca4e3f4ba522a49fbf36b8 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 3 Feb 2023 16:30:38 +0100 Subject: [PATCH 146/330] bump minor version --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e9c51a6a..cf44cd86 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,8 +10,8 @@ cmake_minimum_required(VERSION 3.13) set(OBSW_VERSION_MAJOR_IF_GIT_FAILS 1) -set(OBSW_VERSION_MINOR_IF_GIT_FAILS 23) -set(OBSW_VERSION_REVISION_IF_GIT_FAILS 1) +set(OBSW_VERSION_MINOR_IF_GIT_FAILS 24) +set(OBSW_VERSION_REVISION_IF_GIT_FAILS 0) # set(CMAKE_VERBOSE TRUE) From 05d168d6ee9982f1efd6da6e71d4fb77c6ecea64 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 3 Feb 2023 16:42:35 +0100 Subject: [PATCH 147/330] bump tmtc to v2.10.0 --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 5ed3cec2..04f5a769 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 5ed3cec20b609db435bd5663fd3edd5888fbb932 +Subproject commit 04f5a769629ae79048f68a37d0555e458c9f9a94 From 9bcc424d86c5bced0582a354617ce13741cda7de Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 3 Feb 2023 16:43:53 +0100 Subject: [PATCH 148/330] prepare for v1.24.0 --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c05c05f5..02a48aed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,9 @@ change warranting a new major release: # [unreleased] +# [v1.24.0] 2023-02-03 + +- eive-tmtc v2.10.0 - `AcsSubsystem`: OFF, SAFE and DETUMBLE mode were tested. Auto-transitions SAFE <-> DETUMBLE tested as well. Other modes still need to be tested. From 10378ef1bb166365b552cd8f9caa5b670ccaf239 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 5 Feb 2023 13:13:09 +0100 Subject: [PATCH 149/330] bugfix for GPS handler --- bsp_q7s/core/ObjectFactory.cpp | 4 +- linux/ObjectFactory.cpp | 4 +- linux/devices/CMakeLists.txt | 2 +- ...ler.cpp => GpsHyperionLinuxController.cpp} | 70 ++++++++++--------- ...troller.h => GpsHyperionLinuxController.h} | 8 +-- .../devicedefinitions/GPSDefinitions.h | 2 +- tmtc | 2 +- 7 files changed, 49 insertions(+), 43 deletions(-) rename linux/devices/{GPSHyperionLinuxController.cpp => GpsHyperionLinuxController.cpp} (85%) rename linux/devices/{GPSHyperionLinuxController.h => GpsHyperionLinuxController.h} (92%) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 847cce5f..31dedeba 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -23,7 +23,7 @@ #include "linux/boardtest/UartTestClass.h" #include "linux/callbacks/gpioCallbacks.h" #include "linux/csp/CspComIF.h" -#include "linux/devices/GPSHyperionLinuxController.h" +#include "linux/devices/GpsHyperionLinuxController.h" #include "linux/devices/ScexUartReader.h" #include "linux/devices/devicedefinitions/PlocMPSoCDefinitions.h" #include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" @@ -474,7 +474,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo RESET_ARGS_GNSS.gpioComIF = gpioComIF; RESET_ARGS_GNSS.waitPeriodMs = 100; auto gpsCtrl = - new GPSHyperionLinuxController(objects::GPS_CONTROLLER, objects::NO_OBJECT, debugGps); + new GpsHyperionLinuxController(objects::GPS_CONTROLLER, objects::NO_OBJECT, debugGps); gpsCtrl->setResetPinTriggerFunction(gps::triggerGpioResetPin, &RESET_ARGS_GNSS); AcsBoardHelper acsBoardHelper = AcsBoardHelper( diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index cf27972f..469187a6 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -121,8 +121,8 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo fdir = new SusFdir(objects::SUS_5_N_LOC_XFYMZB_PT_ZB); susHandlers[5]->setCustomFdir(fdir); - spiCookie = new SpiCookie(addresses::SUS_6, gpioIds::CS_SUS_6, SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, - spi::SUS_MAX1227_SPI_FREQ); + spiCookie = new SpiCookie(addresses::SUS_6, gpioIds::CS_SUS_6, SUS::MAX_CMD_SIZE, + spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); susHandlers[6] = new SusHandler(objects::SUS_6_R_LOC_XFYBZM_PT_XF, 6, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_6_R_LOC_XFYBZM_PT_XF); diff --git a/linux/devices/CMakeLists.txt b/linux/devices/CMakeLists.txt index a6a909d0..4864e01f 100644 --- a/linux/devices/CMakeLists.txt +++ b/linux/devices/CMakeLists.txt @@ -1,5 +1,5 @@ if(EIVE_BUILD_GPSD_GPS_HANDLER) - target_sources(${OBSW_NAME} PRIVATE GPSHyperionLinuxController.cpp) + target_sources(${OBSW_NAME} PRIVATE GpsHyperionLinuxController.cpp) endif() target_sources( diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GpsHyperionLinuxController.cpp similarity index 85% rename from linux/devices/GPSHyperionLinuxController.cpp rename to linux/devices/GpsHyperionLinuxController.cpp index d112d507..e9832854 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GpsHyperionLinuxController.cpp @@ -1,4 +1,4 @@ -#include "GPSHyperionLinuxController.h" +#include "GpsHyperionLinuxController.h" #include @@ -16,26 +16,26 @@ #include #include -GPSHyperionLinuxController::GPSHyperionLinuxController(object_id_t objectId, object_id_t parentId, +GpsHyperionLinuxController::GpsHyperionLinuxController(object_id_t objectId, object_id_t parentId, bool debugHyperionGps) : ExtendedControllerBase(objectId), gpsSet(this), debugHyperionGps(debugHyperionGps) { timeUpdateCd.resetTimer(); } -GPSHyperionLinuxController::~GPSHyperionLinuxController() { +GpsHyperionLinuxController::~GpsHyperionLinuxController() { gps_stream(&gps, WATCH_DISABLE, nullptr); gps_close(&gps); } -void GPSHyperionLinuxController::performControlOperation() { +void GpsHyperionLinuxController::performControlOperation() { #ifdef FSFW_OSAL_LINUX readGpsDataFromGpsd(); #endif } -LocalPoolDataSetBase *GPSHyperionLinuxController::getDataSetHandle(sid_t sid) { return &gpsSet; } +LocalPoolDataSetBase *GpsHyperionLinuxController::getDataSetHandle(sid_t sid) { return &gpsSet; } -ReturnValue_t GPSHyperionLinuxController::checkModeCommand(Mode_t mode, Submode_t submode, +ReturnValue_t GpsHyperionLinuxController::checkModeCommand(Mode_t mode, Submode_t submode, uint32_t *msToReachTheMode) { if (not modeCommanded) { if (mode == MODE_ON or mode == MODE_OFF) { @@ -54,7 +54,7 @@ ReturnValue_t GPSHyperionLinuxController::checkModeCommand(Mode_t mode, Submode_ return returnvalue::OK; } -ReturnValue_t GPSHyperionLinuxController::executeAction(ActionId_t actionId, +ReturnValue_t GpsHyperionLinuxController::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, const uint8_t *data, size_t size) { switch (actionId) { @@ -72,7 +72,7 @@ ReturnValue_t GPSHyperionLinuxController::executeAction(ActionId_t actionId, return returnvalue::OK; } -ReturnValue_t GPSHyperionLinuxController::initializeLocalDataPool( +ReturnValue_t GpsHyperionLinuxController::initializeLocalDataPool( localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { localDataPoolMap.emplace(GpsHyperion::ALTITUDE, new PoolEntry({0.0})); localDataPoolMap.emplace(GpsHyperion::LONGITUDE, new PoolEntry({0.0})); @@ -92,13 +92,13 @@ ReturnValue_t GPSHyperionLinuxController::initializeLocalDataPool( return returnvalue::OK; } -void GPSHyperionLinuxController::setResetPinTriggerFunction(gpioResetFunction_t resetCallback, +void GpsHyperionLinuxController::setResetPinTriggerFunction(gpioResetFunction_t resetCallback, void *args) { this->resetCallback = resetCallback; resetCallbackArgs = args; } -ReturnValue_t GPSHyperionLinuxController::initialize() { +ReturnValue_t GpsHyperionLinuxController::initialize() { ReturnValue_t result = ExtendedControllerBase::initialize(); if (result != returnvalue::OK) { return result; @@ -127,13 +127,13 @@ ReturnValue_t GPSHyperionLinuxController::initialize() { return result; } -ReturnValue_t GPSHyperionLinuxController::handleCommandMessage(CommandMessage *message) { +ReturnValue_t GpsHyperionLinuxController::handleCommandMessage(CommandMessage *message) { return ExtendedControllerBase::handleCommandMessage(message); } #ifdef FSFW_OSAL_LINUX -void GPSHyperionLinuxController::readGpsDataFromGpsd() { +void GpsHyperionLinuxController::readGpsDataFromGpsd() { auto readError = [&](int error) { if (gpsReadFailedSwitch) { gpsReadFailedSwitch = false; @@ -146,27 +146,33 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() { if (readMode == ReadModes::SOCKET) { gps_stream(&gps, WATCH_ENABLE | WATCH_JSON, nullptr); // Exit if no data is seen in 2 seconds (should not happen) - if (not gps_waiting(&gps, 2000000)) { - return; - } - int result = gps_read(&gps); - if (result == -1) { - readError(result); - return; - } - if (MODE_SET != (MODE_SET & gps.set)) { - if (noModeSetCntr >= 0) { - noModeSetCntr++; + if (gps_waiting(&gps, 2000000)) { + int result = gps_read(&gps); + while (result > 0) { + result = gps_read(&gps); } - if (noModeSetCntr == 10) { - // TODO: Trigger event here - sif::warning << "GPSHyperionHandler::readGpsDataFromGpsd: No mode could be " - "read for 10 consecutive reads" - << std::endl; - noModeSetCntr = -1; + if (result == -1) { + readError(result); + return; } + if (MODE_SET != (MODE_SET & gps.set)) { + if (mode == MODE_ON) { + if (noModeSetCntr >= 0) { + noModeSetCntr++; + } + if (noModeSetCntr == 10) { + // TODO: Trigger event here + sif::warning << "GPSHyperionHandler::readGpsDataFromGpsd: No mode could be " + "read for 10 consecutive reads" + << std::endl; + noModeSetCntr = -1; + } + // did not event get mode, nothing to see. + return; + } + } + noModeSetCntr = 0; } - noModeSetCntr = 0; } else if (readMode == ReadModes::SHM) { int result = gps_read(&gps); if (result == -1) { @@ -174,10 +180,10 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() { return; } } - handleGpsRead(); + handleGpsReadData(); } -ReturnValue_t GPSHyperionLinuxController::handleGpsRead() { +ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() { PoolReadGuard pg(&gpsSet); if (pg.getReadResult() != returnvalue::OK) { #if FSFW_VERBOSE_LEVEL >= 1 diff --git a/linux/devices/GPSHyperionLinuxController.h b/linux/devices/GpsHyperionLinuxController.h similarity index 92% rename from linux/devices/GPSHyperionLinuxController.h rename to linux/devices/GpsHyperionLinuxController.h index a4c12e57..e0c3dd36 100644 --- a/linux/devices/GPSHyperionLinuxController.h +++ b/linux/devices/GpsHyperionLinuxController.h @@ -20,15 +20,15 @@ * This device handler can only be used on Linux system where the gpsd daemon with shared memory * export is running. */ -class GPSHyperionLinuxController : public ExtendedControllerBase { +class GpsHyperionLinuxController : public ExtendedControllerBase { public: static constexpr uint32_t MAX_SECONDS_TO_REACH_FIX = 60 * 60 * 5; enum ReadModes { SHM = 0, SOCKET = 1 }; - GPSHyperionLinuxController(object_id_t objectId, object_id_t parentId, + GpsHyperionLinuxController(object_id_t objectId, object_id_t parentId, bool debugHyperionGps = false); - virtual ~GPSHyperionLinuxController(); + virtual ~GpsHyperionLinuxController(); using gpioResetFunction_t = ReturnValue_t (*)(const uint8_t* actionData, size_t len, void* args); @@ -49,7 +49,7 @@ class GPSHyperionLinuxController : public ExtendedControllerBase { ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) override; - ReturnValue_t handleGpsRead(); + ReturnValue_t handleGpsReadData(); private: GpsPrimaryDataset gpsSet; diff --git a/mission/devices/devicedefinitions/GPSDefinitions.h b/mission/devices/devicedefinitions/GPSDefinitions.h index 387d08be..0b88cfa5 100644 --- a/mission/devices/devicedefinitions/GPSDefinitions.h +++ b/mission/devices/devicedefinitions/GPSDefinitions.h @@ -63,7 +63,7 @@ class GpsPrimaryDataset : public StaticLocalDataSet<18> { lp_var_t(sid.objectId, GpsHyperion::UNIX_SECONDS, this); private: - friend class GPSHyperionLinuxController; + friend class GpsHyperionLinuxController; GpsPrimaryDataset(HasLocalDataPoolIF* hkOwner) : StaticLocalDataSet(hkOwner, GpsHyperion::DATASET_ID) {} }; diff --git a/tmtc b/tmtc index 04f5a769..5e27a22a 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 04f5a769629ae79048f68a37d0555e458c9f9a94 +Subproject commit 5e27a22a85acca321cc4ef5067c01924579d2c1e From fd7709ea81e09a176470bc47a11dc2b9467a7d04 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 6 Feb 2023 09:20:20 +0100 Subject: [PATCH 150/330] bump changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02a48aed..2c843068 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,12 @@ change warranting a new major release: # [unreleased] +## Fixed + +- `GpsHyperionLinuxController`: Fix `gpsd` polling by continuously calling `gps_read` in one cycle + until it does not have any data left anymore. + PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/368 + # [v1.24.0] 2023-02-03 - eive-tmtc v2.10.0 From 4d6215f54624ed37b8b4c12aad04241893f00c39 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 6 Feb 2023 10:20:22 +0100 Subject: [PATCH 151/330] fixes for scheduling --- bsp_q7s/core/scheduling.cpp | 78 ++++++++++---------- linux/devices/GpsHyperionLinuxController.cpp | 39 ++++++---- linux/devices/GpsHyperionLinuxController.h | 6 +- 3 files changed, 68 insertions(+), 55 deletions(-) diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index d8136d3a..d08bb848 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -173,54 +173,25 @@ void scheduling::initTasks() { } #endif - PeriodicTaskIF* acsCtrlTask = factory->createPeriodicTask( - "ACS_TASK", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); #if OBSW_ADD_GPS_CTRL == 1 - result = acsCtrlTask->addComponent(objects::GPS_CONTROLLER); + PeriodicTaskIF* gpsTask = factory->createPeriodicTask( + "GPS_TASK", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); + result = gpsTask->addComponent(objects::GPS_CONTROLLER); if (result != returnvalue::OK) { scheduling::printAddObjectError("GPS_CTRL", objects::GPS_CONTROLLER); } #endif /* OBSW_ADD_GPS_CTRL */ + PeriodicTaskIF* acsSysTask = factory->createPeriodicTask( + "SYS_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); + static_cast(acsSysTask); + // To be removed soon because it will be part of the ACS PST. #if OBSW_ADD_ACS_CTRL == 1 - acsCtrlTask->addComponent(objects::ACS_CONTROLLER); + gpsTask->addComponent(objects::ACS_CONTROLLER); if (result != returnvalue::OK) { scheduling::printAddObjectError("ACS_CTRL", objects::ACS_CONTROLLER); } #endif -#if OBSW_Q7S_EM == 1 - acsCtrlTask->addComponent(objects::MGM_0_LIS3_HANDLER); - acsCtrlTask->addComponent(objects::MGM_1_RM3100_HANDLER); - acsCtrlTask->addComponent(objects::MGM_2_LIS3_HANDLER); - acsCtrlTask->addComponent(objects::MGM_3_RM3100_HANDLER); - acsCtrlTask->addComponent(objects::IMTQ_HANDLER); - acsCtrlTask->addComponent(objects::SUS_0_N_LOC_XFYFZM_PT_XF); - acsCtrlTask->addComponent(objects::SUS_6_R_LOC_XFYBZM_PT_XF); - acsCtrlTask->addComponent(objects::SUS_1_N_LOC_XBYFZM_PT_XB); - acsCtrlTask->addComponent(objects::SUS_7_R_LOC_XBYBZM_PT_XB); - acsCtrlTask->addComponent(objects::SUS_2_N_LOC_XFYBZB_PT_YB); - acsCtrlTask->addComponent(objects::SUS_8_R_LOC_XBYBZB_PT_YB); - acsCtrlTask->addComponent(objects::SUS_3_N_LOC_XFYBZF_PT_YF); - acsCtrlTask->addComponent(objects::SUS_9_R_LOC_XBYBZB_PT_YF); - acsCtrlTask->addComponent(objects::SUS_4_N_LOC_XMYFZF_PT_ZF); - acsCtrlTask->addComponent(objects::SUS_10_N_LOC_XMYBZF_PT_ZF); - acsCtrlTask->addComponent(objects::SUS_5_N_LOC_XFYMZB_PT_ZB); - acsCtrlTask->addComponent(objects::SUS_11_R_LOC_XBYMZB_PT_ZB); - acsCtrlTask->addComponent(objects::GYRO_0_ADIS_HANDLER); - acsCtrlTask->addComponent(objects::GYRO_1_L3G_HANDLER); - acsCtrlTask->addComponent(objects::GYRO_2_ADIS_HANDLER); - acsCtrlTask->addComponent(objects::GYRO_3_L3G_HANDLER); - acsCtrlTask->addComponent(objects::GPS_CONTROLLER); - acsCtrlTask->addComponent(objects::STAR_TRACKER); - acsCtrlTask->addComponent(objects::RW1); - acsCtrlTask->addComponent(objects::RW2); - acsCtrlTask->addComponent(objects::RW3); - acsCtrlTask->addComponent(objects::RW4); -#endif - - PeriodicTaskIF* acsSysTask = factory->createPeriodicTask( - "SYS_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); - static_cast(acsSysTask); #if OBSW_ADD_ACS_BOARD == 1 result = acsSysTask->addComponent(objects::ACS_BOARD_ASS); if (result != returnvalue::OK) { @@ -244,6 +215,35 @@ void scheduling::initTasks() { scheduling::printAddObjectError("ACS_SUBSYSTEM", objects::ACS_SUBSYSTEM); } +#if OBSW_Q7S_EM == 1 + acsSysTask->addComponent(objects::MGM_0_LIS3_HANDLER); + acsSysTask->addComponent(objects::MGM_1_RM3100_HANDLER); + acsSysTask->addComponent(objects::MGM_2_LIS3_HANDLER); + acsSysTask->addComponent(objects::MGM_3_RM3100_HANDLER); + acsSysTask->addComponent(objects::IMTQ_HANDLER); + acsSysTask->addComponent(objects::SUS_0_N_LOC_XFYFZM_PT_XF); + acsSysTask->addComponent(objects::SUS_6_R_LOC_XFYBZM_PT_XF); + acsSysTask->addComponent(objects::SUS_1_N_LOC_XBYFZM_PT_XB); + acsSysTask->addComponent(objects::SUS_7_R_LOC_XBYBZM_PT_XB); + acsSysTask->addComponent(objects::SUS_2_N_LOC_XFYBZB_PT_YB); + acsSysTask->addComponent(objects::SUS_8_R_LOC_XBYBZB_PT_YB); + acsSysTask->addComponent(objects::SUS_3_N_LOC_XFYBZF_PT_YF); + acsSysTask->addComponent(objects::SUS_9_R_LOC_XBYBZB_PT_YF); + acsSysTask->addComponent(objects::SUS_4_N_LOC_XMYFZF_PT_ZF); + acsSysTask->addComponent(objects::SUS_10_N_LOC_XMYBZF_PT_ZF); + acsSysTask->addComponent(objects::SUS_5_N_LOC_XFYMZB_PT_ZB); + acsSysTask->addComponent(objects::SUS_11_R_LOC_XBYMZB_PT_ZB); + acsSysTask->addComponent(objects::GYRO_0_ADIS_HANDLER); + acsSysTask->addComponent(objects::GYRO_1_L3G_HANDLER); + acsSysTask->addComponent(objects::GYRO_2_ADIS_HANDLER); + acsSysTask->addComponent(objects::GYRO_3_L3G_HANDLER); + acsSysTask->addComponent(objects::GPS_CONTROLLER); + acsSysTask->addComponent(objects::STAR_TRACKER); + acsSysTask->addComponent(objects::RW1); + acsSysTask->addComponent(objects::RW2); + acsSysTask->addComponent(objects::RW3); + acsSysTask->addComponent(objects::RW4); +#endif #if OBSW_ADD_RTD_DEVICES == 1 PeriodicTaskIF* tcsPollingTask = factory->createPeriodicTask( "TCS_POLLING_TASK", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.5, missedDeadlineFunc); @@ -414,7 +414,9 @@ void scheduling::initTasks() { strHelperTask->startTask(); #endif /* OBSW_ADD_STAR_TRACKER == 1 */ - acsCtrlTask->startTask(); +#if OBSW_ADD_GPS_CTRL == 1 + gpsTask->startTask(); +#endif acsSysTask->startTask(); #if OBSW_ADD_RTD_DEVICES == 1 tcsPollingTask->startTask(); diff --git a/linux/devices/GpsHyperionLinuxController.cpp b/linux/devices/GpsHyperionLinuxController.cpp index e9832854..9f3ebbbd 100644 --- a/linux/devices/GpsHyperionLinuxController.cpp +++ b/linux/devices/GpsHyperionLinuxController.cpp @@ -27,12 +27,6 @@ GpsHyperionLinuxController::~GpsHyperionLinuxController() { gps_close(&gps); } -void GpsHyperionLinuxController::performControlOperation() { -#ifdef FSFW_OSAL_LINUX - readGpsDataFromGpsd(); -#endif -} - LocalPoolDataSetBase *GpsHyperionLinuxController::getDataSetHandle(sid_t sid) { return &gpsSet; } ReturnValue_t GpsHyperionLinuxController::checkModeCommand(Mode_t mode, Submode_t submode, @@ -98,6 +92,18 @@ void GpsHyperionLinuxController::setResetPinTriggerFunction(gpioResetFunction_t resetCallbackArgs = args; } +ReturnValue_t GpsHyperionLinuxController::performOperation(uint8_t opCode) { + while (true) { + bool noDataRead = readGpsDataFromGpsd(); + if (noDataRead) { + handleQueue(); + poolManager.performHkOperation(); + } + } + // Should never be reached. + return returnvalue::OK; +} + ReturnValue_t GpsHyperionLinuxController::initialize() { ReturnValue_t result = ExtendedControllerBase::initialize(); if (result != returnvalue::OK) { @@ -133,7 +139,7 @@ ReturnValue_t GpsHyperionLinuxController::handleCommandMessage(CommandMessage *m #ifdef FSFW_OSAL_LINUX -void GpsHyperionLinuxController::readGpsDataFromGpsd() { +bool GpsHyperionLinuxController::readGpsDataFromGpsd() { auto readError = [&](int error) { if (gpsReadFailedSwitch) { gpsReadFailedSwitch = false; @@ -145,15 +151,15 @@ void GpsHyperionLinuxController::readGpsDataFromGpsd() { currentClientBuf = gps_data(&gps); if (readMode == ReadModes::SOCKET) { gps_stream(&gps, WATCH_ENABLE | WATCH_JSON, nullptr); - // Exit if no data is seen in 2 seconds (should not happen) - if (gps_waiting(&gps, 2000000)) { + // Perform other necessary handling if not data seen for 0.2 seconds. + if (gps_waiting(&gps, 200000)) { int result = gps_read(&gps); while (result > 0) { result = gps_read(&gps); } if (result == -1) { readError(result); - return; + return false; } if (MODE_SET != (MODE_SET & gps.set)) { if (mode == MODE_ON) { @@ -168,19 +174,20 @@ void GpsHyperionLinuxController::readGpsDataFromGpsd() { noModeSetCntr = -1; } // did not event get mode, nothing to see. - return; + return false; } } noModeSetCntr = 0; + } else { + return false; } } else if (readMode == ReadModes::SHM) { - int result = gps_read(&gps); - if (result == -1) { - readError(result); - return; - } + sif::error << "GpsHyperionLinuxController::readGpsDataFromGpsdPermanentLoop: " + "SHM read not implemented" + << std::endl; } handleGpsReadData(); + return true; } ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() { diff --git a/linux/devices/GpsHyperionLinuxController.h b/linux/devices/GpsHyperionLinuxController.h index e0c3dd36..829857b2 100644 --- a/linux/devices/GpsHyperionLinuxController.h +++ b/linux/devices/GpsHyperionLinuxController.h @@ -32,6 +32,7 @@ class GpsHyperionLinuxController : public ExtendedControllerBase { using gpioResetFunction_t = ReturnValue_t (*)(const uint8_t* actionData, size_t len, void* args); + ReturnValue_t performOperation(uint8_t opCode) override; void setResetPinTriggerFunction(gpioResetFunction_t resetCallback, void* args); ReturnValue_t handleCommandMessage(CommandMessage* message) override; void performControlOperation() override; @@ -66,7 +67,10 @@ class GpsHyperionLinuxController : public ExtendedControllerBase { uint32_t timeIsConstantCounter = 0; Countdown timeUpdateCd = Countdown(60); - void readGpsDataFromGpsd(); + // Returns true if data was read and function should be called again + // immediately, and false if the gps_waiting blocked for 0.2 seconds + // without new data arriving. + bool readGpsDataFromGpsd(); }; #endif /* MISSION_DEVICES_GPSHYPERIONHANDLER_H_ */ From c49580ea5166183e0cf76b662666e430884edbf3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 6 Feb 2023 10:22:28 +0100 Subject: [PATCH 152/330] bump changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c843068..c22dd4ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,8 @@ change warranting a new major release: ## Fixed - `GpsHyperionLinuxController`: Fix `gpsd` polling by continuously calling `gps_read` in one cycle - until it does not have any data left anymore. + until it does not have any data left anymore. Also, the data is now polled in a permanenty loop, + where controller handling is done on 0.2 second timeouts. PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/368 # [v1.24.0] 2023-02-03 From 4d6d4dd44d59f4c364a55dfe001ad2f4ada23416 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 6 Feb 2023 10:24:13 +0100 Subject: [PATCH 153/330] small tweak --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c22dd4ce..fdd57f46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ change warranting a new major release: ## Fixed - `GpsHyperionLinuxController`: Fix `gpsd` polling by continuously calling `gps_read` in one cycle - until it does not have any data left anymore. Also, the data is now polled in a permanenty loop, + until it does not have any data left anymore. Also, the data is now polled in a permanent loop, where controller handling is done on 0.2 second timeouts. PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/368 From 1a4dbce3503f68354d1fc8e24d56a3ecb776305b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 6 Feb 2023 10:30:17 +0100 Subject: [PATCH 154/330] tweaks and logic fixes --- linux/devices/GpsHyperionLinuxController.cpp | 10 ++++------ linux/devices/GpsHyperionLinuxController.h | 5 ++--- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/linux/devices/GpsHyperionLinuxController.cpp b/linux/devices/GpsHyperionLinuxController.cpp index 9f3ebbbd..e557f5c2 100644 --- a/linux/devices/GpsHyperionLinuxController.cpp +++ b/linux/devices/GpsHyperionLinuxController.cpp @@ -94,8 +94,8 @@ void GpsHyperionLinuxController::setResetPinTriggerFunction(gpioResetFunction_t ReturnValue_t GpsHyperionLinuxController::performOperation(uint8_t opCode) { while (true) { - bool noDataRead = readGpsDataFromGpsd(); - if (noDataRead) { + bool callAgain = readGpsDataFromGpsd(); + if (not callAgain) { handleQueue(); poolManager.performHkOperation(); } @@ -137,7 +137,7 @@ ReturnValue_t GpsHyperionLinuxController::handleCommandMessage(CommandMessage *m return ExtendedControllerBase::handleCommandMessage(message); } -#ifdef FSFW_OSAL_LINUX +void GpsHyperionLinuxController::performControlOperation() {} bool GpsHyperionLinuxController::readGpsDataFromGpsd() { auto readError = [&](int error) { @@ -159,7 +159,7 @@ bool GpsHyperionLinuxController::readGpsDataFromGpsd() { } if (result == -1) { readError(result); - return false; + return true; } if (MODE_SET != (MODE_SET & gps.set)) { if (mode == MODE_ON) { @@ -327,5 +327,3 @@ ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() { } return returnvalue::OK; } - -#endif diff --git a/linux/devices/GpsHyperionLinuxController.h b/linux/devices/GpsHyperionLinuxController.h index 829857b2..d2dc91b6 100644 --- a/linux/devices/GpsHyperionLinuxController.h +++ b/linux/devices/GpsHyperionLinuxController.h @@ -67,9 +67,8 @@ class GpsHyperionLinuxController : public ExtendedControllerBase { uint32_t timeIsConstantCounter = 0; Countdown timeUpdateCd = Countdown(60); - // Returns true if data was read and function should be called again - // immediately, and false if the gps_waiting blocked for 0.2 seconds - // without new data arriving. + // Returns true if the function should be called again or false if other + // controller handling can be done. bool readGpsDataFromGpsd(); }; From ee01b6253e1aef58d45c4ca882b0029cba30b5cf Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 6 Feb 2023 10:39:19 +0100 Subject: [PATCH 155/330] small logic tweak --- linux/devices/GpsHyperionLinuxController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/devices/GpsHyperionLinuxController.cpp b/linux/devices/GpsHyperionLinuxController.cpp index e557f5c2..c1760e98 100644 --- a/linux/devices/GpsHyperionLinuxController.cpp +++ b/linux/devices/GpsHyperionLinuxController.cpp @@ -159,7 +159,7 @@ bool GpsHyperionLinuxController::readGpsDataFromGpsd() { } if (result == -1) { readError(result); - return true; + return false; } if (MODE_SET != (MODE_SET & gps.set)) { if (mode == MODE_ON) { From 67835dd7f7dc1051902e85e758f41d0110d2de90 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 6 Feb 2023 10:40:09 +0100 Subject: [PATCH 156/330] one regular cycle before permanent loop --- linux/devices/GpsHyperionLinuxController.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linux/devices/GpsHyperionLinuxController.cpp b/linux/devices/GpsHyperionLinuxController.cpp index c1760e98..44038a09 100644 --- a/linux/devices/GpsHyperionLinuxController.cpp +++ b/linux/devices/GpsHyperionLinuxController.cpp @@ -93,6 +93,8 @@ void GpsHyperionLinuxController::setResetPinTriggerFunction(gpioResetFunction_t } ReturnValue_t GpsHyperionLinuxController::performOperation(uint8_t opCode) { + handleQueue(); + poolManager.performHkOperation(); while (true) { bool callAgain = readGpsDataFromGpsd(); if (not callAgain) { From 970e018c27e38352e99d7a93a3707cce5ad041fb Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 6 Feb 2023 15:16:14 +0100 Subject: [PATCH 157/330] comment object ID of tmp dev which does not exist anymore --- common/config/eive/objects.h | 3 ++- tmtc | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/common/config/eive/objects.h b/common/config/eive/objects.h index 36cf009a..4914e6dd 100644 --- a/common/config/eive/objects.h +++ b/common/config/eive/objects.h @@ -50,7 +50,8 @@ enum commonObjects : uint32_t { TMP1075_HANDLER_PLPCDU_0 = 0x44420006, TMP1075_HANDLER_PLPCDU_1 = 0x44420007, TMP1075_HANDLER_IF_BOARD = 0x44420008, - TMP1075_HANDLER_OBC_IF_BOARD = 0x44420009, + // Does not exist anymore + // TMP1075_HANDLER_OBC_IF_BOARD = 0x44420009, PCDU_HANDLER = 0x442000A1, P60DOCK_HANDLER = 0x44250000, PDU1_HANDLER = 0x44250001, diff --git a/tmtc b/tmtc index 04f5a769..66867ad9 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 04f5a769629ae79048f68a37d0555e458c9f9a94 +Subproject commit 66867ad9d2fc9cb622e7d2baccba95689cc445c3 From f4f07964599a182c2c2dd8d6f9a961ee70b4d873 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 6 Feb 2023 15:52:49 +0100 Subject: [PATCH 158/330] these includes are required --- linux/ObjectFactory.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index 0b7580ec..0ee74514 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -9,8 +9,15 @@ #include #include #include +#include #include +#include #include +#include +#include +#include +#include +#include #include "OBSWConfig.h" #include "devConf.h" @@ -19,6 +26,7 @@ #include "eive/definitions.h" #include "mission/system/tree/acsModeTree.h" #include "mission/system/tree/payloadModeTree.h" +#include "mission/system/tree/tcsModeTree.h" void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiComIF, PowerSwitchIF* pwrSwitcher, std::string spiDev, @@ -111,8 +119,8 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo fdir = new SusFdir(objects::SUS_5_N_LOC_XFYMZB_PT_ZB); susHandlers[5]->setCustomFdir(fdir); - spiCookie = new SpiCookie(addresses::SUS_6, gpioIds::CS_SUS_6, SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, - spi::SUS_MAX1227_SPI_FREQ); + spiCookie = new SpiCookie(addresses::SUS_6, gpioIds::CS_SUS_6, SUS::MAX_CMD_SIZE, + spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); susHandlers[6] = new SusHandler(objects::SUS_6_R_LOC_XFYBZM_PT_XF, 6, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_6_R_LOC_XFYBZM_PT_XF); From 64e1355e061eebb57649ac0c4bcb9489ba3254a4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 6 Feb 2023 15:59:30 +0100 Subject: [PATCH 159/330] cache maps --- dummies/TemperatureSensorInserter.cpp | 15 +++++++-------- dummies/TemperatureSensorInserter.h | 15 +++++++++------ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/dummies/TemperatureSensorInserter.cpp b/dummies/TemperatureSensorInserter.cpp index 58748e87..efbec2d0 100644 --- a/dummies/TemperatureSensorInserter.cpp +++ b/dummies/TemperatureSensorInserter.cpp @@ -5,23 +5,22 @@ #include #include -TemperatureSensorInserter::TemperatureSensorInserter( - object_id_t objectId, const std::map& tempSensorDummies_, - const std::map& tempTmpSensorDummies_) - : SystemObject(objects::THERMAL_TEMP_INSERTER) {} +TemperatureSensorInserter::TemperatureSensorInserter(object_id_t objectId, + const Max31865DummyMap& tempSensorDummies_, + const Tmp1075DummyMap& tempTmpSensorDummies_) + : SystemObject(objects::THERMAL_TEMP_INSERTER), + max31865DummyMap(tempSensorDummies_), + tmp1075DummyMap(tempTmpSensorDummies_) {} ReturnValue_t TemperatureSensorInserter::initialize() { if (performTest) { - if (testCase == TestCase::OVERCOOL_SYRLINKS) { + if (testCase == TestCase::COOL_SYRLINKS) { } } return returnvalue::OK; } ReturnValue_t TemperatureSensorInserter::performOperation(uint8_t opCode) { - iteration++; - value = sin(iteration / 80. * M_PI) * 10; - /* ReturnValue_t result = max31865PlocHeatspreaderSet.read(); if (result != returnvalue::OK) { diff --git a/dummies/TemperatureSensorInserter.h b/dummies/TemperatureSensorInserter.h index cf858576..ff3f939e 100644 --- a/dummies/TemperatureSensorInserter.h +++ b/dummies/TemperatureSensorInserter.h @@ -8,9 +8,11 @@ class TemperatureSensorInserter : public ExecutableObjectIF, public SystemObject { public: - explicit TemperatureSensorInserter( - object_id_t objectId, const std::map& tempSensorDummies_, - const std::map& tempTmpSensorDummies_); + using Max31865DummyMap = std::map; + using Tmp1075DummyMap = std::map; + explicit TemperatureSensorInserter(object_id_t objectId, + const Max31865DummyMap& tempSensorDummies_, + const Tmp1075DummyMap& tempTmpSensorDummies_); ReturnValue_t initialize() override; @@ -18,11 +20,12 @@ class TemperatureSensorInserter : public ExecutableObjectIF, public SystemObject ReturnValue_t performOperation(uint8_t opCode) override; private: - enum TestCase { OVERCOOL_SYRLINKS = 0 }; + Max31865DummyMap max31865DummyMap; + Tmp1075DummyMap tmp1075DummyMap; + enum TestCase { NONE = 0, COOL_SYRLINKS = 1 }; int iteration = 0; bool performTest = false; - float value = 0; - TestCase testCase; + TestCase testCase = TestCase::NONE; // void noise(); }; From 77aff2620439a27dc74c9332c45499d875effa34 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Mon, 6 Feb 2023 17:10:09 +0100 Subject: [PATCH 160/330] . --- mission/controller/ThermalController.cpp | 183 +++++++++++------------ mission/controller/ThermalController.h | 34 ++--- 2 files changed, 101 insertions(+), 116 deletions(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 8535228a..9eee921f 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -58,7 +58,9 @@ ThermalController::ThermalController(object_id_t objectId, HeaterHandler& heater susSet8(objects::SUS_8_R_LOC_XBYBZB_PT_YB), susSet9(objects::SUS_9_R_LOC_XBYBZB_PT_YF), susSet10(objects::SUS_10_N_LOC_XMYBZF_PT_ZF), - susSet11(objects::SUS_11_R_LOC_XBYMZB_PT_ZB) {} + susSet11(objects::SUS_11_R_LOC_XBYMZB_PT_ZB) { + resetSensorsArray(); +} ReturnValue_t ThermalController::initialize() { auto result = ExtendedControllerBase::initialize(); @@ -113,7 +115,7 @@ void ThermalController::performControlOperation() { ctrlRw(); ctrlStr(); ctrlIfBoard(); - ctrlTcsBoard(); + ctrlAcsBoard(); ctrlObc(); ctrlObcIfBoard(); ctrlSBandTransceiver(); @@ -984,19 +986,17 @@ void ThermalController::copyDevices() { void ThermalController::ctrlAcsBoard() { heater::Switchers switchNr = heater::HEATER_2_ACS_BRD; heater::Switchers redSwitchNr = heater::HEATER_0_OBC_BRD; - chooseHeater(switchNr, redSwitchNr); - if (heaterAvailable) { + if (chooseHeater(switchNr, redSwitchNr)) { // A side - chooseOf4Sensors(switchNr, deviceTemperatures.gyro0SideA, deviceTemperatures.mgm0SideA, - deviceTemperatures.gyro1SideA, sensorTemperatures.sensor_tcs_board); - if (sensorTempAvailable) { + if (chooseOf4Sensors(switchNr, deviceTemperatures.gyro0SideA, deviceTemperatures.mgm0SideA, + deviceTemperatures.gyro1SideA, sensorTemperatures.sensor_tcs_board)) { ctrlHeater(switchNr, redSwitchNr, &acsBoardLimits); + return; } // B side - chooseOf4Sensors(switchNr, deviceTemperatures.gyro2SideB, deviceTemperatures.mgm2SideB, - deviceTemperatures.gyro3SideB, sensorTemperatures.sensor_tcs_board); - if (sensorTempAvailable) { + if (chooseOf4Sensors(switchNr, deviceTemperatures.gyro2SideB, deviceTemperatures.mgm2SideB, + deviceTemperatures.gyro3SideB, sensorTemperatures.sensor_tcs_board)) { ctrlHeater(switchNr, redSwitchNr, &acsBoardLimits); } } @@ -1011,10 +1011,8 @@ void ThermalController::ctrlMgt() { heater::Switchers switchNr = heater::HEATER_2_ACS_BRD; heater::Switchers redSwitchNr = heater::HEATER_3_PCDU_PDU; - chooseHeater(switchNr, redSwitchNr); - - if (heaterAvailable) { - sensorTempAvailable = true; + if (chooseHeater(switchNr, redSwitchNr)) { + bool sensorTempAvailable = true; if (sensorTemperatures.sensor_magnettorquer.isValid()) { sensorTemp = sensorTemperatures.sensor_magnettorquer.value; @@ -1043,7 +1041,7 @@ void ThermalController::ctrlRw() { if (heaterHandler.getHealth(switchNr) == HasHealthIF::HEALTHY) { // RW1 - sensorTempAvailable = true; + bool sensorTempAvailable = true; if (sensorTemperatures.sensor_rw1.isValid()) { sensorTemp = sensorTemperatures.sensor_rw1.value; @@ -1081,7 +1079,7 @@ void ThermalController::ctrlRw() { sensorTempAvailable = false; } if (sensorTempAvailable) { - ctrlHeater(switchNr, redSwitchNr, &rwLimits); + ctrlHeater(switchNr, redSwitchNr, rwLimits); } // RW3 sensorTempAvailable = true; @@ -1101,7 +1099,7 @@ void ThermalController::ctrlRw() { sensorTempAvailable = false; } if (sensorTempAvailable) { - ctrlHeater(switchNr, redSwitchNr, &rwLimits); + ctrlHeater(switchNr, redSwitchNr, rwLimits); } // RW4 sensorTempAvailable = true; @@ -1121,34 +1119,50 @@ void ThermalController::ctrlRw() { sensorTempAvailable = false; } if (sensorTempAvailable) { - ctrlHeater(switchNr, redSwitchNr, &rwLimits); + ctrlHeater(switchNr, redSwitchNr, rwLimits); } } } void ThermalController::ctrlStr() { - ctrlComponentTemperature(heater::HEATER_5_STR, heater::HEATER_6_DRO, - sensorTemperatures.sensor_startracker, deviceTemperatures.startracker, - sensorTemperatures.sensor_dro, &strLimits); + sensors[0].first = sensorTemperatures.sensor_startracker.isValid(); + sensors[0].second = sensorTemperatures.sensor_startracker.value; + sensors[1].first = deviceTemperatures.startracker.isValid(); + sensors[1].second = deviceTemperatures.startracker.value; + sensors[2].first = sensorTemperatures.sensor_dro.isValid(); + sensors[2].second = sensorTemperatures.sensor_dro.value; + numSensors = 3; + ctrlComponentTemperature(heater::HEATER_5_STR, heater::HEATER_6_DRO, + strLimits); } void ThermalController::ctrlIfBoard() { - ctrlComponentTemperature(heater::HEATER_2_ACS_BRD, heater::HEATER_3_PCDU_PDU, - sensorTemperatures.tmp1075IfBrd, sensorTemperatures.sensor_magnettorquer, - deviceTemperatures.mgm2SideB, &ifBoardLimits); + sensors[0].first = sensorTemperatures.tmp1075IfBrd.isValid(); + sensors[0].second = sensorTemperatures.tmp1075IfBrd.value; + sensors[1].first = sensorTemperatures.sensor_magnettorquer.isValid(); + sensors[1].second = sensorTemperatures.sensor_magnettorquer.value; + sensors[2].first = deviceTemperatures.mgm2SideB.isValid(); + sensors[2].second = deviceTemperatures.mgm2SideB.value; + numSensors = 3; + ctrlComponentTemperature(heater::HEATER_2_ACS_BRD, heater::HEATER_3_PCDU_PDU, ifBoardLimits); } void ThermalController::ctrlTcsBoard() { - ctrlComponentTemperature(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, - sensorTemperatures.sensor_tcs_board, sensorTemperatures.tmp1075Tcs0, - sensorTemperatures.tmp1075Tcs1, &tcsBoardLimits); + sensors[0].first = sensorTemperatures.sensor_tcs_board.isValid(); + sensors[0].second = sensorTemperatures.sensor_tcs_board.value; + sensors[1].first = sensorTemperatures.tmp1075Tcs0.isValid(); + sensors[1].second = sensorTemperatures.tmp1075Tcs0.value; + sensors[2].first = sensorTemperatures.tmp1075Tcs1.isValid(); + sensors[2].second = sensorTemperatures.tmp1075Tcs1.value; + numSensors = 3; + ctrlComponentTemperature(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, tcsBoardLimits); } void ThermalController::ctrlObc() { ctrlComponentTemperature(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, deviceTemperatures.q7s, sensorTemperatures.tmp1075Tcs1, sensorTemperatures.tmp1075Tcs0, &obcLimits); - if (componentOverheating) { + if (componentAboveCutOffLimit) { triggerEvent(OBC_OVERHEATING); } } @@ -1163,25 +1177,23 @@ void ThermalController::ctrlSBandTransceiver() { ctrlComponentTemperature(heater::HEATER_7_S_BAND, heater::HEATER_4_CAMERA, deviceTemperatures.syrlinksPowerAmplifier, deviceTemperatures.syrlinksBasebandBoard, - sensorTemperatures.sensor_4k_camera, &sBandTransceiverLimits); - if (componentOverheating) { + sensorTemperatures.sensor_4k_camera, sBandTransceiverLimits); + if (componentAboveCutOffLimit) { triggerEvent(SYRLINKS_OVERHEATING); } } void ThermalController::ctrlPcduP60Board() { ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, deviceTemperatures.temp1P60dock, deviceTemperatures.temp2P60dock, - deviceTemperatures.temp2P60dock, &pcduP60BoardLimits); + deviceTemperatures.temp2P60dock, pcduP60BoardLimits); } void ThermalController::ctrlPcduAcu() { heater::Switchers switchNr = heater::HEATER_3_PCDU_PDU; heater::Switchers redSwitchNr = heater::HEATER_2_ACS_BRD; - chooseHeater(switchNr, redSwitchNr); - - if (heaterAvailable) { - sensorTempAvailable = true; + if (chooseHeater(switchNr, redSwitchNr)) { + bool sensorTempAvailable = true; if (deviceTemperatures.acu.value[0] != INVALID_TEMPERATURE) { sensorTemp = deviceTemperatures.acu.value[0]; @@ -1214,15 +1226,12 @@ void ThermalController::ctrlPlPcduBoard() { heater::Switchers switchNr = heater::HEATER_3_PCDU_PDU; heater::Switchers redSwitchNr = heater::HEATER_2_ACS_BRD; - chooseHeater(switchNr, redSwitchNr); - - if (heaterAvailable) { - chooseOf4Sensors(switchNr, sensorTemperatures.tmp1075PlPcdu0, sensorTemperatures.tmp1075PlPcdu1, - deviceTemperatures.adcPayloadPcdu, - sensorTemperatures.sensor_plpcdu_heatspreader); - if (sensorTempAvailable) { + if (chooseHeater(switchNr, redSwitchNr)) { + if (chooseOf4Sensors(switchNr, sensorTemperatures.tmp1075PlPcdu0, sensorTemperatures.tmp1075PlPcdu1, + deviceTemperatures.adcPayloadPcdu, + sensorTemperatures.sensor_plpcdu_heatspreader)) { ctrlHeater(switchNr, redSwitchNr, &plPcduBoardLimits); - if (componentOverheating) { + if (componentAboveCutOffLimit) { triggerEvent(PLPCDU_OVERHEATING, switchNr); } } @@ -1233,8 +1242,8 @@ void ThermalController::ctrlPlocMissionBoard() { ctrlComponentTemperature(heater::HEATER_1_PLOC_PROC_BRD, heater::HEATER_0_OBC_BRD, sensorTemperatures.sensor_ploc_heatspreader, sensorTemperatures.sensor_ploc_missionboard, - sensorTemperatures.sensor_dac_heatspreader, &plocMissionBoardLimits); - if (componentOverheating) { + sensorTemperatures.sensor_dac_heatspreader, plocMissionBoardLimits); + if (componentAboveCutOffLimit) { triggerEvent(PLOC_OVERHEATING); } } @@ -1243,7 +1252,7 @@ void ThermalController::ctrlPlocProcessingBoard() { ctrlComponentTemperature(heater::HEATER_1_PLOC_PROC_BRD, heater::HEATER_0_OBC_BRD, sensorTemperatures.sensor_ploc_missionboard, sensorTemperatures.sensor_ploc_heatspreader, - sensorTemperatures.sensor_dac_heatspreader, &plocProcessingBoardLimits); + sensorTemperatures.sensor_dac_heatspreader, plocProcessingBoardLimits); } void ThermalController::ctrlDac() { @@ -1287,7 +1296,7 @@ void ThermalController::ctrlHpa() { ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, sensorTemperatures.sensor_hpa, sensorTemperatures.sensor_x8, sensorTemperatures.sensor_mpa, &hpaLimits); - if (componentOverheating) { + if (componentAboveCutOffLimit) { triggerEvent(HPA_OVERHEATING); } } @@ -1299,24 +1308,24 @@ void ThermalController::ctrlScexBoard() { } void ThermalController::ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, - struct TempLimits* tempLimit) { - componentOverheating = false; + struct TempLimits& tempLimit) { + componentAboveCutOffLimit = false; // Heater off if (not heaterHandler.checkSwitchState(switchNr)) { - if (sensorTemp < (*tempLimit).opLowerLimit) { + if (sensorTemp < tempLimit.opLowerLimit) { heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::ON); sif::info << "ThermalController::ctrlHeater: Heater" << switchNr << " ON" << std::endl; } // Heater on } else if (heaterHandler.checkSwitchState(switchNr)) { - if (sensorTemp >= (*tempLimit).opLowerLimit + TEMP_OFFSET) { + if (sensorTemp >= tempLimit.opLowerLimit + TEMP_OFFSET) { heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); sif::info << "ThermalController::ctrlHeater: Heater" << switchNr << " OFF" << std::endl; } } else if (not redSwitchNrInUse) { if (heaterHandler.checkSwitchState(redSwitchNr)) { - if (sensorTemp >= (*tempLimit).cutOffLimit) { - componentOverheating = true; + if (sensorTemp >= tempLimit.cutOffLimit) { + componentAboveCutOffLimit = true; heaterHandler.switchHeater(redSwitchNr, HeaterHandler::SwitchState::OFF); sif::info << "ThermalController::ctrlHeater: Heater" << redSwitchNr << " OFF" << std::endl; } @@ -1324,8 +1333,8 @@ void ThermalController::ctrlHeater(heater::Switchers switchNr, heater::Switchers } } -void ThermalController::chooseHeater(heater::Switchers& switchNr, heater::Switchers redSwitchNr) { - heaterAvailable = true; +bool ThermalController::chooseHeater(heater::Switchers& switchNr, heater::Switchers redSwitchNr) { + bool heaterAvailable = true; if (heaterHandler.getHealth(switchNr) != HasHealthIF::HEALTHY) { if (heaterHandler.getHealth(redSwitchNr) == HasHealthIF::HEALTHY) { @@ -1338,63 +1347,41 @@ void ThermalController::chooseHeater(heater::Switchers& switchNr, heater::Switch } else { redSwitchNrInUse = false; } + return heaterAvailable; } -void ThermalController::chooseSensor(heater::Switchers switchNr, const lp_float_t& sensor1, - const lp_float_t& sensor2, const lp_float_t& sensor3) { - sensorTempAvailable = true; - - if (sensor1.isValid() and sensor1.value != INVALID_TEMPERATURE) { - sensorTemp = sensor1.value; - } else if (sensor2.isValid() and sensor2.value != INVALID_TEMPERATURE) { - sensorTemp = sensor2.value; - } else if (sensor3.isValid() and sensor3.value != INVALID_TEMPERATURE) { - sensorTemp = sensor3.value; - } else { - if (heaterHandler.checkSwitchState(switchNr)) { - heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); - sif::info << "ThermalController::ctrlHeater: Heater" << switchNr << " OFF" << std::endl; +bool ThermalController::selectAndReadSensorTemp(heater::Switchers switchNr) { + for(unsigned i= 0; i, 5> sensors; + uint8_t numSensors = 0; + PoolEntry tmp1075Tcs0 = PoolEntry(10.0); PoolEntry tmp1075Tcs1 = PoolEntry(10.0); PoolEntry tmp1075PlPcdu0 = PoolEntry(10.0); @@ -161,20 +163,16 @@ class ThermalController : public ExtendedControllerBase { static constexpr dur_millis_t MUTEX_TIMEOUT = 50; + void resetSensorsArray(); void copySensors(); void copySus(); void copyDevices(); void ctrlComponentTemperature(heater::Switchers switchNr, heater::Switchers redSwitchNr, - const lp_float_t& sensor1, const lp_float_t& sensor2, - const lp_float_t& sensor3, TempLimits* tempLimit); - void ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, TempLimits* tempLimit); - void chooseHeater(heater::Switchers& switchNr, heater::Switchers redSwitchNr); - void chooseSensor(heater::Switchers switchNr, const lp_float_t& sensor1, - const lp_float_t& sensor2, const lp_float_t& sensor3); - void chooseOf4Sensors(heater::Switchers switchNr, const lp_float_t& sensor1, - const lp_float_t& sensor2, const lp_float_t& sensor3, - const lp_float_t& sensor4); + TempLimits& tempLimit); + void ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, TempLimits& tempLimit); + bool chooseHeater(heater::Switchers& switchNr, heater::Switchers redSwitchNr); + bool selectAndReadSensorTemp(heater::Switchers switchNr); void ctrlAcsBoard(); void ctrlMgt(); From 9d7291eea2ceb8f93c33a9b2bd783c6c5c403437 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 6 Feb 2023 18:12:41 +0100 Subject: [PATCH 161/330] this works now --- linux/devices/GpsHyperionLinuxController.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/linux/devices/GpsHyperionLinuxController.cpp b/linux/devices/GpsHyperionLinuxController.cpp index 44038a09..6bbbcfb7 100644 --- a/linux/devices/GpsHyperionLinuxController.cpp +++ b/linux/devices/GpsHyperionLinuxController.cpp @@ -1,5 +1,6 @@ #include "GpsHyperionLinuxController.h" +#include #include #include "OBSWConfig.h" @@ -96,8 +97,8 @@ ReturnValue_t GpsHyperionLinuxController::performOperation(uint8_t opCode) { handleQueue(); poolManager.performHkOperation(); while (true) { - bool callAgain = readGpsDataFromGpsd(); - if (not callAgain) { + bool callAgainImmediately = readGpsDataFromGpsd(); + if (not callAgainImmediately) { handleQueue(); poolManager.performHkOperation(); } @@ -126,6 +127,7 @@ ReturnValue_t GpsHyperionLinuxController::initialize() { if (retval != 0) { openError("Socket", retval); } + gps_stream(&gps, WATCH_ENABLE | WATCH_JSON, nullptr); } else if (readMode == ReadModes::SHM) { int retval = gps_open(GPSD_SHARED_MEMORY, "", &gps); if (retval != 0) { @@ -142,25 +144,19 @@ ReturnValue_t GpsHyperionLinuxController::handleCommandMessage(CommandMessage *m void GpsHyperionLinuxController::performControlOperation() {} bool GpsHyperionLinuxController::readGpsDataFromGpsd() { - auto readError = [&](int error) { + auto readError = [&]() { if (gpsReadFailedSwitch) { gpsReadFailedSwitch = false; sif::warning << "GPSHyperionHandler::readGpsDataFromGpsd: Reading GPS data failed | " "Error " - << error << " | " << gps_errstr(error) << std::endl; + << errno << " | " << gps_errstr(errno) << std::endl; } }; - currentClientBuf = gps_data(&gps); if (readMode == ReadModes::SOCKET) { - gps_stream(&gps, WATCH_ENABLE | WATCH_JSON, nullptr); // Perform other necessary handling if not data seen for 0.2 seconds. if (gps_waiting(&gps, 200000)) { - int result = gps_read(&gps); - while (result > 0) { - result = gps_read(&gps); - } - if (result == -1) { - readError(result); + if (-1 == gps_read(&gps)) { + readError(); return false; } if (MODE_SET != (MODE_SET & gps.set)) { From 86babcf07b9521b84fd9d139cb63feacb1b8a680 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 6 Feb 2023 18:23:04 +0100 Subject: [PATCH 162/330] important fix --- bsp_q7s/core/scheduling.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index d08bb848..43c50c02 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -187,7 +187,7 @@ void scheduling::initTasks() { static_cast(acsSysTask); // To be removed soon because it will be part of the ACS PST. #if OBSW_ADD_ACS_CTRL == 1 - gpsTask->addComponent(objects::ACS_CONTROLLER); + acsSysTask->addComponent(objects::ACS_CONTROLLER); if (result != returnvalue::OK) { scheduling::printAddObjectError("ACS_CTRL", objects::ACS_CONTROLLER); } From 8ffd10cacc80cd44999a74b5f2d12a8945cbb3f4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 6 Feb 2023 20:15:45 +0100 Subject: [PATCH 163/330] update subsystem mode IDs --- CHANGELOG.md | 4 ++++ mission/acsDefs.h | 14 +++++++------- mission/comDefs.h | 10 +++++----- mission/system/objects/definitions.h | 9 ++++++++- mission/system/tree/payloadModeTree.cpp | 13 ++++++------- tmtc | 2 +- 6 files changed, 31 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fdd57f46..fb56320b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ change warranting a new major release: # [unreleased] +## Changed + +- Updated Subsystem mode IDs to avoid clashes with regular device handler modes. + ## Fixed - `GpsHyperionLinuxController`: Fix `gpsd` polling by continuously calling `gps_read` in one cycle diff --git a/mission/acsDefs.h b/mission/acsDefs.h index 2bb536f2..8869d6ff 100644 --- a/mission/acsDefs.h +++ b/mission/acsDefs.h @@ -8,13 +8,13 @@ namespace acs { enum CtrlSubmode { OFF = HasModesIF::MODE_OFF, - SAFE = 2, - DETUMBLE = 3, - IDLE = 4, - PTG_TARGET_NADIR = 5, - PTG_TARGET = 6, - PTG_TARGET_GS = 7, - PTG_TARGET_INERTIAL = 8, + SAFE = 10, + DETUMBLE = 11, + IDLE = 12, + PTG_TARGET_NADIR = 13, + PTG_TARGET = 14, + PTG_TARGET_GS = 15, + PTG_TARGET_INERTIAL = 16, }; static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::ACS_SUBSYSTEM; diff --git a/mission/comDefs.h b/mission/comDefs.h index 5538b166..dd254263 100644 --- a/mission/comDefs.h +++ b/mission/comDefs.h @@ -10,11 +10,11 @@ enum class Datarate : uint8_t { }; enum Submode : uint8_t { - RX_ONLY, - RX_AND_TX_DEFAULT_DATARATE, - RX_AND_TX_LOW_DATARATE, - RX_AND_TX_HIGH_DATARATE, - RX_AND_TX_CW, + RX_ONLY = 10, + RX_AND_TX_DEFAULT_DATARATE = 11, + RX_AND_TX_LOW_DATARATE = 12, + RX_AND_TX_HIGH_DATARATE = 13, + RX_AND_TX_CW = 14, NUM_SUBMODES }; diff --git a/mission/system/objects/definitions.h b/mission/system/objects/definitions.h index f2b491ca..80f30641 100644 --- a/mission/system/objects/definitions.h +++ b/mission/system/objects/definitions.h @@ -18,7 +18,14 @@ enum Submodes : Submode_t { A_SIDE = 0, B_SIDE = 1, DUAL_MODE = 2 }; namespace payload { -enum Mode { OFF = 0, SUPV_ONLY = 1, MPSOC_STREAM = 2, CAM_STREAM = 3, EARTH_OBSV = 4, SCEX = 5 }; +enum Mode { + OFF = 0, + SUPV_ONLY = 10, + MPSOC_STREAM = 11, + CAM_STREAM = 12, + EARTH_OBSV = 13, + SCEX = 14 +}; namespace ploc { diff --git a/mission/system/tree/payloadModeTree.cpp b/mission/system/tree/payloadModeTree.cpp index a53ad462..ccb3dd2c 100644 --- a/mission/system/tree/payloadModeTree.cpp +++ b/mission/system/tree/payloadModeTree.cpp @@ -27,7 +27,7 @@ static const auto OFF = HasModesIF::MODE_OFF; static const auto ON = HasModesIF::MODE_ON; static const auto NML = DeviceHandlerIF::MODE_NORMAL; -auto PL_SEQUENCE_OFF = std::make_pair(payload::Mode::OFF << 24, FixedArrayList()); +auto PL_SEQUENCE_OFF = std::make_pair(payload::Mode::OFF, FixedArrayList()); auto PL_TABLE_OFF_TGT = std::make_pair((payload::Mode::OFF << 24) | 1, FixedArrayList()); auto PL_TABLE_OFF_TRANS_0 = @@ -36,7 +36,7 @@ auto PL_TABLE_OFF_TRANS_1 = std::make_pair((payload::Mode::OFF << 24) | 3, FixedArrayList()); auto PL_SEQUENCE_MPSOC_STREAM = - std::make_pair(payload::Mode::MPSOC_STREAM << 24, FixedArrayList()); + std::make_pair(payload::Mode::MPSOC_STREAM, FixedArrayList()); auto PL_TABLE_MPSOC_STREAM_TGT = std::make_pair((payload::Mode::MPSOC_STREAM << 24) | 1, FixedArrayList()); auto PL_TABLE_MPSOC_STREAM_TRANS_0 = @@ -45,7 +45,7 @@ auto PL_TABLE_MPSOC_STREAM_TRANS_1 = std::make_pair((payload::Mode::MPSOC_STREAM << 24) | 3, FixedArrayList()); auto PL_SEQUENCE_CAM_STREAM = - std::make_pair(payload::Mode::CAM_STREAM << 24, FixedArrayList()); + std::make_pair(payload::Mode::CAM_STREAM, FixedArrayList()); auto PL_TABLE_CAM_STREAM_TGT = std::make_pair((payload::Mode::CAM_STREAM << 24) | 1, FixedArrayList()); auto PL_TABLE_CAM_STREAM_TRANS_0 = @@ -54,7 +54,7 @@ auto PL_TABLE_CAM_STREAM_TRANS_1 = std::make_pair((payload::Mode::CAM_STREAM << 24) | 3, FixedArrayList()); auto PL_SEQUENCE_SUPV_ONLY = - std::make_pair(payload::Mode::SUPV_ONLY << 24, FixedArrayList()); + std::make_pair(payload::Mode::SUPV_ONLY, FixedArrayList()); auto PL_TABLE_SUPV_ONLY_TGT = std::make_pair((payload::Mode::SUPV_ONLY << 24) | 1, FixedArrayList()); auto PL_TABLE_SUPV_ONLY_TRANS_0 = @@ -63,7 +63,7 @@ auto PL_TABLE_SUPV_ONLY_TRANS_1 = std::make_pair((payload::Mode::SUPV_ONLY << 24) | 3, FixedArrayList()); auto PL_SEQUENCE_EARTH_OBSV = - std::make_pair(payload::Mode::EARTH_OBSV << 24, FixedArrayList()); + std::make_pair(payload::Mode::EARTH_OBSV, FixedArrayList()); auto PL_TABLE_EARTH_OBSV_TGT = std::make_pair((payload::Mode::EARTH_OBSV << 24) | 1, FixedArrayList()); auto PL_TABLE_EARTH_OBSV_TRANS_0 = @@ -71,8 +71,7 @@ auto PL_TABLE_EARTH_OBSV_TRANS_0 = auto PL_TABLE_EARTH_OBSV_TRANS_1 = std::make_pair((payload::Mode::EARTH_OBSV << 24) | 3, FixedArrayList()); -auto PL_SEQUENCE_SCEX = - std::make_pair(payload::Mode::SCEX << 24, FixedArrayList()); +auto PL_SEQUENCE_SCEX = std::make_pair(payload::Mode::SCEX, FixedArrayList()); auto PL_TABLE_SCEX_TGT = std::make_pair((payload::Mode::SCEX << 24) | 1, FixedArrayList()); auto PL_TABLE_SCEX_TRANS_0 = diff --git a/tmtc b/tmtc index 66867ad9..cab0aa02 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 66867ad9d2fc9cb622e7d2baccba95689cc445c3 +Subproject commit cab0aa027ab3169bc2f224fa9cd9ccd524e42ae4 From 7ae2b44806b9e99dea4e08cd1a765ca5ae383373 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 6 Feb 2023 20:19:08 +0100 Subject: [PATCH 164/330] prep v1.25.0 --- CHANGELOG.md | 4 ++++ CMakeLists.txt | 2 +- tmtc | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb56320b..c5eceb87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ change warranting a new major release: # [unreleased] +# [v1.25.0] 2023-02-06 + +eive-tmtc version: v2.12.0 + ## Changed - Updated Subsystem mode IDs to avoid clashes with regular device handler modes. diff --git a/CMakeLists.txt b/CMakeLists.txt index cf44cd86..97b1b2a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ cmake_minimum_required(VERSION 3.13) set(OBSW_VERSION_MAJOR_IF_GIT_FAILS 1) -set(OBSW_VERSION_MINOR_IF_GIT_FAILS 24) +set(OBSW_VERSION_MINOR_IF_GIT_FAILS 25) set(OBSW_VERSION_REVISION_IF_GIT_FAILS 0) # set(CMAKE_VERBOSE TRUE) diff --git a/tmtc b/tmtc index cab0aa02..8aec6c48 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit cab0aa027ab3169bc2f224fa9cd9ccd524e42ae4 +Subproject commit 8aec6c48a0b352709c99e7482eaee71497d591dd From 5f81b0866ace7823122082c2cc263cde7830fcc5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 6 Feb 2023 20:22:52 +0100 Subject: [PATCH 165/330] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 8aec6c48..d6445d38 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 8aec6c48a0b352709c99e7482eaee71497d591dd +Subproject commit d6445d38a8eb644a5e1bd27f0fc56d29e93c030d From 4f8fdc973f5f96c5d4ebf117c99d429babb143f9 Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Mon, 6 Feb 2023 21:13:17 +0100 Subject: [PATCH 166/330] thermalController upgrade --- mission/controller/ThermalController.cpp | 236 ++++++++++++++--------- 1 file changed, 145 insertions(+), 91 deletions(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 9eee921f..aa49ecb5 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -984,6 +984,7 @@ void ThermalController::copyDevices() { } void ThermalController::ctrlAcsBoard() { + // TODO: fix heater::Switchers switchNr = heater::HEATER_2_ACS_BRD; heater::Switchers redSwitchNr = heater::HEATER_0_OBC_BRD; @@ -991,13 +992,13 @@ void ThermalController::ctrlAcsBoard() { // A side if (chooseOf4Sensors(switchNr, deviceTemperatures.gyro0SideA, deviceTemperatures.mgm0SideA, deviceTemperatures.gyro1SideA, sensorTemperatures.sensor_tcs_board)) { - ctrlHeater(switchNr, redSwitchNr, &acsBoardLimits); + ctrlHeater(switchNr, redSwitchNr, acsBoardLimits); return; } // B side if (chooseOf4Sensors(switchNr, deviceTemperatures.gyro2SideB, deviceTemperatures.mgm2SideB, deviceTemperatures.gyro3SideB, sensorTemperatures.sensor_tcs_board)) { - ctrlHeater(switchNr, redSwitchNr, &acsBoardLimits); + ctrlHeater(switchNr, redSwitchNr, acsBoardLimits); } } } @@ -1008,33 +1009,20 @@ void ThermalController::ctrlMgt() { static_cast(imtqThermalSet.heaterRequest.value); if (heaterReq == ThermalComponentIF::STATE_REQUEST_OPERATIONAL) { - heater::Switchers switchNr = heater::HEATER_2_ACS_BRD; - heater::Switchers redSwitchNr = heater::HEATER_3_PCDU_PDU; - - if (chooseHeater(switchNr, redSwitchNr)) { - bool sensorTempAvailable = true; - - if (sensorTemperatures.sensor_magnettorquer.isValid()) { - sensorTemp = sensorTemperatures.sensor_magnettorquer.value; - } else if (deviceTemperatures.mgt.isValid()) { - sensorTemp = deviceTemperatures.mgt.value; - } else if (sensorTemperatures.sensor_plpcdu_heatspreader.isValid()) { - sensorTemp = sensorTemperatures.sensor_plpcdu_heatspreader.value; - } else { - if (heaterHandler.checkSwitchState(switchNr)) { - heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); - } - triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); - sensorTempAvailable = false; - } - if (sensorTempAvailable) { - ctrlHeater(switchNr, redSwitchNr, &mgtLimits); - } - } + sensors[0].first = sensorTemperatures.sensor_magnettorquer.isValid(); + sensors[0].second = sensorTemperatures.sensor_magnettorquer.value; + sensors[1].first = deviceTemperatures.mgt.isValid(); + sensors[1].second = deviceTemperatures.mgt.value; + sensors[2].first = sensorTemperatures.sensor_plpcdu_heatspreader.isValid(); + sensors[2].second = sensorTemperatures.sensor_plpcdu_heatspreader.value; + numSensors = 3; + ctrlComponentTemperature(heater::HEATER_2_ACS_BRD, heater::HEATER_3_PCDU_PDU, + mgtLimits); } } void ThermalController::ctrlRw() { + //TODO: better solution? heater::Switchers switchNr = heater::HEATER_6_DRO; heater::Switchers redSwitchNr = heater::HEATER_6_DRO; redSwitchNrInUse = false; @@ -1059,7 +1047,7 @@ void ThermalController::ctrlRw() { sensorTempAvailable = false; } if (sensorTempAvailable) { - ctrlHeater(switchNr, redSwitchNr, &rwLimits); + ctrlHeater(switchNr, redSwitchNr, rwLimits); } // RW2 sensorTempAvailable = true; @@ -1159,33 +1147,50 @@ void ThermalController::ctrlTcsBoard() { } void ThermalController::ctrlObc() { - ctrlComponentTemperature(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, - deviceTemperatures.q7s, sensorTemperatures.tmp1075Tcs1, - sensorTemperatures.tmp1075Tcs0, &obcLimits); + sensors[0].first = deviceTemperatures.q7s.isValid(); + sensors[0].second = deviceTemperatures.q7s.value; + sensors[1].first = sensorTemperatures.tmp1075Tcs1.isValid(); + sensors[1].second = sensorTemperatures.tmp1075Tcs1.value; + sensors[2].first = sensorTemperatures.tmp1075Tcs0.isValid(); + sensors[2].second = sensorTemperatures.tmp1075Tcs0.value; + numSensors = 3; + ctrlComponentTemperature(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, obcLimits); if (componentAboveCutOffLimit) { triggerEvent(OBC_OVERHEATING); } } void ThermalController::ctrlObcIfBoard() { - ctrlComponentTemperature(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, - deviceTemperatures.q7s, sensorTemperatures.tmp1075Tcs0, - sensorTemperatures.tmp1075Tcs1, &obcIfBoardLimits); + sensors[0].first = deviceTemperatures.q7s.isValid(); + sensors[0].second = deviceTemperatures.q7s.value; + sensors[1].first = sensorTemperatures.tmp1075Tcs0.isValid(); + sensors[1].second = sensorTemperatures.tmp1075Tcs0.value; + sensors[2].first = sensorTemperatures.tmp1075Tcs1.isValid(); + sensors[2].second = sensorTemperatures.tmp1075Tcs1.value; + numSensors = 3; + ctrlComponentTemperature(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, obcIfBoardLimits); } void ThermalController::ctrlSBandTransceiver() { - ctrlComponentTemperature(heater::HEATER_7_S_BAND, heater::HEATER_4_CAMERA, - deviceTemperatures.syrlinksPowerAmplifier, - deviceTemperatures.syrlinksBasebandBoard, - sensorTemperatures.sensor_4k_camera, sBandTransceiverLimits); + sensors[0].first = deviceTemperatures.syrlinksPowerAmplifier.isValid(); + sensors[0].second = deviceTemperatures.syrlinksPowerAmplifier.value; + sensors[1].first = deviceTemperatures.syrlinksBasebandBoard.isValid(); + sensors[1].second = deviceTemperatures.syrlinksBasebandBoard.value; + sensors[2].first = sensorTemperatures.sensor_4k_camera.isValid(); + sensors[2].second = sensorTemperatures.sensor_4k_camera.value; + numSensors = 3; + ctrlComponentTemperature(heater::HEATER_7_S_BAND, heater::HEATER_4_CAMERA, sBandTransceiverLimits); if (componentAboveCutOffLimit) { triggerEvent(SYRLINKS_OVERHEATING); } } void ThermalController::ctrlPcduP60Board() { - ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, - deviceTemperatures.temp1P60dock, deviceTemperatures.temp2P60dock, - deviceTemperatures.temp2P60dock, pcduP60BoardLimits); + sensors[0].first = deviceTemperatures.temp1P60dock.isValid(); + sensors[0].second = deviceTemperatures.temp1P60dock.value; + sensors[1].first = deviceTemperatures.temp2P60dock.isValid(); + sensors[1].second = deviceTemperatures.temp2P60dock.value; + numSensors = 2; + ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, pcduP60BoardLimits); } void ThermalController::ctrlPcduAcu() { @@ -1204,107 +1209,156 @@ void ThermalController::ctrlPcduAcu() { } else if (sensorTemperatures.sensor_acu.isValid()) { sensorTemp = sensorTemperatures.sensor_acu.value; } else { - if (heaterHandler.checkSwitchState(switchNr)) { - heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); - } triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); sensorTempAvailable = false; } if (sensorTempAvailable) { - ctrlHeater(switchNr, redSwitchNr, &pcduAcuLimits); + ctrlHeater(switchNr, redSwitchNr, pcduAcuLimits); } } } void ThermalController::ctrlPcduPdu() { - ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, - deviceTemperatures.pdu1, deviceTemperatures.pdu2, - deviceTemperatures.pdu2, &pcduPduLimits); + sensors[0].first = deviceTemperatures.pdu1.isValid(); + sensors[0].second = deviceTemperatures.pdu1.value; + sensors[1].first = deviceTemperatures.pdu2.isValid(); + sensors[1].second = deviceTemperatures.pdu2.value; + sensors[2].first = sensorTemperatures.tmp1075Tcs0.isValid(); + sensors[2].second = sensorTemperatures.tmp1075Tcs0.value; + numSensors = 2; + ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, pcduPduLimits); } void ThermalController::ctrlPlPcduBoard() { - heater::Switchers switchNr = heater::HEATER_3_PCDU_PDU; - heater::Switchers redSwitchNr = heater::HEATER_2_ACS_BRD; - - if (chooseHeater(switchNr, redSwitchNr)) { - if (chooseOf4Sensors(switchNr, sensorTemperatures.tmp1075PlPcdu0, sensorTemperatures.tmp1075PlPcdu1, - deviceTemperatures.adcPayloadPcdu, - sensorTemperatures.sensor_plpcdu_heatspreader)) { - ctrlHeater(switchNr, redSwitchNr, &plPcduBoardLimits); - if (componentAboveCutOffLimit) { - triggerEvent(PLPCDU_OVERHEATING, switchNr); - } - } + sensors[0].first = sensorTemperatures.tmp1075PlPcdu0.isValid(); + sensors[0].second = sensorTemperatures.tmp1075PlPcdu0.value; + sensors[1].first = sensorTemperatures.tmp1075PlPcdu1.isValid(); + sensors[1].second = sensorTemperatures.tmp1075PlPcdu1.value; + sensors[2].first = deviceTemperatures.adcPayloadPcdu.isValid(); + sensors[2].second = deviceTemperatures.adcPayloadPcdu.value; + sensors[3].first = sensorTemperatures.sensor_plpcdu_heatspreader.isValid(); + sensors[3].second = sensorTemperatures.sensor_plpcdu_heatspreader.value; + numSensors = 4; + ctrlComponentTemperature(heater::HEATER_3_PCDU_PDU, heater::HEATER_2_ACS_BRD, plPcduBoardLimits); + if (componentAboveCutOffLimit) { + triggerEvent(PLPCDU_OVERHEATING); } } void ThermalController::ctrlPlocMissionBoard() { - ctrlComponentTemperature(heater::HEATER_1_PLOC_PROC_BRD, heater::HEATER_0_OBC_BRD, - sensorTemperatures.sensor_ploc_heatspreader, - sensorTemperatures.sensor_ploc_missionboard, - sensorTemperatures.sensor_dac_heatspreader, plocMissionBoardLimits); + sensors[0].first = sensorTemperatures.sensor_ploc_heatspreader.isValid(); + sensors[0].second = sensorTemperatures.sensor_ploc_heatspreader.value; + sensors[1].first = sensorTemperatures.sensor_ploc_missionboard.isValid(); + sensors[1].second = sensorTemperatures.sensor_ploc_missionboard.value; + sensors[2].first = sensorTemperatures.sensor_dac_heatspreader.isValid(); + sensors[2].second = sensorTemperatures.sensor_dac_heatspreader.value; + numSensors = 3; + ctrlComponentTemperature(heater::HEATER_1_PLOC_PROC_BRD, heater::HEATER_0_OBC_BRD, plocMissionBoardLimits); if (componentAboveCutOffLimit) { triggerEvent(PLOC_OVERHEATING); } } void ThermalController::ctrlPlocProcessingBoard() { - ctrlComponentTemperature(heater::HEATER_1_PLOC_PROC_BRD, heater::HEATER_0_OBC_BRD, - sensorTemperatures.sensor_ploc_missionboard, - sensorTemperatures.sensor_ploc_heatspreader, - sensorTemperatures.sensor_dac_heatspreader, plocProcessingBoardLimits); + sensors[0].first = sensorTemperatures.sensor_ploc_missionboard.isValid(); + sensors[0].second = sensorTemperatures.sensor_ploc_missionboard.value; + sensors[1].first = sensorTemperatures.sensor_ploc_heatspreader.isValid(); + sensors[1].second = sensorTemperatures.sensor_ploc_heatspreader.value; + sensors[2].first = sensorTemperatures.sensor_dac_heatspreader.isValid(); + sensors[2].second = sensorTemperatures.sensor_dac_heatspreader.value; + numSensors = 3; + ctrlComponentTemperature(heater::HEATER_1_PLOC_PROC_BRD, heater::HEATER_0_OBC_BRD, plocProcessingBoardLimits); } void ThermalController::ctrlDac() { - ctrlComponentTemperature(heater::HEATER_1_PLOC_PROC_BRD, heater::HEATER_0_OBC_BRD, - sensorTemperatures.sensor_dac_heatspreader, - sensorTemperatures.sensor_ploc_missionboard, - sensorTemperatures.sensor_ploc_heatspreader, &dacLimits); + sensors[0].first = sensorTemperatures.sensor_dac_heatspreader.isValid(); + sensors[0].second = sensorTemperatures.sensor_dac_heatspreader.value; + sensors[1].first = sensorTemperatures.sensor_ploc_missionboard.isValid(); + sensors[1].second = sensorTemperatures.sensor_ploc_missionboard.value; + sensors[2].first = sensorTemperatures.sensor_ploc_heatspreader.isValid(); + sensors[2].second = sensorTemperatures.sensor_ploc_heatspreader.value; + numSensors = 3; + ctrlComponentTemperature(heater::HEATER_1_PLOC_PROC_BRD, heater::HEATER_0_OBC_BRD, dacLimits); } void ThermalController::ctrlCameraBody() { - ctrlComponentTemperature(heater::HEATER_4_CAMERA, heater::HEATER_6_DRO, - sensorTemperatures.sensor_4k_camera, sensorTemperatures.sensor_dro, - sensorTemperatures.sensor_mpa, &cameraLimits); + sensors[0].first = sensorTemperatures.sensor_4k_camera.isValid(); + sensors[0].second = sensorTemperatures.sensor_4k_camera.value; + sensors[1].first = sensorTemperatures.sensor_dro.isValid(); + sensors[1].second = sensorTemperatures.sensor_dro.value; + sensors[2].first = sensorTemperatures.sensor_mpa.isValid(); + sensors[2].second = sensorTemperatures.sensor_mpa.value; + numSensors = 3; + ctrlComponentTemperature(heater::HEATER_4_CAMERA, heater::HEATER_6_DRO, cameraLimits); } void ThermalController::ctrlDro() { - ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, - sensorTemperatures.sensor_dro, sensorTemperatures.sensor_4k_camera, - sensorTemperatures.sensor_mpa, &droLimits); + sensors[0].first = sensorTemperatures.sensor_dro.isValid(); + sensors[0].second = sensorTemperatures.sensor_dro.value; + sensors[1].first = sensorTemperatures.sensor_4k_camera.isValid(); + sensors[1].second = sensorTemperatures.sensor_4k_camera.value; + sensors[2].first = sensorTemperatures.sensor_mpa.isValid(); + sensors[2].second = sensorTemperatures.sensor_mpa.value; + numSensors = 3; + ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, droLimits); } void ThermalController::ctrlX8() { - ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, - sensorTemperatures.sensor_x8, sensorTemperatures.sensor_hpa, - sensorTemperatures.sensor_tx_modul, &x8Limits); + sensors[0].first = sensorTemperatures.sensor_x8.isValid(); + sensors[0].second = sensorTemperatures.sensor_x8.value; + sensors[1].first = sensorTemperatures.sensor_hpa.isValid(); + sensors[1].second = sensorTemperatures.sensor_hpa.value; + sensors[2].first = sensorTemperatures.sensor_tx_modul.isValid(); + sensors[2].second = sensorTemperatures.sensor_tx_modul.value; + numSensors = 3; + ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, x8Limits); } void ThermalController::ctrlTx() { - ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, - sensorTemperatures.sensor_tx_modul, sensorTemperatures.sensor_x8, - sensorTemperatures.sensor_mpa, &txLimits); + sensors[0].first = sensorTemperatures.sensor_tx_modul.isValid(); + sensors[0].second = sensorTemperatures.sensor_tx_modul.value; + sensors[1].first = sensorTemperatures.sensor_x8.isValid(); + sensors[1].second = sensorTemperatures.sensor_x8.value; + sensors[2].first = sensorTemperatures.sensor_mpa.isValid(); + sensors[2].second = sensorTemperatures.sensor_mpa.value; + numSensors = 3; + ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, txLimits); } void ThermalController::ctrlMpa() { - ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, - sensorTemperatures.sensor_mpa, sensorTemperatures.sensor_hpa, - sensorTemperatures.sensor_tx_modul, &mpaLimits); + sensors[0].first = sensorTemperatures.sensor_mpa.isValid(); + sensors[0].second = sensorTemperatures.sensor_mpa.value; + sensors[1].first = sensorTemperatures.sensor_hpa.isValid(); + sensors[1].second = sensorTemperatures.sensor_hpa.value; + sensors[2].first = sensorTemperatures.sensor_tx_modul.isValid(); + sensors[2].second = sensorTemperatures.sensor_tx_modul.value; + numSensors = 3; + ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, mpaLimits); } void ThermalController::ctrlHpa() { - ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, - sensorTemperatures.sensor_hpa, sensorTemperatures.sensor_x8, - sensorTemperatures.sensor_mpa, &hpaLimits); + sensors[0].first = sensorTemperatures.sensor_hpa.isValid(); + sensors[0].second = sensorTemperatures.sensor_hpa.value; + sensors[1].first = sensorTemperatures.sensor_x8.isValid(); + sensors[1].second = sensorTemperatures.sensor_x8.value; + sensors[2].first = sensorTemperatures.sensor_mpa.isValid(); + sensors[2].second = sensorTemperatures.sensor_mpa.value; + numSensors = 3; + ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_4_CAMERA, hpaLimits); if (componentAboveCutOffLimit) { triggerEvent(HPA_OVERHEATING); } } void ThermalController::ctrlScexBoard() { - ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_5_STR, - sensorTemperatures.sensor_scex, sensorTemperatures.sensor_x8, - sensorTemperatures.sensor_hpa, &scexBoardLimits); + sensors[0].first = sensorTemperatures.sensor_scex.isValid(); + sensors[0].second = sensorTemperatures.sensor_scex.value; + sensors[1].first = sensorTemperatures.sensor_x8.isValid(); + sensors[1].second = sensorTemperatures.sensor_x8.value; + sensors[2].first = sensorTemperatures.sensor_hpa.isValid(); + sensors[2].second = sensorTemperatures.sensor_hpa.value; + numSensors = 3; + ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_5_STR, scexBoardLimits); } void ThermalController::ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, From 18af6228a0d617f47b0a56a457d9e57a825733ab Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 7 Feb 2023 09:30:20 +0100 Subject: [PATCH 167/330] added final calibration matrices --- mission/controller/acs/AcsParameters.h | 41 +++++++++++++------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index 1fe5f29c..ab8114bb 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -37,27 +37,28 @@ class AcsParameters /*: public HasParametersIF*/ { float mgm3orientationMatrix[3][3] = {{0, 0, 1}, {0, -1, 0}, {1, 0, 0}}; float mgm4orientationMatrix[3][3] = {{0, 0, -1}, {-1, 0, 0}, {0, 1, 0}}; - float mgm0hardIronOffset[3] = {3.303907e0,4.009162e0,-1.677380e1}; - float mgm1hardIronOffset[3] = {-2.494258e0,3.526886e0,3.593006e0}; - float mgm2hardIronOffset[3] = {-1.630907e1,5.543566e0,-1.619287e1}; - float mgm3hardIronOffset[3] = {-8.612960e-1,2.752825e0,-1.101764e0}; - float mgm4hardIronOffset[3] = {1.696131e0,4.624440e0,2.449785e-1}; + float mgm0hardIronOffset[3] = {6.116487, 6.796264, -19.188060}; + float mgm1hardIronOffset[3] = {-1.077152, 2.080583, 1.974483}; + float mgm2hardIronOffset[3] = {-19.285857, 5.401821, -16.096297}; + float mgm3hardIronOffset[3] = {-0.634033, 2.787695, 0.092036}; + float mgm4hardIronOffset[3] = {1.722133, 4.511870, 0.379980}; + + float mgm0softIronInverse[3][3] = {{1.163335, 0.137584, 0.203908}, + {0.137584, 0.625606, 0.045537}, + {0.203908, 0.045537, 1.095923}}; + float mgm1softIronInverse[3][3] = {{0.972071, 0.131166, 0.042151}, + {0.131166, 0.803260, 0.034779}, + {0.042151, 0.034779, 0.923417}}; + float mgm2softIronInverse[3][3] = {{1.234863, -0.157745, 0.070813}, + {-0.157745, 0.746707, -0.062080}, + {0.070813, -0.062080, 1.122514}}; + float mgm3softIronInverse[3][3] = {{0.956890, -0.134841, 0.054017}, + {-0.134841, 0.811361, -0.015383}, + {0.054017, -0.015383, 0.939153}}; + float mgm4softIronInverse[3][3] = {{0.913163, 0.011058, 0.023273}, + {0.011058, 0.792295, 0.002921}, + {0.023273, 0.002921, 0.739496}}; - float mgm0softIronInverse[3][3] = {{9.687712e-1,1.144510e-2,-9.601610e-2}, - {1.144510e-2,1.391574e0,-1.169994e-1}, - {-9.601610e-2,-1.169994e-1,1.025668e0}}; - float mgm1softIronInverse[3][3] = {{1.086339e0,-4.341287e-2,-5.870281e-2}, - {-4.341287e-2,1.274588e0,-1.893176e-1}, - {-5.870281e-2,-1.893176e-1,1.077651e0}}; - float mgm2softIronInverse[3][3] = {{9.554406e-1,7.009618e-2,-7.924296e-2}, - {7.009618e-2,1.428436e0,1.504623e-1}, - {-7.924296e-2,1.504623e-1,9.978038e-1}}; - float mgm3softIronInverse[3][3] = {{1.091974e0,1.492663e-2-5.993296e-2}, - {1.492663e-2,1.263068e0,2.013953e-1}, - {-5.993296e-2,2.013953e-1,1.055083e0}}; - float mgm4softIronInverse[3][3] = {{1.100341e0,-7.430518e-4,-3.810031e-2}, - {-7.430518e-4,1.259561e0,-1.951225e-2}, - {-3.810031e-2,-1.951225e-2,1.342584e0}}; float mgm02variance[3] = {1, 1, 1}; float mgm13variance[3] = {1, 1, 1}; float mgm4variance[3] = {1, 1, 1}; From a9fcb6a183d6de7263ed48ef944cb8049e7fa85b Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 7 Feb 2023 09:46:19 +0100 Subject: [PATCH 168/330] update changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b15c4f12..c835c81c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,10 +17,17 @@ change warranting a new major release: # [unreleased] +## Changed + +- Readded calibration matrices for MGM calibration + ## Fixed - Bugfix in FSFW where the sequence flags of the PUS packets were set to continuation segment (0b00) instead of unsegmented (0b11). +- Bugfixes in 'SensofProcessing' where previously MGM values would be calibrated before being + transformed in body RF. However, the calibration values are in the body RF. Also fixed the + validity flag of 'mgmVecTotDerivative'. # [v1.23.0] 2023-02-01 From c8e376a625192f9ff46aaa0f493c54f73f0087b4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Feb 2023 10:03:51 +0100 Subject: [PATCH 169/330] add missing pool read guards --- linux/devices/GpsHyperionLinuxController.cpp | 61 +++++++++----------- linux/devices/GpsHyperionLinuxController.h | 7 ++- 2 files changed, 31 insertions(+), 37 deletions(-) diff --git a/linux/devices/GpsHyperionLinuxController.cpp b/linux/devices/GpsHyperionLinuxController.cpp index 6bbbcfb7..3c19ca72 100644 --- a/linux/devices/GpsHyperionLinuxController.cpp +++ b/linux/devices/GpsHyperionLinuxController.cpp @@ -44,6 +44,7 @@ ReturnValue_t GpsHyperionLinuxController::checkModeCommand(Mode_t mode, Submode_ } } if (mode == MODE_OFF) { + PoolReadGuard pg(&gpsSet); gpsSet.setValidity(false, true); } return returnvalue::OK; @@ -217,7 +218,7 @@ ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() { modeCommanded = false; } gpsSet.setValidity(false, true); - } else if (gps.satellites_used > 0) { + } else if (gps.satellites_used > 0 && validFix) { gpsSet.setValidity(true, true); } @@ -250,46 +251,20 @@ ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() { gpsSet.speed.setValid(false); } -#if LIBGPS_VERSION_MINOR <= 17 - gpsSet.unixSeconds.value = gps.fix.time; -#else - gpsSet.unixSeconds.value = gps.fix.time.tv_sec; -#endif timeval time = {}; - time.tv_sec = gpsSet.unixSeconds.value; #if LIBGPS_VERSION_MINOR <= 17 - double fractionalPart = gps.fix.time - std::floor(gps.fix.time); + gpsSet.unixSeconds.value = std::floor(gps.fix.time); + double fractionalPart = gps.fix.time - gpsSet.unixSeconds.value; time.tv_usec = fractionalPart * 1000.0 * 1000.0; #else + gpsSet.unixSeconds.value = gps.fix.time.tv_sec; time.tv_usec = gps.fix.time.tv_nsec / 1000; #endif - std::time_t t = std::time(nullptr); - if (time.tv_sec == t) { - timeIsConstantCounter++; - } else { - timeIsConstantCounter = 0; - } - if (timeInit and validFix) { - if (not utility::timeSanityCheck()) { -#if OBSW_VERBOSE_LEVEL >= 1 - time_t timeRaw = time.tv_sec; - std::tm *timeTm = std::gmtime(&timeRaw); - sif::info << "Setting invalid system time from GPS data directly: " - << std::put_time(timeTm, "%c %Z") << std::endl; -#endif - // For some reason, the clock needs to be somewhat correct for NTP to work. Really dumb.. - Clock::setClock(&time); - } - timeInit = false; - } - // If the received time does not change anymore for whatever reason, do not set it here - // to avoid stale times. Also, don't do it too often often to avoid jumping times - if (timeIsConstantCounter < 20 and timeUpdateCd.hasTimedOut()) { - // Update the system time here for now. NTP seems to be unable to do so for whatever reason. - // Further tests have shown that the time seems to be set by NTPD after some time.. - // Clock::setClock(&time); - timeUpdateCd.resetTimer(); - } + time.tv_sec = gpsSet.unixSeconds.value; + // If the time is totally wrong (e.g. year 2000 after system reset because we do not have a RTC + // and no time file available) we set it with the roughly valid time from the GPS. + // NTP might only work if the time difference between sys time and current time is not too large. + overwriteTimeIfNotSane(time, validFix); Clock::TimeOfDay_t timeOfDay = {}; Clock::convertTimevalToTimeOfDay(&time, &timeOfDay); @@ -325,3 +300,19 @@ ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() { } return returnvalue::OK; } + +void GpsHyperionLinuxController::overwriteTimeIfNotSane(timeval time, bool validFix) { + if (not timeInit and validFix) { + if (not utility::timeSanityCheck()) { +#if OBSW_VERBOSE_LEVEL >= 1 + time_t timeRaw = time.tv_sec; + std::tm *timeTm = std::gmtime(&timeRaw); + sif::info << "Overwriting invalid system time from GPS data directly: " + << std::put_time(timeTm, "%c %Z") << std::endl; +#endif + // For some reason, the clock needs to be somewhat correct for NTP to work. Really dumb.. + Clock::setClock(&time); + } + timeInit = true; + } +} diff --git a/linux/devices/GpsHyperionLinuxController.h b/linux/devices/GpsHyperionLinuxController.h index d2dc91b6..5b0a84cd 100644 --- a/linux/devices/GpsHyperionLinuxController.h +++ b/linux/devices/GpsHyperionLinuxController.h @@ -59,17 +59,20 @@ class GpsHyperionLinuxController : public ExtendedControllerBase { ReadModes readMode = ReadModes::SOCKET; Countdown maxTimeToReachFix = Countdown(MAX_SECONDS_TO_REACH_FIX * 1000); bool modeCommanded = true; - bool timeInit = true; + bool timeInit = false; bool gpsNotOpenSwitch = true; bool gpsReadFailedSwitch = true; bool debugHyperionGps = false; int32_t noModeSetCntr = 0; - uint32_t timeIsConstantCounter = 0; Countdown timeUpdateCd = Countdown(60); // Returns true if the function should be called again or false if other // controller handling can be done. bool readGpsDataFromGpsd(); + // If the time is totally wrong (e.g. year 2000 after system reset because we do not have a RTC) + // we set it with the roughly valid time from the GPS. For some reason, NTP might only work + // if the time difference between sys time and current time is not too large + void overwriteTimeIfNotSane(timeval time, bool validFix); }; #endif /* MISSION_DEVICES_GPSHYPERIONHANDLER_H_ */ From 07ca7388427e69586b6b3e7357e1ad20ab33fdb2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Feb 2023 10:12:28 +0100 Subject: [PATCH 170/330] some more tweaks --- linux/devices/GpsHyperionLinuxController.cpp | 23 ++++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/linux/devices/GpsHyperionLinuxController.cpp b/linux/devices/GpsHyperionLinuxController.cpp index 3c19ca72..c3e7bc73 100644 --- a/linux/devices/GpsHyperionLinuxController.cpp +++ b/linux/devices/GpsHyperionLinuxController.cpp @@ -225,25 +225,34 @@ ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() { gpsSet.satInUse.value = gps.satellites_used; gpsSet.satInView.value = gps.satellites_visible; + bool latValid = false; if (std::isfinite(gps.fix.latitude)) { // Negative latitude -> South direction gpsSet.latitude.value = gps.fix.latitude; - } else { - gpsSet.latitude.setValid(false); + if(gps.fix.mode >= 2) { + latValid = true; + } } + gpsSet.latitude.setValid(latValid); + bool longValid = false; if (std::isfinite(gps.fix.longitude)) { // Negative longitude -> West direction gpsSet.longitude.value = gps.fix.longitude; - } else { - gpsSet.longitude.setValid(false); + if(gps.fix.mode >= 2) { + longValid = true; + } } + gpsSet.latitude.setValid(longValid); + bool altitudeValid = false; if (std::isfinite(gps.fix.altitude)) { gpsSet.altitude.value = gps.fix.altitude; - } else { - gpsSet.altitude.setValid(false); + if(gps.fix.mode == 3) { + altitudeValid = true; + } } + gpsSet.altitude.setValid(altitudeValid); if (std::isfinite(gps.fix.speed)) { gpsSet.speed.value = gps.fix.speed; @@ -277,7 +286,7 @@ ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() { if (debugHyperionGps) { sif::info << "-- Hyperion GPS Data --" << std::endl; #if LIBGPS_VERSION_MINOR <= 17 - time_t timeRaw = gps.fix.time; + time_t timeRaw = gpsSet.unixSeconds.value; #else time_t timeRaw = gps.fix.time.tv_sec; #endif From 5d0a1858cce1a4cbe0b72893db8fd54baac2b07b Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 7 Feb 2023 10:20:36 +0100 Subject: [PATCH 171/330] onboard handling of GYR values changed from deg/s to rad/s --- mission/controller/acs/AcsParameters.h | 4 ++-- mission/controller/acs/SensorProcessing.cpp | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index ae174236..88802a46 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -915,8 +915,8 @@ class AcsParameters : public HasParametersIF { struct DetumbleParameter { uint8_t detumblecounter = 75; // 30 s - double omegaDetumbleStart = 2; - double omegaDetumbleEnd = 0.4; + double omegaDetumbleStart = 2 * M_PI / 180; + double omegaDetumbleEnd = 0.4 * M_PI / 180; double gainD = pow(10.0, -3.3); } detumbleParameter; }; diff --git a/mission/controller/acs/SensorProcessing.cpp b/mission/controller/acs/SensorProcessing.cpp index 9a1a9637..bfb38afc 100644 --- a/mission/controller/acs/SensorProcessing.cpp +++ b/mission/controller/acs/SensorProcessing.cpp @@ -477,6 +477,7 @@ void SensorProcessing::processGyr( const double gyr0Value[3] = {gyr0axXvalue, gyr0axYvalue, gyr0axZvalue}; MatrixOperations::multiply(gyrParameters->gyr0orientationMatrix[0], gyr0Value, gyr0ValueBody, 3, 3, 1); + VectorOperations::mulScalar(gyr0ValueBody, M_PI / 180, gyr0ValueBody, 3); for (uint8_t i = 0; i < 3; i++) { sensorFusionNumerator[i] += gyr0ValueBody[i] / gyrParameters->gyr02variance[i]; sensorFusionDenominator[i] += 1 / gyrParameters->gyr02variance[i]; @@ -486,6 +487,7 @@ void SensorProcessing::processGyr( const double gyr1Value[3] = {gyr1axXvalue, gyr1axYvalue, gyr1axZvalue}; MatrixOperations::multiply(gyrParameters->gyr1orientationMatrix[0], gyr1Value, gyr1ValueBody, 3, 3, 1); + VectorOperations::mulScalar(gyr1ValueBody, M_PI / 180, gyr1ValueBody, 3); for (uint8_t i = 0; i < 3; i++) { sensorFusionNumerator[i] += gyr1ValueBody[i] / gyrParameters->gyr13variance[i]; sensorFusionDenominator[i] += 1 / gyrParameters->gyr13variance[i]; @@ -495,6 +497,7 @@ void SensorProcessing::processGyr( const double gyr2Value[3] = {gyr2axXvalue, gyr2axYvalue, gyr2axZvalue}; MatrixOperations::multiply(gyrParameters->gyr2orientationMatrix[0], gyr2Value, gyr2ValueBody, 3, 3, 1); + VectorOperations::mulScalar(gyr2ValueBody, M_PI / 180, gyr2ValueBody, 3); for (uint8_t i = 0; i < 3; i++) { sensorFusionNumerator[i] += gyr2ValueBody[i] / gyrParameters->gyr02variance[i]; sensorFusionDenominator[i] += 1 / gyrParameters->gyr02variance[i]; @@ -504,6 +507,7 @@ void SensorProcessing::processGyr( const double gyr3Value[3] = {gyr3axXvalue, gyr3axYvalue, gyr3axZvalue}; MatrixOperations::multiply(gyrParameters->gyr3orientationMatrix[0], gyr3Value, gyr3ValueBody, 3, 3, 1); + VectorOperations::mulScalar(gyr3ValueBody, M_PI / 180, gyr3ValueBody, 3); for (uint8_t i = 0; i < 3; i++) { sensorFusionNumerator[i] += gyr3ValueBody[i] / gyrParameters->gyr13variance[i]; sensorFusionDenominator[i] += 1 / gyrParameters->gyr13variance[i]; From d6aa6875ccb88c2cca7f9ffd9d50698b081d4526 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Feb 2023 10:22:12 +0100 Subject: [PATCH 172/330] typos and other minor adaptions --- linux/devices/GpsHyperionLinuxController.cpp | 67 +++++++++++--------- 1 file changed, 38 insertions(+), 29 deletions(-) diff --git a/linux/devices/GpsHyperionLinuxController.cpp b/linux/devices/GpsHyperionLinuxController.cpp index c3e7bc73..7554b805 100644 --- a/linux/devices/GpsHyperionLinuxController.cpp +++ b/linux/devices/GpsHyperionLinuxController.cpp @@ -199,19 +199,17 @@ ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() { } bool validFix = false; - static_cast(validFix); // 0: Not seen, 1: No fix, 2: 2D-Fix, 3: 3D-Fix - int newFixMode = gps.fix.mode; - if (newFixMode == 2 or newFixMode == 3) { + if (gps.fix.mode == 2 or gps.fix.mode == 3) { validFix = true; } - if (gpsSet.fixMode.value != newFixMode) { - triggerEvent(GpsHyperion::GPS_FIX_CHANGE, gpsSet.fixMode.value, newFixMode); + if (gpsSet.fixMode.value != gps.fix.mode) { + triggerEvent(GpsHyperion::GPS_FIX_CHANGE, gpsSet.fixMode.value, gps.fix.mode); } - gpsSet.fixMode.value = newFixMode; + gpsSet.fixMode.value = gps.fix.mode; if (gps.fix.mode == 0 or gps.fix.mode == 1) { if (modeCommanded and maxTimeToReachFix.hasTimedOut()) { - // We are supposed to be on and functioning, but not fix was found + // We are supposed to be on and functioning, but no fix was found if (mode == MODE_ON or mode == MODE_NORMAL) { mode = MODE_OFF; } @@ -229,7 +227,7 @@ ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() { if (std::isfinite(gps.fix.latitude)) { // Negative latitude -> South direction gpsSet.latitude.value = gps.fix.latitude; - if(gps.fix.mode >= 2) { + if (gps.fix.mode >= 2) { latValid = true; } } @@ -239,7 +237,7 @@ ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() { if (std::isfinite(gps.fix.longitude)) { // Negative longitude -> West direction gpsSet.longitude.value = gps.fix.longitude; - if(gps.fix.mode >= 2) { + if (gps.fix.mode >= 2) { longValid = true; } } @@ -248,7 +246,7 @@ ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() { bool altitudeValid = false; if (std::isfinite(gps.fix.altitude)) { gpsSet.altitude.value = gps.fix.altitude; - if(gps.fix.mode == 3) { + if (gps.fix.mode == 3) { altitudeValid = true; } } @@ -260,29 +258,40 @@ ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() { gpsSet.speed.setValid(false); } - timeval time = {}; + if (TIME_SET != (TIME_SET & gps.set)) { + timeval time = {}; #if LIBGPS_VERSION_MINOR <= 17 - gpsSet.unixSeconds.value = std::floor(gps.fix.time); - double fractionalPart = gps.fix.time - gpsSet.unixSeconds.value; - time.tv_usec = fractionalPart * 1000.0 * 1000.0; + gpsSet.unixSeconds.value = std::floor(gps.fix.time); + double fractionalPart = gps.fix.time - gpsSet.unixSeconds.value; + time.tv_usec = fractionalPart * 1000.0 * 1000.0; #else - gpsSet.unixSeconds.value = gps.fix.time.tv_sec; - time.tv_usec = gps.fix.time.tv_nsec / 1000; + gpsSet.unixSeconds.value = gps.fix.time.tv_sec; + time.tv_usec = gps.fix.time.tv_nsec / 1000; #endif - time.tv_sec = gpsSet.unixSeconds.value; - // If the time is totally wrong (e.g. year 2000 after system reset because we do not have a RTC - // and no time file available) we set it with the roughly valid time from the GPS. - // NTP might only work if the time difference between sys time and current time is not too large. - overwriteTimeIfNotSane(time, validFix); + time.tv_sec = gpsSet.unixSeconds.value; + // If the time is totally wrong (e.g. year 2000 after system reset because we do not have a RTC + // and no time file available) we set it with the roughly valid time from the GPS. + // NTP might only work if the time difference between sys time and current time is not too + // large. + overwriteTimeIfNotSane(time, validFix); + Clock::TimeOfDay_t timeOfDay = {}; + Clock::convertTimevalToTimeOfDay(&time, &timeOfDay); + gpsSet.year = timeOfDay.year; + gpsSet.month = timeOfDay.month; + gpsSet.day = timeOfDay.day; + gpsSet.hours = timeOfDay.hour; + gpsSet.minutes = timeOfDay.minute; + gpsSet.seconds = timeOfDay.second; + } else { + gpsSet.unixSeconds.setValid(false); + gpsSet.year.setValid(false); + gpsSet.month.setValid(false); + gpsSet.day.setValid(false); + gpsSet.hours.setValid(false); + gpsSet.minutes.setValid(false); + gpsSet.seconds.setValid(false); + } - Clock::TimeOfDay_t timeOfDay = {}; - Clock::convertTimevalToTimeOfDay(&time, &timeOfDay); - gpsSet.year = timeOfDay.year; - gpsSet.month = timeOfDay.month; - gpsSet.day = timeOfDay.day; - gpsSet.hours = timeOfDay.hour; - gpsSet.minutes = timeOfDay.minute; - gpsSet.seconds = timeOfDay.second; if (debugHyperionGps) { sif::info << "-- Hyperion GPS Data --" << std::endl; #if LIBGPS_VERSION_MINOR <= 17 From 5f9a445aa22f87a9f4ffd80d8df5f3e7b6a189cd Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 7 Feb 2023 10:29:28 +0100 Subject: [PATCH 173/330] added bias removal for GYR --- mission/controller/acs/AcsParameters.h | 6 ++++++ mission/controller/acs/SensorProcessing.cpp | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index 88802a46..1ffb33c7 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -770,6 +770,12 @@ class AcsParameters : public HasParametersIF { double gyr1orientationMatrix[3][3] = {{0, 0, -1}, {0, 1, 0}, {1, 0, 0}}; double gyr2orientationMatrix[3][3] = {{0, 0, -1}, {0, -1, 0}, {-1, 0, 0}}; double gyr3orientationMatrix[3][3] = {{0, 0, -1}, {0, 1, 0}, {1, 0, 0}}; + + double gyr0bias[3] = {0.06318149743589743, 0.4283235025641024, -0.16383500000000004}; + double gyr1bias[3] = {-0.12855128205128205, 1.6737307692307695, 1.031724358974359}; + double gyr2bias[3] = {0.15039212820512823, 0.7094475589743591, -0.22298363589743594}; + double gyr3bias[3] = {0.0021730769230769217, -0.6655897435897435, 0.034096153846153845}; + /* var = sqrt(sigma), sigma = RND*sqrt(freq), following values are RND^2 and not var as freq is * assumed to be equal for the same class of sensors */ float gyr02variance[3] = {pow(3.0e-3 * sqrt(2), 2), // RND_x = 3.0e-3 deg/s/sqrt(Hz) rms diff --git a/mission/controller/acs/SensorProcessing.cpp b/mission/controller/acs/SensorProcessing.cpp index bfb38afc..0496e7e9 100644 --- a/mission/controller/acs/SensorProcessing.cpp +++ b/mission/controller/acs/SensorProcessing.cpp @@ -477,6 +477,7 @@ void SensorProcessing::processGyr( const double gyr0Value[3] = {gyr0axXvalue, gyr0axYvalue, gyr0axZvalue}; MatrixOperations::multiply(gyrParameters->gyr0orientationMatrix[0], gyr0Value, gyr0ValueBody, 3, 3, 1); + VectorOperations::subtract(gyr0ValueBody, gyrParameters->gyr0bias, gyr0ValueBody, 3); VectorOperations::mulScalar(gyr0ValueBody, M_PI / 180, gyr0ValueBody, 3); for (uint8_t i = 0; i < 3; i++) { sensorFusionNumerator[i] += gyr0ValueBody[i] / gyrParameters->gyr02variance[i]; @@ -487,6 +488,7 @@ void SensorProcessing::processGyr( const double gyr1Value[3] = {gyr1axXvalue, gyr1axYvalue, gyr1axZvalue}; MatrixOperations::multiply(gyrParameters->gyr1orientationMatrix[0], gyr1Value, gyr1ValueBody, 3, 3, 1); + VectorOperations::subtract(gyr1ValueBody, gyrParameters->gyr1bias, gyr1ValueBody, 3); VectorOperations::mulScalar(gyr1ValueBody, M_PI / 180, gyr1ValueBody, 3); for (uint8_t i = 0; i < 3; i++) { sensorFusionNumerator[i] += gyr1ValueBody[i] / gyrParameters->gyr13variance[i]; @@ -497,6 +499,7 @@ void SensorProcessing::processGyr( const double gyr2Value[3] = {gyr2axXvalue, gyr2axYvalue, gyr2axZvalue}; MatrixOperations::multiply(gyrParameters->gyr2orientationMatrix[0], gyr2Value, gyr2ValueBody, 3, 3, 1); + VectorOperations::subtract(gyr2ValueBody, gyrParameters->gyr2bias, gyr2ValueBody, 3); VectorOperations::mulScalar(gyr2ValueBody, M_PI / 180, gyr2ValueBody, 3); for (uint8_t i = 0; i < 3; i++) { sensorFusionNumerator[i] += gyr2ValueBody[i] / gyrParameters->gyr02variance[i]; @@ -507,6 +510,7 @@ void SensorProcessing::processGyr( const double gyr3Value[3] = {gyr3axXvalue, gyr3axYvalue, gyr3axZvalue}; MatrixOperations::multiply(gyrParameters->gyr3orientationMatrix[0], gyr3Value, gyr3ValueBody, 3, 3, 1); + VectorOperations::subtract(gyr3ValueBody, gyrParameters->gyr3bias, gyr3ValueBody, 3); VectorOperations::mulScalar(gyr3ValueBody, M_PI / 180, gyr3ValueBody, 3); for (uint8_t i = 0; i < 3; i++) { sensorFusionNumerator[i] += gyr3ValueBody[i] / gyrParameters->gyr13variance[i]; From b6022d2ff15306aab9bce23019184824804405b5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Feb 2023 10:34:09 +0100 Subject: [PATCH 174/330] should be covered by PST now --- bsp_q7s/core/scheduling.cpp | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index c85c7ff0..150efa97 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -216,35 +216,6 @@ void scheduling::initTasks() { scheduling::printAddObjectError("ACS_SUBSYSTEM", objects::ACS_SUBSYSTEM); } -#if OBSW_Q7S_EM == 1 - acsSysTask->addComponent(objects::MGM_0_LIS3_HANDLER); - acsSysTask->addComponent(objects::MGM_1_RM3100_HANDLER); - acsSysTask->addComponent(objects::MGM_2_LIS3_HANDLER); - acsSysTask->addComponent(objects::MGM_3_RM3100_HANDLER); - acsSysTask->addComponent(objects::IMTQ_HANDLER); - acsSysTask->addComponent(objects::SUS_0_N_LOC_XFYFZM_PT_XF); - acsSysTask->addComponent(objects::SUS_6_R_LOC_XFYBZM_PT_XF); - acsSysTask->addComponent(objects::SUS_1_N_LOC_XBYFZM_PT_XB); - acsSysTask->addComponent(objects::SUS_7_R_LOC_XBYBZM_PT_XB); - acsSysTask->addComponent(objects::SUS_2_N_LOC_XFYBZB_PT_YB); - acsSysTask->addComponent(objects::SUS_8_R_LOC_XBYBZB_PT_YB); - acsSysTask->addComponent(objects::SUS_3_N_LOC_XFYBZF_PT_YF); - acsSysTask->addComponent(objects::SUS_9_R_LOC_XBYBZB_PT_YF); - acsSysTask->addComponent(objects::SUS_4_N_LOC_XMYFZF_PT_ZF); - acsSysTask->addComponent(objects::SUS_10_N_LOC_XMYBZF_PT_ZF); - acsSysTask->addComponent(objects::SUS_5_N_LOC_XFYMZB_PT_ZB); - acsSysTask->addComponent(objects::SUS_11_R_LOC_XBYMZB_PT_ZB); - acsSysTask->addComponent(objects::GYRO_0_ADIS_HANDLER); - acsSysTask->addComponent(objects::GYRO_1_L3G_HANDLER); - acsSysTask->addComponent(objects::GYRO_2_ADIS_HANDLER); - acsSysTask->addComponent(objects::GYRO_3_L3G_HANDLER); - acsSysTask->addComponent(objects::GPS_CONTROLLER); - acsSysTask->addComponent(objects::STAR_TRACKER); - acsSysTask->addComponent(objects::RW1); - acsSysTask->addComponent(objects::RW2); - acsSysTask->addComponent(objects::RW3); - acsSysTask->addComponent(objects::RW4); -#endif #if OBSW_ADD_RTD_DEVICES == 1 PeriodicTaskIF* tcsPollingTask = factory->createPeriodicTask( "TCS_POLLING_TASK", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.5, missedDeadlineFunc); From d6b60723d9e6e3942cbb095e8123d422c93b6ee4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Feb 2023 12:53:30 +0100 Subject: [PATCH 175/330] bump fsfw --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 38789e05..69c94645 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 38789e053b65cfa14604fc625e7bcc8ca03a3f17 +Subproject commit 69c94645df81c2fc9d538a0f19d2c6552e1c73a7 From e3cc45d7e3cb8540a8a755d5e3a1b61eab3fff96 Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 7 Feb 2023 13:09:42 +0100 Subject: [PATCH 176/330] merge aftermath: - fixed missing declarations of functions - fixed use of deprecated submode definitions - changed naming of some submodes --- mission/acsDefs.h | 6 ++--- mission/controller/AcsController.cpp | 18 ++++++------- mission/controller/AcsController.h | 5 ++++ mission/system/tree/acsModeTree.cpp | 39 ++++++++++++++-------------- 4 files changed, 37 insertions(+), 31 deletions(-) diff --git a/mission/acsDefs.h b/mission/acsDefs.h index 8869d6ff..72a445c8 100644 --- a/mission/acsDefs.h +++ b/mission/acsDefs.h @@ -10,11 +10,11 @@ enum CtrlSubmode { OFF = HasModesIF::MODE_OFF, SAFE = 10, DETUMBLE = 11, - IDLE = 12, - PTG_TARGET_NADIR = 13, + PTG_IDLE = 12, + PTG_NADIR = 13, PTG_TARGET = 14, PTG_TARGET_GS = 15, - PTG_TARGET_INERTIAL = 16, + PTG_INERTIAL = 16, }; static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::ACS_SUBSYSTEM; diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 868f353a..ff06558d 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -71,11 +71,11 @@ void AcsController::performControlOperation() { case acs::DETUMBLE: performDetumble(); break; - case acs::IDLE: + case acs::PTG_IDLE: case acs::PTG_TARGET: - case acs::PTG_TARGET_GS: - case acs::PTG_TARGET_NADIR: - case acs::PTG_TARGET_INERTIAL: + case acs::PTG_TARGET_GS: + case acs::PTG_NADIR: + case acs::PTG_INERTIAL: performPointingCtrl(); break; } @@ -282,7 +282,7 @@ void AcsController::performPointingCtrl() { double mgtDpDes[3] = {0, 0, 0}, dipolUnits[3] = {0, 0, 0}; // Desaturation Dipol switch (submode) { - case SUBMODE_IDLE: + case acs::PTG_IDLE: guidance.sunQuatPtg(&sensorValues, &mekfData, &susDataProcessed, &gpsDataProcessed, now, targetQuat, refSatRate); std::memcpy(quatRef, acsParameters.targetModeControllerParameters.quatRef, @@ -306,7 +306,7 @@ void AcsController::performPointingCtrl() { break; - case SUBMODE_PTG_TARGET: + case acs::PTG_TARGET: guidance.targetQuatPtgThreeAxes(&sensorValues, &gpsDataProcessed, &mekfData, now, targetQuat, refSatRate); std::memcpy(quatRef, acsParameters.targetModeControllerParameters.quatRef, @@ -329,7 +329,7 @@ void AcsController::performPointingCtrl() { &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), mgtDpDes); break; - case SUBMODE_PTG_TARGET_GS: + case acs::PTG_TARGET_GS: guidance.targetQuatPtgGs(&sensorValues, &mekfData, &susDataProcessed, &gpsDataProcessed, now, targetQuat, refSatRate); std::memcpy(quatRef, acsParameters.targetModeControllerParameters.quatRef, @@ -352,7 +352,7 @@ void AcsController::performPointingCtrl() { &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), mgtDpDes); break; - case SUBMODE_PTG_NADIR: + case acs::PTG_NADIR: guidance.quatNadirPtgThreeAxes(&sensorValues, &gpsDataProcessed, &mekfData, now, targetQuat, refSatRate); std::memcpy(quatRef, acsParameters.nadirModeControllerParameters.quatRef, 4 * sizeof(double)); @@ -374,7 +374,7 @@ void AcsController::performPointingCtrl() { &(sensorValues.rw3Set.currSpeed.value), &(sensorValues.rw4Set.currSpeed.value), mgtDpDes); break; - case SUBMODE_PTG_INERTIAL: + case acs::PTG_INERTIAL: guidance.inertialQuatPtg(targetQuat, refSatRate); std::memcpy(quatRef, acsParameters.inertialModeControllerParameters.quatRef, 4 * sizeof(double)); diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index 265af19c..6a18e988 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -26,6 +26,11 @@ class AcsController : public ExtendedControllerBase, public ReceivesParameterMes AcsController(object_id_t objectId); + MessageQueueId_t getCommandQueue() const; + ReturnValue_t getParameter(uint8_t domainId, uint8_t parameterId, + ParameterWrapper* parameterWrapper, const ParameterWrapper* newValues, + uint16_t startAtIndex) override; + protected: void performSafe(); void performDetumble(); diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index 849959f9..88b4db19 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -55,13 +55,14 @@ auto ACS_TABLE_SAFE_TRANS_0 = auto ACS_TABLE_SAFE_TRANS_1 = std::make_pair((acs::CtrlSubmode::SAFE << 24) | 3, FixedArrayList()); -auto ACS_SEQUENCE_IDLE = std::make_pair(acs::CtrlSubmode::IDLE, FixedArrayList()); +auto ACS_SEQUENCE_IDLE = + std::make_pair(acs::CtrlSubmode::PTG_IDLE, FixedArrayList()); auto ACS_TABLE_IDLE_TGT = - std::make_pair((acs::CtrlSubmode::IDLE << 24) | 1, FixedArrayList()); + std::make_pair((acs::CtrlSubmode::PTG_IDLE << 24) | 1, FixedArrayList()); auto ACS_TABLE_IDLE_TRANS_0 = - std::make_pair((acs::CtrlSubmode::IDLE << 24) | 2, FixedArrayList()); + std::make_pair((acs::CtrlSubmode::PTG_IDLE << 24) | 2, FixedArrayList()); auto ACS_TABLE_IDLE_TRANS_1 = - std::make_pair((acs::CtrlSubmode::IDLE << 24) | 3, FixedArrayList()); + std::make_pair((acs::CtrlSubmode::PTG_IDLE << 24) | 3, FixedArrayList()); auto ACS_TABLE_PTG_TRANS_0 = std::make_pair((acs::CtrlSubmode::PTG_TARGET << 24) | 2, FixedArrayList()); @@ -81,18 +82,18 @@ auto ACS_TABLE_PTG_TARGET_GS_TRANS_1 = std::make_pair((acs::CtrlSubmode::PTG_TARGET_GS << 24) | 3, FixedArrayList()); auto ACS_SEQUENCE_PTG_TARGET_NADIR = - std::make_pair(acs::CtrlSubmode::PTG_TARGET_NADIR, FixedArrayList()); -auto ACS_TABLE_PTG_TARGET_NADIR_TGT = std::make_pair((acs::CtrlSubmode::PTG_TARGET_NADIR << 24) | 1, - FixedArrayList()); -auto ACS_TABLE_PTG_TARGET_NADIR_TRANS_1 = std::make_pair( - (acs::CtrlSubmode::PTG_TARGET_NADIR << 24) | 3, FixedArrayList()); + std::make_pair(acs::CtrlSubmode::PTG_NADIR, FixedArrayList()); +auto ACS_TABLE_PTG_TARGET_NADIR_TGT = + std::make_pair((acs::CtrlSubmode::PTG_NADIR << 24) | 1, FixedArrayList()); +auto ACS_TABLE_PTG_TARGET_NADIR_TRANS_1 = + std::make_pair((acs::CtrlSubmode::PTG_NADIR << 24) | 3, FixedArrayList()); auto ACS_SEQUENCE_PTG_TARGET_INERTIAL = - std::make_pair(acs::CtrlSubmode::PTG_TARGET_INERTIAL, FixedArrayList()); -auto ACS_TABLE_PTG_TARGET_INERTIAL_TGT = std::make_pair( - (acs::CtrlSubmode::PTG_TARGET_INERTIAL << 24) | 1, FixedArrayList()); -auto ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1 = std::make_pair( - (acs::CtrlSubmode::PTG_TARGET_INERTIAL << 24) | 3, FixedArrayList()); + std::make_pair(acs::CtrlSubmode::PTG_INERTIAL, FixedArrayList()); +auto ACS_TABLE_PTG_TARGET_INERTIAL_TGT = + std::make_pair((acs::CtrlSubmode::PTG_INERTIAL << 24) | 1, FixedArrayList()); +auto ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1 = + std::make_pair((acs::CtrlSubmode::PTG_INERTIAL << 24) | 3, FixedArrayList()); void satsystem::acs::init() { ModeListEntry entry; @@ -291,7 +292,7 @@ void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) { check(sequence.insert(eh), ctxc); }; // Build IDLE target - iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::IDLE, ACS_TABLE_IDLE_TGT.second); + iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_IDLE, ACS_TABLE_IDLE_TGT.second); iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_TGT.second); iht(objects::RW_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second); @@ -307,7 +308,7 @@ void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) { ss.addTable(&ACS_TABLE_IDLE_TRANS_0.second, ACS_TABLE_IDLE_TRANS_0.first, false, true); // Build IDLE transition 1 - iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::IDLE, ACS_TABLE_IDLE_TRANS_1.second); + iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_IDLE, ACS_TABLE_IDLE_TRANS_1.second); ss.addTable(&ACS_TABLE_IDLE_TRANS_1.second, ACS_TABLE_IDLE_TRANS_1.first, false, true); // Build IDLE sequence @@ -399,7 +400,7 @@ void buildTargetPtNadirSequence(Subsystem& ss, ModeListEntry& eh) { // Transition 0 already built // Build TARGET PT transition 1 - iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET_NADIR, + iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_NADIR, ACS_TABLE_PTG_TARGET_NADIR_TRANS_1.second); check(ss.addTable(TableEntry(ACS_TABLE_PTG_TARGET_NADIR_TRANS_1.first, &ACS_TABLE_PTG_TARGET_NADIR_TRANS_1.second)), @@ -485,7 +486,7 @@ void buildTargetPtInertialSequence(Subsystem& ss, ModeListEntry& eh) { }; // Build TARGET PT table - iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET_INERTIAL, + iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_INERTIAL, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second); iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second); @@ -498,7 +499,7 @@ void buildTargetPtInertialSequence(Subsystem& ss, ModeListEntry& eh) { // Transition 0 already built // Build TARGET PT transition 1 - iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET_INERTIAL, + iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_INERTIAL, ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1.second); check(ss.addTable(TableEntry(ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1.first, &ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1.second)), From afbaec8e2d7b92020c60590939b4e7423150175c Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 7 Feb 2023 13:10:57 +0100 Subject: [PATCH 177/330] removed deprecated struct --- mission/controller/acs/AcsParameters.h | 9 --------- 1 file changed, 9 deletions(-) diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index 1ffb33c7..b905cf47 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -74,7 +74,6 @@ class AcsParameters : public HasParametersIF { float mgm02variance[3] = {1, 1, 1}; float mgm13variance[3] = {1, 1, 1}; float mgm4variance[3] = {1, 1, 1}; - } mgmHandlingParameters; struct SusHandlingParameters { @@ -823,7 +822,6 @@ class AcsParameters : public HasParametersIF { double sunTargetDir[3] = {0, 0, 1}; double satRateRef[3] = {0, 0, 0}; - } safeModeControllerParameters; struct PointingLawParameters { @@ -837,7 +835,6 @@ class AcsParameters : public HasParametersIF { double deSatGainFactor = 1000; uint8_t desatOn = true; uint8_t enableAntiStiction = true; - } pointingLawParameters; struct TargetModeControllerParameters : PointingLawParameters { @@ -880,12 +877,6 @@ class AcsParameters : public HasParametersIF { double timeDiffVelocityMax = 30; //[s] } gpsParameters; - struct ptgTargetParameters { // Default is Stuttgart GS - double latitudeTgt = 48.7495 * M_PI / 180.; // [rad] Latitude - double longitudeTgt = 9.10384 * M_PI / 180.; // [rad] Longitude - double altitudeTgt = 500; // [m] Altitude - } ptgTargetParameters; - struct SunModelParameters { float domega = 36000.771; float omega_0 = 280.46 * M_PI / 180.; // RAAN plus argument of From 454d56935c09274b35c22be8bc31f3ce483abed0 Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 7 Feb 2023 13:11:57 +0100 Subject: [PATCH 178/330] fixed getParameter to match defined structs again --- mission/controller/acs/AcsParameters.cpp | 200 +++++++++++++++++------ 1 file changed, 148 insertions(+), 52 deletions(-) diff --git a/mission/controller/acs/AcsParameters.cpp b/mission/controller/acs/AcsParameters.cpp index 6bbb5519..13642fe9 100644 --- a/mission/controller/acs/AcsParameters.cpp +++ b/mission/controller/acs/AcsParameters.cpp @@ -237,12 +237,24 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, parameterWrapper->set(gyrHandlingParameters.gyr3orientationMatrix); break; case 0x4: - parameterWrapper->set(gyrHandlingParameters.gyr02variance); + parameterWrapper->set(gyrHandlingParameters.gyr0bias); break; case 0x5: - parameterWrapper->set(gyrHandlingParameters.gyr13variance); + parameterWrapper->set(gyrHandlingParameters.gyr1bias); break; case 0x6: + parameterWrapper->set(gyrHandlingParameters.gyr2bias); + break; + case 0x7: + parameterWrapper->set(gyrHandlingParameters.gyr3bias); + break; + case 0x8: + parameterWrapper->set(gyrHandlingParameters.gyr02variance); + break; + case 0x9: + parameterWrapper->set(gyrHandlingParameters.gyr13variance); + break; + case 0xA: parameterWrapper->set(gyrHandlingParameters.preferAdis); break; default: @@ -327,58 +339,157 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, return INVALID_IDENTIFIER_ID; } break; - case (0x9): // PointingModeControllerParameters + case (0x9): // TargetModeControllerParameters switch (parameterId) { case 0x0: - parameterWrapper->set(targetModeControllerParameters.refDirection); - break; - case 0x1: - parameterWrapper->set(targetModeControllerParameters.refRotRate); - break; - case 0x2: - parameterWrapper->set(targetModeControllerParameters.quatRef); - break; - case 0x3: - parameterWrapper->set(targetModeControllerParameters.avoidBlindStr); - break; - case 0x4: - parameterWrapper->set(targetModeControllerParameters.blindAvoidStart); - break; - case 0x5: - parameterWrapper->set(targetModeControllerParameters.blindAvoidStop); - break; - case 0x6: - parameterWrapper->set(targetModeControllerParameters.blindRotRate); - break; - case 0x7: parameterWrapper->set(targetModeControllerParameters.zeta); break; - case 0x8: + case 0x1: parameterWrapper->set(targetModeControllerParameters.om); break; - case 0x9: + case 0x2: parameterWrapper->set(targetModeControllerParameters.omMax); break; - case 0xA: + case 0x3: parameterWrapper->set(targetModeControllerParameters.qiMin); break; - case 0xB: + case 0x4: parameterWrapper->set(targetModeControllerParameters.gainNullspace); break; - case 0xC: + case 0x5: parameterWrapper->set(targetModeControllerParameters.desatMomentumRef); break; - case 0xD: + case 0x6: parameterWrapper->set(targetModeControllerParameters.deSatGainFactor); break; - case 0xE: + case 0x7: parameterWrapper->set(targetModeControllerParameters.desatOn); break; + case 0x8: + parameterWrapper->set(targetModeControllerParameters.enableAntiStiction); + break; + case 0x9: + parameterWrapper->set(targetModeControllerParameters.refDirection); + break; + case 0xA: + parameterWrapper->set(targetModeControllerParameters.refRotRate); + break; + case 0xB: + parameterWrapper->set(targetModeControllerParameters.quatRef); + break; + case 0xC: + parameterWrapper->set(targetModeControllerParameters.timeElapsedMax); + break; + case 0xD: + parameterWrapper->set(targetModeControllerParameters.latitudeTgt); + break; + case 0xE: + parameterWrapper->set(targetModeControllerParameters.longitudeTgt); + break; + case 0xF: + parameterWrapper->set(targetModeControllerParameters.altitudeTgt); + break; + case 0x10: + parameterWrapper->set(targetModeControllerParameters.avoidBlindStr); + break; + case 0x11: + parameterWrapper->set(targetModeControllerParameters.blindAvoidStart); + break; + case 0x12: + parameterWrapper->set(targetModeControllerParameters.blindAvoidStop); + break; + case 0x13: + parameterWrapper->set(targetModeControllerParameters.blindRotRate); + break; default: return INVALID_IDENTIFIER_ID; } break; - case (0xA): // StrParameters + case (0xA): // NadirModeControllerParameters + switch (parameterId) { + case 0x0: + parameterWrapper->set(nadirModeControllerParameters.zeta); + break; + case 0x1: + parameterWrapper->set(nadirModeControllerParameters.om); + break; + case 0x2: + parameterWrapper->set(nadirModeControllerParameters.omMax); + break; + case 0x3: + parameterWrapper->set(nadirModeControllerParameters.qiMin); + break; + case 0x4: + parameterWrapper->set(nadirModeControllerParameters.gainNullspace); + break; + case 0x5: + parameterWrapper->set(nadirModeControllerParameters.desatMomentumRef); + break; + case 0x6: + parameterWrapper->set(nadirModeControllerParameters.deSatGainFactor); + break; + case 0x7: + parameterWrapper->set(nadirModeControllerParameters.desatOn); + break; + case 0x8: + parameterWrapper->set(nadirModeControllerParameters.enableAntiStiction); + break; + case 0x9: + parameterWrapper->set(nadirModeControllerParameters.refDirection); + break; + case 0xA: + parameterWrapper->set(nadirModeControllerParameters.quatRef); + break; + case 0xC: + parameterWrapper->set(nadirModeControllerParameters.timeElapsedMax); + break; + default: + return INVALID_IDENTIFIER_ID; + } + break; + case (0xB): // InertialModeControllerParameters + switch (parameterId) { + case 0x0: + parameterWrapper->set(inertialModeControllerParameters.zeta); + break; + case 0x1: + parameterWrapper->set(inertialModeControllerParameters.om); + break; + case 0x2: + parameterWrapper->set(inertialModeControllerParameters.omMax); + break; + case 0x3: + parameterWrapper->set(inertialModeControllerParameters.qiMin); + break; + case 0x4: + parameterWrapper->set(inertialModeControllerParameters.gainNullspace); + break; + case 0x5: + parameterWrapper->set(inertialModeControllerParameters.desatMomentumRef); + break; + case 0x6: + parameterWrapper->set(inertialModeControllerParameters.deSatGainFactor); + break; + case 0x7: + parameterWrapper->set(inertialModeControllerParameters.desatOn); + break; + case 0x8: + parameterWrapper->set(inertialModeControllerParameters.enableAntiStiction); + break; + case 0x9: + parameterWrapper->set(inertialModeControllerParameters.tgtQuat); + break; + case 0xA: + parameterWrapper->set(inertialModeControllerParameters.refRotRate); + break; + case 0xC: + parameterWrapper->set(inertialModeControllerParameters.quatRef); + break; + default: + return INVALID_IDENTIFIER_ID; + } + break; + case (0xC): // StrParameters switch (parameterId) { case 0x0: parameterWrapper->set(strParameters.exclusionAngle); @@ -390,7 +501,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, return INVALID_IDENTIFIER_ID; } break; - case (0xB): // GpsParameters + case (0xD): // GpsParameters switch (parameterId) { case 0x0: parameterWrapper->set(gpsParameters.timeDiffVelocityMax); @@ -399,22 +510,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, return INVALID_IDENTIFIER_ID; } break; - case (0xC): // PtgTargetParameters - switch (parameterId) { - case 0x0: - parameterWrapper->set(ptgTargetParameters.latitudeTgt); - break; - case 0x1: - parameterWrapper->set(ptgTargetParameters.longitudeTgt); - break; - case 0x2: - parameterWrapper->set(ptgTargetParameters.altitudeTgt); - break; - default: - return INVALID_IDENTIFIER_ID; - } - break; - case (0xD): // SunModelParameters + case (0xE): // SunModelParameters switch (parameterId) { case 0x0: parameterWrapper->set(sunModelParameters.domega); @@ -444,7 +540,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, return INVALID_IDENTIFIER_ID; } break; - case (0xE): // KalmanFilterParameters + case (0xF): // KalmanFilterParameters switch (parameterId) { case 0x0: parameterWrapper->set(kalmanFilterParameters.sensorNoiseSTR); @@ -468,7 +564,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, return INVALID_IDENTIFIER_ID; } break; - case (0xF): // MagnetorquesParameter + case (0x10): // MagnetorquesParameter switch (parameterId) { case 0x0: parameterWrapper->set(magnetorquesParameter.mtq0orientationMatrix); @@ -492,7 +588,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, return INVALID_IDENTIFIER_ID; } break; - case (0x10): // DetumbleParameter + case (0x11): // DetumbleParameter switch (parameterId) { case 0x0: parameterWrapper->set(detumbleParameter.detumblecounter); From 36f20d235c50c49b6fb189b80ae1ddc12e28de39 Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 7 Feb 2023 13:58:41 +0100 Subject: [PATCH 179/330] this was fun --- CHANGELOG.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5eceb87..18aa0462 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,36 @@ change warranting a new major release: # [unreleased] +## Changed +- added calculation of satellite velocity vector from GPS position data +- added detumble mode using GYR values +- added inertial pointing mode +- added nadir pointing mode +- added ground station target mode +- added antistiction for RWs +- added `sunTargetSafe` differentiation for LEOP +- added check for existance of `SD_0_SKEWED_PTG_FILE` and `SD_1_SKEWED_PTG_FILE` to determine + which `sunTargetSafe` to use +- added `gpsVelocity` and `gpsPosition` to `gpsProcessed` +- removed deprecated `OutputValues` +- added `HasParametersIF` to `AcsParameters` +- added `ReceivesParameterMessagesIF` and `ParameterHelper` to `AcsController` +- updated `AcsParameters` with actual values and changed structure +- sun vector model and magnetic field vector model calculations are always executed now +- `domainId` is now used as identifier for parameter structs +- changed onboard GYR value handling from deg/s to rad/s + +## Fixed +- fixed calculation of model sun vector +- fixed calculation of model magnetic field vector +- fixed MEKF algorithm +- fixed several variable initializations +- fixed several variable types +- fixed use of `sunMagAngleMin` for safe mode +- fixed MEKF not using correct `sampleTime` +- fixed assignment of `SUS0` and `SUS6` calibration matrices due to wiring being mixed up +- various smaller bugfixes + # [v1.25.0] 2023-02-06 eive-tmtc version: v2.12.0 From ab0a3bfd45165f804b0a437cbdc3347ac262e183 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Feb 2023 14:02:46 +0100 Subject: [PATCH 180/330] some fixes and tweaks --- linux/devices/GpsHyperionLinuxController.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/linux/devices/GpsHyperionLinuxController.cpp b/linux/devices/GpsHyperionLinuxController.cpp index 7554b805..aa55b696 100644 --- a/linux/devices/GpsHyperionLinuxController.cpp +++ b/linux/devices/GpsHyperionLinuxController.cpp @@ -102,6 +102,7 @@ ReturnValue_t GpsHyperionLinuxController::performOperation(uint8_t opCode) { if (not callAgainImmediately) { handleQueue(); poolManager.performHkOperation(); + TaskFactory::delayTask(200); } } // Should never be reached. @@ -155,7 +156,7 @@ bool GpsHyperionLinuxController::readGpsDataFromGpsd() { }; if (readMode == ReadModes::SOCKET) { // Perform other necessary handling if not data seen for 0.2 seconds. - if (gps_waiting(&gps, 200000)) { + if (gps_waiting(&gps, 0)) { if (-1 == gps_read(&gps)) { readError(); return false; @@ -258,7 +259,7 @@ ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() { gpsSet.speed.setValid(false); } - if (TIME_SET != (TIME_SET & gps.set)) { + if (TIME_SET == (TIME_SET & gps.set)) { timeval time = {}; #if LIBGPS_VERSION_MINOR <= 17 gpsSet.unixSeconds.value = std::floor(gps.fix.time); From 36ed787db1fc8ad4157ad5a9f57b0b522bf3d6fe Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Feb 2023 14:16:43 +0100 Subject: [PATCH 181/330] improve SW switch handling - also add CANT_GET_FIX event --- linux/devices/GpsHyperionLinuxController.cpp | 40 +++++++++---------- linux/devices/GpsHyperionLinuxController.h | 15 +++++-- .../devicedefinitions/GPSDefinitions.h | 3 ++ 3 files changed, 33 insertions(+), 25 deletions(-) diff --git a/linux/devices/GpsHyperionLinuxController.cpp b/linux/devices/GpsHyperionLinuxController.cpp index aa55b696..ee5f2321 100644 --- a/linux/devices/GpsHyperionLinuxController.cpp +++ b/linux/devices/GpsHyperionLinuxController.cpp @@ -34,7 +34,6 @@ ReturnValue_t GpsHyperionLinuxController::checkModeCommand(Mode_t mode, Submode_ uint32_t *msToReachTheMode) { if (not modeCommanded) { if (mode == MODE_ON or mode == MODE_OFF) { - gpsNotOpenSwitch = true; // 5h time to reach fix *msToReachTheMode = MAX_SECONDS_TO_REACH_FIX; maxTimeToReachFix.resetTimer(); @@ -46,6 +45,7 @@ ReturnValue_t GpsHyperionLinuxController::checkModeCommand(Mode_t mode, Submode_ if (mode == MODE_OFF) { PoolReadGuard pg(&gpsSet); gpsSet.setValidity(false, true); + oneShotSwitches.reset(); } return returnvalue::OK; } @@ -102,7 +102,6 @@ ReturnValue_t GpsHyperionLinuxController::performOperation(uint8_t opCode) { if (not callAgainImmediately) { handleQueue(); poolManager.performHkOperation(); - TaskFactory::delayTask(200); } } // Should never be reached. @@ -115,25 +114,24 @@ ReturnValue_t GpsHyperionLinuxController::initialize() { return result; } auto openError = [&](const char *type, int error) { - if (gpsNotOpenSwitch) { - // Opening failed + // Opening failed #if FSFW_VERBOSE_LEVEL >= 1 - sif::warning << "GPSHyperionHandler::readGpsDataFromGpsd: Opening GPSMM " << type - << " failed | Error " << error << " | " << gps_errstr(error) << std::endl; + sif::warning << "GPSHyperionHandler::readGpsDataFromGpsd: Opening GPSMM " << type + << " failed | Error " << error << " | " << gps_errstr(error) << std::endl; #endif - gpsNotOpenSwitch = false; - } }; if (readMode == ReadModes::SOCKET) { int retval = gps_open("localhost", DEFAULT_GPSD_PORT, &gps); if (retval != 0) { openError("Socket", retval); + return ObjectManager::CHILD_INIT_FAILED; } gps_stream(&gps, WATCH_ENABLE | WATCH_JSON, nullptr); } else if (readMode == ReadModes::SHM) { int retval = gps_open(GPSD_SHARED_MEMORY, "", &gps); if (retval != 0) { openError("SHM", retval); + return ObjectManager::CHILD_INIT_FAILED; } } return result; @@ -147,8 +145,8 @@ void GpsHyperionLinuxController::performControlOperation() {} bool GpsHyperionLinuxController::readGpsDataFromGpsd() { auto readError = [&]() { - if (gpsReadFailedSwitch) { - gpsReadFailedSwitch = false; + if (oneShotSwitches.gpsReadFailedSwitch) { + oneShotSwitches.gpsReadFailedSwitch = false; sif::warning << "GPSHyperionHandler::readGpsDataFromGpsd: Reading GPS data failed | " "Error " << errno << " | " << gps_errstr(errno) << std::endl; @@ -156,23 +154,21 @@ bool GpsHyperionLinuxController::readGpsDataFromGpsd() { }; if (readMode == ReadModes::SOCKET) { // Perform other necessary handling if not data seen for 0.2 seconds. - if (gps_waiting(&gps, 0)) { + if (gps_waiting(&gps, 200000)) { if (-1 == gps_read(&gps)) { readError(); return false; } + oneShotSwitches.gpsReadFailedSwitch = true; if (MODE_SET != (MODE_SET & gps.set)) { - if (mode == MODE_ON) { - if (noModeSetCntr >= 0) { - noModeSetCntr++; - } - if (noModeSetCntr == 10) { - // TODO: Trigger event here - sif::warning << "GPSHyperionHandler::readGpsDataFromGpsd: No mode could be " - "read for 10 consecutive reads" - << std::endl; - noModeSetCntr = -1; - } + if (mode != MODE_OFF and maxTimeToReachFix.hasTimedOut() and + oneShotSwitches.cantGetFixSwitch) { + // TODO: Trigger event here + sif::warning << "GPSHyperionHandler::readGpsDataFromGpsd: No mode could be " + "read for 10 consecutive reads" + << std::endl; + triggerEvent(GpsHyperion::CANT_GET_FIX, maxTimeToReachFix.timeout); + oneShotSwitches.cantGetFixSwitch = false; // did not event get mode, nothing to see. return false; } diff --git a/linux/devices/GpsHyperionLinuxController.h b/linux/devices/GpsHyperionLinuxController.h index 5b0a84cd..5d4a35ff 100644 --- a/linux/devices/GpsHyperionLinuxController.h +++ b/linux/devices/GpsHyperionLinuxController.h @@ -58,10 +58,19 @@ class GpsHyperionLinuxController : public ExtendedControllerBase { const char* currentClientBuf = nullptr; ReadModes readMode = ReadModes::SOCKET; Countdown maxTimeToReachFix = Countdown(MAX_SECONDS_TO_REACH_FIX * 1000); - bool modeCommanded = true; + bool modeCommanded = false; bool timeInit = false; - bool gpsNotOpenSwitch = true; - bool gpsReadFailedSwitch = true; + + struct OneShotSwitches { + void reset() { + gpsReadFailedSwitch = true; + cantGetFixSwitch = true; + } + bool gpsReadFailedSwitch = true; + bool cantGetFixSwitch = true; + + } oneShotSwitches; + bool debugHyperionGps = false; int32_t noModeSetCntr = 0; Countdown timeUpdateCd = Countdown(60); diff --git a/mission/devices/devicedefinitions/GPSDefinitions.h b/mission/devices/devicedefinitions/GPSDefinitions.h index 0b88cfa5..2ac7781d 100644 --- a/mission/devices/devicedefinitions/GPSDefinitions.h +++ b/mission/devices/devicedefinitions/GPSDefinitions.h @@ -13,6 +13,9 @@ static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::GPS_HANDLER; //! [EXPORT] : [COMMENT] Fix has changed. P1: Old fix. P2: New fix //! 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix static constexpr Event GPS_FIX_CHANGE = event::makeEvent(SUBSYSTEM_ID, 0, severity::INFO); +//! [EXPORT] : [COMMENT] Could not get fix in maximum allowed time. P1: Maximum allowed time +//! to get a fix after the GPS was switched on. +static constexpr Event CANT_GET_FIX = event::makeEvent(SUBSYSTEM_ID, 0, severity::LOW); static constexpr DeviceCommandId_t GPS_REPLY = 0; static constexpr DeviceCommandId_t TRIGGER_RESET_PIN_GNSS = 5; From ecc61d184baf438ded0aa6c4f64a9e57869b9d89 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Feb 2023 14:22:03 +0100 Subject: [PATCH 182/330] remove TODO --- linux/devices/GpsHyperionLinuxController.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/linux/devices/GpsHyperionLinuxController.cpp b/linux/devices/GpsHyperionLinuxController.cpp index ee5f2321..8d868512 100644 --- a/linux/devices/GpsHyperionLinuxController.cpp +++ b/linux/devices/GpsHyperionLinuxController.cpp @@ -163,10 +163,8 @@ bool GpsHyperionLinuxController::readGpsDataFromGpsd() { if (MODE_SET != (MODE_SET & gps.set)) { if (mode != MODE_OFF and maxTimeToReachFix.hasTimedOut() and oneShotSwitches.cantGetFixSwitch) { - // TODO: Trigger event here - sif::warning << "GPSHyperionHandler::readGpsDataFromGpsd: No mode could be " - "read for 10 consecutive reads" - << std::endl; + sif::warning << "GPSHyperionHandler::readGpsDataFromGpsd: No mode could be set in allowed " + << maxTimeToReachFix.timeout / 1000 << " seconds" << std::endl; triggerEvent(GpsHyperion::CANT_GET_FIX, maxTimeToReachFix.timeout); oneShotSwitches.cantGetFixSwitch = false; // did not event get mode, nothing to see. From 540bd63f4cc058defcfab66cae1fd5c83e584114 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Feb 2023 14:22:18 +0100 Subject: [PATCH 183/330] afmt --- linux/devices/GpsHyperionLinuxController.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linux/devices/GpsHyperionLinuxController.cpp b/linux/devices/GpsHyperionLinuxController.cpp index 8d868512..e4bd8c7f 100644 --- a/linux/devices/GpsHyperionLinuxController.cpp +++ b/linux/devices/GpsHyperionLinuxController.cpp @@ -163,7 +163,8 @@ bool GpsHyperionLinuxController::readGpsDataFromGpsd() { if (MODE_SET != (MODE_SET & gps.set)) { if (mode != MODE_OFF and maxTimeToReachFix.hasTimedOut() and oneShotSwitches.cantGetFixSwitch) { - sif::warning << "GPSHyperionHandler::readGpsDataFromGpsd: No mode could be set in allowed " + sif::warning + << "GPSHyperionHandler::readGpsDataFromGpsd: No mode could be set in allowed " << maxTimeToReachFix.timeout / 1000 << " seconds" << std::endl; triggerEvent(GpsHyperion::CANT_GET_FIX, maxTimeToReachFix.timeout); oneShotSwitches.cantGetFixSwitch = false; From 9cf65be1be3e8e74b53e8d6e401b4b5fb57ed04e Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Tue, 7 Feb 2023 14:28:42 +0100 Subject: [PATCH 184/330] ThermalController upgrade --- mission/controller/ThermalController.cpp | 230 +++++++++++------------ mission/controller/ThermalController.h | 9 +- 2 files changed, 114 insertions(+), 125 deletions(-) diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index aa49ecb5..a0b710fc 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -984,23 +984,50 @@ void ThermalController::copyDevices() { } void ThermalController::ctrlAcsBoard() { - // TODO: fix + // TODO: check heater::Switchers switchNr = heater::HEATER_2_ACS_BRD; heater::Switchers redSwitchNr = heater::HEATER_0_OBC_BRD; - if (chooseHeater(switchNr, redSwitchNr)) { - // A side - if (chooseOf4Sensors(switchNr, deviceTemperatures.gyro0SideA, deviceTemperatures.mgm0SideA, - deviceTemperatures.gyro1SideA, sensorTemperatures.sensor_tcs_board)) { + // A side + sensors[0].first = deviceTemperatures.gyro0SideA.isValid(); + sensors[0].second = deviceTemperatures.gyro0SideA.value; + sensors[1].first = deviceTemperatures.mgm0SideA.isValid(); + sensors[1].second = deviceTemperatures.mgm0SideA.value; + sensors[2].first = deviceTemperatures.gyro1SideA.isValid(); + sensors[2].second = deviceTemperatures.gyro1SideA.value; + sensors[3].first = sensorTemperatures.sensor_tcs_board.isValid(); + sensors[3].second = sensorTemperatures.sensor_tcs_board.value; + numSensors = 4; + if (selectAndReadSensorTemp()) { + if (chooseHeater(switchNr, redSwitchNr)) { ctrlHeater(switchNr, redSwitchNr, acsBoardLimits); - return; } - // B side - if (chooseOf4Sensors(switchNr, deviceTemperatures.gyro2SideB, deviceTemperatures.mgm2SideB, - deviceTemperatures.gyro3SideB, sensorTemperatures.sensor_tcs_board)) { + resetSensorsArray(); + return; + } + + // B side + sensors[0].first = deviceTemperatures.gyro2SideB.isValid(); + sensors[0].second = deviceTemperatures.gyro2SideB.value; + sensors[1].first = deviceTemperatures.mgm2SideB.isValid(); + sensors[1].second = deviceTemperatures.mgm2SideB.value; + sensors[2].first = deviceTemperatures.gyro3SideB.isValid(); + sensors[2].second = deviceTemperatures.gyro3SideB.value; + sensors[3].first = sensorTemperatures.sensor_tcs_board.isValid(); + sensors[3].second = sensorTemperatures.sensor_tcs_board.value; + if (selectAndReadSensorTemp()) { + if (chooseHeater(switchNr, redSwitchNr)) { ctrlHeater(switchNr, redSwitchNr, acsBoardLimits); } + } else { + if (chooseHeater(switchNr, redSwitchNr)) { + if (heaterHandler.checkSwitchState(switchNr)) { + heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); + sif::info << "ThermalController::ctrlHeater: Heater" << switchNr << " OFF" << std::endl; + } + } } + resetSensorsArray(); } void ThermalController::ctrlMgt() { @@ -1016,100 +1043,59 @@ void ThermalController::ctrlMgt() { sensors[2].first = sensorTemperatures.sensor_plpcdu_heatspreader.isValid(); sensors[2].second = sensorTemperatures.sensor_plpcdu_heatspreader.value; numSensors = 3; - ctrlComponentTemperature(heater::HEATER_2_ACS_BRD, heater::HEATER_3_PCDU_PDU, - mgtLimits); + ctrlComponentTemperature(heater::HEATER_2_ACS_BRD, heater::HEATER_3_PCDU_PDU, mgtLimits); } } void ThermalController::ctrlRw() { - //TODO: better solution? - heater::Switchers switchNr = heater::HEATER_6_DRO; - heater::Switchers redSwitchNr = heater::HEATER_6_DRO; - redSwitchNrInUse = false; + // TODO: better solution? + // RW1 + sensors[0].first = sensorTemperatures.sensor_rw1.isValid(); + sensors[0].second = sensorTemperatures.sensor_rw1.value; + sensors[1].first = deviceTemperatures.rw1.isValid(); + sensors[1].second = deviceTemperatures.rw1.value; + sensors[2].first = deviceTemperatures.rw4.isValid(); + sensors[2].second = deviceTemperatures.rw4.value; + sensors[3].first = sensorTemperatures.sensor_dro.isValid(); + sensors[3].second = sensorTemperatures.sensor_dro.value; + numSensors = 4; + ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_6_DRO, rwLimits); - if (heaterHandler.getHealth(switchNr) == HasHealthIF::HEALTHY) { - // RW1 - bool sensorTempAvailable = true; + // RW2 + sensors[0].first = deviceTemperatures.rw2.isValid(); + sensors[0].second = deviceTemperatures.rw2.value; + sensors[1].first = deviceTemperatures.rw3.isValid(); + sensors[1].second = deviceTemperatures.rw3.value; + sensors[2].first = sensorTemperatures.sensor_rw1.isValid(); + sensors[2].second = sensorTemperatures.sensor_rw1.value; + sensors[3].first = sensorTemperatures.sensor_dro.isValid(); + sensors[3].second = sensorTemperatures.sensor_dro.value; + numSensors = 4; + ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_6_DRO, rwLimits); - if (sensorTemperatures.sensor_rw1.isValid()) { - sensorTemp = sensorTemperatures.sensor_rw1.value; - } else if (deviceTemperatures.rw1.isValid()) { - sensorTemp = static_cast(deviceTemperatures.rw1.value); - } else if (deviceTemperatures.rw4.isValid()) { - sensorTemp = static_cast(deviceTemperatures.rw4.value); - } else if (sensorTemperatures.sensor_dro.isValid()) { - sensorTemp = sensorTemperatures.sensor_dro.value; - } else { - if (heaterHandler.checkSwitchState(switchNr)) { - heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); - } - triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); - sensorTempAvailable = false; - } - if (sensorTempAvailable) { - ctrlHeater(switchNr, redSwitchNr, rwLimits); - } - // RW2 - sensorTempAvailable = true; - if (deviceTemperatures.rw2.isValid()) { - sensorTemp = static_cast(deviceTemperatures.rw2.value); - } else if (deviceTemperatures.rw3.isValid()) { - sensorTemp = static_cast(deviceTemperatures.rw3.value); - } else if (sensorTemperatures.sensor_rw1.isValid()) { - sensorTemp = sensorTemperatures.sensor_rw1.value; - } else if (sensorTemperatures.sensor_dro.isValid()) { - sensorTemp = sensorTemperatures.sensor_dro.value; - } else { - if (heaterHandler.checkSwitchState(switchNr)) { - heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); - } - triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); - sensorTempAvailable = false; - } - if (sensorTempAvailable) { - ctrlHeater(switchNr, redSwitchNr, rwLimits); - } - // RW3 - sensorTempAvailable = true; - if (deviceTemperatures.rw3.isValid()) { - sensorTemp = static_cast(deviceTemperatures.rw3.value); - } else if (deviceTemperatures.rw4.isValid()) { - sensorTemp = static_cast(deviceTemperatures.rw4.value); - } else if (sensorTemperatures.sensor_rw1.isValid()) { - sensorTemp = sensorTemperatures.sensor_rw1.value; - } else if (sensorTemperatures.sensor_dro.isValid()) { - sensorTemp = sensorTemperatures.sensor_dro.value; - } else { - if (heaterHandler.checkSwitchState(switchNr)) { - heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); - } - triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); - sensorTempAvailable = false; - } - if (sensorTempAvailable) { - ctrlHeater(switchNr, redSwitchNr, rwLimits); - } - // RW4 - sensorTempAvailable = true; - if (deviceTemperatures.rw4.isValid()) { - sensorTemp = static_cast(deviceTemperatures.rw4.value); - } else if (deviceTemperatures.rw1.isValid()) { - sensorTemp = static_cast(deviceTemperatures.rw1.value); - } else if (sensorTemperatures.sensor_rw1.isValid()) { - sensorTemp = sensorTemperatures.sensor_rw1.value; - } else if (sensorTemperatures.sensor_dro.isValid()) { - sensorTemp = sensorTemperatures.sensor_dro.value; - } else { - if (heaterHandler.checkSwitchState(switchNr)) { - heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); - } - triggerEvent(NO_VALID_SENSOR_TEMPERATURE, switchNr); - sensorTempAvailable = false; - } - if (sensorTempAvailable) { - ctrlHeater(switchNr, redSwitchNr, rwLimits); - } - } + // RW3 + sensors[0].first = deviceTemperatures.rw3.isValid(); + sensors[0].second = deviceTemperatures.rw3.value; + sensors[1].first = deviceTemperatures.rw4.isValid(); + sensors[1].second = deviceTemperatures.rw4.value; + sensors[2].first = sensorTemperatures.sensor_rw1.isValid(); + sensors[2].second = sensorTemperatures.sensor_rw1.value; + sensors[3].first = sensorTemperatures.sensor_dro.isValid(); + sensors[3].second = sensorTemperatures.sensor_dro.value; + numSensors = 4; + ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_6_DRO, rwLimits); + + // RW4 + sensors[0].first = deviceTemperatures.rw4.isValid(); + sensors[0].second = deviceTemperatures.rw4.value; + sensors[1].first = deviceTemperatures.rw1.isValid(); + sensors[1].second = deviceTemperatures.rw1.value; + sensors[2].first = sensorTemperatures.sensor_rw1.isValid(); + sensors[2].second = sensorTemperatures.sensor_rw1.value; + sensors[3].first = sensorTemperatures.sensor_dro.isValid(); + sensors[3].second = sensorTemperatures.sensor_dro.value; + numSensors = 4; + ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_6_DRO, rwLimits); } void ThermalController::ctrlStr() { @@ -1120,18 +1106,17 @@ void ThermalController::ctrlStr() { sensors[2].first = sensorTemperatures.sensor_dro.isValid(); sensors[2].second = sensorTemperatures.sensor_dro.value; numSensors = 3; - ctrlComponentTemperature(heater::HEATER_5_STR, heater::HEATER_6_DRO, - strLimits); + ctrlComponentTemperature(heater::HEATER_5_STR, heater::HEATER_6_DRO, strLimits); } void ThermalController::ctrlIfBoard() { - sensors[0].first = sensorTemperatures.tmp1075IfBrd.isValid(); - sensors[0].second = sensorTemperatures.tmp1075IfBrd.value; - sensors[1].first = sensorTemperatures.sensor_magnettorquer.isValid(); - sensors[1].second = sensorTemperatures.sensor_magnettorquer.value; - sensors[2].first = deviceTemperatures.mgm2SideB.isValid(); - sensors[2].second = deviceTemperatures.mgm2SideB.value; - numSensors = 3; + sensors[0].first = sensorTemperatures.tmp1075IfBrd.isValid(); + sensors[0].second = sensorTemperatures.tmp1075IfBrd.value; + sensors[1].first = sensorTemperatures.sensor_magnettorquer.isValid(); + sensors[1].second = sensorTemperatures.sensor_magnettorquer.value; + sensors[2].first = deviceTemperatures.mgm2SideB.isValid(); + sensors[2].second = deviceTemperatures.mgm2SideB.value; + numSensors = 3; ctrlComponentTemperature(heater::HEATER_2_ACS_BRD, heater::HEATER_3_PCDU_PDU, ifBoardLimits); } @@ -1179,7 +1164,8 @@ void ThermalController::ctrlSBandTransceiver() { sensors[2].first = sensorTemperatures.sensor_4k_camera.isValid(); sensors[2].second = sensorTemperatures.sensor_4k_camera.value; numSensors = 3; - ctrlComponentTemperature(heater::HEATER_7_S_BAND, heater::HEATER_4_CAMERA, sBandTransceiverLimits); + ctrlComponentTemperature(heater::HEATER_7_S_BAND, heater::HEATER_4_CAMERA, + sBandTransceiverLimits); if (componentAboveCutOffLimit) { triggerEvent(SYRLINKS_OVERHEATING); } @@ -1253,7 +1239,8 @@ void ThermalController::ctrlPlocMissionBoard() { sensors[2].first = sensorTemperatures.sensor_dac_heatspreader.isValid(); sensors[2].second = sensorTemperatures.sensor_dac_heatspreader.value; numSensors = 3; - ctrlComponentTemperature(heater::HEATER_1_PLOC_PROC_BRD, heater::HEATER_0_OBC_BRD, plocMissionBoardLimits); + ctrlComponentTemperature(heater::HEATER_1_PLOC_PROC_BRD, heater::HEATER_0_OBC_BRD, + plocMissionBoardLimits); if (componentAboveCutOffLimit) { triggerEvent(PLOC_OVERHEATING); } @@ -1267,7 +1254,8 @@ void ThermalController::ctrlPlocProcessingBoard() { sensors[2].first = sensorTemperatures.sensor_dac_heatspreader.isValid(); sensors[2].second = sensorTemperatures.sensor_dac_heatspreader.value; numSensors = 3; - ctrlComponentTemperature(heater::HEATER_1_PLOC_PROC_BRD, heater::HEATER_0_OBC_BRD, plocProcessingBoardLimits); + ctrlComponentTemperature(heater::HEATER_1_PLOC_PROC_BRD, heater::HEATER_0_OBC_BRD, + plocProcessingBoardLimits); } void ThermalController::ctrlDac() { @@ -1404,37 +1392,39 @@ bool ThermalController::chooseHeater(heater::Switchers& switchNr, heater::Switch return heaterAvailable; } -bool ThermalController::selectAndReadSensorTemp(heater::Switchers switchNr) { - for(unsigned i= 0; i, 5> sensors; + std::array, 5> sensors; uint8_t numSensors = 0; PoolEntry tmp1075Tcs0 = PoolEntry(10.0); @@ -172,7 +171,7 @@ class ThermalController : public ExtendedControllerBase { TempLimits& tempLimit); void ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, TempLimits& tempLimit); bool chooseHeater(heater::Switchers& switchNr, heater::Switchers redSwitchNr); - bool selectAndReadSensorTemp(heater::Switchers switchNr); + bool selectAndReadSensorTemp(); void ctrlAcsBoard(); void ctrlMgt(); From b2de4ee08c668a73b98ba6361b6c78c0a6a71eb4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Feb 2023 16:57:24 +0100 Subject: [PATCH 185/330] use full polling for gps_wating, manual delay --- linux/devices/GpsHyperionLinuxController.cpp | 12 ++++++++++-- tmtc | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/linux/devices/GpsHyperionLinuxController.cpp b/linux/devices/GpsHyperionLinuxController.cpp index e4bd8c7f..7350aebc 100644 --- a/linux/devices/GpsHyperionLinuxController.cpp +++ b/linux/devices/GpsHyperionLinuxController.cpp @@ -45,7 +45,10 @@ ReturnValue_t GpsHyperionLinuxController::checkModeCommand(Mode_t mode, Submode_ if (mode == MODE_OFF) { PoolReadGuard pg(&gpsSet); gpsSet.setValidity(false, true); + // There can't be a fix with a device that is off. + triggerEvent(GpsHyperion::GPS_FIX_CHANGE, gpsSet.fixMode.value, 0); oneShotSwitches.reset(); + modeCommanded = false; } return returnvalue::OK; } @@ -102,6 +105,7 @@ ReturnValue_t GpsHyperionLinuxController::performOperation(uint8_t opCode) { if (not callAgainImmediately) { handleQueue(); poolManager.performHkOperation(); + TaskFactory::delayTask(250); } } // Should never be reached. @@ -152,9 +156,13 @@ bool GpsHyperionLinuxController::readGpsDataFromGpsd() { << errno << " | " << gps_errstr(errno) << std::endl; } }; + // GPS is off, no point in reading data from GPSD. + if(mode == MODE_OFF) { + return false; + } if (readMode == ReadModes::SOCKET) { // Perform other necessary handling if not data seen for 0.2 seconds. - if (gps_waiting(&gps, 200000)) { + if (gps_waiting(&gps, 0)) { if (-1 == gps_read(&gps)) { readError(); return false; @@ -212,7 +220,7 @@ ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() { modeCommanded = false; } gpsSet.setValidity(false, true); - } else if (gps.satellites_used > 0 && validFix) { + } else if (gps.satellites_used > 0 && validFix && mode != MODE_OFF) { gpsSet.setValidity(true, true); } diff --git a/tmtc b/tmtc index d6445d38..8a96e21d 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit d6445d38a8eb644a5e1bd27f0fc56d29e93c030d +Subproject commit 8a96e21d1a1ca790cd1053594495dd74beb12133 From f5ba8595607592350a51c2792e9ace567207d281 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Feb 2023 17:01:07 +0100 Subject: [PATCH 186/330] comment fix --- linux/devices/GpsHyperionLinuxController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/devices/GpsHyperionLinuxController.cpp b/linux/devices/GpsHyperionLinuxController.cpp index 7350aebc..ec9cb61a 100644 --- a/linux/devices/GpsHyperionLinuxController.cpp +++ b/linux/devices/GpsHyperionLinuxController.cpp @@ -161,7 +161,7 @@ bool GpsHyperionLinuxController::readGpsDataFromGpsd() { return false; } if (readMode == ReadModes::SOCKET) { - // Perform other necessary handling if not data seen for 0.2 seconds. + // Poll the GPS. if (gps_waiting(&gps, 0)) { if (-1 == gps_read(&gps)) { readError(); From bc6cecc14a51ce39e6102c6154dffb9dd87223e0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Feb 2023 17:02:22 +0100 Subject: [PATCH 187/330] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index d6445d38..8a96e21d 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit d6445d38a8eb644a5e1bd27f0fc56d29e93c030d +Subproject commit 8a96e21d1a1ca790cd1053594495dd74beb12133 From e8120fcdefc0d2a73bf3ee69d4538618691ab604 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Feb 2023 17:18:13 +0100 Subject: [PATCH 188/330] allow passsing TM dest names --- fsfw | 2 +- linux/ObjectFactory.cpp | 4 ++-- mission/core/GenericFactory.cpp | 8 ++++---- mission/tmtc/CfdpTmFunnel.cpp | 7 ++++--- mission/tmtc/PusTmFunnel.cpp | 7 ++++--- mission/tmtc/TmFunnelBase.cpp | 5 +++-- mission/tmtc/TmFunnelBase.h | 15 +++++++++++++-- 7 files changed, 31 insertions(+), 17 deletions(-) diff --git a/fsfw b/fsfw index 38789e05..69c94645 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 38789e053b65cfa14604fc625e7bcc8ca03a3f17 +Subproject commit 69c94645df81c2fc9d538a0f19d2c6552e1c73a7 diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index 469187a6..2f04b294 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -363,6 +363,6 @@ void ObjectFactory::gpioChecker(ReturnValue_t result, std::string output) { void ObjectFactory::addTmtcIpCoresToFunnels(CcsdsIpCoreHandler& ipCoreHandler, PusTmFunnel& pusFunnel, CfdpTmFunnel& cfdpFunnel) { - cfdpFunnel.addDestination(ipCoreHandler, config::LIVE_TM); - pusFunnel.addDestination(ipCoreHandler, config::LIVE_TM); + cfdpFunnel.addDestination("PTME IP Core", ipCoreHandler, config::LIVE_TM); + pusFunnel.addDestination("PTME IP Core", ipCoreHandler, config::LIVE_TM); } diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index a5acd734..d486ed59 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -127,12 +127,12 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun config::MAX_PUS_FUNNEL_QUEUE_DEPTH); #if OBSW_ADD_TCPIP_SERVERS == 1 #if OBSW_ADD_TMTC_UDP_SERVER == 1 - (*cfdpFunnel)->addDestination(*udpBridge, 0); - (*pusFunnel)->addDestination(*udpBridge, 0); + (*cfdpFunnel)->addDestination("UDP Server", *udpBridge, 0); + (*pusFunnel)->addDestination("UDP Server", *udpBridge, 0); #endif #if OBSW_ADD_TMTC_TCP_SERVER == 1 - (*cfdpFunnel)->addDestination(*tcpBridge, 0); - (*pusFunnel)->addDestination(*tcpBridge, 0); + (*cfdpFunnel)->addDestination("TCP Server", *tcpBridge, 0); + (*pusFunnel)->addDestination("TCP Server", *tcpBridge, 0); #endif #endif // Every TM packet goes through this funnel diff --git a/mission/tmtc/CfdpTmFunnel.cpp b/mission/tmtc/CfdpTmFunnel.cpp index aff7c95d..f19d5360 100644 --- a/mission/tmtc/CfdpTmFunnel.cpp +++ b/mission/tmtc/CfdpTmFunnel.cpp @@ -68,7 +68,7 @@ ReturnValue_t CfdpTmFunnel::handlePacket(TmTcMessage& msg) { msg.setStorageId(newStoreId); store_address_t origStoreId = newStoreId; for (unsigned int idx = 0; idx < destinations.size(); idx++) { - const auto& destVcidPair = destinations[idx]; + const auto& dest = destinations[idx]; if (destinations.size() > 1) { if (idx < destinations.size() - 1) { // Create copy of data to ensure each TM recipient has its own copy. That way, we don't need @@ -87,10 +87,11 @@ ReturnValue_t CfdpTmFunnel::handlePacket(TmTcMessage& msg) { msg.setStorageId(origStoreId); } } - result = tmQueue->sendMessage(destVcidPair.first, &msg); + result = tmQueue->sendMessage(dest.queueId, &msg); if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 - sif::error << "PusTmFunnel::handlePacket: Error sending TM to downlink handler" << std::endl; + sif::error << "PusTmFunnel::handlePacket: Error sending TM to downlink handler " << dest.name + << " failed" << std::endl; #endif tmStore.deleteData(msg.getStorageId()); } diff --git a/mission/tmtc/PusTmFunnel.cpp b/mission/tmtc/PusTmFunnel.cpp index 5d6bbb4d..dda854a6 100644 --- a/mission/tmtc/PusTmFunnel.cpp +++ b/mission/tmtc/PusTmFunnel.cpp @@ -49,7 +49,7 @@ ReturnValue_t PusTmFunnel::handlePacket(TmTcMessage &message) { packet.updateErrorControl(); for (unsigned int idx = 0; idx < destinations.size(); idx++) { - const auto &destVcidPair = destinations[idx]; + const auto &dest = destinations[idx]; if (destinations.size() > 1) { if (idx < destinations.size() - 1) { // Create copy of data to ensure each TM recipient has its own copy. That way, we don't need @@ -68,10 +68,11 @@ ReturnValue_t PusTmFunnel::handlePacket(TmTcMessage &message) { message.setStorageId(origStoreId); } } - result = tmQueue->sendMessage(destVcidPair.first, &message); + result = tmQueue->sendMessage(dest.queueId, &message); if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 - sif::error << "PusTmFunnel::handlePacket: Error sending TM to downlink handler" << std::endl; + sif::error << "PusTmFunnel::handlePacket: Error sending TM to downlink handler " << dest.name + << " failed" << std::endl; #endif tmStore.deleteData(message.getStorageId()); } diff --git a/mission/tmtc/TmFunnelBase.cpp b/mission/tmtc/TmFunnelBase.cpp index fa0062e6..51bf93a1 100644 --- a/mission/tmtc/TmFunnelBase.cpp +++ b/mission/tmtc/TmFunnelBase.cpp @@ -13,7 +13,8 @@ MessageQueueId_t TmFunnelBase::getReportReceptionQueue(uint8_t virtualChannel) c return tmQueue->getId(); } -void TmFunnelBase::addDestination(const AcceptsTelemetryIF &downlinkDestination, uint8_t vcid) { +void TmFunnelBase::addDestination(const char *name, const AcceptsTelemetryIF &downlinkDestination, + uint8_t vcid) { auto queueId = downlinkDestination.getReportReceptionQueue(vcid); - destinations.emplace_back(queueId, vcid); + destinations.emplace_back(name, queueId, vcid); } diff --git a/mission/tmtc/TmFunnelBase.h b/mission/tmtc/TmFunnelBase.h index c630fefd..408244dd 100644 --- a/mission/tmtc/TmFunnelBase.h +++ b/mission/tmtc/TmFunnelBase.h @@ -10,14 +10,25 @@ class TmFunnelBase : public AcceptsTelemetryIF, public SystemObject { public: TmFunnelBase(object_id_t objectId, StorageManagerIF& tmStore, uint32_t tmMsgDepth); - void addDestination(const AcceptsTelemetryIF& downlinkDestination, uint8_t vcid = 0); + void addDestination(const char* name, const AcceptsTelemetryIF& downlinkDestination, + uint8_t vcid = 0); [[nodiscard]] MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel) const override; virtual ~TmFunnelBase(); protected: StorageManagerIF& tmStore; - std::vector> destinations; + struct Destination { + Destination(const char* name, MessageQueueId_t queueId, uint8_t virtualChannel) + : name(name), queueId(queueId), virtualChannel(virtualChannel) {} + + const char* name; + MessageQueueId_t queueId; + uint8_t virtualChannel = 0; + }; + + std::vector destinations; + MessageQueueIF* tmQueue = nullptr; }; From 8bc71b268ebef87801a7e5a9e2b6120a5fa01ab6 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Feb 2023 17:28:59 +0100 Subject: [PATCH 189/330] some tests with subsystem --- bsp_q7s/core/scheduling.cpp | 2 +- mission/acsDefs.h | 3 +- mission/controller/AcsController.cpp | 2 +- mission/system/objects/AcsSubsystem.cpp | 4 +- mission/system/tree/acsModeTree.cpp | 88 ++++++++++++------------- 5 files changed, 50 insertions(+), 49 deletions(-) diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index 150efa97..e8f83f0e 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -414,7 +414,7 @@ void scheduling::createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction ReturnValue_t result = returnvalue::OK; FixedTimeslotTaskIF* acsPst = factory.createFixedTimeslotTask( - "ACS_PST", 85, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); + "ACS_PST", 85, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 1.0, missedDeadlineFunc); result = pst::pstAcs(acsPst); if (result != returnvalue::OK) { if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { diff --git a/mission/acsDefs.h b/mission/acsDefs.h index 8869d6ff..ca4ab77c 100644 --- a/mission/acsDefs.h +++ b/mission/acsDefs.h @@ -6,7 +6,8 @@ namespace acs { -enum CtrlSubmode { +// These modes are the submodes of the ACS controller and the modes of the ACS subsystem. +enum AcsModes { OFF = HasModesIF::MODE_OFF, SAFE = 10, DETUMBLE = 11, diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 7544c471..7d9cc015 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -426,7 +426,7 @@ ReturnValue_t AcsController::checkModeCommand(Mode_t mode, Submode_t submode, return INVALID_SUBMODE; } } else if ((mode == MODE_ON) || (mode == MODE_NORMAL)) { - if ((submode > 6) || (submode < 2)) { + if (submode < acs::AcsModes::SAFE or submode > acs::AcsModes::PTG_TARGET_INERTIAL) { return INVALID_SUBMODE; } else { return returnvalue::OK; diff --git a/mission/system/objects/AcsSubsystem.cpp b/mission/system/objects/AcsSubsystem.cpp index f5b8a0ce..25b601ac 100644 --- a/mission/system/objects/AcsSubsystem.cpp +++ b/mission/system/objects/AcsSubsystem.cpp @@ -58,7 +58,7 @@ void AcsSubsystem::handleEventMessages() { case EventMessage::EVENT_MESSAGE: if (event.getEvent() == acs::SAFE_RATE_VIOLATION) { CommandMessage msg; - ModeMessage::setCmdModeModeMessage(msg, acs::CtrlSubmode::DETUMBLE, 0); + ModeMessage::setCmdModeModeMessage(msg, acs::AcsModes::DETUMBLE, 0); ReturnValue_t result = commandQueue->sendMessage(commandQueue->getId(), &msg); if (result != returnvalue::OK) { sif::error << "AcsSubsystem: sending DETUMBLE mode cmd to self has failed" << std::endl; @@ -66,7 +66,7 @@ void AcsSubsystem::handleEventMessages() { } if (event.getEvent() == acs::SAFE_RATE_RECOVERY) { CommandMessage msg; - ModeMessage::setCmdModeModeMessage(msg, acs::CtrlSubmode::SAFE, 0); + ModeMessage::setCmdModeModeMessage(msg, acs::AcsModes::SAFE, 0); ReturnValue_t result = commandQueue->sendMessage(commandQueue->getId(), &msg); if (result != returnvalue::OK) { sif::error << "AcsSubsystem: sending IDLE mode cmd to self has failed" << std::endl; diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index 849959f9..db7d7a81 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -30,69 +30,69 @@ void buildTargetPtInertialSequence(Subsystem& ss, ModeListEntry& entryHelper); static const auto OFF = HasModesIF::MODE_OFF; static const auto NML = DeviceHandlerIF::MODE_NORMAL; -auto ACS_SEQUENCE_OFF = std::make_pair(acs::CtrlSubmode::OFF, FixedArrayList()); +auto ACS_SEQUENCE_OFF = std::make_pair(acs::AcsModes::OFF, FixedArrayList()); auto ACS_TABLE_OFF_TGT = - std::make_pair((acs::CtrlSubmode::OFF << 24) | 1, FixedArrayList()); + std::make_pair((acs::AcsModes::OFF << 24) | 1, FixedArrayList()); auto ACS_TABLE_OFF_TRANS_0 = - std::make_pair((acs::CtrlSubmode::OFF << 24) | 2, FixedArrayList()); + std::make_pair((acs::AcsModes::OFF << 24) | 2, FixedArrayList()); auto ACS_TABLE_OFF_TRANS_1 = - std::make_pair((acs::CtrlSubmode::OFF << 24) | 3, FixedArrayList()); + std::make_pair((acs::AcsModes::OFF << 24) | 3, FixedArrayList()); auto ACS_SEQUENCE_DETUMBLE = - std::make_pair(acs::CtrlSubmode::DETUMBLE, FixedArrayList()); + std::make_pair(acs::AcsModes::DETUMBLE, FixedArrayList()); auto ACS_TABLE_DETUMBLE_TGT = - std::make_pair((acs::CtrlSubmode::DETUMBLE << 24) | 1, FixedArrayList()); + std::make_pair((acs::AcsModes::DETUMBLE << 24) | 1, FixedArrayList()); auto ACS_TABLE_DETUMBLE_TRANS_0 = - std::make_pair((acs::CtrlSubmode::DETUMBLE << 24) | 2, FixedArrayList()); + std::make_pair((acs::AcsModes::DETUMBLE << 24) | 2, FixedArrayList()); auto ACS_TABLE_DETUMBLE_TRANS_1 = - std::make_pair((acs::CtrlSubmode::DETUMBLE << 24) | 3, FixedArrayList()); + std::make_pair((acs::AcsModes::DETUMBLE << 24) | 3, FixedArrayList()); -auto ACS_SEQUENCE_SAFE = std::make_pair(acs::CtrlSubmode::SAFE, FixedArrayList()); +auto ACS_SEQUENCE_SAFE = std::make_pair(acs::AcsModes::SAFE, FixedArrayList()); auto ACS_TABLE_SAFE_TGT = - std::make_pair((acs::CtrlSubmode::SAFE << 24) | 1, FixedArrayList()); + std::make_pair((acs::AcsModes::SAFE << 24) | 1, FixedArrayList()); auto ACS_TABLE_SAFE_TRANS_0 = - std::make_pair((acs::CtrlSubmode::SAFE << 24) | 2, FixedArrayList()); + std::make_pair((acs::AcsModes::SAFE << 24) | 2, FixedArrayList()); auto ACS_TABLE_SAFE_TRANS_1 = - std::make_pair((acs::CtrlSubmode::SAFE << 24) | 3, FixedArrayList()); + std::make_pair((acs::AcsModes::SAFE << 24) | 3, FixedArrayList()); -auto ACS_SEQUENCE_IDLE = std::make_pair(acs::CtrlSubmode::IDLE, FixedArrayList()); +auto ACS_SEQUENCE_IDLE = std::make_pair(acs::AcsModes::IDLE, FixedArrayList()); auto ACS_TABLE_IDLE_TGT = - std::make_pair((acs::CtrlSubmode::IDLE << 24) | 1, FixedArrayList()); + std::make_pair((acs::AcsModes::IDLE << 24) | 1, FixedArrayList()); auto ACS_TABLE_IDLE_TRANS_0 = - std::make_pair((acs::CtrlSubmode::IDLE << 24) | 2, FixedArrayList()); + std::make_pair((acs::AcsModes::IDLE << 24) | 2, FixedArrayList()); auto ACS_TABLE_IDLE_TRANS_1 = - std::make_pair((acs::CtrlSubmode::IDLE << 24) | 3, FixedArrayList()); + std::make_pair((acs::AcsModes::IDLE << 24) | 3, FixedArrayList()); auto ACS_TABLE_PTG_TRANS_0 = - std::make_pair((acs::CtrlSubmode::PTG_TARGET << 24) | 2, FixedArrayList()); + std::make_pair((acs::AcsModes::PTG_TARGET << 24) | 2, FixedArrayList()); auto ACS_SEQUENCE_PTG_TARGET = - std::make_pair(acs::CtrlSubmode::PTG_TARGET, FixedArrayList()); + std::make_pair(acs::AcsModes::PTG_TARGET, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_TGT = - std::make_pair((acs::CtrlSubmode::PTG_TARGET << 24) | 1, FixedArrayList()); + std::make_pair((acs::AcsModes::PTG_TARGET << 24) | 1, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_TRANS_1 = - std::make_pair((acs::CtrlSubmode::PTG_TARGET << 24) | 3, FixedArrayList()); + std::make_pair((acs::AcsModes::PTG_TARGET << 24) | 3, FixedArrayList()); auto ACS_SEQUENCE_PTG_TARGET_GS = - std::make_pair(acs::CtrlSubmode::PTG_TARGET_GS, FixedArrayList()); + std::make_pair(acs::AcsModes::PTG_TARGET_GS, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_GS_TGT = - std::make_pair((acs::CtrlSubmode::PTG_TARGET_GS << 24) | 1, FixedArrayList()); + std::make_pair((acs::AcsModes::PTG_TARGET_GS << 24) | 1, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_GS_TRANS_1 = - std::make_pair((acs::CtrlSubmode::PTG_TARGET_GS << 24) | 3, FixedArrayList()); + std::make_pair((acs::AcsModes::PTG_TARGET_GS << 24) | 3, FixedArrayList()); auto ACS_SEQUENCE_PTG_TARGET_NADIR = - std::make_pair(acs::CtrlSubmode::PTG_TARGET_NADIR, FixedArrayList()); -auto ACS_TABLE_PTG_TARGET_NADIR_TGT = std::make_pair((acs::CtrlSubmode::PTG_TARGET_NADIR << 24) | 1, + std::make_pair(acs::AcsModes::PTG_TARGET_NADIR, FixedArrayList()); +auto ACS_TABLE_PTG_TARGET_NADIR_TGT = std::make_pair((acs::AcsModes::PTG_TARGET_NADIR << 24) | 1, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_NADIR_TRANS_1 = std::make_pair( - (acs::CtrlSubmode::PTG_TARGET_NADIR << 24) | 3, FixedArrayList()); + (acs::AcsModes::PTG_TARGET_NADIR << 24) | 3, FixedArrayList()); auto ACS_SEQUENCE_PTG_TARGET_INERTIAL = - std::make_pair(acs::CtrlSubmode::PTG_TARGET_INERTIAL, FixedArrayList()); + std::make_pair(acs::AcsModes::PTG_TARGET_INERTIAL, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_INERTIAL_TGT = std::make_pair( - (acs::CtrlSubmode::PTG_TARGET_INERTIAL << 24) | 1, FixedArrayList()); + (acs::AcsModes::PTG_TARGET_INERTIAL << 24) | 1, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1 = std::make_pair( - (acs::CtrlSubmode::PTG_TARGET_INERTIAL << 24) | 3, FixedArrayList()); + (acs::AcsModes::PTG_TARGET_INERTIAL << 24) | 3, FixedArrayList()); void satsystem::acs::init() { ModeListEntry entry; @@ -122,7 +122,7 @@ void satsystem::acs::init() { buildTargetPtGsSequence(ACS_SUBSYSTEM, entry); buildTargetPtNadirSequence(ACS_SUBSYSTEM, entry); buildTargetPtInertialSequence(ACS_SUBSYSTEM, entry); - ACS_SUBSYSTEM.setInitialMode(::acs::CtrlSubmode::SAFE); + ACS_SUBSYSTEM.setInitialMode(::acs::AcsModes::SAFE); } namespace { @@ -190,7 +190,7 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) { check(sequence.insert(eh), ctxc); }; // Build SAFE target - iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::SAFE, ACS_TABLE_SAFE_TGT.second); + iht(objects::ACS_CONTROLLER, NML, acs::AcsModes::SAFE, ACS_TABLE_SAFE_TGT.second); iht(objects::IMTQ_HANDLER, 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); @@ -206,7 +206,7 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) { ctxc); // Build SAFE transition 1 - iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::SAFE, ACS_TABLE_SAFE_TRANS_1.second); + iht(objects::ACS_CONTROLLER, NML, acs::AcsModes::SAFE, ACS_TABLE_SAFE_TRANS_1.second); check(ss.addTable(&ACS_TABLE_SAFE_TRANS_1.second, ACS_TABLE_SAFE_TRANS_1.first, false, true), ctxc); @@ -239,7 +239,7 @@ void buildDetumbleSequence(Subsystem& ss, ModeListEntry& eh) { check(sequence.insert(eh), ctxc); }; // Build DETUMBLE target - iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::DETUMBLE, ACS_TABLE_DETUMBLE_TGT.second); + iht(objects::ACS_CONTROLLER, NML, acs::AcsModes::DETUMBLE, ACS_TABLE_DETUMBLE_TGT.second); iht(objects::IMTQ_HANDLER, 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); @@ -257,7 +257,7 @@ void buildDetumbleSequence(Subsystem& ss, ModeListEntry& eh) { ctxc); // Build DETUMBLE transition 1 - iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::DETUMBLE, ACS_TABLE_DETUMBLE_TRANS_1.second); + iht(objects::ACS_CONTROLLER, NML, acs::AcsModes::DETUMBLE, ACS_TABLE_DETUMBLE_TRANS_1.second); check(ss.addTable(&ACS_TABLE_DETUMBLE_TRANS_1.second, ACS_TABLE_DETUMBLE_TRANS_1.first, false, true), ctxc); @@ -291,7 +291,7 @@ void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) { check(sequence.insert(eh), ctxc); }; // Build IDLE target - iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::IDLE, ACS_TABLE_IDLE_TGT.second); + iht(objects::ACS_CONTROLLER, NML, acs::AcsModes::IDLE, ACS_TABLE_IDLE_TGT.second); iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_TGT.second); iht(objects::RW_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second); @@ -307,7 +307,7 @@ void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) { ss.addTable(&ACS_TABLE_IDLE_TRANS_0.second, ACS_TABLE_IDLE_TRANS_0.first, false, true); // Build IDLE transition 1 - iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::IDLE, ACS_TABLE_IDLE_TRANS_1.second); + iht(objects::ACS_CONTROLLER, NML, acs::AcsModes::IDLE, ACS_TABLE_IDLE_TRANS_1.second); ss.addTable(&ACS_TABLE_IDLE_TRANS_1.second, ACS_TABLE_IDLE_TRANS_1.first, false, true); // Build IDLE sequence @@ -339,7 +339,7 @@ void buildTargetPtSequence(Subsystem& ss, ModeListEntry& eh) { }; // Build TARGET PT table - iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET, ACS_TABLE_PTG_TARGET_TGT.second); + iht(objects::ACS_CONTROLLER, NML, acs::AcsModes::PTG_TARGET, ACS_TABLE_PTG_TARGET_TGT.second); iht(objects::IMTQ_HANDLER, 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); @@ -350,7 +350,7 @@ void buildTargetPtSequence(Subsystem& ss, ModeListEntry& eh) { // Transition 0 already built // Build TARGET PT transition 1 - iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET, + iht(objects::ACS_CONTROLLER, NML, acs::AcsModes::PTG_TARGET, ACS_TABLE_PTG_TARGET_TRANS_1.second); check(ss.addTable(&ACS_TABLE_PTG_TARGET_TRANS_1.second, ACS_TABLE_PTG_TARGET_TRANS_1.first, false, true), @@ -386,7 +386,7 @@ void buildTargetPtNadirSequence(Subsystem& ss, ModeListEntry& eh) { }; // Build TARGET PT table - iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET, + iht(objects::ACS_CONTROLLER, NML, acs::AcsModes::PTG_TARGET, ACS_TABLE_PTG_TARGET_NADIR_TGT.second); iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_PTG_TARGET_NADIR_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_NADIR_TGT.second); @@ -399,7 +399,7 @@ void buildTargetPtNadirSequence(Subsystem& ss, ModeListEntry& eh) { // Transition 0 already built // Build TARGET PT transition 1 - iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET_NADIR, + iht(objects::ACS_CONTROLLER, NML, acs::AcsModes::PTG_TARGET_NADIR, ACS_TABLE_PTG_TARGET_NADIR_TRANS_1.second); check(ss.addTable(TableEntry(ACS_TABLE_PTG_TARGET_NADIR_TRANS_1.first, &ACS_TABLE_PTG_TARGET_NADIR_TRANS_1.second)), @@ -436,7 +436,7 @@ void buildTargetPtGsSequence(Subsystem& ss, ModeListEntry& eh) { }; // Build TARGET PT table - iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET_GS, + iht(objects::ACS_CONTROLLER, NML, acs::AcsModes::PTG_TARGET_GS, ACS_TABLE_PTG_TARGET_GS_TGT.second); iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_PTG_TARGET_GS_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_GS_TGT.second); @@ -449,7 +449,7 @@ void buildTargetPtGsSequence(Subsystem& ss, ModeListEntry& eh) { // Transition 0 already built // Build TARGET PT transition 1 - iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET_GS, + iht(objects::ACS_CONTROLLER, NML, acs::AcsModes::PTG_TARGET_GS, ACS_TABLE_PTG_TARGET_GS_TRANS_1.second); check(ss.addTable(TableEntry(ACS_TABLE_PTG_TARGET_GS_TRANS_1.first, &ACS_TABLE_PTG_TARGET_GS_TRANS_1.second)), @@ -485,7 +485,7 @@ void buildTargetPtInertialSequence(Subsystem& ss, ModeListEntry& eh) { }; // Build TARGET PT table - iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET_INERTIAL, + iht(objects::ACS_CONTROLLER, NML, acs::AcsModes::PTG_TARGET_INERTIAL, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second); iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second); @@ -498,7 +498,7 @@ void buildTargetPtInertialSequence(Subsystem& ss, ModeListEntry& eh) { // Transition 0 already built // Build TARGET PT transition 1 - iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET_INERTIAL, + iht(objects::ACS_CONTROLLER, NML, acs::AcsModes::PTG_TARGET_INERTIAL, ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1.second); check(ss.addTable(TableEntry(ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1.first, &ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1.second)), From 6829c16ced541ab772b41c158d4baf84a4454ef7 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Feb 2023 17:50:44 +0100 Subject: [PATCH 190/330] that seems to do the trick --- CMakeLists.txt | 6 +++--- bsp_q7s/OBSWConfig.h.in | 2 ++ cmake/BuildType.cmake | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 97b1b2a0..69c3d8f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -301,6 +301,9 @@ else() endif() endif() +include(BuildType) +set_build_type() + # Configuration files configure_file(${COMMON_CONFIG_PATH}/commonConfig.h.in commonConfig.h) configure_file(${FSFW_CONFIG_PATH}/FSFWConfig.h.in FSFWConfig.h) @@ -559,6 +562,3 @@ add_custom_command( POST_BUILD COMMAND ${CMAKE_SIZE} ${OBSW_BIN_NAME}${FILE_SUFFIX} COMMENT ${POST_BUILD_COMMENT}) - -include(BuildType) -set_build_type() diff --git a/bsp_q7s/OBSWConfig.h.in b/bsp_q7s/OBSWConfig.h.in index 5dff001c..be5c7dc9 100644 --- a/bsp_q7s/OBSWConfig.h.in +++ b/bsp_q7s/OBSWConfig.h.in @@ -10,6 +10,8 @@ #include "q7sConfig.h" #include "OBSWVersion.h" +#cmakedefine RELEASE_BUILD + /*******************************************************************/ /** All of the following flags should be enabled for mission code */ /*******************************************************************/ diff --git a/cmake/BuildType.cmake b/cmake/BuildType.cmake index e078e5c7..ee027d13 100644 --- a/cmake/BuildType.cmake +++ b/cmake/BuildType.cmake @@ -21,10 +21,13 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) ) endif() +set(RELEASE_BUILD 1 PARENT_SCOPE) + if(${CMAKE_BUILD_TYPE} MATCHES "Debug") message(STATUS "Building Debug application with flags: ${CMAKE_C_FLAGS_DEBUG}" ) + set(RELEASE_BUILD 0 PARENT_SCOPE) elseif(${CMAKE_BUILD_TYPE} MATCHES "RelWithDebInfo") message(STATUS "Building Release (Debug) application with " From 835d2277d8b530741e177d145b90a4c0635c51be Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Feb 2023 17:54:56 +0100 Subject: [PATCH 191/330] impl variable freq depending on build type --- bsp_q7s/core/scheduling.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index e8f83f0e..42a11875 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -413,8 +413,13 @@ void scheduling::createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction std::vector& taskVec) { ReturnValue_t result = returnvalue::OK; +#ifdef RELEASE_BUILD + static constexpr float acsPstPeriod = 0.4; +#else + static constexpr float acsPstPeriod = 0.6; +#endif FixedTimeslotTaskIF* acsPst = factory.createFixedTimeslotTask( - "ACS_PST", 85, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 1.0, missedDeadlineFunc); + "ACS_PST", 85, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, acsPstPeriod, missedDeadlineFunc); result = pst::pstAcs(acsPst); if (result != returnvalue::OK) { if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { From 4f2853e1b81e742258465676b8196bf8e92f7b89 Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 7 Feb 2023 18:07:19 +0100 Subject: [PATCH 192/330] adapted new acs submodes for checkModeCommand --- mission/controller/AcsController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 8a58eb90..2e53d17c 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -426,7 +426,7 @@ ReturnValue_t AcsController::checkModeCommand(Mode_t mode, Submode_t submode, return INVALID_SUBMODE; } } else if ((mode == MODE_ON) || (mode == MODE_NORMAL)) { - if ((submode > 6) || (submode < 2)) { + if ((submode > acs::PTG_TARGET_INERTIAL) || (submode < acs::SAFE)) { return INVALID_SUBMODE; } else { return returnvalue::OK; From 6cda616236389c8a7719f828f8afc621dcd71220 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Feb 2023 18:10:48 +0100 Subject: [PATCH 193/330] update changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 787c5d25..e6237272 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,7 +53,8 @@ eive-tmtc version: v2.12.0 ## Changed - Update ACS scheduling to represent the actual ACS design. There is one ACS PST now for all - timing sensitive ACS operations. + timing sensitive ACS operations. In the debug builds, the new ACS polling sequence table + will have a period of 0.6 seconds, but will remain 0.4 seconds for the release build. PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/365 - `ACS::SensorValues` is now an ACS controller member to reduce the risk of stack overflow. - ACS Subsystem Sequence Mode IDs updated. From 2580b7cb20b92598a652dcd620a1a2d7f3593dbf Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Feb 2023 19:37:23 +0100 Subject: [PATCH 194/330] proper handling for git sha hash --- CMakeLists.txt | 5 ++++- cmake/EiveHelpers.cmake | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 97b1b2a0..25e63e69 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -171,7 +171,10 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git) list(GET GIT_INFO 1 OBSW_VERSION_MAJOR) list(GET GIT_INFO 2 OBSW_VERSION_MINOR) list(GET GIT_INFO 3 OBSW_VERSION_REVISION) - list(GET GIT_INFO 4 OBSW_VERSION_CST_GIT_SHA1) + list(LENGTH GIT_INFO LIST_LEN) + if(LIST_LEN GREATER 4) + list(GET GIT_INFO 4 OBSW_VERSION_CST_GIT_SHA1) + endif() if(NOT OBSW_VERSION_MAJOR) set(OBSW_VERSION_MAJOR ${OBSW_VERSION_MAJOR_IF_GIT_FAILS}) endif() diff --git a/cmake/EiveHelpers.cmake b/cmake/EiveHelpers.cmake index 1a717552..6410bf28 100644 --- a/cmake/EiveHelpers.cmake +++ b/cmake/EiveHelpers.cmake @@ -4,7 +4,7 @@ # 2. Major version # 3. Minor version # 4. Revision -# 5. git SHA hash and commits since tag +# 5. (Optional) git SHA hash and commits since tag when applicable function(determine_version_with_git) include(GetGitRevisionDescription) git_describe(VERSION ${ARGN}) @@ -22,7 +22,10 @@ function(determine_version_with_git) list(APPEND GIT_INFO ${_VERSION_MAJOR}) list(APPEND GIT_INFO ${_VERSION_MINOR}) list(APPEND GIT_INFO ${_VERSION_PATCH}) - list(APPEND GIT_INFO ${VERSION_SHA1}) + if(NOT VERSION_SHA1 STREQUAL VERSION) + list(APPEND GIT_INFO ${VERSION_SHA1}) + endif() set(GIT_INFO ${GIT_INFO} PARENT_SCOPE) + message(STATUS "GIT INFO: ${GIT_INFO}") message(STATUS "eive | Set git version info into GIT_INFO from the git tag ${VERSION}") endfunction() From 7514071d799e31e4348d69ed7f697697c1b16a37 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Feb 2023 19:39:29 +0100 Subject: [PATCH 195/330] remove stray printout --- cmake/EiveHelpers.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/cmake/EiveHelpers.cmake b/cmake/EiveHelpers.cmake index 6410bf28..b210739e 100644 --- a/cmake/EiveHelpers.cmake +++ b/cmake/EiveHelpers.cmake @@ -26,6 +26,5 @@ function(determine_version_with_git) list(APPEND GIT_INFO ${VERSION_SHA1}) endif() set(GIT_INFO ${GIT_INFO} PARENT_SCOPE) - message(STATUS "GIT INFO: ${GIT_INFO}") message(STATUS "eive | Set git version info into GIT_INFO from the git tag ${VERSION}") endfunction() From 9373a244131b8b9dcbf8738ff34c521ace99cb45 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Feb 2023 19:40:32 +0100 Subject: [PATCH 196/330] bump changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5eceb87..e6fee72b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,12 @@ change warranting a new major release: # [unreleased] +## Fixed + +- Build system: Fixed small bug, where the version itself was + stored as the git SHA hash in `commonConfig.h`. This will be + an empty string now for regular versions. + # [v1.25.0] 2023-02-06 eive-tmtc version: v2.12.0 From 6a24e1b9357ec0a53da11ffcbbdaace7bf493c52 Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 7 Feb 2023 20:11:16 +0100 Subject: [PATCH 197/330] updated MGM calibration values --- mission/controller/acs/AcsParameters.h | 32 +++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index a7b2d631..c4653590 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -41,23 +41,23 @@ class AcsParameters /*: public HasParametersIF*/ { float mgm1hardIronOffset[3] = {-1.077152, 2.080583, 1.974483}; float mgm2hardIronOffset[3] = {-19.285857, 5.401821, -16.096297}; float mgm3hardIronOffset[3] = {-0.634033, 2.787695, 0.092036}; - float mgm4hardIronOffset[3] = {1.722133, 4.511870, 0.379980}; + float mgm4hardIronOffset[3] = {2.702743, 5.236043, 0.726229}; - float mgm0softIronInverse[3][3] = {{1.163335, 0.137584, 0.203908}, - {0.137584, 0.625606, 0.045537}, - {0.203908, 0.045537, 1.095923}}; - float mgm1softIronInverse[3][3] = {{0.972071, 0.131166, 0.042151}, - {0.131166, 0.803260, 0.034779}, - {0.042151, 0.034779, 0.923417}}; - float mgm2softIronInverse[3][3] = {{1.234863, -0.157745, 0.070813}, - {-0.157745, 0.746707, -0.062080}, - {0.070813, -0.062080, 1.122514}}; - float mgm3softIronInverse[3][3] = {{0.956890, -0.134841, 0.054017}, - {-0.134841, 0.811361, -0.015383}, - {0.054017, -0.015383, 0.939153}}; - float mgm4softIronInverse[3][3] = {{0.913163, 0.011058, 0.023273}, - {0.011058, 0.792295, 0.002921}, - {0.023273, 0.002921, 0.739496}}; + float mgm0softIronInverse[3][3] = {{0.910192, -0.188413, -0.161522}, + {-0.188413, 1.642303, -0.033184}, + {-0.161522, -0.033184, 0.943904}}; + float mgm1softIronInverse[3][3] = {{1.053508, -0.170225, -0.041678}, + {-0.170225, 1.274465, -0.040231}, + {-0.041678, -0.040231, 1.086352}}; + float mgm2softIronInverse[3][3] = {{0.931086, 0.172675, -0.043084}, + {0.172675, 1.541296, 0.065489}, + {-0.043084, 0.065489, 1.001238}}; + float mgm3softIronInverse[3][3] = {{1.073353, 0.177266, -0.058832}, + {0.177266, 1.262156, 0.010478}, + {-0.058832, 0.010478, 1.068345}}; + float mgm4softIronInverse[3][3] = {{1.114887, -0.007534, -0.037072}, + {-0.007534, 1.253879, 0.006812}, + {-0.037072, 0.006812, 1.313158}}; float mgm02variance[3] = {1, 1, 1}; float mgm13variance[3] = {1, 1, 1}; From d6a40487934e17c42b38bce1e7a85b6f04385e2c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Feb 2023 01:32:18 +0100 Subject: [PATCH 198/330] bump FSFW, TMTC and changelog --- CHANGELOG.md | 1 + fsfw | 2 +- tmtc | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6fee72b..ddeee97b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ change warranting a new major release: - Build system: Fixed small bug, where the version itself was stored as the git SHA hash in `commonConfig.h`. This will be an empty string now for regular versions. +- Bump FSFW for important fix in PUS mode service. # [v1.25.0] 2023-02-06 diff --git a/fsfw b/fsfw index 38789e05..84dc7ac0 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 38789e053b65cfa14604fc625e7bcc8ca03a3f17 +Subproject commit 84dc7ac0ce4f16d93a6a5a5fcd453b2fde206dba diff --git a/tmtc b/tmtc index d6445d38..f16e27b7 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit d6445d38a8eb644a5e1bd27f0fc56d29e93c030d +Subproject commit f16e27b79b9996f5a6c246cea560b783eb566d7e From 489c813bcc637bd519b0b14eb40cb625b4988224 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 8 Feb 2023 11:05:35 +0100 Subject: [PATCH 199/330] better fit for acs::OFF with SUBMODE_NONE --- mission/acsDefs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/acsDefs.h b/mission/acsDefs.h index 8869d6ff..63824131 100644 --- a/mission/acsDefs.h +++ b/mission/acsDefs.h @@ -7,7 +7,7 @@ namespace acs { enum CtrlSubmode { - OFF = HasModesIF::MODE_OFF, + OFF = HasModesIF::SUBMODE_NONE, SAFE = 10, DETUMBLE = 11, IDLE = 12, From c170bff7202dca5e0fd958d68db0a52ebfb08ef9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Feb 2023 11:08:38 +0100 Subject: [PATCH 200/330] add release checklist --- CHANGELOG.md | 2 ++ CMakeLists.txt | 14 +++++++------- bsp_hosted/OBSWConfig.h.in | 1 - bsp_q7s/OBSWConfig.h.in | 1 - bsp_q7s/core/CoreController.cpp | 13 +++++++++---- bsp_q7s/core/CoreController.h | 8 ++++++++ common/config/OBSWVersion.h | 10 ---------- fsfw | 2 +- mission/system/objects/AcsSubsystem.cpp | 4 ++-- release_checklist.md | 12 ++++++++++++ unittest/rebootLogic/src/CoreController.h | 2 +- 11 files changed, 42 insertions(+), 27 deletions(-) delete mode 100644 common/config/OBSWVersion.h create mode 100644 release_checklist.md diff --git a/CHANGELOG.md b/CHANGELOG.md index ddeee97b..336fce6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ change warranting a new major release: ## Fixed +- Single sourcing the version information into `CMakeLists.txt`. The `git describe` functionality + is only used to retrieve the git SHA hash now. Also removed `OBSWVersion.h` accordingly. - Build system: Fixed small bug, where the version itself was stored as the git SHA hash in `commonConfig.h`. This will be an empty string now for regular versions. diff --git a/CMakeLists.txt b/CMakeLists.txt index 25e63e69..f670b6f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,9 +9,9 @@ # ############################################################################## cmake_minimum_required(VERSION 3.13) -set(OBSW_VERSION_MAJOR_IF_GIT_FAILS 1) -set(OBSW_VERSION_MINOR_IF_GIT_FAILS 25) -set(OBSW_VERSION_REVISION_IF_GIT_FAILS 0) +set(OBSW_VERSION_MAJOR 1) +set(OBSW_VERSION_MINOR 25) +set(OBSW_VERSION_REVISION 0) # set(CMAKE_VERBOSE TRUE) @@ -168,12 +168,12 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git) set(GIT_INFO ${GIT_INFO} CACHE STRING "Version information retrieved with git describe") - list(GET GIT_INFO 1 OBSW_VERSION_MAJOR) - list(GET GIT_INFO 2 OBSW_VERSION_MINOR) - list(GET GIT_INFO 3 OBSW_VERSION_REVISION) + # CMakeLists.txt is now single source of information. list(GET GIT_INFO 1 + # OBSW_VERSION_MAJOR) list(GET GIT_INFO 2 OBSW_VERSION_MINOR) list(GET + # GIT_INFO 3 OBSW_VERSION_REVISION) list(LENGTH GIT_INFO LIST_LEN) if(LIST_LEN GREATER 4) - list(GET GIT_INFO 4 OBSW_VERSION_CST_GIT_SHA1) + list(GET GIT_INFO 4 OBSW_VERSION_CST_GIT_SHA1) endif() if(NOT OBSW_VERSION_MAJOR) set(OBSW_VERSION_MAJOR ${OBSW_VERSION_MAJOR_IF_GIT_FAILS}) diff --git a/bsp_hosted/OBSWConfig.h.in b/bsp_hosted/OBSWConfig.h.in index e58e534d..5e6fcc2c 100644 --- a/bsp_hosted/OBSWConfig.h.in +++ b/bsp_hosted/OBSWConfig.h.in @@ -7,7 +7,6 @@ #define FSFWCONFIG_OBSWCONFIG_H_ #include "commonConfig.h" -#include "OBSWVersion.h" /*******************************************************************/ /** All of the following flags should be enabled for mission code */ diff --git a/bsp_q7s/OBSWConfig.h.in b/bsp_q7s/OBSWConfig.h.in index 5dff001c..9273e4e9 100644 --- a/bsp_q7s/OBSWConfig.h.in +++ b/bsp_q7s/OBSWConfig.h.in @@ -8,7 +8,6 @@ #include "commonConfig.h" #include "q7sConfig.h" -#include "OBSWVersion.h" /*******************************************************************/ /** All of the following flags should be enabled for mission code */ diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index 23c6cc4f..50c662d7 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -5,7 +5,7 @@ #include #include -#include "OBSWVersion.h" +#include "commonConfig.h" #include "fsfw/serviceinterface/ServiceInterface.h" #include "fsfw/timemanager/Stopwatch.h" #include "fsfw/version.h" @@ -179,6 +179,11 @@ ReturnValue_t CoreController::initializeAfterTaskCreation() { ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, const uint8_t *data, size_t size) { switch (actionId) { + case (ANNOUNCE_VERSION): { + // uint32_t p1= + triggerEvent(VERSION_INFO); + return HasActionsIF::EXECUTION_FINISHED; + } case (LIST_DIRECTORY_INTO_FILE): { return actionListDirectoryIntoFile(actionId, commandedBy, data, size); } @@ -673,9 +678,9 @@ ReturnValue_t CoreController::initVersionFile() { sif::warning << "CoreController::versionFileInit: Retrieving uname line failed" << std::endl; } - std::string fullObswVersionString = "OBSW: v" + std::to_string(SW_VERSION) + "." + - std::to_string(SW_SUBVERSION) + "." + - std::to_string(SW_REVISION); + std::string fullObswVersionString = "OBSW: v" + std::to_string(common::OBSW_VERSION_MAJOR) + "." + + std::to_string(common::OBSW_VERSION_MINOR) + "." + + std::to_string(common::OBSW_VERSION_REVISION); char versionString[16] = {}; fsfw::FSFW_VERSION.getVersion(versionString, sizeof(versionString)); std::string fullFsfwVersionString = "FSFW: v" + std::string(versionString); diff --git a/bsp_q7s/core/CoreController.h b/bsp_q7s/core/CoreController.h index 4d9d5ee8..9cbc6340 100644 --- a/bsp_q7s/core/CoreController.h +++ b/bsp_q7s/core/CoreController.h @@ -74,6 +74,8 @@ class CoreController : public ExtendedControllerBase { static constexpr dur_millis_t DEFAULT_SD_CARD_CHECK_TIMEOUT = 60000; static constexpr ActionId_t LIST_DIRECTORY_INTO_FILE = 0; + static constexpr ActionId_t ANNOUNCE_VERSION = 1; + static constexpr ActionId_t ANNOUNCE_CURRENT_IMAGE = 2; static constexpr ActionId_t SWITCH_REBOOT_FILE_HANDLING = 5; static constexpr ActionId_t RESET_REBOOT_COUNTERS = 6; static constexpr ActionId_t SWITCH_IMG_LOCK = 7; @@ -109,6 +111,12 @@ class CoreController : public ExtendedControllerBase { //! [EXPORT] : [COMMENT] No SD card was active. Core controller will attempt to re-initialize //! a SD card. static constexpr Event NO_SD_CARD_ACTIVE = event::makeEvent(SUBSYSTEM_ID, 4, severity::HIGH); + //! [EXPORT] : [COMMENT] + //! P1: Byte 0: Major, Byte 1: Minor, Byte 2: Patch, Byte 3: Has Git Hash + //! P2: First four letters of Git SHA is the last byte of P1 is set. + static constexpr Event VERSION_INFO = event::makeEvent(SUBSYSTEM_ID, 5, severity::INFO); + //! [EXPORT] : [COMMENT] P1: Current Chip, P2: Current Copy + static constexpr Event CURRENT_IMAGE_INFO = event::makeEvent(SUBSYSTEM_ID, 6, severity::INFO); CoreController(object_id_t objectId); virtual ~CoreController(); diff --git a/common/config/OBSWVersion.h b/common/config/OBSWVersion.h deleted file mode 100644 index 36233c3b..00000000 --- a/common/config/OBSWVersion.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef COMMON_CONFIG_OBSWVERSION_H_ -#define COMMON_CONFIG_OBSWVERSION_H_ - -const char* const SW_NAME = "eive"; - -#define SW_VERSION 1 -#define SW_SUBVERSION 12 -#define SW_REVISION 1 - -#endif /* COMMON_CONFIG_OBSWVERSION_H_ */ diff --git a/fsfw b/fsfw index 84dc7ac0..84bbef01 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 84dc7ac0ce4f16d93a6a5a5fcd453b2fde206dba +Subproject commit 84bbef016712096147e8cf3f2cec87f317d9e7e7 diff --git a/mission/system/objects/AcsSubsystem.cpp b/mission/system/objects/AcsSubsystem.cpp index f5b8a0ce..6f7bbf7c 100644 --- a/mission/system/objects/AcsSubsystem.cpp +++ b/mission/system/objects/AcsSubsystem.cpp @@ -58,7 +58,7 @@ void AcsSubsystem::handleEventMessages() { case EventMessage::EVENT_MESSAGE: if (event.getEvent() == acs::SAFE_RATE_VIOLATION) { CommandMessage msg; - ModeMessage::setCmdModeModeMessage(msg, acs::CtrlSubmode::DETUMBLE, 0); + ModeMessage::setCmdModeMessage(msg, acs::CtrlSubmode::DETUMBLE, 0); ReturnValue_t result = commandQueue->sendMessage(commandQueue->getId(), &msg); if (result != returnvalue::OK) { sif::error << "AcsSubsystem: sending DETUMBLE mode cmd to self has failed" << std::endl; @@ -66,7 +66,7 @@ void AcsSubsystem::handleEventMessages() { } if (event.getEvent() == acs::SAFE_RATE_RECOVERY) { CommandMessage msg; - ModeMessage::setCmdModeModeMessage(msg, acs::CtrlSubmode::SAFE, 0); + ModeMessage::setCmdModeMessage(msg, acs::CtrlSubmode::SAFE, 0); ReturnValue_t result = commandQueue->sendMessage(commandQueue->getId(), &msg); if (result != returnvalue::OK) { sif::error << "AcsSubsystem: sending IDLE mode cmd to self has failed" << std::endl; diff --git a/release_checklist.md b/release_checklist.md new file mode 100644 index 00000000..b4f08165 --- /dev/null +++ b/release_checklist.md @@ -0,0 +1,12 @@ +OBSW Release Checklist +========= + +# Pre-Release + +1. Update version in `CMakeLists.txt` +2. Verify that the Q7S, Q7S EM and Host build are working +3. Wait for CI/CD results + +# Post-Release + +1. Create a new release with tag on `EGit` diff --git a/unittest/rebootLogic/src/CoreController.h b/unittest/rebootLogic/src/CoreController.h index 1846c27f..0d89b215 100644 --- a/unittest/rebootLogic/src/CoreController.h +++ b/unittest/rebootLogic/src/CoreController.h @@ -76,4 +76,4 @@ class CoreController { SdCardManager* sdcMan = nullptr; RebootFile rebootFile = {}; bool doPerformRebootFileHandling = true; -}; \ No newline at end of file +}; From d0c8c2a418104cff03084743b4b611a255023c0f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Feb 2023 11:12:12 +0100 Subject: [PATCH 201/330] revert some change --- unittest/rebootLogic/src/CoreController.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unittest/rebootLogic/src/CoreController.h b/unittest/rebootLogic/src/CoreController.h index 0d89b215..1846c27f 100644 --- a/unittest/rebootLogic/src/CoreController.h +++ b/unittest/rebootLogic/src/CoreController.h @@ -76,4 +76,4 @@ class CoreController { SdCardManager* sdcMan = nullptr; RebootFile rebootFile = {}; bool doPerformRebootFileHandling = true; -}; +}; \ No newline at end of file From 37988fbfd454f9df9967ad86cee8c54a9bec7f52 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Feb 2023 11:17:08 +0100 Subject: [PATCH 202/330] complete impl --- bsp_q7s/core/CoreController.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index 50c662d7..d892bc74 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -180,8 +180,20 @@ ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_ const uint8_t *data, size_t size) { switch (actionId) { case (ANNOUNCE_VERSION): { - // uint32_t p1= - triggerEvent(VERSION_INFO); + uint32_t p1 = (common::OBSW_VERSION_MAJOR << 24) | (common::OBSW_VERSION_MINOR << 16) | + (common::OBSW_VERSION_REVISION << 8); + uint32_t p2 = 0; + if (strcmp("", common::OBSW_VERSION_CST_GIT_SHA1) != 0) { + p1 |= 1; + // Only copy first 4 letters of git hash + memcpy(&p2, common::OBSW_VERSION_CST_GIT_SHA1 + 3, 4); + } + + triggerEvent(VERSION_INFO, p1, p2); + return HasActionsIF::EXECUTION_FINISHED; + } + case (ANNOUNCE_CURRENT_IMAGE): { + triggerEvent(CURRENT_IMAGE_INFO, CURRENT_CHIP, CURRENT_COPY); return HasActionsIF::EXECUTION_FINISHED; } case (LIST_DIRECTORY_INTO_FILE): { From b7ec4e3b2043feebba3bb5f403443ff5727690df Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Feb 2023 11:21:39 +0100 Subject: [PATCH 203/330] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index f16e27b7..ef42b1a1 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit f16e27b79b9996f5a6c246cea560b783eb566d7e +Subproject commit ef42b1a179c8cede6092ba328cc7baa92916c26f From de95a1ba61148e3cb51925ad9419423cdc170708 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Feb 2023 11:22:57 +0100 Subject: [PATCH 204/330] add new events --- generators/bsp_q7s_events.csv | 2 ++ generators/events/translateEvents.cpp | 10 ++++++++-- generators/objects/translateObjects.cpp | 2 +- linux/fsfwconfig/events/translateEvents.cpp | 10 ++++++++-- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- tmtc | 2 +- 6 files changed, 21 insertions(+), 7 deletions(-) diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index 2e39b641..b6e2cc88 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -244,3 +244,5 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 14002;0x36b2;REBOOT_MECHANISM_TRIGGERED;MEDIUM;The reboot mechanism was triggered. P1: First 16 bits: Last Chip, Last 16 bits: Last Copy, P2: Each byte is the respective reboot count for the slots;bsp_q7s/core/CoreController.h 14003;0x36b3;REBOOT_HW;MEDIUM;;bsp_q7s/core/CoreController.h 14004;0x36b4;NO_SD_CARD_ACTIVE;HIGH;No SD card was active. Core controller will attempt to re-initialize a SD card.;bsp_q7s/core/CoreController.h +14005;0x36b5;VERSION_INFO;INFO;P1: Byte 0: Major, Byte 1: Minor, Byte 2: Patch, Byte 3: Has Git Hash P2: First four letters of Git SHA is the last byte of P1 is set.;bsp_q7s/core/CoreController.h +14006;0x36b6;CURRENT_IMAGE_INFO;INFO;P1: Current Chip, P2: Current Copy;bsp_q7s/core/CoreController.h diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index e810f4d1..44dc3f24 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 245 translations. + * @brief Auto-generated event translation file. Contains 247 translations. * @details - * Generated on: 2023-02-03 10:52:53 + * Generated on: 2023-02-08 11:22:40 */ #include "translateEvents.h" @@ -245,6 +245,8 @@ const char *REBOOT_SW_STRING = "REBOOT_SW"; const char *REBOOT_MECHANISM_TRIGGERED_STRING = "REBOOT_MECHANISM_TRIGGERED"; const char *REBOOT_HW_STRING = "REBOOT_HW"; const char *NO_SD_CARD_ACTIVE_STRING = "NO_SD_CARD_ACTIVE"; +const char *VERSION_INFO_STRING = "VERSION_INFO"; +const char *CURRENT_IMAGE_INFO_STRING = "CURRENT_IMAGE_INFO"; const char *translateEvents(Event event) { switch ((event & 0xFFFF)) { @@ -728,6 +730,10 @@ const char *translateEvents(Event event) { return REBOOT_HW_STRING; case (14004): return NO_SD_CARD_ACTIVE_STRING; + case (14005): + return VERSION_INFO_STRING; + case (14006): + return CURRENT_IMAGE_INFO_STRING; default: return "UNKNOWN_EVENT"; } diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 9707189d..873bc547 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 152 translations. - * Generated on: 2023-02-03 10:52:53 + * Generated on: 2023-02-08 11:22:40 */ #include "translateObjects.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index e810f4d1..44dc3f24 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 245 translations. + * @brief Auto-generated event translation file. Contains 247 translations. * @details - * Generated on: 2023-02-03 10:52:53 + * Generated on: 2023-02-08 11:22:40 */ #include "translateEvents.h" @@ -245,6 +245,8 @@ const char *REBOOT_SW_STRING = "REBOOT_SW"; const char *REBOOT_MECHANISM_TRIGGERED_STRING = "REBOOT_MECHANISM_TRIGGERED"; const char *REBOOT_HW_STRING = "REBOOT_HW"; const char *NO_SD_CARD_ACTIVE_STRING = "NO_SD_CARD_ACTIVE"; +const char *VERSION_INFO_STRING = "VERSION_INFO"; +const char *CURRENT_IMAGE_INFO_STRING = "CURRENT_IMAGE_INFO"; const char *translateEvents(Event event) { switch ((event & 0xFFFF)) { @@ -728,6 +730,10 @@ const char *translateEvents(Event event) { return REBOOT_HW_STRING; case (14004): return NO_SD_CARD_ACTIVE_STRING; + case (14005): + return VERSION_INFO_STRING; + case (14006): + return CURRENT_IMAGE_INFO_STRING; default: return "UNKNOWN_EVENT"; } diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 9707189d..873bc547 100644 --- a/linux/fsfwconfig/objects/translateObjects.cpp +++ b/linux/fsfwconfig/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 152 translations. - * Generated on: 2023-02-03 10:52:53 + * Generated on: 2023-02-08 11:22:40 */ #include "translateObjects.h" diff --git a/tmtc b/tmtc index ef42b1a1..dedfe1c9 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit ef42b1a179c8cede6092ba328cc7baa92916c26f +Subproject commit dedfe1c977fbe47a2d6a50e56e01eed9fe48b869 From 02f03495259c09e1ab70e402bfe852c9852643f7 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Feb 2023 11:53:20 +0100 Subject: [PATCH 205/330] done --- bsp_q7s/core/CoreController.cpp | 5 ++++- tmtc | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index d892bc74..116b4fc9 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -185,8 +185,11 @@ ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_ uint32_t p2 = 0; if (strcmp("", common::OBSW_VERSION_CST_GIT_SHA1) != 0) { p1 |= 1; + auto shaAsStr = std::string(common::OBSW_VERSION_CST_GIT_SHA1); + size_t posDash = shaAsStr.find("-"); + auto gitHash = shaAsStr.substr(posDash + 2, 4); // Only copy first 4 letters of git hash - memcpy(&p2, common::OBSW_VERSION_CST_GIT_SHA1 + 3, 4); + memcpy(&p2, gitHash.c_str(), 4); } triggerEvent(VERSION_INFO, p1, p2); diff --git a/tmtc b/tmtc index dedfe1c9..4086e794 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit dedfe1c977fbe47a2d6a50e56e01eed9fe48b869 +Subproject commit 4086e7947b4458bcbbd47c78e67c23d3a47885c8 From e25eed76877b14afe9ddb43dc7b051c300d3f2fa Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Feb 2023 13:17:47 +0100 Subject: [PATCH 206/330] now it compiles --- mission/system/objects/AcsSubsystem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mission/system/objects/AcsSubsystem.cpp b/mission/system/objects/AcsSubsystem.cpp index 6f7bbf7c..800c4344 100644 --- a/mission/system/objects/AcsSubsystem.cpp +++ b/mission/system/objects/AcsSubsystem.cpp @@ -58,7 +58,7 @@ void AcsSubsystem::handleEventMessages() { case EventMessage::EVENT_MESSAGE: if (event.getEvent() == acs::SAFE_RATE_VIOLATION) { CommandMessage msg; - ModeMessage::setCmdModeMessage(msg, acs::CtrlSubmode::DETUMBLE, 0); + ModeMessage::setCmdModeMessage(msg, acs::AcsModes::DETUMBLE, 0); ReturnValue_t result = commandQueue->sendMessage(commandQueue->getId(), &msg); if (result != returnvalue::OK) { sif::error << "AcsSubsystem: sending DETUMBLE mode cmd to self has failed" << std::endl; @@ -66,7 +66,7 @@ void AcsSubsystem::handleEventMessages() { } if (event.getEvent() == acs::SAFE_RATE_RECOVERY) { CommandMessage msg; - ModeMessage::setCmdModeMessage(msg, acs::CtrlSubmode::SAFE, 0); + ModeMessage::setCmdModeMessage(msg, acs::AcsModes::SAFE, 0); ReturnValue_t result = commandQueue->sendMessage(commandQueue->getId(), &msg); if (result != returnvalue::OK) { sif::error << "AcsSubsystem: sending IDLE mode cmd to self has failed" << std::endl; From bfa61632c2043478b8273fb14e9149428fd9352f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Feb 2023 13:18:45 +0100 Subject: [PATCH 207/330] use singular enum name --- mission/acsDefs.h | 2 +- mission/controller/AcsController.cpp | 2 +- mission/system/objects/AcsSubsystem.cpp | 4 +- mission/system/tree/acsModeTree.cpp | 88 ++++++++++++------------- 4 files changed, 48 insertions(+), 48 deletions(-) diff --git a/mission/acsDefs.h b/mission/acsDefs.h index ca4ab77c..170305bb 100644 --- a/mission/acsDefs.h +++ b/mission/acsDefs.h @@ -7,7 +7,7 @@ namespace acs { // These modes are the submodes of the ACS controller and the modes of the ACS subsystem. -enum AcsModes { +enum AcsMode { OFF = HasModesIF::MODE_OFF, SAFE = 10, DETUMBLE = 11, diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 50f22483..14069b0a 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -426,7 +426,7 @@ ReturnValue_t AcsController::checkModeCommand(Mode_t mode, Submode_t submode, return INVALID_SUBMODE; } } else if ((mode == MODE_ON) || (mode == MODE_NORMAL)) { - if ((submode < acs::AcsModes::SAFE) or (submode > acs::AcsModes::PTG_TARGET_INERTIAL)) { + if ((submode < acs::AcsMode::SAFE) or (submode > acs::AcsMode::PTG_TARGET_INERTIAL)) { return INVALID_SUBMODE; } else { return returnvalue::OK; diff --git a/mission/system/objects/AcsSubsystem.cpp b/mission/system/objects/AcsSubsystem.cpp index 800c4344..dcf4e67b 100644 --- a/mission/system/objects/AcsSubsystem.cpp +++ b/mission/system/objects/AcsSubsystem.cpp @@ -58,7 +58,7 @@ void AcsSubsystem::handleEventMessages() { case EventMessage::EVENT_MESSAGE: if (event.getEvent() == acs::SAFE_RATE_VIOLATION) { CommandMessage msg; - ModeMessage::setCmdModeMessage(msg, acs::AcsModes::DETUMBLE, 0); + ModeMessage::setCmdModeMessage(msg, acs::AcsMode::DETUMBLE, 0); ReturnValue_t result = commandQueue->sendMessage(commandQueue->getId(), &msg); if (result != returnvalue::OK) { sif::error << "AcsSubsystem: sending DETUMBLE mode cmd to self has failed" << std::endl; @@ -66,7 +66,7 @@ void AcsSubsystem::handleEventMessages() { } if (event.getEvent() == acs::SAFE_RATE_RECOVERY) { CommandMessage msg; - ModeMessage::setCmdModeMessage(msg, acs::AcsModes::SAFE, 0); + ModeMessage::setCmdModeMessage(msg, acs::AcsMode::SAFE, 0); ReturnValue_t result = commandQueue->sendMessage(commandQueue->getId(), &msg); if (result != returnvalue::OK) { sif::error << "AcsSubsystem: sending IDLE mode cmd to self has failed" << std::endl; diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index db7d7a81..fe87dff5 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -30,69 +30,69 @@ void buildTargetPtInertialSequence(Subsystem& ss, ModeListEntry& entryHelper); static const auto OFF = HasModesIF::MODE_OFF; static const auto NML = DeviceHandlerIF::MODE_NORMAL; -auto ACS_SEQUENCE_OFF = std::make_pair(acs::AcsModes::OFF, FixedArrayList()); +auto ACS_SEQUENCE_OFF = std::make_pair(acs::AcsMode::OFF, FixedArrayList()); auto ACS_TABLE_OFF_TGT = - std::make_pair((acs::AcsModes::OFF << 24) | 1, FixedArrayList()); + std::make_pair((acs::AcsMode::OFF << 24) | 1, FixedArrayList()); auto ACS_TABLE_OFF_TRANS_0 = - std::make_pair((acs::AcsModes::OFF << 24) | 2, FixedArrayList()); + std::make_pair((acs::AcsMode::OFF << 24) | 2, FixedArrayList()); auto ACS_TABLE_OFF_TRANS_1 = - std::make_pair((acs::AcsModes::OFF << 24) | 3, FixedArrayList()); + std::make_pair((acs::AcsMode::OFF << 24) | 3, FixedArrayList()); auto ACS_SEQUENCE_DETUMBLE = - std::make_pair(acs::AcsModes::DETUMBLE, FixedArrayList()); + std::make_pair(acs::AcsMode::DETUMBLE, FixedArrayList()); auto ACS_TABLE_DETUMBLE_TGT = - std::make_pair((acs::AcsModes::DETUMBLE << 24) | 1, FixedArrayList()); + std::make_pair((acs::AcsMode::DETUMBLE << 24) | 1, FixedArrayList()); auto ACS_TABLE_DETUMBLE_TRANS_0 = - std::make_pair((acs::AcsModes::DETUMBLE << 24) | 2, FixedArrayList()); + std::make_pair((acs::AcsMode::DETUMBLE << 24) | 2, FixedArrayList()); auto ACS_TABLE_DETUMBLE_TRANS_1 = - std::make_pair((acs::AcsModes::DETUMBLE << 24) | 3, FixedArrayList()); + std::make_pair((acs::AcsMode::DETUMBLE << 24) | 3, FixedArrayList()); -auto ACS_SEQUENCE_SAFE = std::make_pair(acs::AcsModes::SAFE, FixedArrayList()); +auto ACS_SEQUENCE_SAFE = std::make_pair(acs::AcsMode::SAFE, FixedArrayList()); auto ACS_TABLE_SAFE_TGT = - std::make_pair((acs::AcsModes::SAFE << 24) | 1, FixedArrayList()); + std::make_pair((acs::AcsMode::SAFE << 24) | 1, FixedArrayList()); auto ACS_TABLE_SAFE_TRANS_0 = - std::make_pair((acs::AcsModes::SAFE << 24) | 2, FixedArrayList()); + std::make_pair((acs::AcsMode::SAFE << 24) | 2, FixedArrayList()); auto ACS_TABLE_SAFE_TRANS_1 = - std::make_pair((acs::AcsModes::SAFE << 24) | 3, FixedArrayList()); + std::make_pair((acs::AcsMode::SAFE << 24) | 3, FixedArrayList()); -auto ACS_SEQUENCE_IDLE = std::make_pair(acs::AcsModes::IDLE, FixedArrayList()); +auto ACS_SEQUENCE_IDLE = std::make_pair(acs::AcsMode::IDLE, FixedArrayList()); auto ACS_TABLE_IDLE_TGT = - std::make_pair((acs::AcsModes::IDLE << 24) | 1, FixedArrayList()); + std::make_pair((acs::AcsMode::IDLE << 24) | 1, FixedArrayList()); auto ACS_TABLE_IDLE_TRANS_0 = - std::make_pair((acs::AcsModes::IDLE << 24) | 2, FixedArrayList()); + std::make_pair((acs::AcsMode::IDLE << 24) | 2, FixedArrayList()); auto ACS_TABLE_IDLE_TRANS_1 = - std::make_pair((acs::AcsModes::IDLE << 24) | 3, FixedArrayList()); + std::make_pair((acs::AcsMode::IDLE << 24) | 3, FixedArrayList()); auto ACS_TABLE_PTG_TRANS_0 = - std::make_pair((acs::AcsModes::PTG_TARGET << 24) | 2, FixedArrayList()); + std::make_pair((acs::AcsMode::PTG_TARGET << 24) | 2, FixedArrayList()); auto ACS_SEQUENCE_PTG_TARGET = - std::make_pair(acs::AcsModes::PTG_TARGET, FixedArrayList()); + std::make_pair(acs::AcsMode::PTG_TARGET, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_TGT = - std::make_pair((acs::AcsModes::PTG_TARGET << 24) | 1, FixedArrayList()); + std::make_pair((acs::AcsMode::PTG_TARGET << 24) | 1, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_TRANS_1 = - std::make_pair((acs::AcsModes::PTG_TARGET << 24) | 3, FixedArrayList()); + std::make_pair((acs::AcsMode::PTG_TARGET << 24) | 3, FixedArrayList()); auto ACS_SEQUENCE_PTG_TARGET_GS = - std::make_pair(acs::AcsModes::PTG_TARGET_GS, FixedArrayList()); + std::make_pair(acs::AcsMode::PTG_TARGET_GS, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_GS_TGT = - std::make_pair((acs::AcsModes::PTG_TARGET_GS << 24) | 1, FixedArrayList()); + std::make_pair((acs::AcsMode::PTG_TARGET_GS << 24) | 1, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_GS_TRANS_1 = - std::make_pair((acs::AcsModes::PTG_TARGET_GS << 24) | 3, FixedArrayList()); + std::make_pair((acs::AcsMode::PTG_TARGET_GS << 24) | 3, FixedArrayList()); auto ACS_SEQUENCE_PTG_TARGET_NADIR = - std::make_pair(acs::AcsModes::PTG_TARGET_NADIR, FixedArrayList()); -auto ACS_TABLE_PTG_TARGET_NADIR_TGT = std::make_pair((acs::AcsModes::PTG_TARGET_NADIR << 24) | 1, + std::make_pair(acs::AcsMode::PTG_TARGET_NADIR, FixedArrayList()); +auto ACS_TABLE_PTG_TARGET_NADIR_TGT = std::make_pair((acs::AcsMode::PTG_TARGET_NADIR << 24) | 1, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_NADIR_TRANS_1 = std::make_pair( - (acs::AcsModes::PTG_TARGET_NADIR << 24) | 3, FixedArrayList()); + (acs::AcsMode::PTG_TARGET_NADIR << 24) | 3, FixedArrayList()); auto ACS_SEQUENCE_PTG_TARGET_INERTIAL = - std::make_pair(acs::AcsModes::PTG_TARGET_INERTIAL, FixedArrayList()); + std::make_pair(acs::AcsMode::PTG_TARGET_INERTIAL, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_INERTIAL_TGT = std::make_pair( - (acs::AcsModes::PTG_TARGET_INERTIAL << 24) | 1, FixedArrayList()); + (acs::AcsMode::PTG_TARGET_INERTIAL << 24) | 1, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1 = std::make_pair( - (acs::AcsModes::PTG_TARGET_INERTIAL << 24) | 3, FixedArrayList()); + (acs::AcsMode::PTG_TARGET_INERTIAL << 24) | 3, FixedArrayList()); void satsystem::acs::init() { ModeListEntry entry; @@ -122,7 +122,7 @@ void satsystem::acs::init() { buildTargetPtGsSequence(ACS_SUBSYSTEM, entry); buildTargetPtNadirSequence(ACS_SUBSYSTEM, entry); buildTargetPtInertialSequence(ACS_SUBSYSTEM, entry); - ACS_SUBSYSTEM.setInitialMode(::acs::AcsModes::SAFE); + ACS_SUBSYSTEM.setInitialMode(::acs::AcsMode::SAFE); } namespace { @@ -190,7 +190,7 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) { check(sequence.insert(eh), ctxc); }; // Build SAFE target - iht(objects::ACS_CONTROLLER, NML, acs::AcsModes::SAFE, ACS_TABLE_SAFE_TGT.second); + iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::SAFE, ACS_TABLE_SAFE_TGT.second); iht(objects::IMTQ_HANDLER, 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); @@ -206,7 +206,7 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) { ctxc); // Build SAFE transition 1 - iht(objects::ACS_CONTROLLER, NML, acs::AcsModes::SAFE, ACS_TABLE_SAFE_TRANS_1.second); + iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::SAFE, ACS_TABLE_SAFE_TRANS_1.second); check(ss.addTable(&ACS_TABLE_SAFE_TRANS_1.second, ACS_TABLE_SAFE_TRANS_1.first, false, true), ctxc); @@ -239,7 +239,7 @@ void buildDetumbleSequence(Subsystem& ss, ModeListEntry& eh) { check(sequence.insert(eh), ctxc); }; // Build DETUMBLE target - iht(objects::ACS_CONTROLLER, NML, acs::AcsModes::DETUMBLE, ACS_TABLE_DETUMBLE_TGT.second); + iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::DETUMBLE, ACS_TABLE_DETUMBLE_TGT.second); iht(objects::IMTQ_HANDLER, 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); @@ -257,7 +257,7 @@ void buildDetumbleSequence(Subsystem& ss, ModeListEntry& eh) { ctxc); // Build DETUMBLE transition 1 - iht(objects::ACS_CONTROLLER, NML, acs::AcsModes::DETUMBLE, ACS_TABLE_DETUMBLE_TRANS_1.second); + iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::DETUMBLE, ACS_TABLE_DETUMBLE_TRANS_1.second); check(ss.addTable(&ACS_TABLE_DETUMBLE_TRANS_1.second, ACS_TABLE_DETUMBLE_TRANS_1.first, false, true), ctxc); @@ -291,7 +291,7 @@ void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) { check(sequence.insert(eh), ctxc); }; // Build IDLE target - iht(objects::ACS_CONTROLLER, NML, acs::AcsModes::IDLE, ACS_TABLE_IDLE_TGT.second); + iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::IDLE, ACS_TABLE_IDLE_TGT.second); iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_TGT.second); iht(objects::RW_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second); @@ -307,7 +307,7 @@ void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) { ss.addTable(&ACS_TABLE_IDLE_TRANS_0.second, ACS_TABLE_IDLE_TRANS_0.first, false, true); // Build IDLE transition 1 - iht(objects::ACS_CONTROLLER, NML, acs::AcsModes::IDLE, ACS_TABLE_IDLE_TRANS_1.second); + iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::IDLE, ACS_TABLE_IDLE_TRANS_1.second); ss.addTable(&ACS_TABLE_IDLE_TRANS_1.second, ACS_TABLE_IDLE_TRANS_1.first, false, true); // Build IDLE sequence @@ -339,7 +339,7 @@ void buildTargetPtSequence(Subsystem& ss, ModeListEntry& eh) { }; // Build TARGET PT table - iht(objects::ACS_CONTROLLER, NML, acs::AcsModes::PTG_TARGET, ACS_TABLE_PTG_TARGET_TGT.second); + iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::PTG_TARGET, ACS_TABLE_PTG_TARGET_TGT.second); iht(objects::IMTQ_HANDLER, 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); @@ -350,7 +350,7 @@ void buildTargetPtSequence(Subsystem& ss, ModeListEntry& eh) { // Transition 0 already built // Build TARGET PT transition 1 - iht(objects::ACS_CONTROLLER, NML, acs::AcsModes::PTG_TARGET, + iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::PTG_TARGET, ACS_TABLE_PTG_TARGET_TRANS_1.second); check(ss.addTable(&ACS_TABLE_PTG_TARGET_TRANS_1.second, ACS_TABLE_PTG_TARGET_TRANS_1.first, false, true), @@ -386,7 +386,7 @@ void buildTargetPtNadirSequence(Subsystem& ss, ModeListEntry& eh) { }; // Build TARGET PT table - iht(objects::ACS_CONTROLLER, NML, acs::AcsModes::PTG_TARGET, + iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::PTG_TARGET, ACS_TABLE_PTG_TARGET_NADIR_TGT.second); iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_PTG_TARGET_NADIR_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_NADIR_TGT.second); @@ -399,7 +399,7 @@ void buildTargetPtNadirSequence(Subsystem& ss, ModeListEntry& eh) { // Transition 0 already built // Build TARGET PT transition 1 - iht(objects::ACS_CONTROLLER, NML, acs::AcsModes::PTG_TARGET_NADIR, + iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::PTG_TARGET_NADIR, ACS_TABLE_PTG_TARGET_NADIR_TRANS_1.second); check(ss.addTable(TableEntry(ACS_TABLE_PTG_TARGET_NADIR_TRANS_1.first, &ACS_TABLE_PTG_TARGET_NADIR_TRANS_1.second)), @@ -436,7 +436,7 @@ void buildTargetPtGsSequence(Subsystem& ss, ModeListEntry& eh) { }; // Build TARGET PT table - iht(objects::ACS_CONTROLLER, NML, acs::AcsModes::PTG_TARGET_GS, + iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::PTG_TARGET_GS, ACS_TABLE_PTG_TARGET_GS_TGT.second); iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_PTG_TARGET_GS_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_GS_TGT.second); @@ -449,7 +449,7 @@ void buildTargetPtGsSequence(Subsystem& ss, ModeListEntry& eh) { // Transition 0 already built // Build TARGET PT transition 1 - iht(objects::ACS_CONTROLLER, NML, acs::AcsModes::PTG_TARGET_GS, + iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::PTG_TARGET_GS, ACS_TABLE_PTG_TARGET_GS_TRANS_1.second); check(ss.addTable(TableEntry(ACS_TABLE_PTG_TARGET_GS_TRANS_1.first, &ACS_TABLE_PTG_TARGET_GS_TRANS_1.second)), @@ -485,7 +485,7 @@ void buildTargetPtInertialSequence(Subsystem& ss, ModeListEntry& eh) { }; // Build TARGET PT table - iht(objects::ACS_CONTROLLER, NML, acs::AcsModes::PTG_TARGET_INERTIAL, + iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::PTG_TARGET_INERTIAL, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second); iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second); @@ -498,7 +498,7 @@ void buildTargetPtInertialSequence(Subsystem& ss, ModeListEntry& eh) { // Transition 0 already built // Build TARGET PT transition 1 - iht(objects::ACS_CONTROLLER, NML, acs::AcsModes::PTG_TARGET_INERTIAL, + iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::PTG_TARGET_INERTIAL, ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1.second); check(ss.addTable(TableEntry(ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1.first, &ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1.second)), From 6ae0ee5b26812f5aab4e42e5c86d18be5d8b20ea Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Feb 2023 13:23:05 +0100 Subject: [PATCH 208/330] small update --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35491ccf..9ccce344 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ change warranting a new major release: ## Changed -- Readded calibration matrices for MGM calibration +- Readded calibration matrices for MGM calibration. ## Fixed @@ -29,7 +29,7 @@ change warranting a new major release: stored as the git SHA hash in `commonConfig.h`. This will be an empty string now for regular versions. - Bump FSFW for important fix in PUS mode service. -- Bugfixes in 'SensofProcessing' where previously MGM values would be calibrated before being +- Bugfixes in 'SensorProcessing' where previously MGM values would be calibrated before being transformed in body RF. However, the calibration values are in the body RF. Also fixed the validity flag of 'mgmVecTotDerivative'. From da166c7bc31b0688d80ff8eea8adeaaa97302aff Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Feb 2023 13:40:03 +0100 Subject: [PATCH 209/330] resolve merge conflicts --- linux/devices/GpsHyperionLinuxController.cpp | 2 +- mission/controller/AcsController.cpp | 8 +-- mission/system/tree/acsModeTree.cpp | 57 +++++++------------- 3 files changed, 23 insertions(+), 44 deletions(-) diff --git a/linux/devices/GpsHyperionLinuxController.cpp b/linux/devices/GpsHyperionLinuxController.cpp index ec9cb61a..cb0523d9 100644 --- a/linux/devices/GpsHyperionLinuxController.cpp +++ b/linux/devices/GpsHyperionLinuxController.cpp @@ -157,7 +157,7 @@ bool GpsHyperionLinuxController::readGpsDataFromGpsd() { } }; // GPS is off, no point in reading data from GPSD. - if(mode == MODE_OFF) { + if (mode == MODE_OFF) { return false; } if (readMode == ReadModes::SOCKET) { diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index bcf8ba07..b590786b 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -27,7 +27,7 @@ AcsController::AcsController(object_id_t objectId) ctrlValData(this), actuatorCmdData(this) {} -ReturnValue_t AcsController::handleCommandMessage(CommandMessage* message) { +ReturnValue_t AcsController::handleCommandMessage(CommandMessage *message) { ReturnValue_t result = actionHelper.handleActionMessage(message); if (result == returnvalue::OK) { return result; @@ -42,8 +42,8 @@ ReturnValue_t AcsController::handleCommandMessage(CommandMessage* message) { MessageQueueId_t AcsController::getCommandQueue() const { return commandQueue->getId(); } ReturnValue_t AcsController::getParameter(uint8_t domainId, uint8_t parameterId, - ParameterWrapper* parameterWrapper, - const ParameterWrapper* newValues, + ParameterWrapper *parameterWrapper, + const ParameterWrapper *newValues, uint16_t startAtIndex) { return acsParameters.getParameter(domainId, parameterId, parameterWrapper, newValues, startAtIndex); @@ -563,7 +563,7 @@ ReturnValue_t AcsController::checkModeCommand(Mode_t mode, Submode_t submode, return INVALID_SUBMODE; } } else if ((mode == MODE_ON) || (mode == MODE_NORMAL)) { - if ((submode < acs::AcsMode::SAFE) or (submode > acs::AcsMode::PTG_TARGET_INERTIAL)) { + if ((submode < acs::AcsMode::SAFE) or (submode > acs::AcsMode::PTG_INERTIAL)) { return INVALID_SUBMODE; } else { return returnvalue::OK; diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index 704b39e1..0474d0a1 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -55,13 +55,13 @@ auto ACS_TABLE_SAFE_TRANS_0 = auto ACS_TABLE_SAFE_TRANS_1 = std::make_pair((acs::AcsMode::SAFE << 24) | 3, FixedArrayList()); -auto ACS_SEQUENCE_IDLE = std::make_pair(acs::AcsMode::IDLE, FixedArrayList()); +auto ACS_SEQUENCE_IDLE = std::make_pair(acs::AcsMode::PTG_IDLE, FixedArrayList()); auto ACS_TABLE_IDLE_TGT = - std::make_pair((acs::AcsMode::IDLE << 24) | 1, FixedArrayList()); + std::make_pair((acs::AcsMode::PTG_IDLE << 24) | 1, FixedArrayList()); auto ACS_TABLE_IDLE_TRANS_0 = - std::make_pair((acs::AcsMode::IDLE << 24) | 2, FixedArrayList()); + std::make_pair((acs::AcsMode::PTG_IDLE << 24) | 2, FixedArrayList()); auto ACS_TABLE_IDLE_TRANS_1 = - std::make_pair((acs::AcsMode::IDLE << 24) | 3, FixedArrayList()); + std::make_pair((acs::AcsMode::PTG_IDLE << 24) | 3, FixedArrayList()); auto ACS_TABLE_PTG_TRANS_0 = std::make_pair((acs::AcsMode::PTG_TARGET << 24) | 2, FixedArrayList()); @@ -82,17 +82,17 @@ auto ACS_TABLE_PTG_TARGET_GS_TRANS_1 = auto ACS_SEQUENCE_PTG_TARGET_NADIR = std::make_pair(acs::AcsMode::PTG_NADIR, FixedArrayList()); -auto ACS_TABLE_PTG_TARGET_NADIR_TGT = std::make_pair((acs::AcsMode::PTG_TARGET_NADIR << 24) | 1, - FixedArrayList()); -auto ACS_TABLE_PTG_TARGET_NADIR_TRANS_1 = std::make_pair( - (acs::AcsMode::PTG_TARGET_NADIR << 24) | 3, FixedArrayList()); +auto ACS_TABLE_PTG_TARGET_NADIR_TGT = + std::make_pair((acs::AcsMode::PTG_NADIR << 24) | 1, FixedArrayList()); +auto ACS_TABLE_PTG_TARGET_NADIR_TRANS_1 = + std::make_pair((acs::AcsMode::PTG_NADIR << 24) | 3, FixedArrayList()); auto ACS_SEQUENCE_PTG_TARGET_INERTIAL = std::make_pair(acs::AcsMode::PTG_INERTIAL, FixedArrayList()); -auto ACS_TABLE_PTG_TARGET_INERTIAL_TGT = std::make_pair( - (acs::AcsMode::PTG_TARGET_INERTIAL << 24) | 1, FixedArrayList()); -auto ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1 = std::make_pair( - (acs::AcsMode::PTG_TARGET_INERTIAL << 24) | 3, FixedArrayList()); +auto ACS_TABLE_PTG_TARGET_INERTIAL_TGT = + std::make_pair((acs::AcsMode::PTG_INERTIAL << 24) | 1, FixedArrayList()); +auto ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1 = + std::make_pair((acs::AcsMode::PTG_INERTIAL << 24) | 3, FixedArrayList()); void satsystem::acs::init() { ModeListEntry entry; @@ -291,11 +291,7 @@ void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) { check(sequence.insert(eh), ctxc); }; // Build IDLE target -<<<<<<< HEAD - iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_IDLE, ACS_TABLE_IDLE_TGT.second); -======= - iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::IDLE, ACS_TABLE_IDLE_TGT.second); ->>>>>>> origin/develop + iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::PTG_IDLE, ACS_TABLE_IDLE_TGT.second); iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_TGT.second); iht(objects::RW_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second); @@ -311,11 +307,7 @@ void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) { ss.addTable(&ACS_TABLE_IDLE_TRANS_0.second, ACS_TABLE_IDLE_TRANS_0.first, false, true); // Build IDLE transition 1 -<<<<<<< HEAD - iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_IDLE, ACS_TABLE_IDLE_TRANS_1.second); -======= - iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::IDLE, ACS_TABLE_IDLE_TRANS_1.second); ->>>>>>> origin/develop + iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::PTG_IDLE, ACS_TABLE_IDLE_TRANS_1.second); ss.addTable(&ACS_TABLE_IDLE_TRANS_1.second, ACS_TABLE_IDLE_TRANS_1.first, false, true); // Build IDLE sequence @@ -358,8 +350,7 @@ void buildTargetPtSequence(Subsystem& ss, ModeListEntry& eh) { // 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); + iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::PTG_TARGET, ACS_TABLE_PTG_TARGET_TRANS_1.second); check(ss.addTable(&ACS_TABLE_PTG_TARGET_TRANS_1.second, ACS_TABLE_PTG_TARGET_TRANS_1.first, false, true), ctxc); @@ -407,11 +398,7 @@ void buildTargetPtNadirSequence(Subsystem& ss, ModeListEntry& eh) { // Transition 0 already built // Build TARGET PT transition 1 -<<<<<<< HEAD - iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_NADIR, -======= - iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::PTG_TARGET_NADIR, ->>>>>>> origin/develop + iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::PTG_NADIR, ACS_TABLE_PTG_TARGET_NADIR_TRANS_1.second); check(ss.addTable(TableEntry(ACS_TABLE_PTG_TARGET_NADIR_TRANS_1.first, &ACS_TABLE_PTG_TARGET_NADIR_TRANS_1.second)), @@ -497,11 +484,7 @@ void buildTargetPtInertialSequence(Subsystem& ss, ModeListEntry& eh) { }; // Build TARGET PT table -<<<<<<< HEAD - iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_INERTIAL, -======= - iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::PTG_TARGET_INERTIAL, ->>>>>>> origin/develop + iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::PTG_INERTIAL, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second); iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second); @@ -514,11 +497,7 @@ void buildTargetPtInertialSequence(Subsystem& ss, ModeListEntry& eh) { // Transition 0 already built // Build TARGET PT transition 1 -<<<<<<< HEAD - iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_INERTIAL, -======= - iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::PTG_TARGET_INERTIAL, ->>>>>>> origin/develop + iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::PTG_INERTIAL, ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1.second); check(ss.addTable(TableEntry(ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1.first, &ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1.second)), From 349ebca08d462043ad32d7071442fa9f64b79a43 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Feb 2023 14:11:11 +0100 Subject: [PATCH 210/330] re-run generators all associated changes and fixes --- common/config/eive/resultClassIds.h | 5 +++ generators/bsp_q7s_events.csv | 1 + generators/bsp_q7s_returnvalues.csv | 31 ++++++++++--------- generators/events/event_parser.py | 5 +-- generators/events/translateEvents.cpp | 7 +++-- generators/objects/translateObjects.cpp | 2 +- .../returnvalues/returnvalues_parser.py | 2 +- linux/fsfwconfig/events/translateEvents.cpp | 7 +++-- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- .../acs/MultiplicativeKalmanFilter.h | 6 ++-- mission/controller/acs/SensorProcessing.h | 4 +-- mission/controller/acs/config/classIds.h | 18 ----------- mission/controller/acs/control/Detumble.h | 11 ++----- mission/controller/acs/control/PtgCtrl.h | 4 +-- mission/controller/acs/control/SafeCtrl.h | 11 ++----- .../devicedefinitions/GPSDefinitions.h | 2 +- tmtc | 2 +- 17 files changed, 52 insertions(+), 68 deletions(-) delete mode 100644 mission/controller/acs/config/classIds.h diff --git a/common/config/eive/resultClassIds.h b/common/config/eive/resultClassIds.h index aeb05815..e4dfb927 100644 --- a/common/config/eive/resultClassIds.h +++ b/common/config/eive/resultClassIds.h @@ -35,6 +35,11 @@ enum commonClassIds : uint8_t { SA_DEPL_HANDLER, // SADPL MPSOC_RETURN_VALUES_IF, // MPSOCRTVIF SUPV_RETURN_VALUES_IF, // SPVRTVIF + ACS_KALMAN, // ACSKAL + ACS_SAFE, // ACSSAF + ACS_PTG, // ACSPTG + ACS_DETUMBLE, // ACSDTB + ACS_MEKF, // ACSMEK COMMON_CLASS_ID_END // [EXPORT] : [END] }; diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index b6e2cc88..9f477ca2 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -198,6 +198,7 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 12903;0x3267;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission/system/objects/SusAssembly.h 13000;0x32c8;CHILDREN_LOST_MODE;MEDIUM;;mission/system/objects/TcsBoardAssembly.h 13100;0x332c;GPS_FIX_CHANGE;INFO;Fix has changed. P1: Old fix. P2: New fix 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix;mission/devices/devicedefinitions/GPSDefinitions.h +13101;0x332d;CANT_GET_FIX;LOW;Could not get fix in maximum allowed time. P1: Maximum allowed time to get a fix after the GPS was switched on.;mission/devices/devicedefinitions/GPSDefinitions.h 13200;0x3390;P60_BOOT_COUNT;INFO;P60 boot count is broadcasted once at SW startup. P1: Boot count;mission/devices/P60DockHandler.h 13201;0x3391;BATT_MODE;INFO;Battery mode is broadcasted at startup. P1: Mode;mission/devices/P60DockHandler.h 13202;0x3392;BATT_MODE_CHANGED;MEDIUM;Battery mode has changed. P1: Old mode. P2: New mode;mission/devices/P60DockHandler.h diff --git a/generators/bsp_q7s_returnvalues.csv b/generators/bsp_q7s_returnvalues.csv index 82f44173..0581c352 100644 --- a/generators/bsp_q7s_returnvalues.csv +++ b/generators/bsp_q7s_returnvalues.csv @@ -51,9 +51,12 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x4fa4;HEATER_MainSwitchSetTimeout;;164;HEATER_HANDLER;mission/devices/HeaterHandler.h 0x4fa5;HEATER_CommandAlreadyWaiting;;165;HEATER_HANDLER;mission/devices/HeaterHandler.h 0x60a0;CCSDS_CommandNotImplemented;Received action message with unknown action id;160;CCSDS_HANDLER;mission/tmtc/CcsdsIpCoreHandler.h -0x6001;CCSDS_KalmanNoGyrMeas;;1;CCSDS_HANDLER;mission/controller/acs/MultiplicativeKalmanFilter.h -0x6002;CCSDS_KalmanNoModel;;2;CCSDS_HANDLER;mission/controller/acs/MultiplicativeKalmanFilter.h -0x6003;CCSDS_KalmanInversionFailed;;3;CCSDS_HANDLER;mission/controller/acs/MultiplicativeKalmanFilter.h +0x6a01;ACSSAF_SafectrlMekfInputInvalid;;1;ACS_SAFE;mission/controller/acs/control/SafeCtrl.h +0x6b01;ACSPTG_PtgctrlMekfInputInvalid;;1;ACS_PTG;mission/controller/acs/control/PtgCtrl.h +0x6c01;ACSDTB_DetumbleNoSensordata;;1;ACS_DETUMBLE;mission/controller/acs/control/Detumble.h +0x6901;ACSKAL_KalmanNoGyrMeas;;1;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h +0x6902;ACSKAL_KalmanNoModel;;2;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h +0x6903;ACSKAL_KalmanInversionFailed;;3;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h 0x4500;HSPI_OpeningFileFailed;;0;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h 0x4501;HSPI_FullDuplexTransferFailed;;1;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h 0x4502;HSPI_HalfDuplexTransferFailed;;2;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h @@ -468,16 +471,16 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x1d03;ATC_IllegalApplicationData;;3;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h 0x1d04;ATC_SendTmFailed;;4;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h 0x1d05;ATC_Timeout;;5;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h -0x6b00;SCBU_KeyNotFound;;0;SCRATCH_BUFFER;bsp_q7s/memory/scratchApi.h +0x7000;SCBU_KeyNotFound;;0;SCRATCH_BUFFER;bsp_q7s/memory/scratchApi.h 0x64a0;FSHLP_SdNotMounted;SD card specified with path string not mounted;160;FILE_SYSTEM_HELPER;bsp_q7s/fs/FilesystemHelper.h 0x64a1;FSHLP_FileNotExists;Specified file does not exist on filesystem;161;FILE_SYSTEM_HELPER;bsp_q7s/fs/FilesystemHelper.h -0x6a00;SDMA_OpOngoing;;0;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h -0x6a01;SDMA_AlreadyOn;;1;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h -0x6a02;SDMA_AlreadyMounted;;2;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h -0x6a03;SDMA_AlreadyOff;;3;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h -0x6a0a;SDMA_StatusFileNexists;;10;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h -0x6a0b;SDMA_StatusFileFormatInvalid;;11;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h -0x6a0c;SDMA_MountError;;12;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h -0x6a0d;SDMA_UnmountError;;13;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h -0x6a0e;SDMA_SystemCallError;;14;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h -0x6a0f;SDMA_PopenCallError;;15;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h +0x6f00;SDMA_OpOngoing;;0;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h +0x6f01;SDMA_AlreadyOn;;1;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h +0x6f02;SDMA_AlreadyMounted;;2;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h +0x6f03;SDMA_AlreadyOff;;3;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h +0x6f0a;SDMA_StatusFileNexists;;10;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h +0x6f0b;SDMA_StatusFileFormatInvalid;;11;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h +0x6f0c;SDMA_MountError;;12;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h +0x6f0d;SDMA_UnmountError;;13;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h +0x6f0e;SDMA_SystemCallError;;14;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h +0x6f0f;SDMA_PopenCallError;;15;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h diff --git a/generators/events/event_parser.py b/generators/events/event_parser.py index 8c5ab35b..8dd4952b 100644 --- a/generators/events/event_parser.py +++ b/generators/events/event_parser.py @@ -29,6 +29,7 @@ GENERATE_CSV = True COPY_CPP_FILE = True COPY_CPP_H_FILE = True MOVE_CSV_FILE = True +PRINT_EVENTS = False PARSE_HOST_BSP = True @@ -80,13 +81,13 @@ LOGGER = get_console_logger() def parse_events( - generate_csv: bool = True, generate_cpp: bool = True, print_events: bool = True + generate_csv: bool = True, generate_cpp: bool = True ): LOGGER.info("EventParser: Parsing events: ") # Small delay for clean printout time.sleep(0.01) event_list = generate_event_list() - if print_events: + if PRINT_EVENTS: PrettyPrinter.pprint(event_list) # Delay for clean printout time.sleep(0.1) diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 44dc3f24..a13005e1 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 247 translations. + * @brief Auto-generated event translation file. Contains 248 translations. * @details - * Generated on: 2023-02-08 11:22:40 + * Generated on: 2023-02-08 14:09:40 */ #include "translateEvents.h" @@ -200,6 +200,7 @@ const char *POWER_STATE_MACHINE_TIMEOUT_STRING = "POWER_STATE_MACHINE_TIMEOUT"; const char *SIDE_SWITCH_TRANSITION_NOT_ALLOWED_STRING = "SIDE_SWITCH_TRANSITION_NOT_ALLOWED"; const char *CHILDREN_LOST_MODE_STRING = "CHILDREN_LOST_MODE"; const char *GPS_FIX_CHANGE_STRING = "GPS_FIX_CHANGE"; +const char *CANT_GET_FIX_STRING = "CANT_GET_FIX"; const char *P60_BOOT_COUNT_STRING = "P60_BOOT_COUNT"; const char *BATT_MODE_STRING = "BATT_MODE"; const char *BATT_MODE_CHANGED_STRING = "BATT_MODE_CHANGED"; @@ -640,6 +641,8 @@ const char *translateEvents(Event event) { return CHILDREN_LOST_MODE_STRING; case (13100): return GPS_FIX_CHANGE_STRING; + case (13101): + return CANT_GET_FIX_STRING; case (13200): return P60_BOOT_COUNT_STRING; case (13201): diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 873bc547..0e1c12dc 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 152 translations. - * Generated on: 2023-02-08 11:22:40 + * Generated on: 2023-02-08 14:09:40 */ #include "translateObjects.h" diff --git a/generators/returnvalues/returnvalues_parser.py b/generators/returnvalues/returnvalues_parser.py index 4f6f30e1..6ad893d1 100644 --- a/generators/returnvalues/returnvalues_parser.py +++ b/generators/returnvalues/returnvalues_parser.py @@ -22,7 +22,7 @@ LOGGER = get_console_logger() EXPORT_TO_FILE = True COPY_CSV_FILE = True EXPORT_TO_SQL = True -PRINT_TABLES = True +PRINT_TABLES = False FILE_SEPARATOR = ";" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 44dc3f24..a13005e1 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 247 translations. + * @brief Auto-generated event translation file. Contains 248 translations. * @details - * Generated on: 2023-02-08 11:22:40 + * Generated on: 2023-02-08 14:09:40 */ #include "translateEvents.h" @@ -200,6 +200,7 @@ const char *POWER_STATE_MACHINE_TIMEOUT_STRING = "POWER_STATE_MACHINE_TIMEOUT"; const char *SIDE_SWITCH_TRANSITION_NOT_ALLOWED_STRING = "SIDE_SWITCH_TRANSITION_NOT_ALLOWED"; const char *CHILDREN_LOST_MODE_STRING = "CHILDREN_LOST_MODE"; const char *GPS_FIX_CHANGE_STRING = "GPS_FIX_CHANGE"; +const char *CANT_GET_FIX_STRING = "CANT_GET_FIX"; const char *P60_BOOT_COUNT_STRING = "P60_BOOT_COUNT"; const char *BATT_MODE_STRING = "BATT_MODE"; const char *BATT_MODE_CHANGED_STRING = "BATT_MODE_CHANGED"; @@ -640,6 +641,8 @@ const char *translateEvents(Event event) { return CHILDREN_LOST_MODE_STRING; case (13100): return GPS_FIX_CHANGE_STRING; + case (13101): + return CANT_GET_FIX_STRING; case (13200): return P60_BOOT_COUNT_STRING; case (13201): diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 873bc547..0e1c12dc 100644 --- a/linux/fsfwconfig/objects/translateObjects.cpp +++ b/linux/fsfwconfig/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 152 translations. - * Generated on: 2023-02-08 11:22:40 + * Generated on: 2023-02-08 14:09:40 */ #include "translateObjects.h" diff --git a/mission/controller/acs/MultiplicativeKalmanFilter.h b/mission/controller/acs/MultiplicativeKalmanFilter.h index 79d39510..77bb2d9d 100644 --- a/mission/controller/acs/MultiplicativeKalmanFilter.h +++ b/mission/controller/acs/MultiplicativeKalmanFilter.h @@ -20,7 +20,7 @@ #include "../controllerdefinitions/AcsCtrlDefinitions.h" #include "AcsParameters.h" -#include "config/classIds.h" +#include "eive/resultClassIds.h" class MultiplicativeKalmanFilter { public: @@ -64,11 +64,11 @@ class MultiplicativeKalmanFilter { const bool validMagModel, double sampleTime, acsctrl::MekfData *mekfData); // Declaration of Events (like init) and memberships - // static const uint8_t INTERFACE_ID = CLASS_ID::MEKF; //CLASS IDS ND + static const uint8_t INTERFACE_ID = CLASS_ID::ACS_MEKF; // CLASS IDS ND // (/config/returnvalues/classIDs.h) static const Event RESET = // MAKE_EVENT(1,severity::INFO);//typedef uint32_t Event (Event.h), should be // resetting Mekf - static const uint8_t INTERFACE_ID = CLASS_ID::KALMAN; + static const uint8_t INTERFACE_ID = CLASS_ID::ACS_KALMAN; static const ReturnValue_t KALMAN_NO_GYR_MEAS = MAKE_RETURN_CODE(0x01); static const ReturnValue_t KALMAN_NO_MODEL = MAKE_RETURN_CODE(0x02); static const ReturnValue_t KALMAN_INVERSION_FAILED = MAKE_RETURN_CODE(0x03); diff --git a/mission/controller/acs/SensorProcessing.h b/mission/controller/acs/SensorProcessing.h index 49c659b0..6fa1ab8c 100644 --- a/mission/controller/acs/SensorProcessing.h +++ b/mission/controller/acs/SensorProcessing.h @@ -1,5 +1,5 @@ /******************************* - * EIVE Flight Software Framework (FSFW) + * EIVE Flight Software * (c) 2022 IRS, Uni Stuttgart *******************************/ #ifndef SENSORPROCESSING_H_ @@ -13,7 +13,7 @@ #include "AcsParameters.h" #include "SensorValues.h" #include "SusConverter.h" -#include "config/classIds.h" +#include "eive/resultClassIds.h" class SensorProcessing { public: diff --git a/mission/controller/acs/config/classIds.h b/mission/controller/acs/config/classIds.h deleted file mode 100644 index ccf6b616..00000000 --- a/mission/controller/acs/config/classIds.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ACS_CONFIG_CLASSIDS_H_ -#define ACS_CONFIG_CLASSIDS_H_ - -#include -#include - -namespace CLASS_ID { -enum eiveclassIds : uint8_t { - EIVE_CLASS_ID_START = COMMON_CLASS_ID_END, - KALMAN, - SAFE, - PTG, - DETUMBLE, - EIVE_CLASS_ID_END // [EXPORT] : [END] -}; -} - -#endif /* ACS_CONFIG_CLASSIDS_H_ */ diff --git a/mission/controller/acs/control/Detumble.h b/mission/controller/acs/control/Detumble.h index 6a3e6eaa..65e5ec28 100644 --- a/mission/controller/acs/control/Detumble.h +++ b/mission/controller/acs/control/Detumble.h @@ -1,10 +1,3 @@ -/* - * Detumble.h - * - * Created on: 17 Aug 2022 - * Author: Robin Marquardt - */ - #ifndef ACS_CONTROL_DETUMBLE_H_ #define ACS_CONTROL_DETUMBLE_H_ @@ -15,14 +8,14 @@ #include "../AcsParameters.h" #include "../SensorValues.h" -#include "../config/classIds.h" +#include "eive/resultClassIds.h" class Detumble { public: Detumble(AcsParameters *acsParameters_); virtual ~Detumble(); - static const uint8_t INTERFACE_ID = CLASS_ID::DETUMBLE; + static const uint8_t INTERFACE_ID = CLASS_ID::ACS_DETUMBLE; static const ReturnValue_t DETUMBLE_NO_SENSORDATA = MAKE_RETURN_CODE(0x01); /* @brief: Load AcsParameters for this class diff --git a/mission/controller/acs/control/PtgCtrl.h b/mission/controller/acs/control/PtgCtrl.h index 559216f7..5e9a704c 100644 --- a/mission/controller/acs/control/PtgCtrl.h +++ b/mission/controller/acs/control/PtgCtrl.h @@ -20,7 +20,7 @@ #include "../AcsParameters.h" #include "../SensorValues.h" -#include "../config/classIds.h" +#include "eive/resultClassIds.h" class PtgCtrl { public: @@ -30,7 +30,7 @@ class PtgCtrl { PtgCtrl(AcsParameters *acsParameters_); virtual ~PtgCtrl(); - static const uint8_t INTERFACE_ID = CLASS_ID::PTG; + static const uint8_t INTERFACE_ID = CLASS_ID::ACS_PTG; static const ReturnValue_t PTGCTRL_MEKF_INPUT_INVALID = MAKE_RETURN_CODE(0x01); /* @brief: Load AcsParameters for this class diff --git a/mission/controller/acs/control/SafeCtrl.h b/mission/controller/acs/control/SafeCtrl.h index 72e45f08..1784f9ca 100644 --- a/mission/controller/acs/control/SafeCtrl.h +++ b/mission/controller/acs/control/SafeCtrl.h @@ -1,10 +1,3 @@ -/* - * safeCtrl.h - * - * Created on: 19 Apr 2022 - * Author: rooob - */ - #ifndef SAFECTRL_H_ #define SAFECTRL_H_ @@ -14,14 +7,14 @@ #include "../AcsParameters.h" #include "../SensorValues.h" -#include "../config/classIds.h" +#include "eive/resultClassIds.h" class SafeCtrl { public: SafeCtrl(AcsParameters *acsParameters_); virtual ~SafeCtrl(); - static const uint8_t INTERFACE_ID = CLASS_ID::SAFE; + static const uint8_t INTERFACE_ID = CLASS_ID::ACS_SAFE; static const ReturnValue_t SAFECTRL_MEKF_INPUT_INVALID = MAKE_RETURN_CODE(0x01); void loadAcsParameters(AcsParameters *acsParameters_); diff --git a/mission/devices/devicedefinitions/GPSDefinitions.h b/mission/devices/devicedefinitions/GPSDefinitions.h index 2ac7781d..8acb77e9 100644 --- a/mission/devices/devicedefinitions/GPSDefinitions.h +++ b/mission/devices/devicedefinitions/GPSDefinitions.h @@ -15,7 +15,7 @@ static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::GPS_HANDLER; static constexpr Event GPS_FIX_CHANGE = event::makeEvent(SUBSYSTEM_ID, 0, severity::INFO); //! [EXPORT] : [COMMENT] Could not get fix in maximum allowed time. P1: Maximum allowed time //! to get a fix after the GPS was switched on. -static constexpr Event CANT_GET_FIX = event::makeEvent(SUBSYSTEM_ID, 0, severity::LOW); +static constexpr Event CANT_GET_FIX = event::makeEvent(SUBSYSTEM_ID, 1, severity::LOW); static constexpr DeviceCommandId_t GPS_REPLY = 0; static constexpr DeviceCommandId_t TRIGGER_RESET_PIN_GNSS = 5; diff --git a/tmtc b/tmtc index 4086e794..9955295d 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 4086e7947b4458bcbbd47c78e67c23d3a47885c8 +Subproject commit 9955295dfe16a9e0da7dee273c0abd502307eb64 From 7e0b30e8457525e7d16ebe929394f486844a7c46 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Feb 2023 14:11:49 +0100 Subject: [PATCH 211/330] ACS section separate --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46c8c554..57920507 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ change warranting a new major release: ## Changed +### ACS + - Readded calibration matrices for MGM calibration. - Added calculation of satellite velocity vector from GPS position data - Added detumble mode using GYR values @@ -46,6 +48,9 @@ change warranting a new major release: stored as the git SHA hash in `commonConfig.h`. This will be an empty string now for regular versions. - Bump FSFW for important fix in PUS mode service. + +### ACS + - Bugfixes in 'SensorProcessing' where previously MGM values would be calibrated before being transformed in body RF. However, the calibration values are in the body RF. Also fixed the validity flag of 'mgmVecTotDerivative'. From 50d8d0b278473870e8fa184097dba455e17f8382 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Feb 2023 14:22:56 +0100 Subject: [PATCH 212/330] remove old unneeded IF ID --- mission/controller/acs/MultiplicativeKalmanFilter.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/mission/controller/acs/MultiplicativeKalmanFilter.h b/mission/controller/acs/MultiplicativeKalmanFilter.h index 77bb2d9d..a2f81272 100644 --- a/mission/controller/acs/MultiplicativeKalmanFilter.h +++ b/mission/controller/acs/MultiplicativeKalmanFilter.h @@ -63,15 +63,11 @@ class MultiplicativeKalmanFilter { const double *sunDirJ, const bool validSSModel, const double *magFieldJ, const bool validMagModel, double sampleTime, acsctrl::MekfData *mekfData); - // Declaration of Events (like init) and memberships - static const uint8_t INTERFACE_ID = CLASS_ID::ACS_MEKF; // CLASS IDS ND - // (/config/returnvalues/classIDs.h) static const Event RESET = - // MAKE_EVENT(1,severity::INFO);//typedef uint32_t Event (Event.h), should be // resetting Mekf - static const uint8_t INTERFACE_ID = CLASS_ID::ACS_KALMAN; - static const ReturnValue_t KALMAN_NO_GYR_MEAS = MAKE_RETURN_CODE(0x01); - static const ReturnValue_t KALMAN_NO_MODEL = MAKE_RETURN_CODE(0x02); - static const ReturnValue_t KALMAN_INVERSION_FAILED = MAKE_RETURN_CODE(0x03); + static constexpr uint8_t IF_KAL_ID = CLASS_ID::ACS_KALMAN; + static constexpr ReturnValue_t KALMAN_NO_GYR_MEAS = returnvalue::makeCode(IF_KAL_ID, 1); + static constexpr ReturnValue_t KALMAN_NO_MODEL = returnvalue::makeCode(IF_KAL_ID, 2); + static constexpr ReturnValue_t KALMAN_INVERSION_FAILED = returnvalue::makeCode(IF_KAL_ID, 3); private: /*Parameters*/ From b1da4bb81b18ed680037abc0dcf2dbabfe77fd99 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Feb 2023 14:33:48 +0100 Subject: [PATCH 213/330] remove doubly scheduled ACS CTRL --- bsp_q7s/core/scheduling.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index 42a11875..79390b92 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -184,15 +184,8 @@ void scheduling::initTasks() { #endif /* OBSW_ADD_GPS_CTRL */ PeriodicTaskIF* acsSysTask = factory->createPeriodicTask( - "SYS_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); + "SYS_TASK", 55, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); static_cast(acsSysTask); - // To be removed soon because it will be part of the ACS PST. -#if OBSW_ADD_ACS_CTRL == 1 - acsSysTask->addComponent(objects::ACS_CONTROLLER); - if (result != returnvalue::OK) { - scheduling::printAddObjectError("ACS_CTRL", objects::ACS_CONTROLLER); - } -#endif #if OBSW_ADD_ACS_BOARD == 1 result = acsSysTask->addComponent(objects::ACS_BOARD_ASS); if (result != returnvalue::OK) { From 881f9ea7ea7a03957ebb6fd1ebc06b1274f1d9a6 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Feb 2023 14:52:11 +0100 Subject: [PATCH 214/330] prep v1.26.0 --- CHANGELOG.md | 4 ++++ CMakeLists.txt | 2 +- tmtc | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57920507..dd207914 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ change warranting a new major release: # [unreleased] +# [v1.26.0] 2023-02-08 + +eive-tmtc v2.12.1 + ## Changed ### ACS diff --git a/CMakeLists.txt b/CMakeLists.txt index f5220063..8672db5e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ cmake_minimum_required(VERSION 3.13) set(OBSW_VERSION_MAJOR 1) -set(OBSW_VERSION_MINOR 25) +set(OBSW_VERSION_MINOR 26) set(OBSW_VERSION_REVISION 0) # set(CMAKE_VERBOSE TRUE) diff --git a/tmtc b/tmtc index 9955295d..d0c8e20d 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 9955295dfe16a9e0da7dee273c0abd502307eb64 +Subproject commit d0c8e20d4f9a6f5aee3ccfa05c4f7ab7151400b5 From 4528e61fcdbe0423052039059c9498f6de7ae5c9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Feb 2023 15:02:56 +0100 Subject: [PATCH 215/330] initialize ACS controller --- CHANGELOG.md | 4 ++++ mission/controller/AcsController.cpp | 8 ++++++++ mission/controller/AcsController.h | 1 + 3 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd207914..c545da36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ change warranting a new major release: # [unreleased] +# [v1.26.1] 2023-02-08 + +- Initialize parameter helper in ACS controller. + # [v1.26.0] 2023-02-08 eive-tmtc v2.12.1 diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index b590786b..83088b41 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -721,6 +721,14 @@ void AcsController::copySusData() { } } +ReturnValue_t AcsController::initialize() { + ReturnValue_t result = parameterHelper.initialize(); + if (result != returnvalue::OK) { + return result; + } + return ExtendedControllerBase::initialize(); +} + void AcsController::copyGyrData() { ACS::SensorValues sensorValues; { diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index 6a18e988..e1e31a2a 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -55,6 +55,7 @@ class AcsController : public ExtendedControllerBase, public ReceivesParameterMes InternalState internalState = InternalState::STARTUP; + ReturnValue_t initialize() override; ReturnValue_t handleCommandMessage(CommandMessage* message) override; void performControlOperation() override; From e1e6ce5d3442c1a30b0b1f4e2912f0ccce565175 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Feb 2023 15:03:22 +0100 Subject: [PATCH 216/330] bump patch version, prep v1.26.1 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8672db5e..9820c3ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ cmake_minimum_required(VERSION 3.13) set(OBSW_VERSION_MAJOR 1) set(OBSW_VERSION_MINOR 26) -set(OBSW_VERSION_REVISION 0) +set(OBSW_VERSION_REVISION 1) # set(CMAKE_VERBOSE TRUE) From 2e11f067e2118e2e18f0c6ecee6919b0bbfe434c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Feb 2023 15:30:14 +0100 Subject: [PATCH 217/330] start replacing chained locks --- mission/controller/AcsController.cpp | 4 --- mission/controller/AcsController.h | 2 +- mission/controller/acs/SensorValues.cpp | 42 +++++++++++++++++-------- 3 files changed, 30 insertions(+), 18 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 83088b41..10053da8 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -107,8 +107,6 @@ void AcsController::performControlOperation() { } void AcsController::performSafe() { - ACS::SensorValues sensorValues; - timeval now; Clock::getClock_timeval(&now); @@ -197,8 +195,6 @@ void AcsController::performSafe() { } void AcsController::performDetumble() { - ACS::SensorValues sensorValues; - timeval now; Clock::getClock_timeval(&now); diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index e1e31a2a..0ae4f338 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -38,6 +38,7 @@ class AcsController : public ExtendedControllerBase, public ReceivesParameterMes private: AcsParameters acsParameters; + ACS::SensorValues sensorValues; SensorProcessing sensorProcessing; Navigation navigation; ActuatorCmd actuatorCmd; @@ -70,7 +71,6 @@ class AcsController : public ExtendedControllerBase, public ReceivesParameterMes void announceMode(bool recursive); /* ACS Datasets */ - ACS::SensorValues sensorValues; IMTQ::DipoleActuationSet dipoleSet = IMTQ::DipoleActuationSet(objects::IMTQ_HANDLER); // MGMs acsctrl::MgmDataRaw mgmDataRaw; diff --git a/mission/controller/acs/SensorValues.cpp b/mission/controller/acs/SensorValues.cpp index 568a9e1c..a963f326 100644 --- a/mission/controller/acs/SensorValues.cpp +++ b/mission/controller/acs/SensorValues.cpp @@ -20,13 +20,34 @@ SensorValues::SensorValues() {} SensorValues::~SensorValues() {} ReturnValue_t SensorValues::updateMgm() { - ReturnValue_t result; - PoolReadGuard pgMgm0(&mgm0Lis3Set), pgMgm1(&mgm1Rm3100Set), pgMgm2(&mgm2Lis3Set), - pgMgm3(&mgm3Rm3100Set), pgImtq(&imtqMgmSet); + std::vector results; - result = (pgMgm0.getReadResult() || pgMgm1.getReadResult() || pgMgm2.getReadResult() || - pgMgm3.getReadResult() || pgImtq.getReadResult()); - return result; + { + PoolReadGuard pgMgm0(&mgm0Lis3Set); + results.push_back(pgMgm0.getReadResult()); + } + { + PoolReadGuard pgMgm(&mgm1Rm3100Set); + results.push_back(pgMgm.getReadResult()); + } + { + PoolReadGuard pgMgm(&mgm2Lis3Set); + results.push_back(pgMgm.getReadResult()); + } + { + PoolReadGuard pgMgm(&mgm3Rm3100Set); + results.push_back(pgMgm.getReadResult()); + } + { + PoolReadGuard pgMgm(&imtqMgmSet); + results.push_back(pgMgm.getReadResult()); + } + for (const auto& result : results) { + if (result != returnvalue::OK) { + return result; + } + } + return returnvalue::OK; } ReturnValue_t SensorValues::updateSus() { @@ -53,19 +74,14 @@ ReturnValue_t SensorValues::updateGyr() { } ReturnValue_t SensorValues::updateStr() { - ReturnValue_t result; PoolReadGuard pgStr(&strSet); - result = pgStr.getReadResult(); - return result; + return pgStr.getReadResult(); } ReturnValue_t SensorValues::updateGps() { - ReturnValue_t result; PoolReadGuard pgGps(&gpsSet); - - result = pgGps.getReadResult(); - return result; + return pgGps.getReadResult(); } ReturnValue_t SensorValues::updateRw() { From 79a13b8b6a7317a187aea466660c231dbc9d307d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Feb 2023 16:45:19 +0100 Subject: [PATCH 218/330] update sched again --- bsp_q7s/core/scheduling.cpp | 7 +- bsp_q7s/core/scheduling.h | 5 +- bsp_q7s/em/emObjectFactory.cpp | 3 + common/config/eive/definitions.h | 13 + .../pollingSequenceFactory.cpp | 290 +++++++++--------- .../pollingsequence/pollingSequenceFactory.h | 10 +- 6 files changed, 180 insertions(+), 148 deletions(-) diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index 79390b92..0279243f 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -313,7 +313,8 @@ void scheduling::initTasks() { std::vector pusTasks; createPusTasks(*factory, missedDeadlineFunc, pusTasks); std::vector pstTasks; - createPstTasks(*factory, missedDeadlineFunc, pstTasks); + AcsPstCfg cfg; + createPstTasks(*factory, missedDeadlineFunc, pstTasks, cfg); #if OBSW_ADD_TEST_CODE == 1 #if OBSW_TEST_CCSDS_BRIDGE == 1 @@ -403,7 +404,7 @@ void scheduling::initTasks() { } void scheduling::createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc, - std::vector& taskVec) { + std::vector& taskVec, AcsPstCfg cfg) { ReturnValue_t result = returnvalue::OK; #ifdef RELEASE_BUILD @@ -413,7 +414,7 @@ void scheduling::createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction #endif FixedTimeslotTaskIF* acsPst = factory.createFixedTimeslotTask( "ACS_PST", 85, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, acsPstPeriod, missedDeadlineFunc); - result = pst::pstAcs(acsPst); + result = pst::pstAcs(acsPst, cfg); if (result != returnvalue::OK) { if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { sif::warning << "scheduling::initTasks: ACS PST is empty" << std::endl; diff --git a/bsp_q7s/core/scheduling.h b/bsp_q7s/core/scheduling.h index d43575dc..15b3abc2 100644 --- a/bsp_q7s/core/scheduling.h +++ b/bsp_q7s/core/scheduling.h @@ -1,10 +1,13 @@ #ifndef BSP_Q7S_INITMISSION_H_ #define BSP_Q7S_INITMISSION_H_ +#include #include #include "fsfw/tasks/definitions.h" +using pst::AcsPstCfg; + class PeriodicTaskIF; class TaskFactory; @@ -13,7 +16,7 @@ void initMission(); void initTasks(); void createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc, - std::vector& taskVec); + std::vector& taskVec, AcsPstCfg cfg); void createPusTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc, std::vector& taskVec); void createTestTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc, diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 375ddb0f..832d082c 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -43,6 +43,9 @@ void ObjectFactory::produce(void* args) { #if OBSW_ADD_GOMSPACE_PCDU == 1 dummyCfg.addPowerDummies = false; #endif +#if OBSW_ADD_ACS_BOARD == 1 + dummyCfg.addAcsBoardDummies = false; +#endif PowerSwitchIF* pwrSwitcher = nullptr; #if OBSW_ADD_GOMSPACE_PCDU == 0 diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index 02896e1c..0e7ecea6 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -55,6 +55,19 @@ static constexpr uint32_t MAX_PUS_FUNNEL_QUEUE_DEPTH = 100; static constexpr uint32_t MAX_STORED_CMDS_UDP = 120; static constexpr uint32_t MAX_STORED_CMDS_TCP = 120; +namespace acs { + +static constexpr uint32_t SCHED_BLOCK_1_SENSORS_MS = 15; +static constexpr uint32_t SCHED_BLOCK_2_ACS_CTRL_MS = 40; +static constexpr uint32_t SCHED_BLOCK_3_ACTUATOR_MS = 45; + +// 15 ms for FM +static constexpr float SCHED_BLOCK_1_PERIOD = static_cast(SCHED_BLOCK_1_SENSORS_MS) / 400.0; +static constexpr float SCHED_BLOCK_2_PERIOD = static_cast(SCHED_BLOCK_2_ACS_CTRL_MS) / 400.0; +static constexpr float SCHED_BLOCK_3_PERIOD = static_cast(SCHED_BLOCK_3_ACTUATOR_MS) / 400.0; + +} + } // namespace config #endif /* COMMON_CONFIG_DEFINITIONS_H_ */ diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index efbb9578..6cfedf72 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -1,5 +1,7 @@ #include "pollingSequenceFactory.h" +#include "eive/definitions.h" + #include #include #include @@ -183,94 +185,94 @@ ReturnValue_t pst::pstTest(FixedTimeslotTaskIF *thisSequence) { return returnvalue::OK; } -ReturnValue_t pst::pstAcs(FixedTimeslotTaskIF *thisSequence) { +ReturnValue_t pst::pstAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg) { /* Length of a communication cycle */ uint32_t length = thisSequence->getPeriodMs(); -#if OBSW_ADD_ACS_BOARD == 1 bool enableAside = true; bool enableBside = true; + if(cfg.scheduleAcsBoard) { + if (enableAside) { // A side - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.0625, + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.0625, + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.0625, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.0625, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.0625, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.0625, + thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.0625, + thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.0625, + thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.0625, + thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.0625, + thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.0625, + thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.0625, + thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.0625, + thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.0625, + thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.0625, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.0625, + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.0625, + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.0625, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.0625, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.0625, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); } if (enableBside) { // B side - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0.0625, + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0.0625, + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0.0625, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0.0625, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0.0625, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * 0.0625, + thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * 0.0625, + thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * 0.0625, + thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * 0.0625, + thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * 0.0625, + thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0.0625, + thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0.0625, + thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0.0625, + thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0.0625, + thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0.0625, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0.0625, + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0.0625, + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0.0625, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0.0625, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0.0625, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + } } -#endif /* OBSW_ADD_ACS_BOARD == 1 */ // SUS: 16 ms -#if OBSW_ADD_SUN_SENSORS == 1 bool addSus0 = true; bool addSus1 = true; @@ -285,6 +287,7 @@ ReturnValue_t pst::pstAcs(FixedTimeslotTaskIF *thisSequence) { bool addSus10 = true; bool addSus11 = true; + if(cfg.scheduleSus) { if (addSus0) { /* Write setup */ thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0, @@ -297,13 +300,13 @@ ReturnValue_t pst::pstAcs(FixedTimeslotTaskIF *thisSequence) { DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0.0325, + thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0.0325, + thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0.0325, + thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0.0325, + thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); } if (addSus1) { @@ -317,13 +320,13 @@ ReturnValue_t pst::pstAcs(FixedTimeslotTaskIF *thisSequence) { DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0.0325, + thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0.0325, + thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0.0325, + thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0.0325, + thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); } if (addSus2) { @@ -337,13 +340,13 @@ ReturnValue_t pst::pstAcs(FixedTimeslotTaskIF *thisSequence) { DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0.0325, + thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0.0325, + thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0.0325, + thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0.0325, + thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); } if (addSus3) { @@ -357,13 +360,13 @@ ReturnValue_t pst::pstAcs(FixedTimeslotTaskIF *thisSequence) { DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0.0325, + thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0.0325, + thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0.0325, + thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0.0325, + thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); } if (addSus4) { @@ -377,13 +380,13 @@ ReturnValue_t pst::pstAcs(FixedTimeslotTaskIF *thisSequence) { DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0.0325, + thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0.0325, + thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0.0325, + thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0.0325, + thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); } if (addSus5) { @@ -397,13 +400,13 @@ ReturnValue_t pst::pstAcs(FixedTimeslotTaskIF *thisSequence) { DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0.0325, + thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0.0325, + thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0.0325, + thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0.0325, + thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); } @@ -418,13 +421,13 @@ ReturnValue_t pst::pstAcs(FixedTimeslotTaskIF *thisSequence) { DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0.0325, + thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0.0325, + thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0.0325, + thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0.0325, + thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); } @@ -439,13 +442,13 @@ ReturnValue_t pst::pstAcs(FixedTimeslotTaskIF *thisSequence) { DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0.0325, + thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0.0325, + thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0.0325, + thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0.0325, + thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); } @@ -460,13 +463,13 @@ ReturnValue_t pst::pstAcs(FixedTimeslotTaskIF *thisSequence) { DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0.0325, + thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0.0325, + thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0.0325, + thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0.0325, + thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); } @@ -480,13 +483,13 @@ ReturnValue_t pst::pstAcs(FixedTimeslotTaskIF *thisSequence) { thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0, DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0.0325, + thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0.0325, + thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0.0325, + thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0.0325, + thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); } @@ -502,13 +505,13 @@ ReturnValue_t pst::pstAcs(FixedTimeslotTaskIF *thisSequence) { thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0.0325, + thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0.0325, + thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0.0325, + thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0.0325, + thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); } @@ -524,80 +527,81 @@ ReturnValue_t pst::pstAcs(FixedTimeslotTaskIF *thisSequence) { thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0.0325, + thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0.0325, + thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0.0325, + thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0.0325, + thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); } -#endif /* OBSW_ADD_SUN_SENSORS == 1 */ + } -#if OBSW_ADD_STAR_TRACKER == 1 + if(cfg.scheduleStr) { thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::GET_WRITE); thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::GET_READ); -#endif + } -#if OBSW_ADD_MGT == 1 - // This is the MTM measurement cycle - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.0625, DeviceHandlerIF::GET_READ); -#endif + if(cfg.scheduleImtq) { + // This is the MTM measurement cycle + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + } - thisSequence->addSlot(objects::ACS_CONTROLLER, length * 0.1, 0); + thisSequence->addSlot(objects::ACS_CONTROLLER, length * config::acs::SCHED_BLOCK_2_PERIOD, 0); -#if OBSW_ADD_MGT == 1 + if(cfg.scheduleImtq) { // This is the torquing cycle. - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.1125, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.1125, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.1125, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.1125, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.1125, DeviceHandlerIF::GET_READ); -#endif + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_READ); + } -#if OBSW_ADD_RW == 1 - thisSequence->addSlot(objects::RW1, length * 0.1125, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW2, length * 0.1125, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW3, length * 0.1125, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW4, length * 0.1125, DeviceHandlerIF::PERFORM_OPERATION); + if(cfg.scheduleRws) { - thisSequence->addSlot(objects::RW1, length * 0.1125, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW2, length * 0.1125, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW3, length * 0.1125, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW4, length * 0.1125, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW1, length * 0.1125, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW2, length * 0.1125, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW3, length * 0.1125, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW4, length * 0.1125, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW1, length * 0.1125, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW2, length * 0.1125, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW3, length * 0.1125, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW4, length * 0.1125, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW1, length * 0.1125, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RW2, length * 0.1125, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RW3, length * 0.1125, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RW4, length * 0.1125, DeviceHandlerIF::GET_READ); -#endif + thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_READ); + + thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_READ); + } return returnvalue::OK; } diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h index 1dcfc30a..3e5ead52 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h @@ -31,6 +31,14 @@ class FixedTimeslotTaskIF; */ namespace pst { +struct AcsPstCfg { + bool scheduleAcsBoard = true; + bool scheduleImtq = true; + bool scheduleRws = true; + bool scheduleSus = true; + bool scheduleStr = true; +}; + /** * @brief This function creates the PST for all gomspace devices. * @details @@ -41,7 +49,7 @@ ReturnValue_t pstGompaceCan(FixedTimeslotTaskIF* thisSequence); ReturnValue_t pstSpiAndSyrlinks(FixedTimeslotTaskIF* thisSequence); -ReturnValue_t pstAcs(FixedTimeslotTaskIF* thisSequence); +ReturnValue_t pstAcs(FixedTimeslotTaskIF* thisSequence, AcsPstCfg cfg); ReturnValue_t pstI2c(FixedTimeslotTaskIF* thisSequence); From 13b3fe03b88abd4122f7d81be6f38bc4eec849d2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Feb 2023 16:46:30 +0100 Subject: [PATCH 219/330] afmt and changelog --- CHANGELOG.md | 5 + bsp_q7s/core/scheduling.h | 1 + common/config/eive/definitions.h | 2 +- .../pollingSequenceFactory.cpp | 813 ++++++++++-------- 4 files changed, 454 insertions(+), 367 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c545da36..2e110d6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,11 @@ change warranting a new major release: # [unreleased] +## Changed + +- ACS Controller scheduling is now configurable via the `eive/definitions.h` file. Also ensured + that scheduling is done in big blocks to reduce risk of missed deadlines. + # [v1.26.1] 2023-02-08 - Initialize parameter helper in ACS controller. diff --git a/bsp_q7s/core/scheduling.h b/bsp_q7s/core/scheduling.h index 15b3abc2..2241e683 100644 --- a/bsp_q7s/core/scheduling.h +++ b/bsp_q7s/core/scheduling.h @@ -2,6 +2,7 @@ #define BSP_Q7S_INITMISSION_H_ #include + #include #include "fsfw/tasks/definitions.h" diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index 0e7ecea6..8e0ac7b7 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -66,7 +66,7 @@ static constexpr float SCHED_BLOCK_1_PERIOD = static_cast(SCHED_BLOCK_1_S static constexpr float SCHED_BLOCK_2_PERIOD = static_cast(SCHED_BLOCK_2_ACS_CTRL_MS) / 400.0; static constexpr float SCHED_BLOCK_3_PERIOD = static_cast(SCHED_BLOCK_3_ACTUATOR_MS) / 400.0; -} +} // namespace acs } // namespace config diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 6cfedf72..f9b69e45 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -1,12 +1,11 @@ #include "pollingSequenceFactory.h" -#include "eive/definitions.h" - #include #include #include #include +#include "eive/definitions.h" #include "mission/devices/devicedefinitions/Max31865Definitions.h" #ifndef RPI_TEST_ADIS16507 @@ -190,87 +189,108 @@ ReturnValue_t pst::pstAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg) { uint32_t length = thisSequence->getPeriodMs(); bool enableAside = true; bool enableBside = true; - if(cfg.scheduleAcsBoard) { + if (cfg.scheduleAcsBoard) { + if (enableAside) { + // A side + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_READ); - if (enableAside) { - // A side - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, + length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, + length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, + length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, + length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_READ); + } - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); - } + if (enableBside) { + // B side + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_READ); - if (enableBside) { - // B side - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, + length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, + length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, + length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, + length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); - } + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_READ); + } } // SUS: 16 ms @@ -287,321 +307,382 @@ ReturnValue_t pst::pstAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg) { bool addSus10 = true; bool addSus11 = true; - if(cfg.scheduleSus) { - if (addSus0) { - /* Write setup */ - thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0, + if (cfg.scheduleSus) { + if (addSus0) { + /* Write setup */ + thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0, + DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, + length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + } + if (addSus1) { + thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0, + DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, + length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + } + if (addSus2) { + thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0, + DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, + length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + } + if (addSus3) { + thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0, + DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, + length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + } + if (addSus4) { + thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0, + DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, + length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + } + if (addSus5) { + thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0, + DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, + length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + } + + if (addSus6) { + thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0, + DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, + length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + } + + if (addSus7) { + thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0, + DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, + length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + } + + if (addSus8) { + thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0, + DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, + length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + } + + if (addSus9) { + thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0, + DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, + length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + } + + if (addSus10) { + thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0, + DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, + length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + } + + if (addSus11) { + thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0, + DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, + length * config::acs::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, + length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + } + } + + if (cfg.scheduleStr) { + thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::GET_READ); + } + + if (cfg.scheduleImtq) { + // This is the MTM measurement cycle + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0, + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0, + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0, + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * 0, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, length * config::acs::SCHED_BLOCK_1_PERIOD, + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); - } - if (addSus1) { - thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0, + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0, + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0, + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0, + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * 0, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, length * config::acs::SCHED_BLOCK_1_PERIOD, + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); - } - if (addSus2) { - thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0, + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0, + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0, + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0, + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * 0, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, length * config::acs::SCHED_BLOCK_1_PERIOD, + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); } - if (addSus3) { - thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * 0, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::GET_READ); - } - if (addSus4) { - thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * 0, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::GET_READ); - } - if (addSus5) { - thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * 0, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::GET_READ); - } - - if (addSus6) { - thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::GET_READ); - } - - if (addSus7) { - thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::GET_READ); - } - - if (addSus8) { - thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::GET_READ); - } - - if (addSus9) { - thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::GET_READ); - } - - if (addSus10) { - thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0, - DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::GET_READ); - } - - if (addSus11) { - thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0, - DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * config::acs::SCHED_BLOCK_1_PERIOD, - DeviceHandlerIF::GET_READ); - } - } - - if(cfg.scheduleStr) { - thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::GET_READ); - } - - if(cfg.scheduleImtq) { - // This is the MTM measurement cycle - thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); - } thisSequence->addSlot(objects::ACS_CONTROLLER, length * config::acs::SCHED_BLOCK_2_PERIOD, 0); - if(cfg.scheduleImtq) { - // This is the torquing cycle. - thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_READ); + if (cfg.scheduleImtq) { + // This is the torquing cycle. + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::IMTQ_HANDLER, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::GET_READ); } - if(cfg.scheduleRws) { + if (cfg.scheduleRws) { + thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_READ); - - thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::GET_READ); } return returnvalue::OK; } From fddfa80f765f1ca018d1eca32c20a4fcf96ada2f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Feb 2023 16:58:32 +0100 Subject: [PATCH 220/330] fix unittest --- unittest/controller/testThermalController.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/unittest/controller/testThermalController.cpp b/unittest/controller/testThermalController.cpp index 87c6ee12..302a18c4 100644 --- a/unittest/controller/testThermalController.cpp +++ b/unittest/controller/testThermalController.cpp @@ -7,7 +7,7 @@ #include -#include "../../dummies/TemperatureSensorInserter.h" +#include "dummies/TemperatureSensorInserter.h" #include "../testEnvironment.h" #include "mission/core/GenericFactory.h" #include "test/gpio/DummyGpioIF.h" @@ -15,7 +15,9 @@ TEST_CASE("Thermal Controller", "[ThermalController]") { const object_id_t THERMAL_CONTROLLER_ID = 0x123; - new TemperatureSensorInserter(objects::THERMAL_TEMP_INSERTER); + TemperatureSensorInserter::Max31865DummyMap map0; + TemperatureSensorInserter::Tmp1075DummyMap map1; + new TemperatureSensorInserter(objects::THERMAL_TEMP_INSERTER, map0, map1); auto dummyGpioIF = new DummyGpioIF(); auto dummySwitcher = new DummyPowerSwitcher(objects::PCDU_HANDLER, 18, 0); // TODO: Create dummy heater handler From 1d12d5f1445fc524911abf9e889ffdd20b5557cb Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 8 Feb 2023 17:02:22 +0100 Subject: [PATCH 221/330] removed sensorValues inits --- mission/controller/AcsController.cpp | 18 ++++++++---------- mission/controller/AcsController.h | 4 +++- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 10053da8..1b4f54a9 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -254,8 +254,6 @@ void AcsController::performDetumble() { } void AcsController::performPointingCtrl() { - ACS::SensorValues sensorValues; - timeval now; Clock::getClock_timeval(&now); @@ -717,14 +715,6 @@ void AcsController::copySusData() { } } -ReturnValue_t AcsController::initialize() { - ReturnValue_t result = parameterHelper.initialize(); - if (result != returnvalue::OK) { - return result; - } - return ExtendedControllerBase::initialize(); -} - void AcsController::copyGyrData() { ACS::SensorValues sensorValues; { @@ -772,3 +762,11 @@ void AcsController::copyGyrData() { } } } + +ReturnValue_t AcsController::initialize() { + ReturnValue_t result = parameterHelper.initialize(); + if (result != returnvalue::OK) { + return result; + } + return ExtendedControllerBase::initialize(); +} diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index 0ae4f338..1e017099 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -38,7 +38,6 @@ class AcsController : public ExtendedControllerBase, public ReceivesParameterMes private: AcsParameters acsParameters; - ACS::SensorValues sensorValues; SensorProcessing sensorProcessing; Navigation navigation; ActuatorCmd actuatorCmd; @@ -70,6 +69,9 @@ class AcsController : public ExtendedControllerBase, public ReceivesParameterMes void modeChanged(Mode_t mode, Submode_t submode); void announceMode(bool recursive); + /* ACS Sensor Values */ + ACS::SensorValues sensorValues; + /* ACS Datasets */ IMTQ::DipoleActuationSet dipoleSet = IMTQ::DipoleActuationSet(objects::IMTQ_HANDLER); // MGMs From 5f9a52977bd981effe3bde1db6a7872cacf3390c Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 8 Feb 2023 17:02:59 +0100 Subject: [PATCH 222/330] replaced all chained locks --- mission/controller/acs/SensorValues.cpp | 87 +++++++++++++++++-------- 1 file changed, 61 insertions(+), 26 deletions(-) diff --git a/mission/controller/acs/SensorValues.cpp b/mission/controller/acs/SensorValues.cpp index a963f326..e4026300 100644 --- a/mission/controller/acs/SensorValues.cpp +++ b/mission/controller/acs/SensorValues.cpp @@ -23,8 +23,8 @@ ReturnValue_t SensorValues::updateMgm() { std::vector results; { - PoolReadGuard pgMgm0(&mgm0Lis3Set); - results.push_back(pgMgm0.getReadResult()); + PoolReadGuard pgMgm(&mgm0Lis3Set); + results.push_back(pgMgm.getReadResult()); } { PoolReadGuard pgMgm(&mgm1Rm3100Set); @@ -51,31 +51,49 @@ ReturnValue_t SensorValues::updateMgm() { } ReturnValue_t SensorValues::updateSus() { - ReturnValue_t result; - PoolReadGuard pgSus0(&susSets[0]), pgSus1(&susSets[1]), pgSus2(&susSets[2]), pgSus3(&susSets[3]), - pgSus4(&susSets[4]), pgSus5(&susSets[5]), pgSus6(&susSets[6]), pgSus7(&susSets[7]), - pgSus8(&susSets[8]), pgSus9(&susSets[9]), pgSus10(&susSets[10]), pgSus11(&susSets[11]); - - result = (pgSus0.getReadResult() || pgSus1.getReadResult() || pgSus2.getReadResult() || - pgSus3.getReadResult() || pgSus4.getReadResult() || pgSus5.getReadResult() || - pgSus6.getReadResult() || pgSus7.getReadResult() || pgSus8.getReadResult() || - pgSus9.getReadResult() || pgSus10.getReadResult() || pgSus11.getReadResult()); - return result; + std::vector results; + for (auto& susSet : susSets) { + { + PoolReadGuard pgSus(&susSet); + results.push_back(pgSus.getReadResult()); + } + } + for (const auto& result : results) { + if (result != returnvalue::OK) { + return result; + } + } + return returnvalue::OK; } ReturnValue_t SensorValues::updateGyr() { - ReturnValue_t result; - PoolReadGuard pgGyr0(&gyr0AdisSet), pgGyr1(&gyr1L3gSet), pgGyr2(&gyr2AdisSet), - pgGyr3(&gyr3L3gSet); - - result = (pgGyr0.getReadResult() || pgGyr1.getReadResult() || pgGyr2.getReadResult() || - pgGyr3.getReadResult()); - return result; + std::vector results; + { + PoolReadGuard pgGyr(&gyr0AdisSet); + results.push_back(pgGyr.getReadResult()); + } + { + PoolReadGuard pgGyr(&gyr1L3gSet); + results.push_back(pgGyr.getReadResult()); + } + { + PoolReadGuard pgGyr(&gyr2AdisSet); + results.push_back(pgGyr.getReadResult()); + } + { + PoolReadGuard pgGyr(&gyr3L3gSet); + results.push_back(pgGyr.getReadResult()); + } + for (const auto& result : results) { + if (result != returnvalue::OK) { + return result; + } + } + return returnvalue::OK; } ReturnValue_t SensorValues::updateStr() { PoolReadGuard pgStr(&strSet); - return pgStr.getReadResult(); } @@ -85,12 +103,29 @@ ReturnValue_t SensorValues::updateGps() { } ReturnValue_t SensorValues::updateRw() { - ReturnValue_t result; - PoolReadGuard pgRw1(&rw1Set), pgRw2(&rw2Set), pgRw3(&rw3Set), pgRw4(&rw4Set); - - result = (pgRw1.getReadResult() || pgRw2.getReadResult() || pgRw3.getReadResult() || - pgRw4.getReadResult()); - return result; + std::vector results; + { + PoolReadGuard pgRw(&rw1Set); + results.push_back(pgRw.getReadResult()); + } + { + PoolReadGuard pgRw(&rw2Set); + results.push_back(pgRw.getReadResult()); + } + { + PoolReadGuard pgRw(&rw3Set); + results.push_back(pgRw.getReadResult()); + } + { + PoolReadGuard pgRw(&rw4Set); + results.push_back(pgRw.getReadResult()); + } + for (const auto& result : results) { + if (result != returnvalue::OK) { + return result; + } + } + return returnvalue::OK; } ReturnValue_t SensorValues::update() { From b943fee5158a04e1fcce4dd58339c5e624cf51e0 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 8 Feb 2023 17:17:19 +0100 Subject: [PATCH 223/330] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c545da36..b112aeef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ change warranting a new major release: # [unreleased] +## Changed + +- Replaced chained locks for polling new sensor data to the `AcsController` + # [v1.26.1] 2023-02-08 - Initialize parameter helper in ACS controller. From 557fe5a9a237673c7e109126cd468c556b960906 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Feb 2023 20:01:56 +0100 Subject: [PATCH 224/330] PDEC evil fix --- linux/ipcore/PdecHandler.cpp | 23 +++++++++++++++++------ linux/ipcore/PdecHandler.h | 3 ++- tmtc | 2 +- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/linux/ipcore/PdecHandler.cpp b/linux/ipcore/PdecHandler.cpp index 57d59841..0598cc95 100644 --- a/linux/ipcore/PdecHandler.cpp +++ b/linux/ipcore/PdecHandler.cpp @@ -132,6 +132,7 @@ ReturnValue_t PdecHandler::polledOperation() { return returnvalue::OK; } +// See https://yurovsky.github.io/2014/10/10/linux-uio-gpio-interrupt.html for more information. ReturnValue_t PdecHandler::irqOperation() { ReturnValue_t result = returnvalue::OK; int fd = open(uioNames.irq, O_RDWR); @@ -141,15 +142,17 @@ ReturnValue_t PdecHandler::irqOperation() { return returnvalue::FAILED; } - struct pollfd fds = {.fd = fd, .events = POLLIN, .revents = 0}; // Used to unmask IRQ uint32_t info = 1; ssize_t nb = 0; int ret = 0; - // Clear interrupts with dummy read before unmasking the interrupt - ret = *(registerBaseAddress + PDEC_PIR_OFFSET); + // Clear interrupts with dummy read before unmasking the interrupt. Use a volatile to prevent + // read being optimized away. + volatile uint32_t dummy = *(registerBaseAddress + PDEC_PIR_OFFSET); while (true) { + // Default value to unmask IRQ on the write call. + info = 1; readCommandQueue(); switch (state) { case State::INIT: @@ -166,9 +169,12 @@ ReturnValue_t PdecHandler::irqOperation() { nb = write(fd, &info, sizeof(info)); if (nb != static_cast(sizeof(info))) { sif::error << "PdecHandler::irqOperation: Unmasking IRQ failed" << std::endl; + triggerEvent(WRITE_SYSCALL_ERROR_PDEC, errno); close(fd); + state = State::INIT; + return returnvalue::FAILED; } - + struct pollfd fds = {.fd = fd, .events = POLLIN, .revents = 0}; ret = poll(&fds, 1, IRQ_TIMEOUT_MS); if (ret == 0) { // No TCs for timeout period @@ -195,12 +201,15 @@ ReturnValue_t PdecHandler::irqOperation() { lockCheckCd.resetTimer(); } // Clear interrupts with dummy read - ret = *(registerBaseAddress + PDEC_PIR_OFFSET); + dummy = *(registerBaseAddress + PDEC_PIR_OFFSET); } } else { sif::error << "PdecHandler::irqOperation: Poll error with errno " << errno << ": " << strerror(errno) << std::endl; - triggerEvent(POLL_ERROR_PDEC, errno); + triggerEvent(POLL_SYSCALL_ERROR_PDEC, errno); + close(fd); + state = State::INIT; + return returnvalue::FAILED; } break; } @@ -211,6 +220,8 @@ ReturnValue_t PdecHandler::irqOperation() { break; } } + // To avoid compiler warning + static_cast(dummy); return returnvalue::OK; } diff --git a/linux/ipcore/PdecHandler.h b/linux/ipcore/PdecHandler.h index 6ebd9ce6..8e08adc8 100644 --- a/linux/ipcore/PdecHandler.h +++ b/linux/ipcore/PdecHandler.h @@ -87,7 +87,8 @@ class PdecHandler : public SystemObject, public ExecutableObjectIF, public HasAc static const Event LOST_CARRIER_LOCK_PDEC = MAKE_EVENT(5, severity::INFO); //! [EXPORT] : [COMMENT] Lost bit lock static const Event LOST_BIT_LOCK_PDEC = MAKE_EVENT(6, severity::INFO); - static constexpr Event POLL_ERROR_PDEC = event::makeEvent(SUBSYSTEM_ID, 7, severity::MEDIUM); + static constexpr Event POLL_SYSCALL_ERROR_PDEC = event::makeEvent(SUBSYSTEM_ID, 7, severity::MEDIUM); + static constexpr Event WRITE_SYSCALL_ERROR_PDEC = event::makeEvent(SUBSYSTEM_ID, 8, severity::MEDIUM); private: static const uint8_t INTERFACE_ID = CLASS_ID::PDEC_HANDLER; diff --git a/tmtc b/tmtc index 94a82b84..33da498e 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 94a82b84e86177d122f4ac12eff6e06528f6290b +Subproject commit 33da498ea8aeb2e8b328d040b3cd0720aa12f50c From cea0a28cee075e4122a77e0c43c0a0e9c938f2e9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Feb 2023 20:06:15 +0100 Subject: [PATCH 225/330] bump changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe5c2dec..ede02f9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,13 @@ change warranting a new major release: that scheduling is done in big blocks to reduce risk of missed deadlines. - Replaced chained locks for polling new sensor data to the `AcsController` +## Fixed + +- Bugfix for PDEC handler which causes the PIR register of the PDEC to never + be cleared on release builds. The dummy variable used to read the register + needs to be declared volatile to avoid compiler optimizations. + PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/374 + # [v1.26.1] 2023-02-08 - Initialize parameter helper in ACS controller. From 7ec8ca33566d73130c80daf01883a0182d6ace82 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Feb 2023 20:40:53 +0100 Subject: [PATCH 226/330] updates --- CHANGELOG.md | 7 ++++++- bsp_q7s/em/emObjectFactory.cpp | 1 + fsfw | 2 +- linux/ipcore/PdecHandler.h | 6 ++++-- mission/core/GenericFactory.cpp | 6 +++--- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ede02f9e..73b5f293 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,8 @@ change warranting a new major release: - ACS Controller scheduling is now configurable via the `eive/definitions.h` file. Also ensured that scheduling is done in big blocks to reduce risk of missed deadlines. -- Replaced chained locks for polling new sensor data to the `AcsController` +- Replaced chained locks for polling new sensor data to the `AcsController`. +- Made TM store even larger. ## Fixed @@ -30,6 +31,10 @@ change warranting a new major release: needs to be declared volatile to avoid compiler optimizations. PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/374 +## Added + +- Create TCS controller for EM build. + # [v1.26.1] 2023-02-08 - Initialize parameter helper in ACS controller. diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 832d082c..1627a858 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -112,5 +112,6 @@ void ObjectFactory::produce(void* args) { pcdu::Switches::PDU1_CH5_SOLAR_CELL_EXP_5V); #endif createAcsController(true); + createThermalController(); satsystem::com::init(); } diff --git a/fsfw b/fsfw index 84bbef01..6f05d6b7 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 84bbef016712096147e8cf3f2cec87f317d9e7e7 +Subproject commit 6f05d6b7b0ee0e6bc86986ec55491d42cde1cf93 diff --git a/linux/ipcore/PdecHandler.h b/linux/ipcore/PdecHandler.h index 8e08adc8..32692dd8 100644 --- a/linux/ipcore/PdecHandler.h +++ b/linux/ipcore/PdecHandler.h @@ -87,8 +87,10 @@ class PdecHandler : public SystemObject, public ExecutableObjectIF, public HasAc static const Event LOST_CARRIER_LOCK_PDEC = MAKE_EVENT(5, severity::INFO); //! [EXPORT] : [COMMENT] Lost bit lock static const Event LOST_BIT_LOCK_PDEC = MAKE_EVENT(6, severity::INFO); - static constexpr Event POLL_SYSCALL_ERROR_PDEC = event::makeEvent(SUBSYSTEM_ID, 7, severity::MEDIUM); - static constexpr Event WRITE_SYSCALL_ERROR_PDEC = event::makeEvent(SUBSYSTEM_ID, 8, severity::MEDIUM); + static constexpr Event POLL_SYSCALL_ERROR_PDEC = + event::makeEvent(SUBSYSTEM_ID, 7, severity::MEDIUM); + static constexpr Event WRITE_SYSCALL_ERROR_PDEC = + event::makeEvent(SUBSYSTEM_ID, 8, severity::MEDIUM); private: static const uint8_t INTERFACE_ID = CLASS_ID::PDEC_HANDLER; diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index d486ed59..db529096 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -87,14 +87,14 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun } { - PoolManager::LocalPoolConfig poolCfg = {{300, 16}, {350, 32}, {350, 64}, - {200, 128}, {150, 1024}, {150, 2048}}; + PoolManager::LocalPoolConfig poolCfg = {{400, 32}, {350, 64}, {200, 128}, + {150, 512}, {150, 1024}, {150, 2048}}; tmStore = new PoolManager(objects::TM_STORE, poolCfg); } { PoolManager::LocalPoolConfig poolCfg = {{300, 16}, {200, 32}, {150, 64}, {150, 128}, - {100, 256}, {50, 512}, {50, 1024}, {10, 2048}}; + {100, 256}, {50, 512}, {50, 1024}, {50, 2048}}; new PoolManager(objects::IPC_STORE, poolCfg); } From 9d14788ef3f0c494c14836c620d769a260c6cec5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Feb 2023 21:11:24 +0100 Subject: [PATCH 227/330] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 33da498e..aadd6f59 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 33da498ea8aeb2e8b328d040b3cd0720aa12f50c +Subproject commit aadd6f59b55ac3e67ea783107da823bd4e8e84dc From c843e34464c7701f1dbaa4072c6da716e6d8d890 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Feb 2023 21:22:07 +0100 Subject: [PATCH 228/330] prep v1.26.2 --- CHANGELOG.md | 4 ++++ CMakeLists.txt | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73b5f293..7d11cac9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ change warranting a new major release: # [unreleased] +# [v1.26.2] 2023-02-08 + ## Changed - ACS Controller scheduling is now configurable via the `eive/definitions.h` file. Also ensured @@ -30,6 +32,8 @@ change warranting a new major release: be cleared on release builds. The dummy variable used to read the register needs to be declared volatile to avoid compiler optimizations. PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/374 +- Bumped FSFW for fix of possible memory leaks in TCP/IP TMTC bridge + inside the FSFW. ## Added diff --git a/CMakeLists.txt b/CMakeLists.txt index 9820c3ab..a221f578 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ cmake_minimum_required(VERSION 3.13) set(OBSW_VERSION_MAJOR 1) set(OBSW_VERSION_MINOR 26) -set(OBSW_VERSION_REVISION 1) +set(OBSW_VERSION_REVISION 2) # set(CMAKE_VERBOSE TRUE) From 8d69996d4c4ebbd3461e843a22304270815a8b04 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Feb 2023 21:27:42 +0100 Subject: [PATCH 229/330] bump fsfw --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 6f05d6b7..6ce80ea6 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 6f05d6b7b0ee0e6bc86986ec55491d42cde1cf93 +Subproject commit 6ce80ea6c5b7621876422d2c7614096cbca6f302 From 55425070245512a1b72670cd8f8c3e52562150ca Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 8 Feb 2023 21:40:09 +0100 Subject: [PATCH 230/330] changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d11cac9..3b85408c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,14 @@ change warranting a new major release: # [unreleased] +## Added + +- First version of a TCS controller heater control loop. + +## Changed + +- Reworked dummy handling for the TCS controller. + # [v1.26.2] 2023-02-08 ## Changed From e527695a33dc594716dcccbe8b27f7d437e489ab Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 9 Feb 2023 14:25:29 +0100 Subject: [PATCH 231/330] update generates files --- generators/bsp_q7s_events.csv | 10 +++++- generators/bsp_q7s_objects.csv | 2 +- generators/events/translateEvents.cpp | 32 ++++++++++++++++--- generators/objects/translateObjects.cpp | 8 ++--- linux/devices/GpsHyperionLinuxController.cpp | 22 +++++++------ linux/fsfwconfig/events/translateEvents.cpp | 32 ++++++++++++++++--- linux/fsfwconfig/objects/translateObjects.cpp | 8 ++--- mission/controller/ThermalController.cpp | 2 +- tmtc | 2 +- unittest/controller/testThermalController.cpp | 2 +- 10 files changed, 90 insertions(+), 30 deletions(-) diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index 9f477ca2..23d51222 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -144,7 +144,8 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 12404;0x3074;BIT_LOCK_PDEC;INFO;Bit lock detected (data valid);linux/ipcore/PdecHandler.h 12405;0x3075;LOST_CARRIER_LOCK_PDEC;INFO;Lost carrier lock;linux/ipcore/PdecHandler.h 12406;0x3076;LOST_BIT_LOCK_PDEC;INFO;Lost bit lock;linux/ipcore/PdecHandler.h -12407;0x3077;POLL_ERROR_PDEC;MEDIUM;;linux/ipcore/PdecHandler.h +12407;0x3077;POLL_SYSCALL_ERROR_PDEC;MEDIUM;;linux/ipcore/PdecHandler.h +12408;0x3078;WRITE_SYSCALL_ERROR_PDEC;MEDIUM;;linux/ipcore/PdecHandler.h 12500;0x30d4;IMAGE_UPLOAD_FAILED;LOW;Image upload failed;linux/devices/startracker/StrHelper.h 12501;0x30d5;IMAGE_DOWNLOAD_FAILED;LOW;Image download failed;linux/devices/startracker/StrHelper.h 12502;0x30d6;IMAGE_UPLOAD_SUCCESSFUL;LOW;Uploading image to star tracker was successfulop;linux/devices/startracker/StrHelper.h @@ -247,3 +248,10 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 14004;0x36b4;NO_SD_CARD_ACTIVE;HIGH;No SD card was active. Core controller will attempt to re-initialize a SD card.;bsp_q7s/core/CoreController.h 14005;0x36b5;VERSION_INFO;INFO;P1: Byte 0: Major, Byte 1: Minor, Byte 2: Patch, Byte 3: Has Git Hash P2: First four letters of Git SHA is the last byte of P1 is set.;bsp_q7s/core/CoreController.h 14006;0x36b6;CURRENT_IMAGE_INFO;INFO;P1: Current Chip, P2: Current Copy;bsp_q7s/core/CoreController.h +14100;0x3714;NO_VALID_SENSOR_TEMPERATURE;MEDIUM;;mission/controller/ThermalController.h +14101;0x3715;NO_HEALTHY_HEATER_AVAILABLE;MEDIUM;;mission/controller/ThermalController.h +14102;0x3716;SYRLINKS_OVERHEATING;HIGH;;mission/controller/ThermalController.h +14103;0x3717;PLOC_OVERHEATING;HIGH;;mission/controller/ThermalController.h +14104;0x3718;OBC_OVERHEATING;HIGH;;mission/controller/ThermalController.h +14105;0x3719;HPA_OVERHEATING;HIGH;;mission/controller/ThermalController.h +14106;0x371a;PLPCDU_OVERHEATING;HIGH;;mission/controller/ThermalController.h diff --git a/generators/bsp_q7s_objects.csv b/generators/bsp_q7s_objects.csv index 35463225..08c09a47 100644 --- a/generators/bsp_q7s_objects.csv +++ b/generators/bsp_q7s_objects.csv @@ -55,7 +55,6 @@ 0x44420006;TMP1075_HANDLER_PLPCDU_0 0x44420007;TMP1075_HANDLER_PLPCDU_1 0x44420008;TMP1075_HANDLER_IF_BOARD -0x44420009;TMP1075_HANDLER_OBC_IF_BOARD 0x44420016;RTD_0_IC3_PLOC_HEATSPREADER 0x44420017;RTD_1_IC4_PLOC_MISSIONBOARD 0x44420018;RTD_2_IC5_4K_CAMERA @@ -149,4 +148,5 @@ 0x73010003;TCS_SUBSYSTEM 0x73010004;COM_SUBSYSTEM 0x73500000;CCSDS_IP_CORE_BRIDGE +0x90000003;THERMAL_TEMP_INSERTER 0xFFFFFFFF;NO_OBJECT diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index a13005e1..b7556f0a 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 248 translations. + * @brief Auto-generated event translation file. Contains 256 translations. * @details - * Generated on: 2023-02-08 14:09:40 + * Generated on: 2023-02-09 14:24:39 */ #include "translateEvents.h" @@ -150,7 +150,8 @@ const char *CARRIER_LOCK_STRING = "CARRIER_LOCK"; const char *BIT_LOCK_PDEC_STRING = "BIT_LOCK_PDEC"; const char *LOST_CARRIER_LOCK_PDEC_STRING = "LOST_CARRIER_LOCK_PDEC"; const char *LOST_BIT_LOCK_PDEC_STRING = "LOST_BIT_LOCK_PDEC"; -const char *POLL_ERROR_PDEC_STRING = "POLL_ERROR_PDEC"; +const char *POLL_SYSCALL_ERROR_PDEC_STRING = "POLL_SYSCALL_ERROR_PDEC"; +const char *WRITE_SYSCALL_ERROR_PDEC_STRING = "WRITE_SYSCALL_ERROR_PDEC"; const char *IMAGE_UPLOAD_FAILED_STRING = "IMAGE_UPLOAD_FAILED"; const char *IMAGE_DOWNLOAD_FAILED_STRING = "IMAGE_DOWNLOAD_FAILED"; const char *IMAGE_UPLOAD_SUCCESSFUL_STRING = "IMAGE_UPLOAD_SUCCESSFUL"; @@ -248,6 +249,13 @@ const char *REBOOT_HW_STRING = "REBOOT_HW"; const char *NO_SD_CARD_ACTIVE_STRING = "NO_SD_CARD_ACTIVE"; const char *VERSION_INFO_STRING = "VERSION_INFO"; const char *CURRENT_IMAGE_INFO_STRING = "CURRENT_IMAGE_INFO"; +const char *NO_VALID_SENSOR_TEMPERATURE_STRING = "NO_VALID_SENSOR_TEMPERATURE"; +const char *NO_HEALTHY_HEATER_AVAILABLE_STRING = "NO_HEALTHY_HEATER_AVAILABLE"; +const char *SYRLINKS_OVERHEATING_STRING = "SYRLINKS_OVERHEATING"; +const char *PLOC_OVERHEATING_STRING = "PLOC_OVERHEATING"; +const char *OBC_OVERHEATING_STRING = "OBC_OVERHEATING"; +const char *HPA_OVERHEATING_STRING = "HPA_OVERHEATING"; +const char *PLPCDU_OVERHEATING_STRING = "PLPCDU_OVERHEATING"; const char *translateEvents(Event event) { switch ((event & 0xFFFF)) { @@ -542,7 +550,9 @@ const char *translateEvents(Event event) { case (12406): return LOST_BIT_LOCK_PDEC_STRING; case (12407): - return POLL_ERROR_PDEC_STRING; + return POLL_SYSCALL_ERROR_PDEC_STRING; + case (12408): + return WRITE_SYSCALL_ERROR_PDEC_STRING; case (12500): return IMAGE_UPLOAD_FAILED_STRING; case (12501): @@ -737,6 +747,20 @@ const char *translateEvents(Event event) { return VERSION_INFO_STRING; case (14006): return CURRENT_IMAGE_INFO_STRING; + case (14100): + return NO_VALID_SENSOR_TEMPERATURE_STRING; + case (14101): + return NO_HEALTHY_HEATER_AVAILABLE_STRING; + case (14102): + return SYRLINKS_OVERHEATING_STRING; + case (14103): + return PLOC_OVERHEATING_STRING; + case (14104): + return OBC_OVERHEATING_STRING; + case (14105): + return HPA_OVERHEATING_STRING; + case (14106): + return PLPCDU_OVERHEATING_STRING; default: return "UNKNOWN_EVENT"; } diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 0e1c12dc..2be64bee 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 152 translations. - * Generated on: 2023-02-08 14:09:40 + * Generated on: 2023-02-09 14:24:39 */ #include "translateObjects.h" @@ -63,7 +63,6 @@ const char *TMP1075_HANDLER_TCS_1_STRING = "TMP1075_HANDLER_TCS_1"; const char *TMP1075_HANDLER_PLPCDU_0_STRING = "TMP1075_HANDLER_PLPCDU_0"; const char *TMP1075_HANDLER_PLPCDU_1_STRING = "TMP1075_HANDLER_PLPCDU_1"; const char *TMP1075_HANDLER_IF_BOARD_STRING = "TMP1075_HANDLER_IF_BOARD"; -const char *TMP1075_HANDLER_OBC_IF_BOARD_STRING = "TMP1075_HANDLER_OBC_IF_BOARD"; const char *RTD_0_IC3_PLOC_HEATSPREADER_STRING = "RTD_0_IC3_PLOC_HEATSPREADER"; const char *RTD_1_IC4_PLOC_MISSIONBOARD_STRING = "RTD_1_IC4_PLOC_MISSIONBOARD"; const char *RTD_2_IC5_4K_CAMERA_STRING = "RTD_2_IC5_4K_CAMERA"; @@ -157,6 +156,7 @@ const char *PL_SUBSYSTEM_STRING = "PL_SUBSYSTEM"; const char *TCS_SUBSYSTEM_STRING = "TCS_SUBSYSTEM"; const char *COM_SUBSYSTEM_STRING = "COM_SUBSYSTEM"; const char *CCSDS_IP_CORE_BRIDGE_STRING = "CCSDS_IP_CORE_BRIDGE"; +const char *THERMAL_TEMP_INSERTER_STRING = "THERMAL_TEMP_INSERTER"; const char *NO_OBJECT_STRING = "NO_OBJECT"; const char *translateObject(object_id_t object) { @@ -275,8 +275,6 @@ const char *translateObject(object_id_t object) { return TMP1075_HANDLER_PLPCDU_1_STRING; case 0x44420008: return TMP1075_HANDLER_IF_BOARD_STRING; - case 0x44420009: - return TMP1075_HANDLER_OBC_IF_BOARD_STRING; case 0x44420016: return RTD_0_IC3_PLOC_HEATSPREADER_STRING; case 0x44420017: @@ -463,6 +461,8 @@ const char *translateObject(object_id_t object) { return COM_SUBSYSTEM_STRING; case 0x73500000: return CCSDS_IP_CORE_BRIDGE_STRING; + case 0x90000003: + return THERMAL_TEMP_INSERTER_STRING; case 0xFFFFFFFF: return NO_OBJECT_STRING; default: diff --git a/linux/devices/GpsHyperionLinuxController.cpp b/linux/devices/GpsHyperionLinuxController.cpp index cb0523d9..d3f1f868 100644 --- a/linux/devices/GpsHyperionLinuxController.cpp +++ b/linux/devices/GpsHyperionLinuxController.cpp @@ -168,17 +168,21 @@ bool GpsHyperionLinuxController::readGpsDataFromGpsd() { return false; } oneShotSwitches.gpsReadFailedSwitch = true; + // did not event get mode, nothing to see. if (MODE_SET != (MODE_SET & gps.set)) { - if (mode != MODE_OFF and maxTimeToReachFix.hasTimedOut() and - oneShotSwitches.cantGetFixSwitch) { - sif::warning - << "GPSHyperionHandler::readGpsDataFromGpsd: No mode could be set in allowed " - << maxTimeToReachFix.timeout / 1000 << " seconds" << std::endl; - triggerEvent(GpsHyperion::CANT_GET_FIX, maxTimeToReachFix.timeout); - oneShotSwitches.cantGetFixSwitch = false; - // did not event get mode, nothing to see. - return false; + if (mode != MODE_OFF) { + if (maxTimeToReachFix.hasTimedOut() and oneShotSwitches.cantGetFixSwitch) { + sif::warning + << "GPSHyperionHandler::readGpsDataFromGpsd: No mode could be set in allowed " + << maxTimeToReachFix.timeout / 1000 << " seconds" << std::endl; + triggerEvent(GpsHyperion::CANT_GET_FIX, maxTimeToReachFix.timeout); + oneShotSwitches.cantGetFixSwitch = false; + } + // Mode is on, so do next read immediately + return true; } + // GPS device is off anyway, so do other handling + return false; } noModeSetCntr = 0; } else { diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index a13005e1..b7556f0a 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 248 translations. + * @brief Auto-generated event translation file. Contains 256 translations. * @details - * Generated on: 2023-02-08 14:09:40 + * Generated on: 2023-02-09 14:24:39 */ #include "translateEvents.h" @@ -150,7 +150,8 @@ const char *CARRIER_LOCK_STRING = "CARRIER_LOCK"; const char *BIT_LOCK_PDEC_STRING = "BIT_LOCK_PDEC"; const char *LOST_CARRIER_LOCK_PDEC_STRING = "LOST_CARRIER_LOCK_PDEC"; const char *LOST_BIT_LOCK_PDEC_STRING = "LOST_BIT_LOCK_PDEC"; -const char *POLL_ERROR_PDEC_STRING = "POLL_ERROR_PDEC"; +const char *POLL_SYSCALL_ERROR_PDEC_STRING = "POLL_SYSCALL_ERROR_PDEC"; +const char *WRITE_SYSCALL_ERROR_PDEC_STRING = "WRITE_SYSCALL_ERROR_PDEC"; const char *IMAGE_UPLOAD_FAILED_STRING = "IMAGE_UPLOAD_FAILED"; const char *IMAGE_DOWNLOAD_FAILED_STRING = "IMAGE_DOWNLOAD_FAILED"; const char *IMAGE_UPLOAD_SUCCESSFUL_STRING = "IMAGE_UPLOAD_SUCCESSFUL"; @@ -248,6 +249,13 @@ const char *REBOOT_HW_STRING = "REBOOT_HW"; const char *NO_SD_CARD_ACTIVE_STRING = "NO_SD_CARD_ACTIVE"; const char *VERSION_INFO_STRING = "VERSION_INFO"; const char *CURRENT_IMAGE_INFO_STRING = "CURRENT_IMAGE_INFO"; +const char *NO_VALID_SENSOR_TEMPERATURE_STRING = "NO_VALID_SENSOR_TEMPERATURE"; +const char *NO_HEALTHY_HEATER_AVAILABLE_STRING = "NO_HEALTHY_HEATER_AVAILABLE"; +const char *SYRLINKS_OVERHEATING_STRING = "SYRLINKS_OVERHEATING"; +const char *PLOC_OVERHEATING_STRING = "PLOC_OVERHEATING"; +const char *OBC_OVERHEATING_STRING = "OBC_OVERHEATING"; +const char *HPA_OVERHEATING_STRING = "HPA_OVERHEATING"; +const char *PLPCDU_OVERHEATING_STRING = "PLPCDU_OVERHEATING"; const char *translateEvents(Event event) { switch ((event & 0xFFFF)) { @@ -542,7 +550,9 @@ const char *translateEvents(Event event) { case (12406): return LOST_BIT_LOCK_PDEC_STRING; case (12407): - return POLL_ERROR_PDEC_STRING; + return POLL_SYSCALL_ERROR_PDEC_STRING; + case (12408): + return WRITE_SYSCALL_ERROR_PDEC_STRING; case (12500): return IMAGE_UPLOAD_FAILED_STRING; case (12501): @@ -737,6 +747,20 @@ const char *translateEvents(Event event) { return VERSION_INFO_STRING; case (14006): return CURRENT_IMAGE_INFO_STRING; + case (14100): + return NO_VALID_SENSOR_TEMPERATURE_STRING; + case (14101): + return NO_HEALTHY_HEATER_AVAILABLE_STRING; + case (14102): + return SYRLINKS_OVERHEATING_STRING; + case (14103): + return PLOC_OVERHEATING_STRING; + case (14104): + return OBC_OVERHEATING_STRING; + case (14105): + return HPA_OVERHEATING_STRING; + case (14106): + return PLPCDU_OVERHEATING_STRING; default: return "UNKNOWN_EVENT"; } diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 0e1c12dc..2be64bee 100644 --- a/linux/fsfwconfig/objects/translateObjects.cpp +++ b/linux/fsfwconfig/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 152 translations. - * Generated on: 2023-02-08 14:09:40 + * Generated on: 2023-02-09 14:24:39 */ #include "translateObjects.h" @@ -63,7 +63,6 @@ const char *TMP1075_HANDLER_TCS_1_STRING = "TMP1075_HANDLER_TCS_1"; const char *TMP1075_HANDLER_PLPCDU_0_STRING = "TMP1075_HANDLER_PLPCDU_0"; const char *TMP1075_HANDLER_PLPCDU_1_STRING = "TMP1075_HANDLER_PLPCDU_1"; const char *TMP1075_HANDLER_IF_BOARD_STRING = "TMP1075_HANDLER_IF_BOARD"; -const char *TMP1075_HANDLER_OBC_IF_BOARD_STRING = "TMP1075_HANDLER_OBC_IF_BOARD"; const char *RTD_0_IC3_PLOC_HEATSPREADER_STRING = "RTD_0_IC3_PLOC_HEATSPREADER"; const char *RTD_1_IC4_PLOC_MISSIONBOARD_STRING = "RTD_1_IC4_PLOC_MISSIONBOARD"; const char *RTD_2_IC5_4K_CAMERA_STRING = "RTD_2_IC5_4K_CAMERA"; @@ -157,6 +156,7 @@ const char *PL_SUBSYSTEM_STRING = "PL_SUBSYSTEM"; const char *TCS_SUBSYSTEM_STRING = "TCS_SUBSYSTEM"; const char *COM_SUBSYSTEM_STRING = "COM_SUBSYSTEM"; const char *CCSDS_IP_CORE_BRIDGE_STRING = "CCSDS_IP_CORE_BRIDGE"; +const char *THERMAL_TEMP_INSERTER_STRING = "THERMAL_TEMP_INSERTER"; const char *NO_OBJECT_STRING = "NO_OBJECT"; const char *translateObject(object_id_t object) { @@ -275,8 +275,6 @@ const char *translateObject(object_id_t object) { return TMP1075_HANDLER_PLPCDU_1_STRING; case 0x44420008: return TMP1075_HANDLER_IF_BOARD_STRING; - case 0x44420009: - return TMP1075_HANDLER_OBC_IF_BOARD_STRING; case 0x44420016: return RTD_0_IC3_PLOC_HEATSPREADER_STRING; case 0x44420017: @@ -463,6 +461,8 @@ const char *translateObject(object_id_t object) { return COM_SUBSYSTEM_STRING; case 0x73500000: return CCSDS_IP_CORE_BRIDGE_STRING; + case 0x90000003: + return THERMAL_TEMP_INSERTER_STRING; case 0xFFFFFFFF: return NO_OBJECT_STRING; default: diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index a0b710fc..8915071e 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -1423,7 +1423,7 @@ void ThermalController::ctrlComponentTemperature(heater::Switchers switchNr, } void ThermalController::resetSensorsArray() { - //TODO: müssen auch andere Variablen resettet werden? senstemp? + // TODO: müssen auch andere Variablen resettet werden? senstemp? for (auto& validValuePair : sensors) { validValuePair.first = false; validValuePair.second = INVALID_TEMPERATURE; diff --git a/tmtc b/tmtc index aadd6f59..669e9559 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit aadd6f59b55ac3e67ea783107da823bd4e8e84dc +Subproject commit 669e9559b9e6e83beca755586d01f6ad1a80e036 diff --git a/unittest/controller/testThermalController.cpp b/unittest/controller/testThermalController.cpp index 302a18c4..0772018e 100644 --- a/unittest/controller/testThermalController.cpp +++ b/unittest/controller/testThermalController.cpp @@ -7,8 +7,8 @@ #include -#include "dummies/TemperatureSensorInserter.h" #include "../testEnvironment.h" +#include "dummies/TemperatureSensorInserter.h" #include "mission/core/GenericFactory.h" #include "test/gpio/DummyGpioIF.h" From 1cda86ee94fbdbd284f0d69884fb2f02b1d9451c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 9 Feb 2023 14:49:50 +0100 Subject: [PATCH 232/330] rework generator modules and remove fsfwgen deps as submodule --- .gitmodules | 3 - generators/deps/fsfwgen | 1 - generators/events/event_parser.py | 104 ++++++++++-------- .../returnvalues/returnvalues_parser.py | 74 +++++++------ 4 files changed, 101 insertions(+), 81 deletions(-) delete mode 160000 generators/deps/fsfwgen diff --git a/.gitmodules b/.gitmodules index 50e2e6e1..76fb8527 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,9 +10,6 @@ [submodule "thirdparty/lwgps"] path = thirdparty/lwgps url = https://github.com/rmspacefish/lwgps.git -[submodule "generators/fsfwgen"] - path = generators/deps/fsfwgen - url = https://egit.irs.uni-stuttgart.de/fsfw/fsfw-gen.git [submodule "thirdparty/arcsec_star_tracker"] path = thirdparty/arcsec_star_tracker url = https://egit.irs.uni-stuttgart.de/eive/arcsec_star_tracker.git diff --git a/generators/deps/fsfwgen b/generators/deps/fsfwgen deleted file mode 160000 index b1e5a2d4..00000000 --- a/generators/deps/fsfwgen +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b1e5a2d40a5f41b9020f2beb0b976035f91c6343 diff --git a/generators/events/event_parser.py b/generators/events/event_parser.py index 8dd4952b..284b13a4 100644 --- a/generators/events/event_parser.py +++ b/generators/events/event_parser.py @@ -41,63 +41,79 @@ CPP_H_FILENAME = Path( f"{os.path.dirname(os.path.realpath(__file__))}/translateEvents.h" ) -BSP_SELECT = BspType.BSP_Q7S - -BSP_DIR_NAME = BSP_SELECT.value - -# Store this file in the root of the generators folder -CSV_FILENAME = Path(f"{ROOT_DIR}/{BSP_SELECT.value}_events.csv") -CSV_COPY_DEST = Path(f"{OBSW_ROOT_DIR}/tmtc/eive_tmtc/config/events.csv") - -if BSP_SELECT == BspType.BSP_Q7S or BSP_SELECT == BspType.BSP_LINUX_BOARD: - FSFW_CONFIG_ROOT = Path(f"{OBSW_ROOT_DIR}/linux/fsfwconfig") - -else: - FSFW_CONFIG_ROOT = Path(f"{OBSW_ROOT_DIR}/{BSP_DIR_NAME}/fsfwconfig") - -CPP_COPY_DESTINATION = Path(f"{FSFW_CONFIG_ROOT}/events/") - FILE_SEPARATOR = ";" -SUBSYSTEM_DEFINITION_DESTINATIONS = [ - f"{FSFW_CONFIG_ROOT}/events/subsystemIdRanges.h", - f"{OBSW_ROOT_DIR}/fsfw/src/fsfw/events/fwSubsystemIdRanges.h", - f"{OBSW_ROOT_DIR}/common/config/eive/eventSubsystemIds.h", -] -SUBSYSTEM_DEFS_DEST_AS_PATH = [Path(x) for x in SUBSYSTEM_DEFINITION_DESTINATIONS] -HEADER_DEFINITION_DESTINATIONS = [ - f"{OBSW_ROOT_DIR}/mission/", - f"{OBSW_ROOT_DIR}/fsfw/", - f"{FSFW_CONFIG_ROOT}", - f"{OBSW_ROOT_DIR}/test/", - f"{OBSW_ROOT_DIR}/bsp_q7s/", - f"{OBSW_ROOT_DIR}/linux/", -] -HEADER_DEFINITION_DESTINATIONS_AS_PATH = [ - Path(x) for x in HEADER_DEFINITION_DESTINATIONS -] + +class BspConfig: + def __init__(self, bsp_select: BspType): + self.bsp_select = bsp_select + self.bsp_dir_name = self.bsp_select.value + + # Store this file in the root of the generators folder + self.csv_filename = Path(f"{ROOT_DIR}/{self.bsp_dir_name}_events.csv") + self.csv_copy_dest = Path(f"{OBSW_ROOT_DIR}/tmtc/eive_tmtc/config/events.csv") + + if ( + self.bsp_select == BspType.BSP_Q7S + or self.bsp_select == BspType.BSP_LINUX_BOARD + ): + self.fsfw_config_root = Path(f"{OBSW_ROOT_DIR}/linux/fsfwconfig") + + else: + self.fsfw_config_root = Path( + f"{OBSW_ROOT_DIR}/{self.bsp_dir_name}/fsfwconfig" + ) + + self.cpp_copy_dest = Path(f"{self.fsfw_config_root}/events/") + + self.subystem_defs_destinations = [ + f"{self.fsfw_config_root}/events/subsystemIdRanges.h", + f"{OBSW_ROOT_DIR}/fsfw/src/fsfw/events/fwSubsystemIdRanges.h", + f"{OBSW_ROOT_DIR}/common/config/eive/eventSubsystemIds.h", + ] + + self.header_defs_destinations = [ + f"{OBSW_ROOT_DIR}/mission/", + f"{OBSW_ROOT_DIR}/fsfw/", + f"{self.fsfw_config_root}", + f"{OBSW_ROOT_DIR}/test/", + f"{OBSW_ROOT_DIR}/bsp_q7s/", + f"{OBSW_ROOT_DIR}/linux/", + ] + + def subsystem_defs_as_paths(self): + return [Path(x) for x in self.subystem_defs_destinations] + + def header_defs_as_paths(self): + return [Path(x) for x in self.header_defs_destinations] + LOGGER = get_console_logger() def parse_events( - generate_csv: bool = True, generate_cpp: bool = True + bsp_type: BspType, generate_csv: bool = True, generate_cpp: bool = True ): + bsp_cfg = BspConfig(bsp_type) LOGGER.info("EventParser: Parsing events: ") # Small delay for clean printout time.sleep(0.01) - event_list = generate_event_list() + event_list = generate_event_list(bsp_cfg) if PRINT_EVENTS: PrettyPrinter.pprint(event_list) # Delay for clean printout time.sleep(0.1) if generate_csv: handle_csv_export( - file_name=CSV_FILENAME, event_list=event_list, file_separator=FILE_SEPARATOR + file_name=bsp_cfg.csv_filename, + event_list=event_list, + file_separator=FILE_SEPARATOR, ) - LOGGER.info(f"Copying CSV file to {CSV_COPY_DEST}") + LOGGER.info(f"Copying CSV file to {bsp_cfg.cpp_copy_dest}") copy_file( - filename=CSV_FILENAME, destination=CSV_COPY_DEST, delete_existing_file=True + filename=bsp_cfg.csv_filename, + destination=bsp_cfg.csv_copy_dest, + delete_existing_file=True, ) if generate_cpp: @@ -110,18 +126,18 @@ def parse_events( ) if COPY_CPP_FILE: LOGGER.info( - f"EventParser: Copying CPP translation file to {CPP_COPY_DESTINATION}" + f"EventParser: Copying CPP translation file to {bsp_cfg.cpp_copy_dest}" ) - copy_file(CPP_FILENAME, CPP_COPY_DESTINATION) - copy_file(CPP_H_FILENAME, CPP_COPY_DESTINATION) + copy_file(CPP_FILENAME, bsp_cfg.cpp_copy_dest) + copy_file(CPP_H_FILENAME, bsp_cfg.cpp_copy_dest) -def generate_event_list() -> EventDictT: - subsystem_parser = SubsystemDefinitionParser(SUBSYSTEM_DEFS_DEST_AS_PATH) +def generate_event_list(cfg: BspConfig) -> EventDictT: + subsystem_parser = SubsystemDefinitionParser(cfg.subsystem_defs_as_paths()) subsystem_table = subsystem_parser.parse_files() LOGGER.info(f"Found {len(subsystem_table)} subsystem definitions.") PrettyPrinter.pprint(subsystem_table) - event_header_parser = FileListParser(HEADER_DEFINITION_DESTINATIONS_AS_PATH) + event_header_parser = FileListParser(cfg.header_defs_as_paths()) event_headers = event_header_parser.parse_header_files( True, "Parsing event header file list:\n", True ) diff --git a/generators/returnvalues/returnvalues_parser.py b/generators/returnvalues/returnvalues_parser.py index 6ad893d1..f4da066c 100644 --- a/generators/returnvalues/returnvalues_parser.py +++ b/generators/returnvalues/returnvalues_parser.py @@ -14,7 +14,6 @@ from fsfwgen.returnvalues.returnvalues_parser import ( RetvalDictT, ) from fsfwgen.utility.sql_writer import SqlWriter -from fsfwgen.utility.printer import PrettyPrinter from definitions import BspType, DATABASE_NAME, ROOT_DIR, OBSW_ROOT_DIR @@ -28,33 +27,41 @@ PRINT_TABLES = False FILE_SEPARATOR = ";" MAX_STRING_LENGTH = 32 -BSP_SELECT = BspType.BSP_Q7S -BSP_DIR_NAME = BSP_SELECT.value -CSV_RETVAL_FILENAME = Path(f"{ROOT_DIR}/{BSP_SELECT.value}_returnvalues.csv") + +class BspConfig: + def __init__(self, bps_select: BspType): + self.bsp_dir_name = bps_select.value + self.csv_retval_filename = Path( + f"{ROOT_DIR}/{self.bsp_dir_name}_returnvalues.csv" + ) + self.add_linux_folder = False + if bps_select == BspType.BSP_Q7S or bps_select == BspType.BSP_LINUX_BOARD: + self.fsfw_config_root = f"{OBSW_ROOT_DIR}/linux/fsfwconfig" + self.add_linux_folder = True + else: + self.fsfw_config_root = f"{OBSW_ROOT_DIR}/{self.bsp_dir_name}/fsfwconfig" + self.bsp_path = f"{OBSW_ROOT_DIR}/{self.bsp_dir_name}" + self.retval_sources = [ + f"{OBSW_ROOT_DIR}/mission/", + f"{OBSW_ROOT_DIR}/fsfw/", + f"{self.bsp_path}", + ] + if self.add_linux_folder: + self.retval_sources.append(f"{OBSW_ROOT_DIR}/linux") + + def if_definition_files(self): + return [ + f"{OBSW_ROOT_DIR}/fsfw/src/fsfw/returnvalues/FwClassIds.h", + f"{OBSW_ROOT_DIR}/common/config/eive/resultClassIds.h", + f"{self.fsfw_config_root}/returnvalues/classIds.h", + ] + + def retval_sources_as_path(self): + return [Path(x) for x in self.retval_sources] + + CSV_COPY_DEST = Path(f"{OBSW_ROOT_DIR}/tmtc/eive_tmtc/config/returnvalues.csv") -ADD_LINUX_FOLDER = False -if BSP_SELECT == BspType.BSP_Q7S or BSP_SELECT == BspType.BSP_LINUX_BOARD: - FSFW_CONFIG_ROOT = f"{OBSW_ROOT_DIR}/linux/fsfwconfig" - ADD_LINUX_FOLDER = True -else: - FSFW_CONFIG_ROOT = f"{OBSW_ROOT_DIR}/{BSP_DIR_NAME}/fsfwconfig" -BSP_PATH = f"{OBSW_ROOT_DIR}/{BSP_DIR_NAME}" - -INTERFACE_DEFINITION_FILES = [ - f"{OBSW_ROOT_DIR}/fsfw/src/fsfw/returnvalues/FwClassIds.h", - f"{OBSW_ROOT_DIR}/common/config/eive/resultClassIds.h", - f"{FSFW_CONFIG_ROOT}/returnvalues/classIds.h", -] -RETURNVALUE_SOURCES = [ - f"{OBSW_ROOT_DIR}/mission/", - f"{OBSW_ROOT_DIR}/fsfw/", - f"{BSP_PATH}", -] -RETVAL_SRCS_AS_PATH = [Path(x) for x in RETURNVALUE_SOURCES] - -if ADD_LINUX_FOLDER: - RETURNVALUE_SOURCES.append(f"{OBSW_ROOT_DIR}/linux") SQL_DELETE_RETURNVALUES_CMD = """ DROP TABLE IF EXISTS Returnvalues @@ -77,15 +84,16 @@ VALUES(?,?,?,?,?) """ -def parse_returnvalues(): - returnvalue_table = generate_returnvalue_table() +def parse_returnvalues(bsp_select: BspType): + cfg = BspConfig(bsp_select) + returnvalue_table = generate_returnvalue_table(cfg) if EXPORT_TO_FILE: ReturnValueParser.export_to_csv( - CSV_RETVAL_FILENAME, returnvalue_table, FILE_SEPARATOR + cfg.csv_retval_filename, returnvalue_table, FILE_SEPARATOR ) if COPY_CSV_FILE: copy_file( - filename=CSV_RETVAL_FILENAME, + filename=cfg.csv_retval_filename, destination=CSV_COPY_DEST, delete_existing_file=True, ) @@ -96,13 +104,13 @@ def parse_returnvalues(): ) -def generate_returnvalue_table(): +def generate_returnvalue_table(cfg: BspConfig): """Core function to parse for the return values""" interface_parser = InterfaceParser( - file_list=INTERFACE_DEFINITION_FILES, print_table=PRINT_TABLES + file_list=cfg.if_definition_files(), print_table=PRINT_TABLES ) interfaces = interface_parser.parse_files() - header_parser = FileListParser(RETVAL_SRCS_AS_PATH) + header_parser = FileListParser(cfg.retval_sources_as_path()) header_list = header_parser.parse_header_files(True, "Parsing header file list: ") returnvalue_parser = ReturnValueParser(interfaces, header_list, PRINT_TABLES) returnvalue_parser.obsw_root_path = OBSW_ROOT_DIR From f8b9373627cfe63c7873ec260aaf2c81dff4cdbd Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 9 Feb 2023 14:57:01 +0100 Subject: [PATCH 233/330] replace submodule by installer --- generators/deps/.gitignore | 3 +++ generators/deps/install_fsfwgen.sh | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 generators/deps/.gitignore create mode 100644 generators/deps/install_fsfwgen.sh diff --git a/generators/deps/.gitignore b/generators/deps/.gitignore new file mode 100644 index 00000000..a031d048 --- /dev/null +++ b/generators/deps/.gitignore @@ -0,0 +1,3 @@ +/* +!/*.sh +!/.gitignore diff --git a/generators/deps/install_fsfwgen.sh b/generators/deps/install_fsfwgen.sh new file mode 100644 index 00000000..599c069f --- /dev/null +++ b/generators/deps/install_fsfwgen.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +git clone https://egit.irs.uni-stuttgart.de/fsfw/fsfwgen.git From 9ded406f4920b4dc75240d2befa9b8a2e5395435 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 9 Feb 2023 14:57:18 +0100 Subject: [PATCH 234/330] make script executable --- generators/deps/install_fsfwgen.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 generators/deps/install_fsfwgen.sh diff --git a/generators/deps/install_fsfwgen.sh b/generators/deps/install_fsfwgen.sh old mode 100644 new mode 100755 From 8a886954092e176acfa646f55281d917a3f83456 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 9 Feb 2023 15:05:05 +0100 Subject: [PATCH 235/330] update requirements file for fsfwgen --- generators/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/requirements.txt b/generators/requirements.txt index 0aa54598..b3097158 100644 --- a/generators/requirements.txt +++ b/generators/requirements.txt @@ -1 +1 @@ -colorlog>=5.0.0 +git+https://egit.irs.uni-stuttgart.de/fsfw/fsfwgen@66e31885a7c87fbb4340cd2a51a13e1196f377af#egg=fsfwgen From 59689f2af6d5e3788179c2d0dfcbc9ede14072c8 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 9 Feb 2023 15:14:21 +0100 Subject: [PATCH 236/330] continuing rework of generators --- generators/events/event_parser.py | 17 ++--- generators/gen.py | 30 ++++----- generators/objects/objects.py | 66 +++++++++++-------- .../returnvalues/returnvalues_parser.py | 8 +-- 4 files changed, 65 insertions(+), 56 deletions(-) diff --git a/generators/events/event_parser.py b/generators/events/event_parser.py index 284b13a4..f6037400 100644 --- a/generators/events/event_parser.py +++ b/generators/events/event_parser.py @@ -2,6 +2,7 @@ Event exporter. """ import datetime +import logging import time import os from pathlib import Path @@ -16,10 +17,9 @@ from fsfwgen.events.event_parser import ( from fsfwgen.parserbase.file_list_parser import FileListParser from fsfwgen.utility.printer import PrettyPrinter from fsfwgen.utility.file_management import copy_file -from fsfwgen.logging import get_console_logger from definitions import BspType, ROOT_DIR, OBSW_ROOT_DIR -LOGGER = get_console_logger() +_LOGGER = logging.getLogger(__name__) DATE_TODAY = datetime.datetime.now() DATE_STRING_FULL = DATE_TODAY.strftime("%Y-%m-%d %H:%M:%S") @@ -88,14 +88,11 @@ class BspConfig: return [Path(x) for x in self.header_defs_destinations] -LOGGER = get_console_logger() - - def parse_events( bsp_type: BspType, generate_csv: bool = True, generate_cpp: bool = True ): bsp_cfg = BspConfig(bsp_type) - LOGGER.info("EventParser: Parsing events: ") + _LOGGER.info("EventParser: Parsing events: ") # Small delay for clean printout time.sleep(0.01) event_list = generate_event_list(bsp_cfg) @@ -109,7 +106,7 @@ def parse_events( event_list=event_list, file_separator=FILE_SEPARATOR, ) - LOGGER.info(f"Copying CSV file to {bsp_cfg.cpp_copy_dest}") + _LOGGER.info(f"Copying CSV file to {bsp_cfg.cpp_copy_dest}") copy_file( filename=bsp_cfg.csv_filename, destination=bsp_cfg.csv_copy_dest, @@ -125,7 +122,7 @@ def parse_events( header_file_name=CPP_H_FILENAME, ) if COPY_CPP_FILE: - LOGGER.info( + _LOGGER.info( f"EventParser: Copying CPP translation file to {bsp_cfg.cpp_copy_dest}" ) copy_file(CPP_FILENAME, bsp_cfg.cpp_copy_dest) @@ -135,7 +132,7 @@ def parse_events( def generate_event_list(cfg: BspConfig) -> EventDictT: subsystem_parser = SubsystemDefinitionParser(cfg.subsystem_defs_as_paths()) subsystem_table = subsystem_parser.parse_files() - LOGGER.info(f"Found {len(subsystem_table)} subsystem definitions.") + _LOGGER.info(f"Found {len(subsystem_table)} subsystem definitions.") PrettyPrinter.pprint(subsystem_table) event_header_parser = FileListParser(cfg.header_defs_as_paths()) event_headers = event_header_parser.parse_header_files( @@ -148,5 +145,5 @@ def generate_event_list(cfg: BspConfig) -> EventDictT: event_parser.set_moving_window_mode(moving_window_size=7) event_table = event_parser.parse_files() events_sorted = dict(sorted(event_table.items())) - LOGGER.info(f"Found {len(events_sorted)} entries") + _LOGGER.info(f"Found {len(events_sorted)} entries") return events_sorted diff --git a/generators/gen.py b/generators/gen.py index 5ae9f071..ae68b39a 100755 --- a/generators/gen.py +++ b/generators/gen.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 -import time +import logging +from definitions import BspType from objects.objects import parse_objects from events.event_parser import parse_events from returnvalues.returnvalues_parser import parse_returnvalues @@ -8,32 +9,29 @@ from fsfwgen.core import ( return_generic_args_parser, init_printout, ) -from fsfwgen.logging import get_console_logger -LOGGER = get_console_logger() +_LOGGER = logging.getLogger(__name__) def main(): init_printout(project_string="EIVE") parser = return_generic_args_parser() args = parser.parse_args() + bsp_select = BspType.BSP_Q7S if args.type == "objects": - LOGGER.info(f"Generating objects data") - time.sleep(0.05) - parse_objects() + _LOGGER.info(f"Generating objects data") + parse_objects(bsp_select) elif args.type == "events": - LOGGER.info(f"Generating event data") - time.sleep(0.05) - parse_events() + _LOGGER.info(f"Generating event data") + parse_events(bsp_select) elif args.type == "returnvalues": - LOGGER.info("Generating returnvalue data") - time.sleep(0.05) - parse_returnvalues() + _LOGGER.info("Generating returnvalue data") + parse_returnvalues(bsp_select) elif args.type == "all": - LOGGER.info("Generating all data") - parse_objects() - parse_events() - parse_returnvalues() + _LOGGER.info("Generating all data") + parse_objects(bsp_select) + parse_events(bsp_select) + parse_returnvalues(bsp_select) if __name__ == "__main__": diff --git a/generators/objects/objects.py b/generators/objects/objects.py index af8fec4b..d1f160e0 100644 --- a/generators/objects/objects.py +++ b/generators/objects/objects.py @@ -2,10 +2,10 @@ Object exporter. """ import datetime +import logging import os from pathlib import Path -from fsfwgen.logging import get_console_logger from fsfwgen.objects.objects import ( sql_object_exporter, ObjectDefinitionParser, @@ -18,7 +18,7 @@ from fsfwgen.utility.file_management import copy_file from definitions import BspType, DATABASE_NAME, OBSW_ROOT_DIR, ROOT_DIR -LOGGER = get_console_logger() +_LOGGER = logging.getLogger(__name__) DATE_TODAY = datetime.datetime.now() DATE_STRING_FULL = DATE_TODAY.strftime("%Y-%m-%d %H:%M:%S") @@ -30,29 +30,40 @@ COPY_CPP = True GENERATE_HEADER = True -BSP_SELECT = BspType.BSP_Q7S -BSP_DIR_NAME = BSP_SELECT.value -if BSP_SELECT == BspType.BSP_Q7S or BSP_SELECT == BspType.BSP_LINUX_BOARD: - FSFW_CONFIG_ROOT = f"{OBSW_ROOT_DIR}/linux/fsfwconfig" -else: - FSFW_CONFIG_ROOT = f"{OBSW_ROOT_DIR}/{BSP_DIR_NAME}/fsfwconfig" + +class BspConfig: + def __init__(self, bsp_select: BspType): + self.bsp_select = bsp_select + self.bsp_dir_name = bsp_select.value + if ( + self.bsp_select == BspType.BSP_Q7S + or self.bsp_select == BspType.BSP_LINUX_BOARD + ): + self.fsfw_config_root = f"{OBSW_ROOT_DIR}/linux/fsfwconfig" + else: + self.fsfw_config_root = f"{OBSW_ROOT_DIR}/{self.bsp_dir_name}/fsfwconfig" + self.cpp_copy_dest = Path(f"{self.fsfw_config_root}/objects/") + self.csv_obj_filename = f"{ROOT_DIR}/{self.bsp_dir_name}_objects.csv" + self.objects_path = Path(f"{self.fsfw_config_root}/objects/systemObjectList.h") + self.objects_defs = [ + self.objects_path, + FRAMEWORK_OBJECT_PATH, + COMMON_OBJECTS_PATH, + ] + EXPORT_TO_SQL = True -CPP_COPY_DESTINATION = f"{FSFW_CONFIG_ROOT}/objects/" CPP_FILENAME = f"{os.path.dirname(os.path.realpath(__file__))}//translateObjects.cpp" CPP_H_FILENAME = f"{os.path.dirname(os.path.realpath(__file__))}//translateObjects.h" -CSV_OBJECT_FILENAME = f"{ROOT_DIR}/{BSP_SELECT.value}_objects.csv" CSV_COPY_DEST = f"{OBSW_ROOT_DIR}/tmtc/eive_tmtc/config/objects.csv" FILE_SEPARATOR = ";" -OBJECTS_PATH = Path(f"{FSFW_CONFIG_ROOT}/objects/systemObjectList.h") FRAMEWORK_OBJECT_PATH = Path( f"{OBSW_ROOT_DIR}/fsfw/src/fsfw/objectmanager/frameworkObjects.h" ) COMMON_OBJECTS_PATH = Path(f"{OBSW_ROOT_DIR}/common/config/eive/objects.h") -OBJECTS_DEFINITIONS = [OBJECTS_PATH, FRAMEWORK_OBJECT_PATH, COMMON_OBJECTS_PATH] SQL_DELETE_OBJECTS_CMD = """ DROP TABLE IF EXISTS Objects @@ -72,20 +83,21 @@ VALUES(?,?) """ -def parse_objects(print_object_list: bool = True): +def parse_objects(bsp_select: BspType, print_object_list: bool = True): + cfg = BspConfig(bsp_select) # fetch objects - object_parser = ObjectDefinitionParser(OBJECTS_DEFINITIONS) + object_parser = ObjectDefinitionParser(cfg.objects_defs) subsystem_definitions = object_parser.parse_files() # id_subsystem_definitions.update(framework_subsystem_definitions) list_items = sorted(subsystem_definitions.items()) - LOGGER.info(f"ObjectParser: Number of objects: {len(list_items)}") + _LOGGER.info(f"ObjectParser: Number of objects: {len(list_items)}") if print_object_list: PrettyPrinter.pprint(list_items) - handle_file_export(list_items) + handle_file_export(cfg, list_items) if EXPORT_TO_SQL: - LOGGER.info("ObjectParser: Exporting to SQL") + _LOGGER.info("ObjectParser: Exporting to SQL") sql_object_exporter( object_table=list_items, delete_cmd=SQL_DELETE_OBJECTS_CMD, @@ -95,29 +107,31 @@ def parse_objects(print_object_list: bool = True): ) -def handle_file_export(list_items): +def handle_file_export(cfg: BspConfig, list_items): if GENERATE_CPP: - LOGGER.info("ObjectParser: Generating C++ translation file") + _LOGGER.info("ObjectParser: Generating C++ translation file") write_translation_file( filename=CPP_FILENAME, list_of_entries=list_items, date_string_full=DATE_STRING_FULL, ) if COPY_CPP: - LOGGER.info("ObjectParser: Copying object file to " + CPP_COPY_DESTINATION) - copy_file(CPP_FILENAME, CPP_COPY_DESTINATION) + _LOGGER.info( + "ObjectParser: Copying object file to " + str(cfg.cpp_copy_dest) + ) + copy_file(Path(CPP_FILENAME), cfg.cpp_copy_dest) if GENERATE_HEADER: write_translation_header_file(filename=CPP_H_FILENAME) - copy_file(filename=CPP_H_FILENAME, destination=CPP_COPY_DESTINATION) + copy_file(filename=Path(CPP_H_FILENAME), destination=cfg.cpp_copy_dest) if GENERATE_CSV: - LOGGER.info("ObjectParser: Generating text export") + _LOGGER.info("ObjectParser: Generating text export") export_object_file( - filename=CSV_OBJECT_FILENAME, + filename=cfg.csv_obj_filename, object_list=list_items, file_separator=FILE_SEPARATOR, ) copy_file( - filename=CSV_OBJECT_FILENAME, - destination=CSV_COPY_DEST, + filename=Path(cfg.csv_obj_filename), + destination=Path(CSV_COPY_DEST), delete_existing_file=True, ) diff --git a/generators/returnvalues/returnvalues_parser.py b/generators/returnvalues/returnvalues_parser.py index f4da066c..a6d951cb 100644 --- a/generators/returnvalues/returnvalues_parser.py +++ b/generators/returnvalues/returnvalues_parser.py @@ -3,9 +3,9 @@ """Part of the MIB export tools for the EIVE project by. Returnvalue exporter. """ +import logging from pathlib import Path -from fsfwgen.logging import get_console_logger from fsfwgen.utility.file_management import copy_file from fsfwgen.parserbase.file_list_parser import FileListParser from fsfwgen.returnvalues.returnvalues_parser import ( @@ -17,7 +17,7 @@ from fsfwgen.utility.sql_writer import SqlWriter from definitions import BspType, DATABASE_NAME, ROOT_DIR, OBSW_ROOT_DIR -LOGGER = get_console_logger() +_LOGGER = logging.getLogger(__name__) EXPORT_TO_FILE = True COPY_CSV_FILE = True EXPORT_TO_SQL = True @@ -98,7 +98,7 @@ def parse_returnvalues(bsp_select: BspType): delete_existing_file=True, ) if EXPORT_TO_SQL: - LOGGER.info("ReturnvalueParser: Exporting to SQL") + _LOGGER.info("ReturnvalueParser: Exporting to SQL") sql_retval_exporter( returnvalue_table, db_filename=f"{ROOT_DIR}/{DATABASE_NAME}" ) @@ -116,7 +116,7 @@ def generate_returnvalue_table(cfg: BspConfig): returnvalue_parser.obsw_root_path = OBSW_ROOT_DIR returnvalue_parser.set_moving_window_mode(moving_window_size=7) returnvalue_table = returnvalue_parser.parse_files(True) - LOGGER.info(f"ReturnvalueParser: Found {len(returnvalue_table)} returnvalues") + _LOGGER.info(f"ReturnvalueParser: Found {len(returnvalue_table)} returnvalues") return returnvalue_table From 15f8b9d0fb53762125d449a540baec03cf956325 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 9 Feb 2023 15:51:36 +0100 Subject: [PATCH 237/330] update generates files again --- .../fsfwconfig/events/translateEvents.cpp | 86 ++++-- .../fsfwconfig/objects/translateObjects.cpp | 105 ++++--- generators/bsp_hosted_events.csv | 257 ++++++++++++++++++ generators/bsp_hosted_objects.csv | 147 ++++++++++ generators/bsp_q7s_returnvalues.csv | 108 ++++++++ generators/events/event_parser.py | 25 +- generators/events/translateEvents.cpp | 2 +- generators/gen.py | 54 +++- generators/objects/objects.py | 23 +- generators/objects/translateObjects.cpp | 2 +- generators/requirements.txt | 1 + linux/fsfwconfig/events/translateEvents.cpp | 2 +- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- tmtc | 2 +- 14 files changed, 709 insertions(+), 107 deletions(-) create mode 100644 generators/bsp_hosted_events.csv create mode 100644 generators/bsp_hosted_objects.csv diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index ac00745c..89e393fa 100644 --- a/bsp_hosted/fsfwconfig/events/translateEvents.cpp +++ b/bsp_hosted/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 239 translations. + * @brief Auto-generated event translation file. Contains 256 translations. * @details - * Generated on: 2022-11-16 15:25:08 + * Generated on: 2023-02-09 15:49:39 */ #include "translateEvents.h" @@ -82,6 +82,7 @@ const char *BIT_LOCK_STRING = "BIT_LOCK"; const char *BIT_LOCK_LOST_STRING = "BIT_LOCK_LOST"; const char *FRAME_PROCESSING_FAILED_STRING = "FRAME_PROCESSING_FAILED"; const char *CLOCK_SET_STRING = "CLOCK_SET"; +const char *CLOCK_DUMP_STRING = "CLOCK_DUMP"; const char *CLOCK_SET_FAILURE_STRING = "CLOCK_SET_FAILURE"; const char *TC_DELETION_FAILED_STRING = "TC_DELETION_FAILED"; const char *TEST_STRING = "TEST"; @@ -89,6 +90,8 @@ const char *CHANGE_OF_SETUP_PARAMETER_STRING = "CHANGE_OF_SETUP_PARAMETER"; const char *STORE_ERROR_STRING = "STORE_ERROR"; const char *MSG_QUEUE_ERROR_STRING = "MSG_QUEUE_ERROR"; const char *SERIALIZATION_ERROR_STRING = "SERIALIZATION_ERROR"; +const char *SAFE_RATE_VIOLATION_STRING = "SAFE_RATE_VIOLATION"; +const char *SAFE_RATE_RECOVERY_STRING = "SAFE_RATE_RECOVERY"; const char *SWITCH_CMD_SENT_STRING = "SWITCH_CMD_SENT"; const char *SWITCH_HAS_CHANGED_STRING = "SWITCH_HAS_CHANGED"; const char *SWITCHING_Q7S_DENIED_STRING = "SWITCHING_Q7S_DENIED"; @@ -135,7 +138,7 @@ const char *SUPV_ACK_FAILURE_STRING = "SUPV_ACK_FAILURE"; const char *SUPV_EXE_FAILURE_STRING = "SUPV_EXE_FAILURE"; const char *SUPV_CRC_FAILURE_EVENT_STRING = "SUPV_CRC_FAILURE_EVENT"; const char *SUPV_HELPER_EXECUTING_STRING = "SUPV_HELPER_EXECUTING"; -const char *SUPV_MPSOC_SHUWDOWN_BUILD_FAILED_STRING = "SUPV_MPSOC_SHUWDOWN_BUILD_FAILED"; +const char *SUPV_MPSOC_SHUTDOWN_BUILD_FAILED_STRING = "SUPV_MPSOC_SHUTDOWN_BUILD_FAILED"; const char *SANITIZATION_FAILED_STRING = "SANITIZATION_FAILED"; const char *MOUNTED_SD_CARD_STRING = "MOUNTED_SD_CARD"; const char *SEND_MRAM_DUMP_FAILED_STRING = "SEND_MRAM_DUMP_FAILED"; @@ -147,7 +150,8 @@ const char *CARRIER_LOCK_STRING = "CARRIER_LOCK"; const char *BIT_LOCK_PDEC_STRING = "BIT_LOCK_PDEC"; const char *LOST_CARRIER_LOCK_PDEC_STRING = "LOST_CARRIER_LOCK_PDEC"; const char *LOST_BIT_LOCK_PDEC_STRING = "LOST_BIT_LOCK_PDEC"; -const char *POLL_ERROR_PDEC_STRING = "POLL_ERROR_PDEC"; +const char *POLL_SYSCALL_ERROR_PDEC_STRING = "POLL_SYSCALL_ERROR_PDEC"; +const char *WRITE_SYSCALL_ERROR_PDEC_STRING = "WRITE_SYSCALL_ERROR_PDEC"; const char *IMAGE_UPLOAD_FAILED_STRING = "IMAGE_UPLOAD_FAILED"; const char *IMAGE_DOWNLOAD_FAILED_STRING = "IMAGE_DOWNLOAD_FAILED"; const char *IMAGE_UPLOAD_SUCCESSFUL_STRING = "IMAGE_UPLOAD_SUCCESSFUL"; @@ -197,6 +201,7 @@ const char *POWER_STATE_MACHINE_TIMEOUT_STRING = "POWER_STATE_MACHINE_TIMEOUT"; const char *SIDE_SWITCH_TRANSITION_NOT_ALLOWED_STRING = "SIDE_SWITCH_TRANSITION_NOT_ALLOWED"; const char *CHILDREN_LOST_MODE_STRING = "CHILDREN_LOST_MODE"; const char *GPS_FIX_CHANGE_STRING = "GPS_FIX_CHANGE"; +const char *CANT_GET_FIX_STRING = "CANT_GET_FIX"; const char *P60_BOOT_COUNT_STRING = "P60_BOOT_COUNT"; const char *BATT_MODE_STRING = "BATT_MODE"; const char *BATT_MODE_CHANGED_STRING = "BATT_MODE_CHANGED"; @@ -227,11 +232,8 @@ const char *SUPV_REPLY_CRC_MISSMATCH_STRING = "SUPV_REPLY_CRC_MISSMATCH"; const char *SUPV_UPDATE_PROGRESS_STRING = "SUPV_UPDATE_PROGRESS"; const char *HDLC_FRAME_REMOVAL_ERROR_STRING = "HDLC_FRAME_REMOVAL_ERROR"; const char *HDLC_CRC_ERROR_STRING = "HDLC_CRC_ERROR"; -const char *ALLOC_FAILURE_STRING = "ALLOC_FAILURE"; -const char *REBOOT_SW_STRING = "REBOOT_SW"; -const char *REBOOT_MECHANISM_TRIGGERED_STRING = "REBOOT_MECHANISM_TRIGGERED"; -const char *REBOOT_HW_STRING = "REBOOT_HW"; -const char *NO_SD_CARD_ACTIVE_STRING = "NO_SD_CARD_ACTIVE"; +const char *TX_ON_STRING = "TX_ON"; +const char *TX_OFF_STRING = "TX_OFF"; const char *MISSING_PACKET_STRING = "MISSING_PACKET"; const char *EXPERIMENT_TIMEDOUT_STRING = "EXPERIMENT_TIMEDOUT"; const char *MULTI_PACKET_COMMAND_DONE_STRING = "MULTI_PACKET_COMMAND_DONE"; @@ -240,6 +242,20 @@ const char *GET_CONFIGFILEVALUE_FAILED_STRING = "GET_CONFIGFILEVALUE_FAILED"; const char *INSERT_CONFIGFILEVALUE_FAILED_STRING = "INSERT_CONFIGFILEVALUE_FAILED"; const char *WRITE_CONFIGFILE_FAILED_STRING = "WRITE_CONFIGFILE_FAILED"; const char *READ_CONFIGFILE_FAILED_STRING = "READ_CONFIGFILE_FAILED"; +const char *ALLOC_FAILURE_STRING = "ALLOC_FAILURE"; +const char *REBOOT_SW_STRING = "REBOOT_SW"; +const char *REBOOT_MECHANISM_TRIGGERED_STRING = "REBOOT_MECHANISM_TRIGGERED"; +const char *REBOOT_HW_STRING = "REBOOT_HW"; +const char *NO_SD_CARD_ACTIVE_STRING = "NO_SD_CARD_ACTIVE"; +const char *VERSION_INFO_STRING = "VERSION_INFO"; +const char *CURRENT_IMAGE_INFO_STRING = "CURRENT_IMAGE_INFO"; +const char *NO_VALID_SENSOR_TEMPERATURE_STRING = "NO_VALID_SENSOR_TEMPERATURE"; +const char *NO_HEALTHY_HEATER_AVAILABLE_STRING = "NO_HEALTHY_HEATER_AVAILABLE"; +const char *SYRLINKS_OVERHEATING_STRING = "SYRLINKS_OVERHEATING"; +const char *PLOC_OVERHEATING_STRING = "PLOC_OVERHEATING"; +const char *OBC_OVERHEATING_STRING = "OBC_OVERHEATING"; +const char *HPA_OVERHEATING_STRING = "HPA_OVERHEATING"; +const char *PLPCDU_OVERHEATING_STRING = "PLPCDU_OVERHEATING"; const char *translateEvents(Event event) { switch ((event & 0xFFFF)) { @@ -398,6 +414,8 @@ const char *translateEvents(Event event) { case (8900): return CLOCK_SET_STRING; case (8901): + return CLOCK_DUMP_STRING; + case (8902): return CLOCK_SET_FAILURE_STRING; case (9100): return TC_DELETION_FAILED_STRING; @@ -411,6 +429,10 @@ const char *translateEvents(Event event) { return MSG_QUEUE_ERROR_STRING; case (10802): return SERIALIZATION_ERROR_STRING; + case (11200): + return SAFE_RATE_VIOLATION_STRING; + case (11201): + return SAFE_RATE_RECOVERY_STRING; case (11300): return SWITCH_CMD_SENT_STRING; case (11301): @@ -504,7 +526,7 @@ const char *translateEvents(Event event) { case (12007): return SUPV_HELPER_EXECUTING_STRING; case (12008): - return SUPV_MPSOC_SHUWDOWN_BUILD_FAILED_STRING; + return SUPV_MPSOC_SHUTDOWN_BUILD_FAILED_STRING; case (12100): return SANITIZATION_FAILED_STRING; case (12101): @@ -528,7 +550,9 @@ const char *translateEvents(Event event) { case (12406): return LOST_BIT_LOCK_PDEC_STRING; case (12407): - return POLL_ERROR_PDEC_STRING; + return POLL_SYSCALL_ERROR_PDEC_STRING; + case (12408): + return WRITE_SYSCALL_ERROR_PDEC_STRING; case (12500): return IMAGE_UPLOAD_FAILED_STRING; case (12501): @@ -627,6 +651,8 @@ const char *translateEvents(Event event) { return CHILDREN_LOST_MODE_STRING; case (13100): return GPS_FIX_CHANGE_STRING; + case (13101): + return CANT_GET_FIX_STRING; case (13200): return P60_BOOT_COUNT_STRING; case (13201): @@ -687,16 +713,10 @@ const char *translateEvents(Event event) { return HDLC_FRAME_REMOVAL_ERROR_STRING; case (13632): return HDLC_CRC_ERROR_STRING; - case (13700): - return ALLOC_FAILURE_STRING; case (13701): - return REBOOT_SW_STRING; + return TX_ON_STRING; case (13702): - return REBOOT_MECHANISM_TRIGGERED_STRING; - case (13703): - return REBOOT_HW_STRING; - case (13704): - return NO_SD_CARD_ACTIVE_STRING; + return TX_OFF_STRING; case (13800): return MISSING_PACKET_STRING; case (13801): @@ -713,6 +733,34 @@ const char *translateEvents(Event event) { return WRITE_CONFIGFILE_FAILED_STRING; case (13905): return READ_CONFIGFILE_FAILED_STRING; + case (14000): + return ALLOC_FAILURE_STRING; + case (14001): + return REBOOT_SW_STRING; + case (14002): + return REBOOT_MECHANISM_TRIGGERED_STRING; + case (14003): + return REBOOT_HW_STRING; + case (14004): + return NO_SD_CARD_ACTIVE_STRING; + case (14005): + return VERSION_INFO_STRING; + case (14006): + return CURRENT_IMAGE_INFO_STRING; + case (14100): + return NO_VALID_SENSOR_TEMPERATURE_STRING; + case (14101): + return NO_HEALTHY_HEATER_AVAILABLE_STRING; + case (14102): + return SYRLINKS_OVERHEATING_STRING; + case (14103): + return PLOC_OVERHEATING_STRING; + case (14104): + return OBC_OVERHEATING_STRING; + case (14105): + return HPA_OVERHEATING_STRING; + case (14106): + return PLPCDU_OVERHEATING_STRING; default: return "UNKNOWN_EVENT"; } diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index 4856c347..0c43d969 100644 --- a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp +++ b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp @@ -1,16 +1,17 @@ /** * @brief Auto-generated object translation file. * @details - * Contains 148 translations. - * Generated on: 2022-11-15 17:44:20 + * Contains 147 translations. + * Generated on: 2023-02-09 15:45:44 */ #include "translateObjects.h" -const char *P60DOCK_TEST_TASK_STRING = "P60DOCK_TEST_TASK"; +const char *TEST_TASK_STRING = "TEST_TASK"; const char *ACS_CONTROLLER_STRING = "ACS_CONTROLLER"; const char *CORE_CONTROLLER_STRING = "CORE_CONTROLLER"; const char *GLOBAL_JSON_CFG_STRING = "GLOBAL_JSON_CFG"; const char *THERMAL_CONTROLLER_STRING = "THERMAL_CONTROLLER"; +const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER"; const char *MGM_0_LIS3_HANDLER_STRING = "MGM_0_LIS3_HANDLER"; const char *GYRO_0_ADIS_HANDLER_STRING = "GYRO_0_ADIS_HANDLER"; const char *SUS_0_N_LOC_XFYFZM_PT_XF_STRING = "SUS_0_N_LOC_XFYFZM_PT_XF"; @@ -63,7 +64,6 @@ const char *TMP1075_HANDLER_TCS_1_STRING = "TMP1075_HANDLER_TCS_1"; const char *TMP1075_HANDLER_PLPCDU_0_STRING = "TMP1075_HANDLER_PLPCDU_0"; const char *TMP1075_HANDLER_PLPCDU_1_STRING = "TMP1075_HANDLER_PLPCDU_1"; const char *TMP1075_HANDLER_IF_BOARD_STRING = "TMP1075_HANDLER_IF_BOARD"; -const char *TMP1075_HANDLER_OBC_IF_BOARD_STRING = "TMP1075_HANDLER_OBC_IF_BOARD"; const char *RTD_0_IC3_PLOC_HEATSPREADER_STRING = "RTD_0_IC3_PLOC_HEATSPREADER"; const char *RTD_1_IC4_PLOC_MISSIONBOARD_STRING = "RTD_1_IC4_PLOC_MISSIONBOARD"; const char *RTD_2_IC5_4K_CAMERA_STRING = "RTD_2_IC5_4K_CAMERA"; @@ -80,26 +80,29 @@ const char *RTD_12_IC15_ACU_STRING = "RTD_12_IC15_ACU"; const char *RTD_13_IC16_PLPCDU_HEATSPREADER_STRING = "RTD_13_IC16_PLPCDU_HEATSPREADER"; const char *RTD_14_IC17_TCS_BOARD_STRING = "RTD_14_IC17_TCS_BOARD"; const char *RTD_15_IC18_IMTQ_STRING = "RTD_15_IC18_IMTQ"; -const char *SYRLINKS_HK_HANDLER_STRING = "SYRLINKS_HK_HANDLER"; +const char *SYRLINKS_HANDLER_STRING = "SYRLINKS_HANDLER"; const char *ARDUINO_COM_IF_STRING = "ARDUINO_COM_IF"; -const char *GPIO_IF_STRING = "GPIO_IF"; +const char *DUMMY_COM_IF_STRING = "DUMMY_COM_IF"; const char *SCEX_UART_READER_STRING = "SCEX_UART_READER"; -const char *SPI_MAIN_COM_IF_STRING = "SPI_MAIN_COM_IF"; -const char *SPI_RW_COM_IF_STRING = "SPI_RW_COM_IF"; const char *SPI_RTD_COM_IF_STRING = "SPI_RTD_COM_IF"; const char *UART_COM_IF_STRING = "UART_COM_IF"; -const char *I2C_COM_IF_STRING = "I2C_COM_IF"; -const char *CSP_COM_IF_STRING = "CSP_COM_IF"; const char *CCSDS_PACKET_DISTRIBUTOR_STRING = "CCSDS_PACKET_DISTRIBUTOR"; const char *PUS_PACKET_DISTRIBUTOR_STRING = "PUS_PACKET_DISTRIBUTOR"; -const char *TMTC_BRIDGE_STRING = "TMTC_BRIDGE"; -const char *TMTC_POLLING_TASK_STRING = "TMTC_POLLING_TASK"; +const char *TCP_TMTC_SERVER_STRING = "TCP_TMTC_SERVER"; +const char *UDP_TMTC_SERVER_STRING = "UDP_TMTC_SERVER"; +const char *TCP_TMTC_POLLING_TASK_STRING = "TCP_TMTC_POLLING_TASK"; +const char *UDP_TMTC_POLLING_TASK_STRING = "UDP_TMTC_POLLING_TASK"; const char *FILE_SYSTEM_HANDLER_STRING = "FILE_SYSTEM_HANDLER"; const char *SDC_MANAGER_STRING = "SDC_MANAGER"; const char *PTME_STRING = "PTME"; const char *PDEC_HANDLER_STRING = "PDEC_HANDLER"; const char *CCSDS_HANDLER_STRING = "CCSDS_HANDLER"; +const char *PUS_SERVICE_3_STRING = "PUS_SERVICE_3"; +const char *PUS_SERVICE_5_STRING = "PUS_SERVICE_5"; const char *PUS_SERVICE_6_STRING = "PUS_SERVICE_6"; +const char *PUS_SERVICE_8_STRING = "PUS_SERVICE_8"; +const char *PUS_SERVICE_23_STRING = "PUS_SERVICE_23"; +const char *PUS_SERVICE_201_STRING = "PUS_SERVICE_201"; const char *FSFW_OBJECTS_START_STRING = "FSFW_OBJECTS_START"; const char *PUS_SERVICE_1_VERIFICATION_STRING = "PUS_SERVICE_1_VERIFICATION"; const char *PUS_SERVICE_2_DEVICE_ACCESS_STRING = "PUS_SERVICE_2_DEVICE_ACCESS"; @@ -123,14 +126,6 @@ const char *IPC_STORE_STRING = "IPC_STORE"; const char *TIME_STAMPER_STRING = "TIME_STAMPER"; const char *VERIFICATION_REPORTER_STRING = "VERIFICATION_REPORTER"; const char *FSFW_OBJECTS_END_STRING = "FSFW_OBJECTS_END"; -const char *SPI_TEST_STRING = "SPI_TEST"; -const char *UART_TEST_STRING = "UART_TEST"; -const char *I2C_TEST_STRING = "I2C_TEST"; -const char *DUMMY_COM_IF_STRING = "DUMMY_COM_IF"; -const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER"; -const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE"; -const char *LIBGPIOD_TEST_STRING = "LIBGPIOD_TEST"; -const char *TEST_TASK_STRING = "TEST_TASK"; const char *HEATER_0_PLOC_PROC_BRD_STRING = "HEATER_0_PLOC_PROC_BRD"; const char *HEATER_1_PCDU_BRD_STRING = "HEATER_1_PCDU_BRD"; const char *HEATER_2_ACS_BRD_STRING = "HEATER_2_ACS_BRD"; @@ -152,13 +147,17 @@ const char *CFDP_DISTRIBUTOR_STRING = "CFDP_DISTRIBUTOR"; const char *EIVE_SYSTEM_STRING = "EIVE_SYSTEM"; const char *ACS_SUBSYSTEM_STRING = "ACS_SUBSYSTEM"; const char *PL_SUBSYSTEM_STRING = "PL_SUBSYSTEM"; +const char *TCS_SUBSYSTEM_STRING = "TCS_SUBSYSTEM"; +const char *COM_SUBSYSTEM_STRING = "COM_SUBSYSTEM"; const char *CCSDS_IP_CORE_BRIDGE_STRING = "CCSDS_IP_CORE_BRIDGE"; +const char *THERMAL_TEMP_INSERTER_STRING = "THERMAL_TEMP_INSERTER"; +const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE"; const char *NO_OBJECT_STRING = "NO_OBJECT"; const char *translateObject(object_id_t object) { switch ((object & 0xFFFFFFFF)) { - case 0x00005060: - return P60DOCK_TEST_TASK_STRING; + case 0x42694269: + return TEST_TASK_STRING; case 0x43000002: return ACS_CONTROLLER_STRING; case 0x43000003: @@ -167,6 +166,8 @@ const char *translateObject(object_id_t object) { return GLOBAL_JSON_CFG_STRING; case 0x43400001: return THERMAL_CONTROLLER_STRING; + case 0x44000001: + return DUMMY_HANDLER_STRING; case 0x44120006: return MGM_0_LIS3_HANDLER_STRING; case 0x44120010: @@ -271,8 +272,6 @@ const char *translateObject(object_id_t object) { return TMP1075_HANDLER_PLPCDU_1_STRING; case 0x44420008: return TMP1075_HANDLER_IF_BOARD_STRING; - case 0x44420009: - return TMP1075_HANDLER_OBC_IF_BOARD_STRING; case 0x44420016: return RTD_0_IC3_PLOC_HEATSPREADER_STRING; case 0x44420017: @@ -306,33 +305,29 @@ const char *translateObject(object_id_t object) { case 0x44420031: return RTD_15_IC18_IMTQ_STRING; case 0x445300A3: - return SYRLINKS_HK_HANDLER_STRING; - case 0x49000000: + return SYRLINKS_HANDLER_STRING; + case 0x49000001: return ARDUINO_COM_IF_STRING; - case 0x49010005: - return GPIO_IF_STRING; + case 0x49000002: + return DUMMY_COM_IF_STRING; case 0x49010006: return SCEX_UART_READER_STRING; - case 0x49020004: - return SPI_MAIN_COM_IF_STRING; - case 0x49020005: - return SPI_RW_COM_IF_STRING; case 0x49020006: return SPI_RTD_COM_IF_STRING; case 0x49030003: return UART_COM_IF_STRING; - case 0x49040002: - return I2C_COM_IF_STRING; - case 0x49050001: - return CSP_COM_IF_STRING; case 0x50000100: return CCSDS_PACKET_DISTRIBUTOR_STRING; case 0x50000200: return PUS_PACKET_DISTRIBUTOR_STRING; case 0x50000300: - return TMTC_BRIDGE_STRING; + return TCP_TMTC_SERVER_STRING; + case 0x50000301: + return UDP_TMTC_SERVER_STRING; case 0x50000400: - return TMTC_POLLING_TASK_STRING; + return TCP_TMTC_POLLING_TASK_STRING; + case 0x50000401: + return UDP_TMTC_POLLING_TASK_STRING; case 0x50000500: return FILE_SYSTEM_HANDLER_STRING; case 0x50000550: @@ -343,8 +338,18 @@ const char *translateObject(object_id_t object) { return PDEC_HANDLER_STRING; case 0x50000800: return CCSDS_HANDLER_STRING; + case 0x51000300: + return PUS_SERVICE_3_STRING; + case 0x51000400: + return PUS_SERVICE_5_STRING; case 0x51000500: return PUS_SERVICE_6_STRING; + case 0x51000800: + return PUS_SERVICE_8_STRING; + case 0x51002300: + return PUS_SERVICE_23_STRING; + case 0x51020100: + return PUS_SERVICE_201_STRING; case 0x53000000: return FSFW_OBJECTS_START_STRING; case 0x53000001: @@ -391,22 +396,6 @@ const char *translateObject(object_id_t object) { return VERIFICATION_REPORTER_STRING; case 0x53ffffff: return FSFW_OBJECTS_END_STRING; - case 0x54000010: - return SPI_TEST_STRING; - case 0x54000020: - return UART_TEST_STRING; - case 0x54000030: - return I2C_TEST_STRING; - case 0x54000040: - return DUMMY_COM_IF_STRING; - case 0x5400AFFE: - return DUMMY_HANDLER_STRING; - case 0x5400CAFE: - return DUMMY_INTERFACE_STRING; - case 0x54123456: - return LIBGPIOD_TEST_STRING; - case 0x54694269: - return TEST_TASK_STRING; case 0x60000000: return HEATER_0_PLOC_PROC_BRD_STRING; case 0x60000001: @@ -449,8 +438,16 @@ const char *translateObject(object_id_t object) { return ACS_SUBSYSTEM_STRING; case 0x73010002: return PL_SUBSYSTEM_STRING; + case 0x73010003: + return TCS_SUBSYSTEM_STRING; + case 0x73010004: + return COM_SUBSYSTEM_STRING; case 0x73500000: return CCSDS_IP_CORE_BRIDGE_STRING; + case 0x90000003: + return THERMAL_TEMP_INSERTER_STRING; + case 0xCAFECAFE: + return DUMMY_INTERFACE_STRING; case 0xFFFFFFFF: return NO_OBJECT_STRING; default: diff --git a/generators/bsp_hosted_events.csv b/generators/bsp_hosted_events.csv new file mode 100644 index 00000000..23d51222 --- /dev/null +++ b/generators/bsp_hosted_events.csv @@ -0,0 +1,257 @@ +Event ID (dec); Event ID (hex); Name; Severity; Description; File Path +2200;0x0898;STORE_SEND_WRITE_FAILED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2201;0x0899;STORE_WRITE_FAILED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2202;0x089a;STORE_SEND_READ_FAILED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2203;0x089b;STORE_READ_FAILED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2204;0x089c;UNEXPECTED_MSG;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2205;0x089d;STORING_FAILED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2206;0x089e;TM_DUMP_FAILED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2207;0x089f;STORE_INIT_FAILED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2208;0x08a0;STORE_INIT_EMPTY;INFO;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2209;0x08a1;STORE_CONTENT_CORRUPTED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2210;0x08a2;STORE_INITIALIZE;INFO;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2211;0x08a3;INIT_DONE;INFO;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2212;0x08a4;DUMP_FINISHED;INFO;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2213;0x08a5;DELETION_FINISHED;INFO;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2214;0x08a6;DELETION_FAILED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2215;0x08a7;AUTO_CATALOGS_SENDING_FAILED;INFO;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +2600;0x0a28;GET_DATA_FAILED;LOW;;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +2601;0x0a29;STORE_DATA_FAILED;LOW;;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +2800;0x0af0;DEVICE_BUILDING_COMMAND_FAILED;LOW;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +2801;0x0af1;DEVICE_SENDING_COMMAND_FAILED;LOW;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +2802;0x0af2;DEVICE_REQUESTING_REPLY_FAILED;LOW;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +2803;0x0af3;DEVICE_READING_REPLY_FAILED;LOW;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +2804;0x0af4;DEVICE_INTERPRETING_REPLY_FAILED;LOW;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +2805;0x0af5;DEVICE_MISSED_REPLY;LOW;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +2806;0x0af6;DEVICE_UNKNOWN_REPLY;LOW;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +2807;0x0af7;DEVICE_UNREQUESTED_REPLY;LOW;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +2808;0x0af8;INVALID_DEVICE_COMMAND;LOW;Indicates a SW bug in child class.;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +2809;0x0af9;MONITORING_LIMIT_EXCEEDED;LOW;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +2810;0x0afa;MONITORING_AMBIGUOUS;HIGH;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +2811;0x0afb;DEVICE_WANTS_HARD_REBOOT;HIGH;;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +4201;0x1069;FUSE_CURRENT_HIGH;LOW;;fsfw/src/fsfw/power/Fuse.h +4202;0x106a;FUSE_WENT_OFF;LOW;;fsfw/src/fsfw/power/Fuse.h +4204;0x106c;POWER_ABOVE_HIGH_LIMIT;LOW;;fsfw/src/fsfw/power/Fuse.h +4205;0x106d;POWER_BELOW_LOW_LIMIT;LOW;;fsfw/src/fsfw/power/Fuse.h +4300;0x10cc;SWITCH_WENT_OFF;LOW;;fsfw/src/fsfw/power/PowerSwitchIF.h +5000;0x1388;HEATER_ON;INFO;;fsfw/src/fsfw/thermal/Heater.h +5001;0x1389;HEATER_OFF;INFO;;fsfw/src/fsfw/thermal/Heater.h +5002;0x138a;HEATER_TIMEOUT;LOW;;fsfw/src/fsfw/thermal/Heater.h +5003;0x138b;HEATER_STAYED_ON;LOW;;fsfw/src/fsfw/thermal/Heater.h +5004;0x138c;HEATER_STAYED_OFF;LOW;;fsfw/src/fsfw/thermal/Heater.h +5200;0x1450;TEMP_SENSOR_HIGH;LOW;;fsfw/src/fsfw/thermal/AbstractTemperatureSensor.h +5201;0x1451;TEMP_SENSOR_LOW;LOW;;fsfw/src/fsfw/thermal/AbstractTemperatureSensor.h +5202;0x1452;TEMP_SENSOR_GRADIENT;LOW;;fsfw/src/fsfw/thermal/AbstractTemperatureSensor.h +5901;0x170d;COMPONENT_TEMP_LOW;LOW;;fsfw/src/fsfw/thermal/ThermalComponentIF.h +5902;0x170e;COMPONENT_TEMP_HIGH;LOW;;fsfw/src/fsfw/thermal/ThermalComponentIF.h +5903;0x170f;COMPONENT_TEMP_OOL_LOW;LOW;;fsfw/src/fsfw/thermal/ThermalComponentIF.h +5904;0x1710;COMPONENT_TEMP_OOL_HIGH;LOW;;fsfw/src/fsfw/thermal/ThermalComponentIF.h +5905;0x1711;TEMP_NOT_IN_OP_RANGE;LOW;;fsfw/src/fsfw/thermal/ThermalComponentIF.h +7101;0x1bbd;FDIR_CHANGED_STATE;INFO;;fsfw/src/fsfw/fdir/FailureIsolationBase.h +7102;0x1bbe;FDIR_STARTS_RECOVERY;MEDIUM;;fsfw/src/fsfw/fdir/FailureIsolationBase.h +7103;0x1bbf;FDIR_TURNS_OFF_DEVICE;MEDIUM;;fsfw/src/fsfw/fdir/FailureIsolationBase.h +7201;0x1c21;MONITOR_CHANGED_STATE;LOW;;fsfw/src/fsfw/monitoring/MonitoringIF.h +7202;0x1c22;VALUE_BELOW_LOW_LIMIT;LOW;;fsfw/src/fsfw/monitoring/MonitoringIF.h +7203;0x1c23;VALUE_ABOVE_HIGH_LIMIT;LOW;;fsfw/src/fsfw/monitoring/MonitoringIF.h +7204;0x1c24;VALUE_OUT_OF_RANGE;LOW;;fsfw/src/fsfw/monitoring/MonitoringIF.h +7400;0x1ce8;CHANGING_MODE;INFO;;fsfw/src/fsfw/modes/HasModesIF.h +7401;0x1ce9;MODE_INFO;INFO;;fsfw/src/fsfw/modes/HasModesIF.h +7402;0x1cea;FALLBACK_FAILED;HIGH;;fsfw/src/fsfw/modes/HasModesIF.h +7403;0x1ceb;MODE_TRANSITION_FAILED;LOW;;fsfw/src/fsfw/modes/HasModesIF.h +7404;0x1cec;CANT_KEEP_MODE;HIGH;;fsfw/src/fsfw/modes/HasModesIF.h +7405;0x1ced;OBJECT_IN_INVALID_MODE;LOW;;fsfw/src/fsfw/modes/HasModesIF.h +7406;0x1cee;FORCING_MODE;MEDIUM;;fsfw/src/fsfw/modes/HasModesIF.h +7407;0x1cef;MODE_CMD_REJECTED;LOW;;fsfw/src/fsfw/modes/HasModesIF.h +7506;0x1d52;HEALTH_INFO;INFO;;fsfw/src/fsfw/health/HasHealthIF.h +7507;0x1d53;CHILD_CHANGED_HEALTH;INFO;;fsfw/src/fsfw/health/HasHealthIF.h +7508;0x1d54;CHILD_PROBLEMS;LOW;;fsfw/src/fsfw/health/HasHealthIF.h +7509;0x1d55;OVERWRITING_HEALTH;LOW;;fsfw/src/fsfw/health/HasHealthIF.h +7510;0x1d56;TRYING_RECOVERY;MEDIUM;;fsfw/src/fsfw/health/HasHealthIF.h +7511;0x1d57;RECOVERY_STEP;MEDIUM;;fsfw/src/fsfw/health/HasHealthIF.h +7512;0x1d58;RECOVERY_DONE;MEDIUM;;fsfw/src/fsfw/health/HasHealthIF.h +7600;0x1db0;HANDLE_PACKET_FAILED;LOW;;fsfw/src/fsfw/tcdistribution/definitions.h +7900;0x1edc;RF_AVAILABLE;INFO;A RF available signal was detected. P1: raw RFA state, P2: 0;fsfw/src/fsfw/datalinklayer/DataLinkLayer.h +7901;0x1edd;RF_LOST;INFO;A previously found RF available signal was lost. P1: raw RFA state, P2: 0;fsfw/src/fsfw/datalinklayer/DataLinkLayer.h +7902;0x1ede;BIT_LOCK;INFO;A Bit Lock signal. Was detected. P1: raw BLO state, P2: 0;fsfw/src/fsfw/datalinklayer/DataLinkLayer.h +7903;0x1edf;BIT_LOCK_LOST;INFO;A previously found Bit Lock signal was lost. P1: raw BLO state, P2: 0;fsfw/src/fsfw/datalinklayer/DataLinkLayer.h +7905;0x1ee1;FRAME_PROCESSING_FAILED;LOW;The CCSDS Board could not interpret a TC;fsfw/src/fsfw/datalinklayer/DataLinkLayer.h +8900;0x22c4;CLOCK_SET;INFO;;fsfw/src/fsfw/pus/Service9TimeManagement.h +8901;0x22c5;CLOCK_DUMP;INFO;;fsfw/src/fsfw/pus/Service9TimeManagement.h +8902;0x22c6;CLOCK_SET_FAILURE;LOW;;fsfw/src/fsfw/pus/Service9TimeManagement.h +9100;0x238c;TC_DELETION_FAILED;MEDIUM;Deletion of a TC from the map failed. P1: First 32 bit of request ID, P2. Last 32 bit of Request ID;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h +9700;0x25e4;TEST;INFO;;fsfw/src/fsfw/pus/Service17Test.h +10600;0x2968;CHANGE_OF_SETUP_PARAMETER;LOW;;fsfw/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h +10800;0x2a30;STORE_ERROR;LOW;;fsfw/src/fsfw/cfdp/handler/defs.h +10801;0x2a31;MSG_QUEUE_ERROR;LOW;;fsfw/src/fsfw/cfdp/handler/defs.h +10802;0x2a32;SERIALIZATION_ERROR;LOW;;fsfw/src/fsfw/cfdp/handler/defs.h +11200;0x2bc0;SAFE_RATE_VIOLATION;MEDIUM;;mission/acsDefs.h +11201;0x2bc1;SAFE_RATE_RECOVERY;MEDIUM;;mission/acsDefs.h +11300;0x2c24;SWITCH_CMD_SENT;INFO;Indicates that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h +11301;0x2c25;SWITCH_HAS_CHANGED;INFO;Indicated that a switch state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h +11302;0x2c26;SWITCHING_Q7S_DENIED;MEDIUM;;mission/devices/devicedefinitions/powerDefinitions.h +11303;0x2c27;FDIR_REACTION_IGNORED;MEDIUM;;mission/devices/devicedefinitions/powerDefinitions.h +11400;0x2c88;GPIO_PULL_HIGH_FAILED;LOW;;mission/devices/HeaterHandler.h +11401;0x2c89;GPIO_PULL_LOW_FAILED;LOW;;mission/devices/HeaterHandler.h +11402;0x2c8a;HEATER_WENT_ON;INFO;;mission/devices/HeaterHandler.h +11403;0x2c8b;HEATER_WENT_OFF;INFO;;mission/devices/HeaterHandler.h +11404;0x2c8c;SWITCH_ALREADY_ON;LOW;;mission/devices/HeaterHandler.h +11405;0x2c8d;SWITCH_ALREADY_OFF;LOW;;mission/devices/HeaterHandler.h +11406;0x2c8e;MAIN_SWITCH_TIMEOUT;MEDIUM;;mission/devices/HeaterHandler.h +11407;0x2c8f;FAULTY_HEATER_WAS_ON;LOW;;mission/devices/HeaterHandler.h +11500;0x2cec;BURN_PHASE_START;INFO;P1: Burn duration in milliseconds, P2: Dry run flag;mission/devices/SolarArrayDeploymentHandler.h +11501;0x2ced;BURN_PHASE_DONE;INFO;P1: Burn duration in milliseconds, P2: Dry run flag;mission/devices/SolarArrayDeploymentHandler.h +11502;0x2cee;MAIN_SWITCH_ON_TIMEOUT;LOW;;mission/devices/SolarArrayDeploymentHandler.h +11503;0x2cef;MAIN_SWITCH_OFF_TIMEOUT;LOW;;mission/devices/SolarArrayDeploymentHandler.h +11504;0x2cf0;DEPL_SA1_GPIO_SWTICH_ON_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h +11505;0x2cf1;DEPL_SA2_GPIO_SWTICH_ON_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h +11506;0x2cf2;DEPL_SA1_GPIO_SWTICH_OFF_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h +11507;0x2cf3;DEPL_SA2_GPIO_SWTICH_OFF_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h +11508;0x2cf4;AUTONOMOUS_DEPLOYMENT_COMPLETED;INFO;;mission/devices/SolarArrayDeploymentHandler.h +11601;0x2d51;MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC crc failure in telemetry packet;linux/devices/ploc/PlocMPSoCHandler.h +11602;0x2d52;ACK_FAILURE;LOW;PLOC receive acknowledgment failure report P1: Command Id which leads the acknowledgment failure report P2: The status field inserted by the MPSoC into the data field;linux/devices/ploc/PlocMPSoCHandler.h +11603;0x2d53;EXE_FAILURE;LOW;PLOC receive execution failure report P1: Command Id which leads the execution failure report P2: The status field inserted by the MPSoC into the data field;linux/devices/ploc/PlocMPSoCHandler.h +11604;0x2d54;MPSOC_HANDLER_CRC_FAILURE;LOW;PLOC reply has invalid crc;linux/devices/ploc/PlocMPSoCHandler.h +11605;0x2d55;MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH;LOW;Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count;linux/devices/ploc/PlocMPSoCHandler.h +11606;0x2d56;MPSOC_SHUTDOWN_FAILED;HIGH;Supervisor fails to shutdown MPSoC. Requires to power off the PLOC and thus also to shutdown the supervisor.;linux/devices/ploc/PlocMPSoCHandler.h +11701;0x2db5;SELF_TEST_I2C_FAILURE;LOW;Get self test result returns I2C failure P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/ImtqHandler.h +11702;0x2db6;SELF_TEST_SPI_FAILURE;LOW;Get self test result returns SPI failure. This concerns the MTM connectivity. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/ImtqHandler.h +11703;0x2db7;SELF_TEST_ADC_FAILURE;LOW;Get self test result returns failure in measurement of current and temperature. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/ImtqHandler.h +11704;0x2db8;SELF_TEST_PWM_FAILURE;LOW;Get self test result returns PWM failure which concerns the coil actuation. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/ImtqHandler.h +11705;0x2db9;SELF_TEST_TC_FAILURE;LOW;Get self test result returns TC failure (system failure) P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/ImtqHandler.h +11706;0x2dba;SELF_TEST_MTM_RANGE_FAILURE;LOW;Get self test result returns failure that MTM values were outside of the expected range. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/ImtqHandler.h +11707;0x2dbb;SELF_TEST_COIL_CURRENT_FAILURE;LOW;Get self test result returns failure indicating that the coil current was outside of the expected range P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/ImtqHandler.h +11708;0x2dbc;INVALID_ERROR_BYTE;LOW;Received invalid error byte. This indicates an error of the communication link between IMTQ and OBC.;mission/devices/ImtqHandler.h +11801;0x2e19;ERROR_STATE;HIGH;Reaction wheel signals an error state;mission/devices/devicedefinitions/RwDefinitions.h +11802;0x2e1a;RESET_OCCURED;LOW;;mission/devices/devicedefinitions/RwDefinitions.h +11901;0x2e7d;BOOTING_FIRMWARE_FAILED;LOW;Failed to boot firmware;linux/devices/startracker/StarTrackerHandler.h +11902;0x2e7e;BOOTING_BOOTLOADER_FAILED;LOW;Failed to boot star tracker into bootloader mode;linux/devices/startracker/StarTrackerHandler.h +12001;0x2ee1;SUPV_MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC supervisor crc failure in telemetry packet;linux/devices/ploc/PlocSupervisorHandler.h +12002;0x2ee2;SUPV_UNKNOWN_TM;LOW;Unhandled event. P1: APID, P2: Service ID;linux/devices/ploc/PlocSupervisorHandler.h +12003;0x2ee3;SUPV_UNINIMPLEMENTED_TM;LOW;;linux/devices/ploc/PlocSupervisorHandler.h +12004;0x2ee4;SUPV_ACK_FAILURE;LOW;PLOC supervisor received acknowledgment failure report;linux/devices/ploc/PlocSupervisorHandler.h +12005;0x2ee5;SUPV_EXE_FAILURE;LOW;PLOC received execution failure report P1: ID of command for which the execution failed P2: Status code sent by the supervisor handler;linux/devices/ploc/PlocSupervisorHandler.h +12006;0x2ee6;SUPV_CRC_FAILURE_EVENT;LOW;PLOC supervisor reply has invalid crc;linux/devices/ploc/PlocSupervisorHandler.h +12007;0x2ee7;SUPV_HELPER_EXECUTING;LOW;Supervisor helper currently executing a command;linux/devices/ploc/PlocSupervisorHandler.h +12008;0x2ee8;SUPV_MPSOC_SHUTDOWN_BUILD_FAILED;LOW;Failed to build the command to shutdown the MPSoC;linux/devices/ploc/PlocSupervisorHandler.h +12100;0x2f44;SANITIZATION_FAILED;LOW;;bsp_q7s/fs/SdCardManager.h +12101;0x2f45;MOUNTED_SD_CARD;INFO;;bsp_q7s/fs/SdCardManager.h +12300;0x300c;SEND_MRAM_DUMP_FAILED;LOW;Failed to send mram dump command to supervisor handler P1: Return value of commandAction function P2: Start address of MRAM to dump with this command;linux/devices/ploc/PlocMemoryDumper.h +12301;0x300d;MRAM_DUMP_FAILED;LOW;Received completion failure report form PLOC supervisor handler P1: MRAM start address of failing dump command;linux/devices/ploc/PlocMemoryDumper.h +12302;0x300e;MRAM_DUMP_FINISHED;LOW;MRAM dump finished successfully;linux/devices/ploc/PlocMemoryDumper.h +12401;0x3071;INVALID_TC_FRAME;HIGH;;linux/ipcore/PdecHandler.h +12402;0x3072;INVALID_FAR;HIGH;Read invalid FAR from PDEC after startup;linux/ipcore/PdecHandler.h +12403;0x3073;CARRIER_LOCK;INFO;Carrier lock detected;linux/ipcore/PdecHandler.h +12404;0x3074;BIT_LOCK_PDEC;INFO;Bit lock detected (data valid);linux/ipcore/PdecHandler.h +12405;0x3075;LOST_CARRIER_LOCK_PDEC;INFO;Lost carrier lock;linux/ipcore/PdecHandler.h +12406;0x3076;LOST_BIT_LOCK_PDEC;INFO;Lost bit lock;linux/ipcore/PdecHandler.h +12407;0x3077;POLL_SYSCALL_ERROR_PDEC;MEDIUM;;linux/ipcore/PdecHandler.h +12408;0x3078;WRITE_SYSCALL_ERROR_PDEC;MEDIUM;;linux/ipcore/PdecHandler.h +12500;0x30d4;IMAGE_UPLOAD_FAILED;LOW;Image upload failed;linux/devices/startracker/StrHelper.h +12501;0x30d5;IMAGE_DOWNLOAD_FAILED;LOW;Image download failed;linux/devices/startracker/StrHelper.h +12502;0x30d6;IMAGE_UPLOAD_SUCCESSFUL;LOW;Uploading image to star tracker was successfulop;linux/devices/startracker/StrHelper.h +12503;0x30d7;IMAGE_DOWNLOAD_SUCCESSFUL;LOW;Image download was successful;linux/devices/startracker/StrHelper.h +12504;0x30d8;FLASH_WRITE_SUCCESSFUL;LOW;Finished flash write procedure successfully;linux/devices/startracker/StrHelper.h +12505;0x30d9;FLASH_READ_SUCCESSFUL;LOW;Finished flash read procedure successfully;linux/devices/startracker/StrHelper.h +12506;0x30da;FLASH_READ_FAILED;LOW;Flash read procedure failed;linux/devices/startracker/StrHelper.h +12507;0x30db;FIRMWARE_UPDATE_SUCCESSFUL;LOW;Firmware update was successful;linux/devices/startracker/StrHelper.h +12508;0x30dc;FIRMWARE_UPDATE_FAILED;LOW;Firmware update failed;linux/devices/startracker/StrHelper.h +12509;0x30dd;STR_HELPER_READING_REPLY_FAILED;LOW;Failed to read communication interface reply data P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;linux/devices/startracker/StrHelper.h +12510;0x30de;STR_HELPER_COM_ERROR;LOW;Unexpected stop of decoding sequence P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;linux/devices/startracker/StrHelper.h +12511;0x30df;STR_HELPER_NO_REPLY;LOW;Star tracker did not send replies (maybe device is powered off) P1: Position of upload or download packet for which no reply was sent;linux/devices/startracker/StrHelper.h +12512;0x30e0;STR_HELPER_DEC_ERROR;LOW;Error during decoding of received reply occurred P1: Return value of decoding function P2: Position of upload/download packet, or address of flash write/read request;linux/devices/startracker/StrHelper.h +12513;0x30e1;POSITION_MISMATCH;LOW;Position mismatch P1: The expected position and thus the position for which the image upload/download failed;linux/devices/startracker/StrHelper.h +12514;0x30e2;STR_HELPER_FILE_NOT_EXISTS;LOW;Specified file does not exist P1: Internal state of str helper;linux/devices/startracker/StrHelper.h +12515;0x30e3;STR_HELPER_SENDING_PACKET_FAILED;LOW;;linux/devices/startracker/StrHelper.h +12516;0x30e4;STR_HELPER_REQUESTING_MSG_FAILED;LOW;;linux/devices/startracker/StrHelper.h +12600;0x3138;MPSOC_FLASH_WRITE_FAILED;LOW;Flash write fails;linux/devices/ploc/PlocMPSoCHelper.h +12601;0x3139;MPSOC_FLASH_WRITE_SUCCESSFUL;LOW;Flash write successful;linux/devices/ploc/PlocMPSoCHelper.h +12602;0x313a;MPSOC_SENDING_COMMAND_FAILED;LOW;;linux/devices/ploc/PlocMPSoCHelper.h +12603;0x313b;MPSOC_HELPER_REQUESTING_REPLY_FAILED;LOW;Request receive message of communication interface failed P1: Return value returned by the communication interface requestReceiveMessage function P2: Internal state of MPSoC helper;linux/devices/ploc/PlocMPSoCHelper.h +12604;0x313c;MPSOC_HELPER_READING_REPLY_FAILED;LOW;Reading receive message of communication interface failed P1: Return value returned by the communication interface readingReceivedMessage function P2: Internal state of MPSoC helper;linux/devices/ploc/PlocMPSoCHelper.h +12605;0x313d;MPSOC_MISSING_ACK;LOW;Did not receive acknowledgment report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux/devices/ploc/PlocMPSoCHelper.h +12606;0x313e;MPSOC_MISSING_EXE;LOW;Did not receive execution report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux/devices/ploc/PlocMPSoCHelper.h +12607;0x313f;MPSOC_ACK_FAILURE_REPORT;LOW;Received acknowledgment failure report P1: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h +12608;0x3140;MPSOC_EXE_FAILURE_REPORT;LOW;Received execution failure report P1: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h +12609;0x3141;MPSOC_ACK_INVALID_APID;LOW;Expected acknowledgment report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h +12610;0x3142;MPSOC_EXE_INVALID_APID;LOW;Expected execution report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h +12611;0x3143;MPSOC_HELPER_SEQ_CNT_MISMATCH;LOW;Received sequence count does not match expected sequence count P1: Expected sequence count P2: Received sequence count;linux/devices/ploc/PlocMPSoCHelper.h +12612;0x3144;MPSOC_TM_SIZE_ERROR;LOW;;linux/devices/ploc/PlocMPSoCHelper.h +12613;0x3145;MPSOC_TM_CRC_MISSMATCH;LOW;;linux/devices/ploc/PlocMPSoCHelper.h +12700;0x319c;TRANSITION_BACK_TO_OFF;MEDIUM;Could not transition properly and went back to ALL OFF;mission/devices/PayloadPcduHandler.h +12701;0x319d;NEG_V_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h +12702;0x319e;U_DRO_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h +12703;0x319f;I_DRO_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h +12704;0x31a0;U_X8_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h +12705;0x31a1;I_X8_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h +12706;0x31a2;U_TX_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h +12707;0x31a3;I_TX_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h +12708;0x31a4;U_MPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h +12709;0x31a5;I_MPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h +12710;0x31a6;U_HPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h +12711;0x31a7;I_HPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h +12800;0x3200;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission/system/objects/AcsBoardAssembly.h +12801;0x3201;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission/system/objects/AcsBoardAssembly.h +12802;0x3202;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission/system/objects/AcsBoardAssembly.h +12803;0x3203;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission/system/objects/AcsBoardAssembly.h +12900;0x3264;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission/system/objects/SusAssembly.h +12901;0x3265;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission/system/objects/SusAssembly.h +12902;0x3266;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission/system/objects/SusAssembly.h +12903;0x3267;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission/system/objects/SusAssembly.h +13000;0x32c8;CHILDREN_LOST_MODE;MEDIUM;;mission/system/objects/TcsBoardAssembly.h +13100;0x332c;GPS_FIX_CHANGE;INFO;Fix has changed. P1: Old fix. P2: New fix 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix;mission/devices/devicedefinitions/GPSDefinitions.h +13101;0x332d;CANT_GET_FIX;LOW;Could not get fix in maximum allowed time. P1: Maximum allowed time to get a fix after the GPS was switched on.;mission/devices/devicedefinitions/GPSDefinitions.h +13200;0x3390;P60_BOOT_COUNT;INFO;P60 boot count is broadcasted once at SW startup. P1: Boot count;mission/devices/P60DockHandler.h +13201;0x3391;BATT_MODE;INFO;Battery mode is broadcasted at startup. P1: Mode;mission/devices/P60DockHandler.h +13202;0x3392;BATT_MODE_CHANGED;MEDIUM;Battery mode has changed. P1: Old mode. P2: New mode;mission/devices/P60DockHandler.h +13600;0x3520;SUPV_UPDATE_FAILED;LOW;update failed;linux/devices/ploc/PlocSupvUartMan.h +13601;0x3521;SUPV_UPDATE_SUCCESSFUL;LOW;update successful;linux/devices/ploc/PlocSupvUartMan.h +13602;0x3522;SUPV_CONTINUE_UPDATE_FAILED;LOW;Continue update command failed;linux/devices/ploc/PlocSupvUartMan.h +13603;0x3523;SUPV_CONTINUE_UPDATE_SUCCESSFUL;LOW;Continue update command successful;linux/devices/ploc/PlocSupvUartMan.h +13604;0x3524;TERMINATED_UPDATE_PROCEDURE;LOW;Terminated update procedure by command;linux/devices/ploc/PlocSupvUartMan.h +13605;0x3525;SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL;LOW;Requesting event buffer was successful;linux/devices/ploc/PlocSupvUartMan.h +13606;0x3526;SUPV_EVENT_BUFFER_REQUEST_FAILED;LOW;Requesting event buffer failed;linux/devices/ploc/PlocSupvUartMan.h +13607;0x3527;SUPV_EVENT_BUFFER_REQUEST_TERMINATED;LOW;Terminated event buffer request by command P1: Number of packets read before process was terminated;linux/devices/ploc/PlocSupvUartMan.h +13608;0x3528;SUPV_MEM_CHECK_OK;INFO;;linux/devices/ploc/PlocSupvUartMan.h +13609;0x3529;SUPV_MEM_CHECK_FAIL;INFO;;linux/devices/ploc/PlocSupvUartMan.h +13616;0x3530;SUPV_SENDING_COMMAND_FAILED;LOW;;linux/devices/ploc/PlocSupvUartMan.h +13617;0x3531;SUPV_HELPER_REQUESTING_REPLY_FAILED;LOW;Request receive message of communication interface failed P1: Return value returned by the communication interface requestReceiveMessage function P2: Internal state of supervisor helper;linux/devices/ploc/PlocSupvUartMan.h +13618;0x3532;SUPV_HELPER_READING_REPLY_FAILED;LOW;Reading receive message of communication interface failed P1: Return value returned by the communication interface readingReceivedMessage function P2: Internal state of supervisor helper;linux/devices/ploc/PlocSupvUartMan.h +13619;0x3533;SUPV_MISSING_ACK;LOW;Did not receive acknowledgement report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux/devices/ploc/PlocSupvUartMan.h +13620;0x3534;SUPV_MISSING_EXE;LOW;Supervisor did not receive execution report P1: Number of bytes missing P2: Internal state of supervisor helper;linux/devices/ploc/PlocSupvUartMan.h +13621;0x3535;SUPV_ACK_FAILURE_REPORT;LOW;Supervisor received acknowledgment failure report P1: Internal state of supervisor helper;linux/devices/ploc/PlocSupvUartMan.h +13622;0x3536;SUPV_EXE_FAILURE_REPORT;LOW;Execution report failure P1:;linux/devices/ploc/PlocSupvUartMan.h +13623;0x3537;SUPV_ACK_INVALID_APID;LOW;Supervisor expected acknowledgment report but received space packet with other apid P1: Apid of received space packet P2: Internal state of supervisor helper;linux/devices/ploc/PlocSupvUartMan.h +13624;0x3538;SUPV_EXE_INVALID_APID;LOW;Supervisor helper expected execution report but received space packet with other apid P1: Apid of received space packet P2: Internal state of supervisor helper;linux/devices/ploc/PlocSupvUartMan.h +13625;0x3539;ACK_RECEPTION_FAILURE;LOW;Failed to receive acknowledgment report P1: Return value P2: Apid of command for which the reception of the acknowledgment report failed;linux/devices/ploc/PlocSupvUartMan.h +13626;0x353a;EXE_RECEPTION_FAILURE;LOW;Failed to receive execution report P1: Return value P2: Apid of command for which the reception of the execution report failed;linux/devices/ploc/PlocSupvUartMan.h +13627;0x353b;WRITE_MEMORY_FAILED;LOW;Update procedure failed when sending packet. P1: First byte percent, third and fourth byte Sequence Count, P2: Bytes written;linux/devices/ploc/PlocSupvUartMan.h +13628;0x353c;SUPV_REPLY_SIZE_MISSMATCH;LOW;;linux/devices/ploc/PlocSupvUartMan.h +13629;0x353d;SUPV_REPLY_CRC_MISSMATCH;LOW;;linux/devices/ploc/PlocSupvUartMan.h +13630;0x353e;SUPV_UPDATE_PROGRESS;INFO;Will be triggered every 5 percent of the update progress. P1: First byte percent, third and fourth byte Sequence Count, P2: Bytes written;linux/devices/ploc/PlocSupvUartMan.h +13631;0x353f;HDLC_FRAME_REMOVAL_ERROR;INFO;;linux/devices/ploc/PlocSupvUartMan.h +13632;0x3540;HDLC_CRC_ERROR;INFO;;linux/devices/ploc/PlocSupvUartMan.h +13700;0x3584;FDIR_REACTION_IGNORED;MEDIUM;;mission/devices/devicedefinitions/SyrlinksDefinitions.h +13701;0x3585;TX_ON;INFO;Transmitter is on now. P1: Submode, P2: Current default datarate.;mission/devices/devicedefinitions/SyrlinksDefinitions.h +13702;0x3586;TX_OFF;INFO;Transmitter is off now.;mission/devices/devicedefinitions/SyrlinksDefinitions.h +13800;0x35e8;MISSING_PACKET;LOW;;mission/devices/devicedefinitions/ScexDefinitions.h +13801;0x35e9;EXPERIMENT_TIMEDOUT;LOW;;mission/devices/devicedefinitions/ScexDefinitions.h +13802;0x35ea;MULTI_PACKET_COMMAND_DONE;INFO;;mission/devices/devicedefinitions/ScexDefinitions.h +13901;0x364d;SET_CONFIGFILEVALUE_FAILED;MEDIUM;;mission/utility/GlobalConfigHandler.h +13902;0x364e;GET_CONFIGFILEVALUE_FAILED;MEDIUM;;mission/utility/GlobalConfigHandler.h +13903;0x364f;INSERT_CONFIGFILEVALUE_FAILED;MEDIUM;;mission/utility/GlobalConfigHandler.h +13904;0x3650;WRITE_CONFIGFILE_FAILED;MEDIUM;;mission/utility/GlobalConfigHandler.h +13905;0x3651;READ_CONFIGFILE_FAILED;MEDIUM;;mission/utility/GlobalConfigHandler.h +14000;0x36b0;ALLOC_FAILURE;MEDIUM;;bsp_q7s/core/CoreController.h +14001;0x36b1;REBOOT_SW;MEDIUM; Software reboot occurred. Can also be a systemd reboot. P1: Current Chip, P2: Current Copy;bsp_q7s/core/CoreController.h +14002;0x36b2;REBOOT_MECHANISM_TRIGGERED;MEDIUM;The reboot mechanism was triggered. P1: First 16 bits: Last Chip, Last 16 bits: Last Copy, P2: Each byte is the respective reboot count for the slots;bsp_q7s/core/CoreController.h +14003;0x36b3;REBOOT_HW;MEDIUM;;bsp_q7s/core/CoreController.h +14004;0x36b4;NO_SD_CARD_ACTIVE;HIGH;No SD card was active. Core controller will attempt to re-initialize a SD card.;bsp_q7s/core/CoreController.h +14005;0x36b5;VERSION_INFO;INFO;P1: Byte 0: Major, Byte 1: Minor, Byte 2: Patch, Byte 3: Has Git Hash P2: First four letters of Git SHA is the last byte of P1 is set.;bsp_q7s/core/CoreController.h +14006;0x36b6;CURRENT_IMAGE_INFO;INFO;P1: Current Chip, P2: Current Copy;bsp_q7s/core/CoreController.h +14100;0x3714;NO_VALID_SENSOR_TEMPERATURE;MEDIUM;;mission/controller/ThermalController.h +14101;0x3715;NO_HEALTHY_HEATER_AVAILABLE;MEDIUM;;mission/controller/ThermalController.h +14102;0x3716;SYRLINKS_OVERHEATING;HIGH;;mission/controller/ThermalController.h +14103;0x3717;PLOC_OVERHEATING;HIGH;;mission/controller/ThermalController.h +14104;0x3718;OBC_OVERHEATING;HIGH;;mission/controller/ThermalController.h +14105;0x3719;HPA_OVERHEATING;HIGH;;mission/controller/ThermalController.h +14106;0x371a;PLPCDU_OVERHEATING;HIGH;;mission/controller/ThermalController.h diff --git a/generators/bsp_hosted_objects.csv b/generators/bsp_hosted_objects.csv new file mode 100644 index 00000000..59710edb --- /dev/null +++ b/generators/bsp_hosted_objects.csv @@ -0,0 +1,147 @@ +0x42694269;TEST_TASK +0x43000002;ACS_CONTROLLER +0x43000003;CORE_CONTROLLER +0x43000006;GLOBAL_JSON_CFG +0x43400001;THERMAL_CONTROLLER +0x44000001;DUMMY_HANDLER +0x44120006;MGM_0_LIS3_HANDLER +0x44120010;GYRO_0_ADIS_HANDLER +0x44120032;SUS_0_N_LOC_XFYFZM_PT_XF +0x44120033;SUS_1_N_LOC_XBYFZM_PT_XB +0x44120034;SUS_2_N_LOC_XFYBZB_PT_YB +0x44120035;SUS_3_N_LOC_XFYBZF_PT_YF +0x44120036;SUS_4_N_LOC_XMYFZF_PT_ZF +0x44120037;SUS_5_N_LOC_XFYMZB_PT_ZB +0x44120038;SUS_6_R_LOC_XFYBZM_PT_XF +0x44120039;SUS_7_R_LOC_XBYBZM_PT_XB +0x44120040;SUS_8_R_LOC_XBYBZB_PT_YB +0x44120041;SUS_9_R_LOC_XBYBZB_PT_YF +0x44120042;SUS_10_N_LOC_XMYBZF_PT_ZF +0x44120043;SUS_11_R_LOC_XBYMZB_PT_ZB +0x44120047;RW1 +0x44120107;MGM_1_RM3100_HANDLER +0x44120111;GYRO_1_L3G_HANDLER +0x44120148;RW2 +0x44120208;MGM_2_LIS3_HANDLER +0x44120212;GYRO_2_ADIS_HANDLER +0x44120249;RW3 +0x44120309;MGM_3_RM3100_HANDLER +0x44120313;GYRO_3_L3G_HANDLER +0x44120350;RW4 +0x44130001;STAR_TRACKER +0x44130045;GPS_CONTROLLER +0x44140014;IMTQ_HANDLER +0x442000A1;PCDU_HANDLER +0x44250000;P60DOCK_HANDLER +0x44250001;PDU1_HANDLER +0x44250002;PDU2_HANDLER +0x44250003;ACU_HANDLER +0x44260000;BPX_BATT_HANDLER +0x44300000;PLPCDU_HANDLER +0x443200A5;RAD_SENSOR +0x44330000;PLOC_UPDATER +0x44330001;PLOC_MEMORY_DUMPER +0x44330002;STR_HELPER +0x44330003;PLOC_MPSOC_HELPER +0x44330004;AXI_PTME_CONFIG +0x44330005;PTME_CONFIG +0x44330015;PLOC_MPSOC_HANDLER +0x44330016;PLOC_SUPERVISOR_HANDLER +0x44330017;PLOC_SUPERVISOR_HELPER +0x44330032;SCEX +0x444100A2;SOLAR_ARRAY_DEPL_HANDLER +0x444100A4;HEATER_HANDLER +0x44420004;TMP1075_HANDLER_TCS_0 +0x44420005;TMP1075_HANDLER_TCS_1 +0x44420006;TMP1075_HANDLER_PLPCDU_0 +0x44420007;TMP1075_HANDLER_PLPCDU_1 +0x44420008;TMP1075_HANDLER_IF_BOARD +0x44420016;RTD_0_IC3_PLOC_HEATSPREADER +0x44420017;RTD_1_IC4_PLOC_MISSIONBOARD +0x44420018;RTD_2_IC5_4K_CAMERA +0x44420019;RTD_3_IC6_DAC_HEATSPREADER +0x44420020;RTD_4_IC7_STARTRACKER +0x44420021;RTD_5_IC8_RW1_MX_MY +0x44420022;RTD_6_IC9_DRO +0x44420023;RTD_7_IC10_SCEX +0x44420024;RTD_8_IC11_X8 +0x44420025;RTD_9_IC12_HPA +0x44420026;RTD_10_IC13_PL_TX +0x44420027;RTD_11_IC14_MPA +0x44420028;RTD_12_IC15_ACU +0x44420029;RTD_13_IC16_PLPCDU_HEATSPREADER +0x44420030;RTD_14_IC17_TCS_BOARD +0x44420031;RTD_15_IC18_IMTQ +0x445300A3;SYRLINKS_HANDLER +0x49000001;ARDUINO_COM_IF +0x49000002;DUMMY_COM_IF +0x49010006;SCEX_UART_READER +0x49020006;SPI_RTD_COM_IF +0x49030003;UART_COM_IF +0x50000100;CCSDS_PACKET_DISTRIBUTOR +0x50000200;PUS_PACKET_DISTRIBUTOR +0x50000300;TCP_TMTC_SERVER +0x50000301;UDP_TMTC_SERVER +0x50000400;TCP_TMTC_POLLING_TASK +0x50000401;UDP_TMTC_POLLING_TASK +0x50000500;FILE_SYSTEM_HANDLER +0x50000550;SDC_MANAGER +0x50000600;PTME +0x50000700;PDEC_HANDLER +0x50000800;CCSDS_HANDLER +0x51000300;PUS_SERVICE_3 +0x51000400;PUS_SERVICE_5 +0x51000500;PUS_SERVICE_6 +0x51000800;PUS_SERVICE_8 +0x51002300;PUS_SERVICE_23 +0x51020100;PUS_SERVICE_201 +0x53000000;FSFW_OBJECTS_START +0x53000001;PUS_SERVICE_1_VERIFICATION +0x53000002;PUS_SERVICE_2_DEVICE_ACCESS +0x53000003;PUS_SERVICE_3_HOUSEKEEPING +0x53000005;PUS_SERVICE_5_EVENT_REPORTING +0x53000008;PUS_SERVICE_8_FUNCTION_MGMT +0x53000009;PUS_SERVICE_9_TIME_MGMT +0x53000011;PUS_SERVICE_11_TC_SCHEDULER +0x53000017;PUS_SERVICE_17_TEST +0x53000020;PUS_SERVICE_20_PARAMETERS +0x53000200;PUS_SERVICE_200_MODE_MGMT +0x53000201;PUS_SERVICE_201_HEALTH +0x53001000;CFDP_PACKET_DISTRIBUTOR +0x53010000;HEALTH_TABLE +0x53010100;MODE_STORE +0x53030000;EVENT_MANAGER +0x53040000;INTERNAL_ERROR_REPORTER +0x534f0100;TC_STORE +0x534f0200;TM_STORE +0x534f0300;IPC_STORE +0x53500010;TIME_STAMPER +0x53500020;VERIFICATION_REPORTER +0x53ffffff;FSFW_OBJECTS_END +0x60000000;HEATER_0_PLOC_PROC_BRD +0x60000001;HEATER_1_PCDU_BRD +0x60000002;HEATER_2_ACS_BRD +0x60000003;HEATER_3_OBC_BRD +0x60000004;HEATER_4_CAMERA +0x60000005;HEATER_5_STR +0x60000006;HEATER_6_DRO +0x60000007;HEATER_7_HPA +0x73000001;ACS_BOARD_ASS +0x73000002;SUS_BOARD_ASS +0x73000003;TCS_BOARD_ASS +0x73000004;RW_ASS +0x73000006;CAM_SWITCHER +0x73000100;TM_FUNNEL +0x73000101;PUS_TM_FUNNEL +0x73000102;CFDP_TM_FUNNEL +0x73000205;CFDP_HANDLER +0x73000206;CFDP_DISTRIBUTOR +0x73010000;EIVE_SYSTEM +0x73010001;ACS_SUBSYSTEM +0x73010002;PL_SUBSYSTEM +0x73010003;TCS_SUBSYSTEM +0x73010004;COM_SUBSYSTEM +0x73500000;CCSDS_IP_CORE_BRIDGE +0x90000003;THERMAL_TEMP_INSERTER +0xCAFECAFE;DUMMY_INTERFACE +0xFFFFFFFF;NO_OBJECT diff --git a/generators/bsp_q7s_returnvalues.csv b/generators/bsp_q7s_returnvalues.csv index 0581c352..2b343f4a 100644 --- a/generators/bsp_q7s_returnvalues.csv +++ b/generators/bsp_q7s_returnvalues.csv @@ -484,3 +484,111 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x6f0d;SDMA_UnmountError;;13;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h 0x6f0e;SDMA_SystemCallError;;14;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h 0x6f0f;SDMA_PopenCallError;;15;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h +0x65a0;PLMPHLP_FileClosedAccidentally;File accidentally close;160;PLOC_MPSOC_HELPER;linux/devices/ploc/PlocMPSoCHelper.h +0x5ea0;PLMEMDUMP_MramAddressTooHigh;The capacity of the MRAM amounts to 512 kB. Thus the maximum address must not be higher than 0x7d000.;160;PLOC_MEMORY_DUMPER;linux/devices/ploc/PlocMemoryDumper.h +0x5ea1;PLMEMDUMP_MramInvalidAddressCombination;The specified end address is lower than the start address;161;PLOC_MEMORY_DUMPER;linux/devices/ploc/PlocMemoryDumper.h +0x57a0;PLSPVhLP_FileClosedAccidentally;File accidentally close;160;PLOC_SUPV_HELPER;linux/devices/ploc/PlocSupvUartMan.h +0x57a1;PLSPVhLP_ProcessTerminated;Process has been terminated by command;161;PLOC_SUPV_HELPER;linux/devices/ploc/PlocSupvUartMan.h +0x57a2;PLSPVhLP_PathNotExists;Received command with invalid pathname;162;PLOC_SUPV_HELPER;linux/devices/ploc/PlocSupvUartMan.h +0x57a3;PLSPVhLP_EventBufferReplyInvalidApid;Expected event buffer TM but received space packet with other APID;163;PLOC_SUPV_HELPER;linux/devices/ploc/PlocSupvUartMan.h +0x5700;PLSPVhLP_RequestDone;;0;PLOC_SUPV_HELPER;linux/devices/ploc/PlocSupvUartMan.h +0x5701;PLSPVhLP_NoPacketFound;;1;PLOC_SUPV_HELPER;linux/devices/ploc/PlocSupvUartMan.h +0x5702;PLSPVhLP_DecodeBufTooSmall;;2;PLOC_SUPV_HELPER;linux/devices/ploc/PlocSupvUartMan.h +0x5703;PLSPVhLP_PossiblePacketLossConsecutiveStart;;3;PLOC_SUPV_HELPER;linux/devices/ploc/PlocSupvUartMan.h +0x5704;PLSPVhLP_PossiblePacketLossConsecutiveEnd;;4;PLOC_SUPV_HELPER;linux/devices/ploc/PlocSupvUartMan.h +0x5705;PLSPVhLP_HdlcError;;5;PLOC_SUPV_HELPER;linux/devices/ploc/PlocSupvUartMan.h +0x67a0;MPSOCRTVIF_CrcFailure;Space Packet received from PLOC has invalid CRC;160;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h +0x67a1;MPSOCRTVIF_ReceivedAckFailure;Received ACK failure reply from PLOC;161;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h +0x67a2;MPSOCRTVIF_ReceivedExeFailure;Received execution failure reply from PLOC;162;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h +0x67a3;MPSOCRTVIF_InvalidApid;Received space packet with invalid APID from PLOC;163;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h +0x67a4;MPSOCRTVIF_InvalidLength;Received command with invalid length;164;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h +0x67a5;MPSOCRTVIF_FilenameTooLong;Filename of file in OBC filesystem is too long;165;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h +0x67a6;MPSOCRTVIF_MpsocHelperExecuting;MPSoC helper is currently executing a command;166;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h +0x67a7;MPSOCRTVIF_MpsocFilenameTooLong;Filename of MPSoC file is to long (max. 256 bytes);167;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h +0x67a8;MPSOCRTVIF_InvalidParameter;Command has invalid parameter;168;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h +0x67a9;MPSOCRTVIF_NameTooLong;Received command has file string with invalid length;169;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h +0x68a0;SPVRTVIF_CrcFailure;Space Packet received from PLOC supervisor has invalid CRC;160;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +0x68a1;SPVRTVIF_InvalidServiceId;;161;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +0x68a2;SPVRTVIF_ReceivedAckFailure;Received ACK failure reply from PLOC supervisor;162;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +0x68a3;SPVRTVIF_ReceivedExeFailure;Received execution failure reply from PLOC supervisor;163;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +0x68a4;SPVRTVIF_InvalidApid;Received space packet with invalid APID from PLOC supervisor;164;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +0x68a5;SPVRTVIF_GetTimeFailure;Failed to read current system time;165;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +0x68a6;SPVRTVIF_InvalidWatchdog;Received command with invalid watchdog parameter. Valid watchdogs are 0 for PS, 1 for PL and 2 for INT;166;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +0x68a7;SPVRTVIF_InvalidWatchdogTimeout;Received watchdog timeout config command with invalid timeout. Valid timeouts must be in the range between 1000 and 360000 ms.;167;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +0x68a8;SPVRTVIF_InvalidLatchupId;Received latchup config command with invalid latchup ID;168;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +0x68a9;SPVRTVIF_SweepPeriodTooSmall;Received set adc sweep period command with invalid sweep period. Must be larger than 21.;169;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +0x68aa;SPVRTVIF_InvalidTestParam;Receive auto EM test command with invalid test param. Valid params are 1 and 2.;170;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +0x68ab;SPVRTVIF_MramPacketParsingFailure;Returned when scanning for MRAM dump packets failed.;171;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +0x68ac;SPVRTVIF_InvalidMramAddresses;Returned when the start and stop addresses of the MRAM dump or MRAM wipe commands are invalid (e.g. start address bigger than stop address);172;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +0x68ad;SPVRTVIF_NoMramPacket;Expect reception of an MRAM dump packet but received space packet with other apid.;173;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +0x68ae;SPVRTVIF_PathDoesNotExist;Path to PLOC directory on SD card does not exist;174;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +0x68af;SPVRTVIF_MramFileNotExists;MRAM dump file does not exists. The file should actually already have been created with the reception of the first dump packet.;175;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +0x68b0;SPVRTVIF_InvalidReplyLength;;176;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +0x68b1;SPVRTVIF_InvalidLength;Received action command has invalid length;177;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +0x68b2;SPVRTVIF_FilenameTooLong;Filename too long;178;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +0x68b3;SPVRTVIF_UpdateStatusReportInvalidLength;Received update status report with invalid packet length field;179;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +0x68b4;SPVRTVIF_UpdateCrcFailure;Update status report does not contain expected CRC. There might be a bit flip in the update memory region.;180;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +0x68b5;SPVRTVIF_SupvHelperExecuting;Supervisor helper task ist currently executing a command (wait until helper tas has finished or interrupt by sending the terminate command);181;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +0x68c0;SPVRTVIF_BufTooSmall;;192;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +0x68c1;SPVRTVIF_NoReplyTimeout;;193;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +0x54e0;DWLPWRON_InvalidMode;Received command has invalid JESD mode (valid modes are 0 - 5);224;DWLPWRON_CMD;linux/devices/devicedefinitions/PlocMPSoCDefinitions.h +0x54e1;DWLPWRON_InvalidLaneRate;Received command has invalid lane rate (valid lane rate are 0 - 9);225;DWLPWRON_CMD;linux/devices/devicedefinitions/PlocMPSoCDefinitions.h +0x6201;JSONBASE_JsonFileNotExists;Specified json file does not exist;1;ARCSEC_JSON_BASE;linux/devices/startracker/ArcsecJsonParamBase.h +0x6202;JSONBASE_SetNotExists;Requested set does not exist in json file;2;ARCSEC_JSON_BASE;linux/devices/startracker/ArcsecJsonParamBase.h +0x6203;JSONBASE_ParamNotExists;Requested parameter does not exist in json file;3;ARCSEC_JSON_BASE;linux/devices/startracker/ArcsecJsonParamBase.h +0x53a0;STRH_TemperatureReqFailed;Status in temperature reply signals error;160;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53a1;STRH_PingFailed;Ping command failed;161;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53a2;STRH_VersionReqFailed;Status in version reply signals error;162;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x5ca0;STRHLP_SdNotMounted;SD card specified in path string not mounted;160;STR_HELPER;linux/devices/startracker/StrHelper.h +0x5ca1;STRHLP_FileNotExists;Specified file does not exist on filesystem;161;STR_HELPER;linux/devices/startracker/StrHelper.h +0x5ca2;STRHLP_PathNotExists;Specified path does not exist;162;STR_HELPER;linux/devices/startracker/StrHelper.h +0x5ca3;STRHLP_FileCreationFailed;Failed to create download image or read flash file;163;STR_HELPER;linux/devices/startracker/StrHelper.h +0x5ca4;STRHLP_RegionMismatch;Region in flash write/read reply does not match expected region;164;STR_HELPER;linux/devices/startracker/StrHelper.h +0x5ca5;STRHLP_AddressMismatch;Address in flash write/read reply does not match expected address;165;STR_HELPER;linux/devices/startracker/StrHelper.h +0x5ca6;STRHLP_LengthMismatch;Length in flash write/read reply does not match expected length;166;STR_HELPER;linux/devices/startracker/StrHelper.h +0x5ca7;STRHLP_StatusError;Status field in reply signals error;167;STR_HELPER;linux/devices/startracker/StrHelper.h +0x5ca8;STRHLP_InvalidTypeId;Reply has invalid type ID (should be of action reply type);168;STR_HELPER;linux/devices/startracker/StrHelper.h +0x53a3;STRH_InterfaceReqFailed;Status in interface reply signals error;163;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53a4;STRH_PowerReqFailed;Status in power reply signals error;164;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53a5;STRH_SetParamFailed;Status of reply to parameter set command signals error;165;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53a6;STRH_ActionFailed;Status of reply to action command signals error;166;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53a7;STRH_FilePathTooLong;Received invalid path string. Exceeds allowed length;167;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53a8;STRH_FilenameTooLong;Name of file received with command is too long;168;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53a9;STRH_InvalidProgram;Received version reply with invalid program ID;169;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53aa;STRH_ReplyError;Status field reply signals error;170;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53ab;STRH_CommandTooShort;Received command which is too short (some data is missing for proper execution);171;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53ac;STRH_InvalidLength;Received command with invalid length (too few or too many parameters);172;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53ad;STRH_RegionMismatch;Region mismatch between send and received data;173;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53ae;STRH_AddressMismatch;Address mismatch between send and received data;174;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53af;STRH_LengthMismatch;Length field mismatch between send and received data;175;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53b0;STRH_FileNotExists;Specified file does not exist;176;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53b1;STRH_InvalidType;Download blob pixel command has invalid type field;177;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53b2;STRH_InvalidId;Received FPGA action command with invalid ID;178;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53b3;STRH_ReplyTooShort;Received reply is too short;179;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53b4;STRH_CrcFailure;Received reply with invalid CRC;180;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53b5;STRH_StrHelperExecuting;Star tracker handler currently executing a command and using the communication interface;181;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53b6;STRH_StartrackerAlreadyBooted;Star tracker is already in firmware mode;182;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53b7;STRH_StartrackerRunningFirmware;Star tracker is in firmware mode but must be in bootloader mode to execute this command;183;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53b8;STRH_StartrackerRunningBootloader;Star tracker is in bootloader mode but must be in firmware mode to execute this command;184;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x5302;STRH_InvalidCrc;;2;STR_HANDLER;linux/devices/ScexHelper.h +0x5aa0;PTME_UnknownVcId;;160;PTME;linux/ipcore/Ptme.h +0x5fa0;PDEC_AbandonedCltu;;160;PDEC_HANDLER;linux/ipcore/PdecHandler.h +0x5fa1;PDEC_FrameDirty;;161;PDEC_HANDLER;linux/ipcore/PdecHandler.h +0x5fa2;PDEC_FrameIllegalMultipleReasons;;162;PDEC_HANDLER;linux/ipcore/PdecHandler.h +0x5fa3;PDEC_AdDiscardedLockout;;163;PDEC_HANDLER;linux/ipcore/PdecHandler.h +0x5fa4;PDEC_AdDiscardedWait;;164;PDEC_HANDLER;linux/ipcore/PdecHandler.h +0x5fa5;PDEC_AdDiscardedNsVs;;165;PDEC_HANDLER;linux/ipcore/PdecHandler.h +0x5fb0;PDEC_CommandNotImplemented;Received action message with unknown action id;176;PDEC_HANDLER;linux/ipcore/PdecHandler.h +0x5fa6;PDEC_NoReport;;166;PDEC_HANDLER;linux/ipcore/PdecHandler.h +0x5fa7;PDEC_ErrorVersionNumber;;167;PDEC_HANDLER;linux/ipcore/PdecHandler.h +0x5fa8;PDEC_IllegalCombination;;168;PDEC_HANDLER;linux/ipcore/PdecHandler.h +0x5fa9;PDEC_InvalidScId;;169;PDEC_HANDLER;linux/ipcore/PdecHandler.h +0x5faa;PDEC_InvalidVcIdMsb;;170;PDEC_HANDLER;linux/ipcore/PdecHandler.h +0x5fab;PDEC_InvalidVcIdLsb;;171;PDEC_HANDLER;linux/ipcore/PdecHandler.h +0x5fac;PDEC_NsNotZero;;172;PDEC_HANDLER;linux/ipcore/PdecHandler.h +0x5fae;PDEC_InvalidBcCc;;174;PDEC_HANDLER;linux/ipcore/PdecHandler.h +0x61a0;RS_RateNotSupported;The commanded rate is not supported by the current FPGA design;160;RATE_SETTER;linux/ipcore/PtmeConfig.h +0x61a1;RS_BadBitRate;Bad bitrate has been commanded (e.g. 0);161;RATE_SETTER;linux/ipcore/PtmeConfig.h +0x61a2;RS_ClkInversionFailed;Failed to invert clock and thus change the time the data is updated with respect to the tx clock;162;RATE_SETTER;linux/ipcore/PtmeConfig.h +0x61a3;RS_TxManipulatorConfigFailed;Failed to change configuration bit of tx clock manipulator;163;RATE_SETTER;linux/ipcore/PtmeConfig.h +0x59a0;IPCI_PapbBusy;;160;CCSDS_IP_CORE_BRIDGE;linux/ipcore/PapbVcInterface.h diff --git a/generators/events/event_parser.py b/generators/events/event_parser.py index f6037400..2f75a773 100644 --- a/generators/events/event_parser.py +++ b/generators/events/event_parser.py @@ -23,13 +23,15 @@ _LOGGER = logging.getLogger(__name__) DATE_TODAY = datetime.datetime.now() DATE_STRING_FULL = DATE_TODAY.strftime("%Y-%m-%d %H:%M:%S") +PRINT_EVENTS = False +PRINT_SUBSYSTEM_TABLE = False + GENERATE_CPP = True GENERATE_CPP_H = True GENERATE_CSV = True COPY_CPP_FILE = True COPY_CPP_H_FILE = True MOVE_CSV_FILE = True -PRINT_EVENTS = False PARSE_HOST_BSP = True @@ -89,10 +91,10 @@ class BspConfig: def parse_events( - bsp_type: BspType, generate_csv: bool = True, generate_cpp: bool = True + bsp_type: BspType, generate_csv: bool, generate_cpp: bool, copy_csv_to_eive_tmtc: bool ): bsp_cfg = BspConfig(bsp_type) - _LOGGER.info("EventParser: Parsing events: ") + _LOGGER.info(f"EventParser: Parsing events for {bsp_type.name}") # Small delay for clean printout time.sleep(0.01) event_list = generate_event_list(bsp_cfg) @@ -106,12 +108,13 @@ def parse_events( event_list=event_list, file_separator=FILE_SEPARATOR, ) - _LOGGER.info(f"Copying CSV file to {bsp_cfg.cpp_copy_dest}") - copy_file( - filename=bsp_cfg.csv_filename, - destination=bsp_cfg.csv_copy_dest, - delete_existing_file=True, - ) + if copy_csv_to_eive_tmtc: + _LOGGER.info(f"Copying CSV file to {bsp_cfg.cpp_copy_dest}") + copy_file( + filename=bsp_cfg.csv_filename, + destination=bsp_cfg.csv_copy_dest, + delete_existing_file=True, + ) if generate_cpp: handle_cpp_export( @@ -127,13 +130,15 @@ def parse_events( ) copy_file(CPP_FILENAME, bsp_cfg.cpp_copy_dest) copy_file(CPP_H_FILENAME, bsp_cfg.cpp_copy_dest) + _LOGGER.info(f"Parsing done for {bsp_type.name}") def generate_event_list(cfg: BspConfig) -> EventDictT: subsystem_parser = SubsystemDefinitionParser(cfg.subsystem_defs_as_paths()) subsystem_table = subsystem_parser.parse_files() _LOGGER.info(f"Found {len(subsystem_table)} subsystem definitions.") - PrettyPrinter.pprint(subsystem_table) + if PRINT_SUBSYSTEM_TABLE: + PrettyPrinter.pprint(subsystem_table) event_header_parser = FileListParser(cfg.header_defs_as_paths()) event_headers = event_header_parser.parse_header_files( True, "Parsing event header file list:\n", True diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index b7556f0a..89e393fa 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 256 translations. * @details - * Generated on: 2023-02-09 14:24:39 + * Generated on: 2023-02-09 15:49:39 */ #include "translateEvents.h" diff --git a/generators/gen.py b/generators/gen.py index ae68b39a..c7858fa0 100755 --- a/generators/gen.py +++ b/generators/gen.py @@ -1,5 +1,9 @@ #!/usr/bin/env python3 import logging +import sys + +import colorlog +from colorlog import ColoredFormatter from definitions import BspType from objects.objects import parse_objects @@ -10,27 +14,57 @@ from fsfwgen.core import ( init_printout, ) -_LOGGER = logging.getLogger(__name__) +_LOGGER = logging.getLogger() def main(): + set_up_logger() init_printout(project_string="EIVE") parser = return_generic_args_parser() args = parser.parse_args() - bsp_select = BspType.BSP_Q7S - if args.type == "objects": + # parse_handling_for_bsp(args.type, BspType.BSP_HOSTED) + parse_handling_for_bsp(args.type, BspType.BSP_Q7S) + + +def set_up_logger(): + handler = colorlog.StreamHandler(stream=sys.stdout) + formatter = ColoredFormatter( + "%(log_color)s%(levelname)-8s%(reset)s %(blue)s%(message)s", + datefmt=None, + reset=True, + log_colors={ + 'DEBUG': 'cyan', + 'INFO': 'green', + 'WARNING': 'yellow', + 'ERROR': 'red', + 'CRITICAL': 'red,bg_white', + }, + secondary_log_colors={}, + style='%' + ) + handler.setFormatter(formatter) + _LOGGER.addHandler(handler) + _LOGGER.setLevel(logging.INFO) + + +def parse_handling_for_bsp(type_arg: str, bsp_select: BspType): + if bsp_select == BspType.BSP_Q7S: + copy_to_eive_tmtc = True + else: + copy_to_eive_tmtc = False + if type_arg == "objects": _LOGGER.info(f"Generating objects data") - parse_objects(bsp_select) - elif args.type == "events": + parse_objects(bsp_select, copy_to_eive_tmtc) + elif type_arg == "events": _LOGGER.info(f"Generating event data") - parse_events(bsp_select) - elif args.type == "returnvalues": + parse_events(bsp_select, True, True, copy_to_eive_tmtc) + elif type_arg == "returnvalues": _LOGGER.info("Generating returnvalue data") parse_returnvalues(bsp_select) - elif args.type == "all": + elif type_arg == "all": _LOGGER.info("Generating all data") - parse_objects(bsp_select) - parse_events(bsp_select) + parse_objects(bsp_select, copy_to_eive_tmtc) + parse_events(bsp_select, True, True, copy_to_eive_tmtc) parse_returnvalues(bsp_select) diff --git a/generators/objects/objects.py b/generators/objects/objects.py index d1f160e0..822909ea 100644 --- a/generators/objects/objects.py +++ b/generators/objects/objects.py @@ -29,6 +29,7 @@ GENERATE_CPP = True COPY_CPP = True GENERATE_HEADER = True +PRINT_OBJECTS = False class BspConfig: @@ -83,7 +84,7 @@ VALUES(?,?) """ -def parse_objects(bsp_select: BspType, print_object_list: bool = True): +def parse_objects(bsp_select: BspType, copy_to_eive_tmtc: bool): cfg = BspConfig(bsp_select) # fetch objects object_parser = ObjectDefinitionParser(cfg.objects_defs) @@ -92,10 +93,10 @@ def parse_objects(bsp_select: BspType, print_object_list: bool = True): list_items = sorted(subsystem_definitions.items()) _LOGGER.info(f"ObjectParser: Number of objects: {len(list_items)}") - if print_object_list: + if PRINT_OBJECTS: PrettyPrinter.pprint(list_items) - handle_file_export(cfg, list_items) + handle_file_export(cfg, list_items, copy_to_eive_tmtc) if EXPORT_TO_SQL: _LOGGER.info("ObjectParser: Exporting to SQL") sql_object_exporter( @@ -107,7 +108,7 @@ def parse_objects(bsp_select: BspType, print_object_list: bool = True): ) -def handle_file_export(cfg: BspConfig, list_items): +def handle_file_export(cfg: BspConfig, list_items, copy_to_eive_tmtc: bool): if GENERATE_CPP: _LOGGER.info("ObjectParser: Generating C++ translation file") write_translation_file( @@ -130,8 +131,12 @@ def handle_file_export(cfg: BspConfig, list_items): object_list=list_items, file_separator=FILE_SEPARATOR, ) - copy_file( - filename=Path(cfg.csv_obj_filename), - destination=Path(CSV_COPY_DEST), - delete_existing_file=True, - ) + if copy_to_eive_tmtc: + _LOGGER.info( + f"ObjectParser: Copying CSV file to {CSV_COPY_DEST}" + ) + copy_file( + filename=Path(cfg.csv_obj_filename), + destination=Path(CSV_COPY_DEST), + delete_existing_file=True, + ) diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 2be64bee..de812091 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 152 translations. - * Generated on: 2023-02-09 14:24:39 + * Generated on: 2023-02-09 15:45:44 */ #include "translateObjects.h" diff --git a/generators/requirements.txt b/generators/requirements.txt index b3097158..cbdc29d2 100644 --- a/generators/requirements.txt +++ b/generators/requirements.txt @@ -1 +1,2 @@ +colorlog==6.7.0 git+https://egit.irs.uni-stuttgart.de/fsfw/fsfwgen@66e31885a7c87fbb4340cd2a51a13e1196f377af#egg=fsfwgen diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index b7556f0a..89e393fa 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 256 translations. * @details - * Generated on: 2023-02-09 14:24:39 + * Generated on: 2023-02-09 15:49:39 */ #include "translateEvents.h" diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 2be64bee..de812091 100644 --- a/linux/fsfwconfig/objects/translateObjects.cpp +++ b/linux/fsfwconfig/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 152 translations. - * Generated on: 2023-02-09 14:24:39 + * Generated on: 2023-02-09 15:45:44 */ #include "translateObjects.h" diff --git a/tmtc b/tmtc index 669e9559..84178059 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 669e9559b9e6e83beca755586d01f6ad1a80e036 +Subproject commit 841780593ebe35ce01ea95dc5e21b78237f1d861 From 417969fcec5346d5b1f886fe8a6c1283cc565b73 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 9 Feb 2023 15:58:41 +0100 Subject: [PATCH 238/330] always generate host files now as well --- .../fsfwconfig/events/translateEvents.cpp | 2 +- .../fsfwconfig/objects/translateObjects.cpp | 2 +- bsp_hosted/fsfwconfig/returnvalues/classIds.h | 1 + generators/bsp_hosted_returnvalues.csv | 473 ++++++++++++++++++ generators/events/event_parser.py | 5 +- generators/events/translateEvents.cpp | 2 +- generators/gen.py | 18 +- generators/objects/objects.py | 4 +- generators/objects/translateObjects.cpp | 2 +- .../returnvalues/returnvalues_parser.py | 62 +-- linux/fsfwconfig/events/translateEvents.cpp | 2 +- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- 12 files changed, 526 insertions(+), 49 deletions(-) create mode 100644 generators/bsp_hosted_returnvalues.csv diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index 89e393fa..076be623 100644 --- a/bsp_hosted/fsfwconfig/events/translateEvents.cpp +++ b/bsp_hosted/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 256 translations. * @details - * Generated on: 2023-02-09 15:49:39 + * Generated on: 2023-02-09 15:57:01 */ #include "translateEvents.h" diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index 0c43d969..09224cd4 100644 --- a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp +++ b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 147 translations. - * Generated on: 2023-02-09 15:45:44 + * Generated on: 2023-02-09 15:57:01 */ #include "translateObjects.h" diff --git a/bsp_hosted/fsfwconfig/returnvalues/classIds.h b/bsp_hosted/fsfwconfig/returnvalues/classIds.h index deedca6a..d7c66f4c 100644 --- a/bsp_hosted/fsfwconfig/returnvalues/classIds.h +++ b/bsp_hosted/fsfwconfig/returnvalues/classIds.h @@ -13,6 +13,7 @@ namespace CLASS_ID { enum { CLASS_ID_START = COMMON_CLASS_ID_END, + CLASS_ID_END // [EXPORT] : [END] }; } diff --git a/generators/bsp_hosted_returnvalues.csv b/generators/bsp_hosted_returnvalues.csv new file mode 100644 index 00000000..44bc8078 --- /dev/null +++ b/generators/bsp_hosted_returnvalues.csv @@ -0,0 +1,473 @@ +Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path +0x0000;OK;System-wide code for ok.;0;HasReturnvaluesIF;fsfw/returnvalues/returnvalue.h +0x0001;Failed;Unspecified system-wide code for failed.;1;HasReturnvaluesIF;fsfw/returnvalues/returnvalue.h +0x63a0;NVMB_KeyNotExists;Specified key does not exist in json file;160;NVM_PARAM_BASE;mission/memory/NVMParameterBase.h +0x6300;NVMB_Busy;;0;NVM_PARAM_BASE;mission/system/objects/Stack5VHandler.h +0x58a0;SUSS_ErrorUnlockMutex;;160;SUS_HANDLER;mission/devices/SusHandler.h +0x58a1;SUSS_ErrorLockMutex;;161;SUS_HANDLER;mission/devices/SusHandler.h +0x66a0;SADPL_CommandNotSupported;;160;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x66a1;SADPL_DeploymentAlreadyExecuting;;161;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x66a2;SADPL_MainSwitchTimeoutFailure;;162;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x66a3;SADPL_SwitchingDeplSa1Failed;;163;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x66a4;SADPL_SwitchingDeplSa2Failed;;164;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x51a0;IMTQ_InvalidCommandCode;;160;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x51a1;IMTQ_ParameterMissing;;161;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x51a2;IMTQ_ParameterInvalid;;162;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x51a3;IMTQ_CcUnavailable;;163;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x51a4;IMTQ_InternalProcessingError;;164;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x51a5;IMTQ_RejectedWithoutReason;;165;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x51a6;IMTQ_CmdErrUnknown;;166;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x51a7;IMTQ_UnexpectedSelfTestReply;The status reply to a self test command was received but no self test command has been sent. This should normally never happen.;167;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x52b0;RWHA_SpiWriteFailure;;176;RW_HANDLER;mission/devices/RwHandler.h +0x52b1;RWHA_SpiReadFailure;Used by the spi send function to tell a failing read call;177;RW_HANDLER;mission/devices/RwHandler.h +0x52b2;RWHA_MissingStartSign;Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E;178;RW_HANDLER;mission/devices/RwHandler.h +0x52b3;RWHA_InvalidSubstitute;Can be used by the HDLC decoding mechanism to inform about an invalid substitution combination;179;RW_HANDLER;mission/devices/RwHandler.h +0x52b4;RWHA_MissingEndSign;HDLC decoding mechanism never receives the end sign 0x7E;180;RW_HANDLER;mission/devices/RwHandler.h +0x52b5;RWHA_NoReply;Reaction wheel only responds with empty frames.;181;RW_HANDLER;mission/devices/RwHandler.h +0x52b6;RWHA_NoStartMarker;Expected a start marker as first byte;182;RW_HANDLER;mission/devices/RwHandler.h +0x52a0;RWHA_InvalidSpeed;Action Message with invalid speed was received. Valid speeds must be in the range of [-65000, 1000] or [1000, 65000];160;RW_HANDLER;mission/devices/RwHandler.h +0x52a1;RWHA_InvalidRampTime;Action Message with invalid ramp time was received.;161;RW_HANDLER;mission/devices/RwHandler.h +0x52a2;RWHA_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;162;RW_HANDLER;mission/devices/RwHandler.h +0x52a3;RWHA_ExecutionFailed;Command execution failed;163;RW_HANDLER;mission/devices/RwHandler.h +0x52a4;RWHA_CrcError;Reaction wheel reply has invalid crc;164;RW_HANDLER;mission/devices/RwHandler.h +0x50a0;SYRLINKS_CrcFailure;;160;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h +0x50a1;SYRLINKS_UartFraminOrParityErrorAck;;161;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h +0x50a2;SYRLINKS_BadCharacterAck;;162;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h +0x50a3;SYRLINKS_BadParameterValueAck;;163;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h +0x50a4;SYRLINKS_BadEndOfFrameAck;;164;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h +0x50a5;SYRLINKS_UnknownCommandIdAck;;165;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h +0x50a6;SYRLINKS_BadCrcAck;;166;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h +0x50a7;SYRLINKS_ReplyWrongSize;;167;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h +0x50a8;SYRLINKS_MissingStartFrameCharacter;;168;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h +0x5d00;GOMS_PacketTooLong;;0;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5d01;GOMS_InvalidTableId;;1;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5d02;GOMS_InvalidAddress;;2;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5d03;GOMS_InvalidParamSize;;3;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5d04;GOMS_InvalidPayloadSize;;4;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5d05;GOMS_UnknownReplyId;;5;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x4fa1;HEATER_CommandNotSupported;;161;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x4fa2;HEATER_InitFailed;;162;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x4fa3;HEATER_InvalidSwitchNr;;163;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x4fa4;HEATER_MainSwitchSetTimeout;;164;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x4fa5;HEATER_CommandAlreadyWaiting;;165;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x60a0;CCSDS_CommandNotImplemented;Received action message with unknown action id;160;CCSDS_HANDLER;mission/tmtc/CcsdsIpCoreHandler.h +0x6a01;ACSSAF_SafectrlMekfInputInvalid;;1;ACS_SAFE;mission/controller/acs/control/SafeCtrl.h +0x6b01;ACSPTG_PtgctrlMekfInputInvalid;;1;ACS_PTG;mission/controller/acs/control/PtgCtrl.h +0x6c01;ACSDTB_DetumbleNoSensordata;;1;ACS_DETUMBLE;mission/controller/acs/control/Detumble.h +0x6901;ACSKAL_KalmanNoGyrMeas;;1;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h +0x6902;ACSKAL_KalmanNoModel;;2;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h +0x6903;ACSKAL_KalmanInversionFailed;;3;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h +0x4500;HSPI_OpeningFileFailed;;0;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h +0x4501;HSPI_FullDuplexTransferFailed;;1;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h +0x4502;HSPI_HalfDuplexTransferFailed;;2;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h +0x4801;HGIO_UnknownGpioId;;1;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4802;HGIO_DriveGpioFailure;;2;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4803;HGIO_GpioTypeFailure;;3;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4804;HGIO_GpioInvalidInstance;;4;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4805;HGIO_GpioDuplicateDetected;;5;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4806;HGIO_GpioInitFailed;;6;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4807;HGIO_GpioGetValueFailed;;7;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4601;HURT_UartReadFailure;;1;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h +0x4602;HURT_UartReadSizeMissmatch;;2;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h +0x4603;HURT_UartRxBufferTooSmall;;3;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h +0x4400;UXOS_ExecutionFinished;Execution of the current command has finished;0;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4401;UXOS_CommandPending;Command is pending. This will also be returned if the user tries to load another command but a command is still pending;1;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4402;UXOS_BytesRead;Some bytes have been read from the executing process;2;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4403;UXOS_CommandError;Command execution failed;3;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4404;UXOS_NoCommandLoadedOrPending;;4;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4406;UXOS_PcloseCallError;;6;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x2801;SM_DataTooLarge;;1;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x2802;SM_DataStorageFull;;2;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x2803;SM_IllegalStorageId;;3;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x2804;SM_DataDoesNotExist;;4;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x2805;SM_IllegalAddress;;5;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x2806;SM_PoolTooLarge;;6;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x0601;PP_DoItMyself;;1;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0602;PP_PointsToVariable;;2;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0603;PP_PointsToMemory;;3;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0604;PP_ActivityCompleted;;4;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0605;PP_PointsToVectorUint8;;5;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0606;PP_PointsToVectorUint16;;6;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0607;PP_PointsToVectorUint32;;7;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0608;PP_PointsToVectorFloat;;8;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06a0;PP_DumpNotSupported;;160;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06e0;PP_InvalidSize;;224;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06e1;PP_InvalidAddress;;225;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06e2;PP_InvalidContent;;226;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06e3;PP_UnalignedAccess;;227;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06e4;PP_WriteProtected;;228;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x13e0;MH_UnknownCmd;;224;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h +0x13e1;MH_InvalidAddress;;225;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h +0x13e2;MH_InvalidSize;;226;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h +0x13e3;MH_StateMismatch;;227;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h +0x38a1;SGP4_InvalidEccentricity;;161;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38a2;SGP4_InvalidMeanMotion;;162;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38a3;SGP4_InvalidPerturbationElements;;163;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38a4;SGP4_InvalidSemiLatusRectum;;164;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38a5;SGP4_InvalidEpochElements;;165;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38a6;SGP4_SatelliteHasDecayed;;166;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38b1;SGP4_TleTooOld;;177;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38b2;SGP4_TleNotInitialized;;178;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x1801;FF_Full;;1;FIFO_CLASS;fsfw/src/fsfw/container/FIFOBase.h +0x1802;FF_Empty;;2;FIFO_CLASS;fsfw/src/fsfw/container/FIFOBase.h +0x1601;FMM_MapFull;;1;FIXED_MULTIMAP;fsfw/src/fsfw/container/FixedOrderedMultimap.h +0x1602;FMM_KeyDoesNotExist;;2;FIXED_MULTIMAP;fsfw/src/fsfw/container/FixedOrderedMultimap.h +0x3901;MUX_NotEnoughResources;;1;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3902;MUX_InsufficientMemory;;2;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3903;MUX_NoPrivilege;;3;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3904;MUX_WrongAttributeSetting;;4;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3905;MUX_MutexAlreadyLocked;;5;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3906;MUX_MutexNotFound;;6;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3907;MUX_MutexMaxLocks;;7;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3908;MUX_CurrThreadAlreadyOwnsMutex;;8;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3909;MUX_CurrThreadDoesNotOwnMutex;;9;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x390a;MUX_MutexTimeout;;10;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x390b;MUX_MutexInvalidId;;11;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x390c;MUX_MutexDestroyedWhileWaiting;;12;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3a01;MQI_Empty;;1;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h +0x3a02;MQI_Full;No space left for more messages;2;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h +0x3a03;MQI_NoReplyPartner;Returned if a reply method was called without partner;3;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h +0x3a04;MQI_DestinationInvalid;Returned if the target destination is invalid.;4;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h +0x0f01;CM_UnknownCommand;;1;COMMAND_MESSAGE;fsfw/src/fsfw/ipc/CommandMessageIF.h +0x0e01;HM_InvalidMode;;1;HAS_MODES_IF;fsfw/src/fsfw/modes/HasModesIF.h +0x0e02;HM_TransNotAllowed;;2;HAS_MODES_IF;fsfw/src/fsfw/modes/HasModesIF.h +0x0e03;HM_InTransition;;3;HAS_MODES_IF;fsfw/src/fsfw/modes/HasModesIF.h +0x0e04;HM_InvalidSubmode;;4;HAS_MODES_IF;fsfw/src/fsfw/modes/HasModesIF.h +0x0c02;MS_InvalidEntry;;2;MODE_STORE_IF;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h +0x0c03;MS_TooManyElements;;3;MODE_STORE_IF;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h +0x0c04;MS_CantStoreEmpty;;4;MODE_STORE_IF;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h +0x0b01;SB_ChildNotFound;;1;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h +0x0b02;SB_ChildInfoUpdated;;2;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h +0x0b03;SB_ChildDoesntHaveModes;;3;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h +0x0b04;SB_CouldNotInsertChild;;4;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h +0x0b05;SB_TableContainsInvalidObjectId;;5;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h +0x0d01;SS_SequenceAlreadyExists;;1;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d02;SS_TableAlreadyExists;;2;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d03;SS_TableDoesNotExist;;3;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d04;SS_TableOrSequenceLengthInvalid;;4;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d05;SS_SequenceDoesNotExist;;5;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d06;SS_TableContainsInvalidObjectId;;6;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d07;SS_FallbackSequenceDoesNotExist;;7;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d08;SS_NoTargetTable;;8;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d09;SS_SequenceOrTableTooLong;;9;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d0b;SS_IsFallbackSequence;;11;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d0c;SS_AccessDenied;;12;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d0e;SS_TableInUse;;14;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0da1;SS_TargetTableNotReached;;161;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0da2;SS_TableCheckFailed;;162;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x2501;EV_ListenerNotFound;;1;EVENT_MANAGER_IF;fsfw/src/fsfw/events/EventManagerIF.h +0x04e1;RMP_CommandNoDescriptorsAvailable;;225;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x04e2;RMP_CommandBufferFull;;226;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x04e3;RMP_CommandChannelOutOfRange;;227;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x04e6;RMP_CommandChannelDeactivated;;230;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x04e7;RMP_CommandPortOutOfRange;;231;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x04e8;RMP_CommandPortInUse;;232;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x04e9;RMP_CommandNoChannel;;233;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x04ea;RMP_NoHwCrc;;234;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x04d0;RMP_ReplyNoReply;;208;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x04d1;RMP_ReplyNotSent;;209;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x04d2;RMP_ReplyNotYetSent;;210;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x04d3;RMP_ReplyMissmatch;;211;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x04d4;RMP_ReplyTimeout;;212;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x04c0;RMP_ReplyInterfaceBusy;;192;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x04c1;RMP_ReplyTransmissionError;;193;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x04c2;RMP_ReplyInvalidData;;194;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x04c3;RMP_ReplyNotSupported;;195;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x04f0;RMP_LinkDown;;240;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x04f1;RMP_SpwCredit;;241;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x04f2;RMP_SpwEscape;;242;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x04f3;RMP_SpwDisconnect;;243;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x04f4;RMP_SpwParity;;244;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x04f5;RMP_SpwWriteSync;;245;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x04f6;RMP_SpwInvalidAddress;;246;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x04f7;RMP_SpwEarlyEop;;247;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x04f8;RMP_SpwDma;;248;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x04f9;RMP_SpwLinkError;;249;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x0400;RMP_ReplyOk;;0;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x0401;RMP_ReplyGeneralErrorCode;;1;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x0402;RMP_ReplyUnusedPacketTypeOrCommandCode;;2;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x0403;RMP_ReplyInvalidKey;;3;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x0404;RMP_ReplyInvalidDataCrc;;4;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x0405;RMP_ReplyEarlyEop;;5;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x0406;RMP_ReplyTooMuchData;;6;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x0407;RMP_ReplyEep;;7;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x0408;RMP_ReplyReserved;;8;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x0409;RMP_ReplyVerifyBufferOverrun;;9;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x040a;RMP_ReplyCommandNotImplementedOrNotAuthorised;;10;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x040b;RMP_ReplyRmwDataLengthError;;11;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x040c;RMP_ReplyInvalidTargetLogicalAddress;;12;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h +0x1401;SE_BufferTooShort;;1;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h +0x1402;SE_StreamTooShort;;2;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h +0x1403;SE_TooManyElements;;3;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h +0x3da0;PVA_InvalidReadWriteMode;;160;POOL_VARIABLE_IF;fsfw/src/fsfw/datapool/PoolVariableIF.h +0x3da1;PVA_InvalidPoolEntry;;161;POOL_VARIABLE_IF;fsfw/src/fsfw/datapool/PoolVariableIF.h +0x0801;DPS_InvalidParameterDefinition;;1;DATA_SET_CLASS;fsfw/src/fsfw/datapool/DataSetIF.h +0x0802;DPS_SetWasAlreadyRead;;2;DATA_SET_CLASS;fsfw/src/fsfw/datapool/DataSetIF.h +0x0803;DPS_CommitingWithoutReading;;3;DATA_SET_CLASS;fsfw/src/fsfw/datapool/DataSetIF.h +0x0804;DPS_DataSetUninitialised;;4;DATA_SET_CLASS;fsfw/src/fsfw/datapool/DataSetIF.h +0x0805;DPS_DataSetFull;;5;DATA_SET_CLASS;fsfw/src/fsfw/datapool/DataSetIF.h +0x0806;DPS_PoolVarNull;;6;DATA_SET_CLASS;fsfw/src/fsfw/datapool/DataSetIF.h +0x1c01;TCD_PacketLost;;1;PACKET_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/TcDistributorBase.h +0x1c02;TCD_DestinationNotFound;;2;PACKET_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/TcDistributorBase.h +0x1c03;TCD_ServiceIdAlreadyExists;;3;PACKET_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/TcDistributorBase.h +0x1b00;TCC_NoDestinationFound;;0;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b01;TCC_InvalidCcsdsVersion;;1;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b02;TCC_InvalidApid;;2;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b03;TCC_InvalidPacketType;;3;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b04;TCC_InvalidSecHeaderField;;4;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b05;TCC_IncorrectPrimaryHeader;;5;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b07;TCC_IncompletePacket;;7;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b08;TCC_InvalidPusVersion;;8;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b09;TCC_IncorrectChecksum;;9;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b0a;TCC_IllegalPacketSubtype;;10;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b0b;TCC_IncorrectSecondaryHeader;;11;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x3001;POS_InPowerTransition;;1;POWER_SWITCHER;fsfw/src/fsfw/power/PowerSwitcher.h +0x3002;POS_SwitchStateMismatch;;2;POWER_SWITCHER;fsfw/src/fsfw/power/PowerSwitcher.h +0x0501;PS_SwitchOn;;1;POWER_SWITCH_IF;fsfw/src/fsfw/power/PowerSwitchIF.h +0x0500;PS_SwitchOff;;0;POWER_SWITCH_IF;fsfw/src/fsfw/power/PowerSwitchIF.h +0x0502;PS_SwitchTimeout;;2;POWER_SWITCH_IF;fsfw/src/fsfw/power/PowerSwitchIF.h +0x0503;PS_FuseOn;;3;POWER_SWITCH_IF;fsfw/src/fsfw/power/PowerSwitchIF.h +0x0504;PS_FuseOff;;4;POWER_SWITCH_IF;fsfw/src/fsfw/power/PowerSwitchIF.h +0x3b00;SPH_ConnBroken;;0;SEMAPHORE_IF;fsfw/src/fsfw/osal/common/TcpTmTcServer.h +0x2a01;IEC_NoConfigurationTable;;1;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a02;IEC_NoCpuTable;;2;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a03;IEC_InvalidWorkspaceAddress;;3;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a04;IEC_TooLittleWorkspace;;4;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a05;IEC_WorkspaceAllocation;;5;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a06;IEC_InterruptStackTooSmall;;6;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a07;IEC_ThreadExitted;;7;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a08;IEC_InconsistentMpInformation;;8;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a09;IEC_InvalidNode;;9;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0a;IEC_NoMpci;;10;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0b;IEC_BadPacket;;11;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0c;IEC_OutOfPackets;;12;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0d;IEC_OutOfGlobalObjects;;13;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0e;IEC_OutOfProxies;;14;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0f;IEC_InvalidGlobalId;;15;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a10;IEC_BadStackHook;;16;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a11;IEC_BadAttributes;;17;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a12;IEC_ImplementationKeyCreateInconsistency;;18;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a13;IEC_ImplementationBlockingOperationCancel;;19;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a14;IEC_MutexObtainFromBadState;;20;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a15;IEC_UnlimitedAndMaximumIs0;;21;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2600;FDI_YourFault;;0;HANDLES_FAILURES_IF;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h +0x2601;FDI_MyFault;;1;HANDLES_FAILURES_IF;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h +0x2602;FDI_ConfirmLater;;2;HANDLES_FAILURES_IF;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h +0x1e00;PUS_InvalidPusVersion;;0;PUS_IF;fsfw/src/fsfw/tmtcpacket/pus/PusIF.h +0x1e01;PUS_InvalidCrc16;;1;PUS_IF;fsfw/src/fsfw/tmtcpacket/pus/PusIF.h +0x0201;OM_InsertionFailed;;1;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h +0x0202;OM_NotFound;;2;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h +0x0203;OM_ChildInitFailed;;3;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h +0x0204;OM_InternalErrReporterUninit;;4;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h +0x2201;TMF_Busy;;1;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2202;TMF_LastPacketFound;;2;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2203;TMF_StopFetch;;3;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2204;TMF_Timeout;;4;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2205;TMF_TmChannelFull;;5;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2206;TMF_NotStored;;6;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2207;TMF_AllDeleted;;7;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2208;TMF_InvalidData;;8;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2209;TMF_NotReady;;9;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2101;TMB_Busy;;1;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2102;TMB_Full;;2;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2103;TMB_Empty;;3;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2104;TMB_NullRequested;;4;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2105;TMB_TooLarge;;5;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2106;TMB_NotReady;;6;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2107;TMB_DumpError;;7;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2108;TMB_CrcError;;8;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2109;TMB_Timeout;;9;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210a;TMB_IdlePacketFound;;10;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210b;TMB_TelecommandFound;;11;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210c;TMB_NoPusATm;;12;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210d;TMB_TooSmall;;13;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210e;TMB_BlockNotFound;;14;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210f;TMB_InvalidRequest;;15;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2d01;PAW_UnknownDatatype;;1;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d02;PAW_DatatypeMissmatch;;2;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d03;PAW_Readonly;;3;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d04;PAW_TooBig;;4;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d05;PAW_SourceNotSet;;5;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d06;PAW_OutOfBounds;;6;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d07;PAW_NotSet;;7;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d08;PAW_ColumnOrRowsZero;;8;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2e01;HPA_InvalidIdentifierId;;1;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h +0x2e02;HPA_InvalidDomainId;;2;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h +0x2e03;HPA_InvalidValue;;3;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h +0x2e05;HPA_ReadOnly;;5;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h +0x3b01;SPH_SemaphoreTimeout;;1;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h +0x3b02;SPH_SemaphoreNotOwned;;2;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h +0x3b03;SPH_SemaphoreInvalid;;3;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h +0x1a01;TRC_NotEnoughSensors;;1;TRIPLE_REDUNDACY_CHECK;fsfw/src/fsfw/monitoring/TriplexMonitor.h +0x1a02;TRC_LowestValueOol;;2;TRIPLE_REDUNDACY_CHECK;fsfw/src/fsfw/monitoring/TriplexMonitor.h +0x1a03;TRC_HighestValueOol;;3;TRIPLE_REDUNDACY_CHECK;fsfw/src/fsfw/monitoring/TriplexMonitor.h +0x1a04;TRC_BothValuesOol;;4;TRIPLE_REDUNDACY_CHECK;fsfw/src/fsfw/monitoring/TriplexMonitor.h +0x1a05;TRC_DuplexOol;;5;TRIPLE_REDUNDACY_CHECK;fsfw/src/fsfw/monitoring/TriplexMonitor.h +0x3101;LIM_Unchecked;;1;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h +0x3102;LIM_Invalid;;2;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h +0x3103;LIM_Unselected;;3;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h +0x3104;LIM_BelowLowLimit;;4;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h +0x3105;LIM_AboveHighLimit;;5;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h +0x3106;LIM_UnexpectedValue;;6;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h +0x3107;LIM_OutOfRange;;7;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h +0x31a0;LIM_FirstSample;;160;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h +0x31e0;LIM_InvalidSize;;224;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h +0x31e1;LIM_WrongType;;225;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h +0x31e2;LIM_WrongPid;;226;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h +0x31e3;LIM_WrongLimitId;;227;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h +0x31ee;LIM_MonitorNotFound;;238;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h +0x3601;CFDP_InvalidTlvType;;1;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3602;CFDP_InvalidDirectiveField;;2;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3603;CFDP_InvalidPduDatafieldLen;;3;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3604;CFDP_InvalidAckDirectiveFields;;4;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3605;CFDP_MetadataCantParseOptions;;5;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3606;CFDP_NakCantParseOptions;;6;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3607;CFDP_FinishedCantParseFsResponses;;7;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3608;CFDP_FilestoreRequiresSecondFile;;8;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3609;CFDP_FilestoreResponseCantParseFsMessage;;9;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x360a;CFDP_InvalidPduFormat;;10;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x4300;FILS_GenericFileError;;0;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4301;FILS_GenericDirError;;1;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4302;FILS_FilesystemInactive;;2;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4303;FILS_GenericRenameError;;3;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4304;FILS_IsBusy;;4;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4305;FILS_InvalidParameters;;5;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x430a;FILS_FileDoesNotExist;;10;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x430b;FILS_FileAlreadyExists;;11;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x430c;FILS_NotAFile;;12;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x430d;FILS_FileLocked;;13;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x430e;FILS_PermissionDenied;;14;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4315;FILS_DirectoryDoesNotExist;;21;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4316;FILS_DirectoryAlreadyExists;;22;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4317;FILS_NotADirectory;;23;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4318;FILS_DirectoryNotEmpty;;24;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x431e;FILS_SequencePacketMissingWrite;;30;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x431f;FILS_SequencePacketMissingRead;;31;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x2c01;CCS_BcIsSetVrCommand;;1;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2c02;CCS_BcIsUnlockCommand;;2;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cb0;CCS_BcIllegalCommand;;176;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cb1;CCS_BoardReadingNotFinished;;177;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cf0;CCS_NsPositiveW;;240;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cf1;CCS_NsNegativeW;;241;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cf2;CCS_NsLockout;;242;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cf3;CCS_FarmInLockout;;243;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cf4;CCS_FarmInWait;;244;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce0;CCS_WrongSymbol;;224;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce1;CCS_DoubleStart;;225;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce2;CCS_StartSymbolMissed;;226;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce3;CCS_EndWithoutStart;;227;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce4;CCS_TooLarge;;228;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce5;CCS_TooShort;;229;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce6;CCS_WrongTfVersion;;230;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce7;CCS_WrongSpacecraftId;;231;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce8;CCS_NoValidFrameType;;232;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce9;CCS_CrcFailed;;233;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cea;CCS_VcNotFound;;234;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ceb;CCS_ForwardingFailed;;235;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cec;CCS_ContentTooLarge;;236;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ced;CCS_ResidualData;;237;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cee;CCS_DataCorrupted;;238;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cef;CCS_IllegalSegmentationFlag;;239;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cd0;CCS_IllegalFlagCombination;;208;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cd1;CCS_ShorterThanHeader;;209;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cd2;CCS_TooShortBlockedPacket;;210;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cd3;CCS_TooShortMapExtraction;;211;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x4201;PUS11_InvalidTypeTimeWindow;;1;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h +0x4202;PUS11_InvalidTimeWindow;;2;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h +0x4203;PUS11_TimeshiftingNotPossible;;3;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h +0x4204;PUS11_InvalidRelativeTime;;4;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h +0x4205;PUS11_ContainedTcTooSmall;;5;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h +0x4206;PUS11_ContainedTcCrcMissmatch;;6;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h +0x3401;DC_NoReplyReceived;;1;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h +0x3402;DC_ProtocolError;;2;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h +0x3403;DC_Nullpointer;;3;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h +0x3404;DC_InvalidCookieType;;4;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h +0x3405;DC_NotActive;;5;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h +0x3406;DC_TooMuchData;;6;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h +0x03a0;DHB_InvalidChannel;;160;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h +0x03b0;DHB_AperiodicReply;;176;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h +0x03b1;DHB_IgnoreReplyData;;177;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h +0x03b2;DHB_IgnoreFullPacket;;178;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h +0x03c0;DHB_NothingToSend;;192;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h +0x03c2;DHB_CommandMapError;;194;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h +0x03d0;DHB_NoSwitch;;208;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h +0x03e0;DHB_ChildTimeout;;224;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h +0x03e1;DHB_SwitchFailed;;225;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h +0x1201;AB_NeedSecondStep;;1;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x1202;AB_NeedToReconfigure;;2;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x1203;AB_ModeFallback;;3;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x1204;AB_ChildNotCommandable;;4;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x1205;AB_NeedToChangeHealth;;5;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x12a1;AB_NotEnoughChildrenInCorrectState;;161;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x27a0;DHI_NoCommandData;;160;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27a1;DHI_CommandNotSupported;;161;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27a2;DHI_CommandAlreadySent;;162;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27a3;DHI_CommandWasNotSent;;163;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27a4;DHI_CantSwitchAddress;;164;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27a5;DHI_WrongModeForCommand;;165;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27a6;DHI_Timeout;;166;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27a7;DHI_Busy;;167;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27a8;DHI_NoReplyExpected;;168;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27a9;DHI_NonOpTemperature;;169;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27aa;DHI_CommandNotImplemented;;170;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27b0;DHI_ChecksumError;;176;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27b1;DHI_LengthMissmatch;;177;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27b2;DHI_InvalidData;;178;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27b3;DHI_ProtocolError;;179;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27c0;DHI_DeviceDidNotExecute;;192;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27c1;DHI_DeviceReportedError;;193;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27c2;DHI_UnknownDeviceReply;;194;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27c3;DHI_DeviceReplyInvalid;;195;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27d0;DHI_InvalidCommandParameter;;208;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x27d1;DHI_InvalidNumberOrLengthOfParameters;;209;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h +0x2401;MT_TooDetailedRequest;;1;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h +0x2402;MT_TooGeneralRequest;;2;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h +0x2403;MT_NoMatch;;3;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h +0x2404;MT_Full;;4;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h +0x2405;MT_NewNodeCreated;;5;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h +0x3f01;DLEE_NoPacketFound;;1;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleParser.h +0x3f02;DLEE_PossiblePacketLoss;;2;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleParser.h +0x2f01;ASC_TooLongForTargetType;;1;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h +0x2f02;ASC_InvalidCharacters;;2;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h +0x2f03;ASC_BufferTooSmall;;3;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h +0x1701;HHI_ObjectNotHealthy;;1;HAS_HEALTH_IF;fsfw/src/fsfw/health/HasHealthIF.h +0x1702;HHI_InvalidHealthState;;2;HAS_HEALTH_IF;fsfw/src/fsfw/health/HasHealthIF.h +0x1703;HHI_IsExternallyControlled;;3;HAS_HEALTH_IF;fsfw/src/fsfw/health/HasHealthIF.h +0x3201;CF_ObjectHasNoFunctions;;1;COMMANDS_ACTIONS_IF;fsfw/src/fsfw/action/CommandsActionsIF.h +0x3202;CF_AlreadyCommanding;;2;COMMANDS_ACTIONS_IF;fsfw/src/fsfw/action/CommandsActionsIF.h +0x3301;HF_IsBusy;;1;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h +0x3302;HF_InvalidParameters;;2;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h +0x3303;HF_ExecutionFinished;;3;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h +0x3304;HF_InvalidActionId;;4;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h +0x1000;TIM_UnsupportedTimeFormat;;0;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x1001;TIM_NotEnoughInformationForTargetFormat;;1;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x1002;TIM_LengthMismatch;;2;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x1003;TIM_InvalidTimeFormat;;3;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x1004;TIM_InvalidDayOfYear;;4;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x1005;TIM_TimeDoesNotFitFormat;;5;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x3701;TSI_BadTimestamp;;1;TIME_STAMPER_IF;fsfw/src/fsfw/timemanager/TimeStampIF.h +0x3c00;LPIF_PoolEntryNotFound;;0;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h +0x3c01;LPIF_PoolEntryTypeConflict;;1;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h +0x3e00;HKM_QueueOrDestinationInvalid;;0;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3e01;HKM_WrongHkPacketType;;1;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3e02;HKM_ReportingStatusUnchanged;;2;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3e03;HKM_PeriodicHelperInvalid;;3;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3e04;HKM_PoolobjectNotFound;;4;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3e05;HKM_DatasetNotFound;;5;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x2901;TC_InvalidTargetState;;1;THERMAL_COMPONENT_IF;fsfw/src/fsfw/thermal/ThermalComponentIF.h +0x29f1;TC_AboveOperationalLimit;;241;THERMAL_COMPONENT_IF;fsfw/src/fsfw/thermal/ThermalComponentIF.h +0x29f2;TC_BelowOperationalLimit;;242;THERMAL_COMPONENT_IF;fsfw/src/fsfw/thermal/ThermalComponentIF.h +0x2001;CSB_ExecutionComplete;;1;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2002;CSB_NoStepMessage;;2;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2003;CSB_ObjectBusy;;3;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2004;CSB_Busy;;4;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2005;CSB_InvalidTc;;5;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2006;CSB_InvalidObject;;6;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2007;CSB_InvalidReply;;7;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x4c00;SPPA_NoPacketFound;;0;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h +0x4c01;SPPA_SplitPacket;;1;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h +0x1d01;ATC_ActivityStarted;;1;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h +0x1d02;ATC_InvalidSubservice;;2;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h +0x1d03;ATC_IllegalApplicationData;;3;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h +0x1d04;ATC_SendTmFailed;;4;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h +0x1d05;ATC_Timeout;;5;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h diff --git a/generators/events/event_parser.py b/generators/events/event_parser.py index 2f75a773..77f68c35 100644 --- a/generators/events/event_parser.py +++ b/generators/events/event_parser.py @@ -91,7 +91,10 @@ class BspConfig: def parse_events( - bsp_type: BspType, generate_csv: bool, generate_cpp: bool, copy_csv_to_eive_tmtc: bool + bsp_type: BspType, + generate_csv: bool, + generate_cpp: bool, + copy_csv_to_eive_tmtc: bool, ): bsp_cfg = BspConfig(bsp_type) _LOGGER.info(f"EventParser: Parsing events for {bsp_type.name}") diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 89e393fa..076be623 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 256 translations. * @details - * Generated on: 2023-02-09 15:49:39 + * Generated on: 2023-02-09 15:57:01 */ #include "translateEvents.h" diff --git a/generators/gen.py b/generators/gen.py index c7858fa0..05574502 100755 --- a/generators/gen.py +++ b/generators/gen.py @@ -22,7 +22,7 @@ def main(): init_printout(project_string="EIVE") parser = return_generic_args_parser() args = parser.parse_args() - # parse_handling_for_bsp(args.type, BspType.BSP_HOSTED) + parse_handling_for_bsp(args.type, BspType.BSP_HOSTED) parse_handling_for_bsp(args.type, BspType.BSP_Q7S) @@ -33,14 +33,14 @@ def set_up_logger(): datefmt=None, reset=True, log_colors={ - 'DEBUG': 'cyan', - 'INFO': 'green', - 'WARNING': 'yellow', - 'ERROR': 'red', - 'CRITICAL': 'red,bg_white', + "DEBUG": "cyan", + "INFO": "green", + "WARNING": "yellow", + "ERROR": "red", + "CRITICAL": "red,bg_white", }, secondary_log_colors={}, - style='%' + style="%", ) handler.setFormatter(formatter) _LOGGER.addHandler(handler) @@ -60,12 +60,12 @@ def parse_handling_for_bsp(type_arg: str, bsp_select: BspType): parse_events(bsp_select, True, True, copy_to_eive_tmtc) elif type_arg == "returnvalues": _LOGGER.info("Generating returnvalue data") - parse_returnvalues(bsp_select) + parse_returnvalues(bsp_select, copy_to_eive_tmtc) elif type_arg == "all": _LOGGER.info("Generating all data") parse_objects(bsp_select, copy_to_eive_tmtc) parse_events(bsp_select, True, True, copy_to_eive_tmtc) - parse_returnvalues(bsp_select) + parse_returnvalues(bsp_select, copy_to_eive_tmtc) if __name__ == "__main__": diff --git a/generators/objects/objects.py b/generators/objects/objects.py index 822909ea..644aec7d 100644 --- a/generators/objects/objects.py +++ b/generators/objects/objects.py @@ -132,9 +132,7 @@ def handle_file_export(cfg: BspConfig, list_items, copy_to_eive_tmtc: bool): file_separator=FILE_SEPARATOR, ) if copy_to_eive_tmtc: - _LOGGER.info( - f"ObjectParser: Copying CSV file to {CSV_COPY_DEST}" - ) + _LOGGER.info(f"ObjectParser: Copying CSV file to {CSV_COPY_DEST}") copy_file( filename=Path(cfg.csv_obj_filename), destination=Path(CSV_COPY_DEST), diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index de812091..85fe0632 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 152 translations. - * Generated on: 2023-02-09 15:45:44 + * Generated on: 2023-02-09 15:57:01 */ #include "translateObjects.h" diff --git a/generators/returnvalues/returnvalues_parser.py b/generators/returnvalues/returnvalues_parser.py index a6d951cb..544cd64b 100644 --- a/generators/returnvalues/returnvalues_parser.py +++ b/generators/returnvalues/returnvalues_parser.py @@ -28,6 +28,30 @@ FILE_SEPARATOR = ";" MAX_STRING_LENGTH = 32 +CSV_COPY_DEST = Path(f"{OBSW_ROOT_DIR}/tmtc/eive_tmtc/config/returnvalues.csv") + + +SQL_DELETE_RETURNVALUES_CMD = """ + DROP TABLE IF EXISTS Returnvalues +""" + +SQL_CREATE_RETURNVALUES_CMD = """ + CREATE TABLE IF NOT EXISTS Returnvalues ( + id INTEGER PRIMARY KEY, + code TEXT, + name TEXT, + interface TEXT, + file TEXT, + description TEXT + ) +""" + +SQL_INSERT_RETURNVALUES_CMD = """ +INSERT INTO Returnvalues(code,name,interface,file,description) +VALUES(?,?,?,?,?) +""" + + class BspConfig: def __init__(self, bps_select: BspType): self.bsp_dir_name = bps_select.value @@ -60,31 +84,7 @@ class BspConfig: return [Path(x) for x in self.retval_sources] -CSV_COPY_DEST = Path(f"{OBSW_ROOT_DIR}/tmtc/eive_tmtc/config/returnvalues.csv") - - -SQL_DELETE_RETURNVALUES_CMD = """ - DROP TABLE IF EXISTS Returnvalues -""" - -SQL_CREATE_RETURNVALUES_CMD = """ - CREATE TABLE IF NOT EXISTS Returnvalues ( - id INTEGER PRIMARY KEY, - code TEXT, - name TEXT, - interface TEXT, - file TEXT, - description TEXT - ) -""" - -SQL_INSERT_RETURNVALUES_CMD = """ -INSERT INTO Returnvalues(code,name,interface,file,description) -VALUES(?,?,?,?,?) -""" - - -def parse_returnvalues(bsp_select: BspType): +def parse_returnvalues(bsp_select: BspType, copy_to_eive_tmtc: bool): cfg = BspConfig(bsp_select) returnvalue_table = generate_returnvalue_table(cfg) if EXPORT_TO_FILE: @@ -92,11 +92,13 @@ def parse_returnvalues(bsp_select: BspType): cfg.csv_retval_filename, returnvalue_table, FILE_SEPARATOR ) if COPY_CSV_FILE: - copy_file( - filename=cfg.csv_retval_filename, - destination=CSV_COPY_DEST, - delete_existing_file=True, - ) + if copy_to_eive_tmtc: + _LOGGER.info(f"Copying CSV to {CSV_COPY_DEST}") + copy_file( + filename=cfg.csv_retval_filename, + destination=CSV_COPY_DEST, + delete_existing_file=True, + ) if EXPORT_TO_SQL: _LOGGER.info("ReturnvalueParser: Exporting to SQL") sql_retval_exporter( diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 89e393fa..076be623 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 256 translations. * @details - * Generated on: 2023-02-09 15:49:39 + * Generated on: 2023-02-09 15:57:01 */ #include "translateEvents.h" diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index de812091..85fe0632 100644 --- a/linux/fsfwconfig/objects/translateObjects.cpp +++ b/linux/fsfwconfig/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 152 translations. - * Generated on: 2023-02-09 15:45:44 + * Generated on: 2023-02-09 15:57:01 */ #include "translateObjects.h" From c34d32e65e1f02978d7ae38c9a336673462461d2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 9 Feb 2023 15:59:19 +0100 Subject: [PATCH 239/330] bump changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b85408c..d92d6113 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ change warranting a new major release: ## Changed - Reworked dummy handling for the TCS controller. +- Generator scripts now generate files for hosted and for Q7S build. # [v1.26.2] 2023-02-08 From ee51b5428d41c6fab7125975138c4024f873564a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 9 Feb 2023 16:13:29 +0100 Subject: [PATCH 240/330] disable TCS ctrl for hosted build --- bsp_hosted/scheduling.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bsp_hosted/scheduling.cpp b/bsp_hosted/scheduling.cpp index 843b2892..4e9f6b8c 100644 --- a/bsp_hosted/scheduling.cpp +++ b/bsp_hosted/scheduling.cpp @@ -154,10 +154,11 @@ void scheduling::initTasks() { scheduling::printAddObjectError("Core controller dummy", objects::CORE_CONTROLLER); } - result = thermalTask->addComponent(objects::THERMAL_CONTROLLER); - if (result != returnvalue::OK) { - scheduling::printAddObjectError("THERMAL_CONTROLLER", objects::THERMAL_CONTROLLER); - } + // Disabled until more stable + //result = thermalTask->addComponent(objects::THERMAL_CONTROLLER); + //if (result != returnvalue::OK) { + // scheduling::printAddObjectError("THERMAL_CONTROLLER", objects::THERMAL_CONTROLLER); + //} FixedTimeslotTaskIF* pstTask = factory->createFixedTimeslotTask( "DUMMY_PST", 75, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.5, missedDeadlineFunc); From 5a5d00e4e50bf81bcb2932386850724bad31e966 Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 9 Feb 2023 17:11:23 +0100 Subject: [PATCH 241/330] dataPool for setting RW speeds --- mission/devices/RwHandler.cpp | 2 + mission/devices/RwHandler.h | 2 + .../devices/devicedefinitions/RwDefinitions.h | 54 +++++++++++++++---- 3 files changed, 47 insertions(+), 11 deletions(-) diff --git a/mission/devices/RwHandler.cpp b/mission/devices/RwHandler.cpp index 732bb9fe..d859f9d0 100644 --- a/mission/devices/RwHandler.cpp +++ b/mission/devices/RwHandler.cpp @@ -243,6 +243,8 @@ uint32_t RwHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { retur ReturnValue_t RwHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) { + localDataPoolMap.emplace(RwDefinitions::RW_SPEED, &rwSpeed); + localDataPoolMap.emplace(RwDefinitions::TEMPERATURE_C, new PoolEntry({0})); localDataPoolMap.emplace(RwDefinitions::CURR_SPEED, new PoolEntry({0})); diff --git a/mission/devices/RwHandler.h b/mission/devices/RwHandler.h index f9f66bd5..43deb579 100644 --- a/mission/devices/RwHandler.h +++ b/mission/devices/RwHandler.h @@ -96,6 +96,8 @@ class RwHandler : public DeviceHandlerBase { uint8_t commandBuffer[RwDefinitions::MAX_CMD_SIZE]; + PoolEntry rwSpeed = PoolEntry(0, false); + enum class InternalState { GET_RESET_STATUS, CLEAR_RESET_STATUS, READ_TEMPERATURE, GET_RW_SATUS }; InternalState internalState = InternalState::GET_RESET_STATUS; diff --git a/mission/devices/devicedefinitions/RwDefinitions.h b/mission/devices/devicedefinitions/RwDefinitions.h index 2923b41b..4016b23c 100644 --- a/mission/devices/devicedefinitions/RwDefinitions.h +++ b/mission/devices/devicedefinitions/RwDefinitions.h @@ -51,7 +51,9 @@ enum PoolIds : lp_id_t { SPI_BYTES_WRITTEN, SPI_BYTES_READ, SPI_REG_OVERRUN_ERRORS, - SPI_TOTAL_ERRORS + SPI_TOTAL_ERRORS, + + RW_SPEED, }; enum States : uint8_t { STATE_ERROR, IDLE, COASTING, RUNNING_SPEED_STABLE, RUNNING_SPEED_CHANGING }; @@ -75,10 +77,13 @@ static const DeviceCommandId_t SET_SPEED = 6; static const DeviceCommandId_t GET_TEMPERATURE = 8; static const DeviceCommandId_t GET_TM = 9; -static const uint32_t TEMPERATURE_SET_ID = GET_TEMPERATURE; -static const uint32_t STATUS_SET_ID = GET_RW_STATUS; -static const uint32_t LAST_RESET_ID = GET_LAST_RESET_STATUS; -static const uint32_t TM_SET_ID = GET_TM; +enum SetIds : uint32_t { + TEMPERATURE_SET_ID = GET_TEMPERATURE, + STATUS_SET_ID = GET_RW_STATUS, + LAST_RESET_ID = GET_LAST_RESET_STATUS, + TM_SET_ID = GET_TM, + RW_SPEED = 10, +}; static const size_t SIZE_GET_RESET_STATUS = 5; static const size_t SIZE_CLEAR_RESET_STATUS = 4; @@ -106,9 +111,11 @@ static const uint8_t TM_SET_ENTRIES = 24; */ class StatusSet : public StaticLocalDataSet { public: - StatusSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, STATUS_SET_ID) {} + StatusSet(HasLocalDataPoolIF* owner) + : StaticLocalDataSet(owner, RwDefinitions::SetIds::STATUS_SET_ID) {} - StatusSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, STATUS_SET_ID)) {} + StatusSet(object_id_t objectId) + : StaticLocalDataSet(sid_t(objectId, RwDefinitions::SetIds::STATUS_SET_ID)) {} lp_var_t temperatureCelcius = lp_var_t(sid.objectId, PoolIds::TEMPERATURE_C, this); @@ -124,9 +131,11 @@ class StatusSet : public StaticLocalDataSet { */ class LastResetSatus : public StaticLocalDataSet { public: - LastResetSatus(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, LAST_RESET_ID) {} + LastResetSatus(HasLocalDataPoolIF* owner) + : StaticLocalDataSet(owner, RwDefinitions::SetIds::LAST_RESET_ID) {} - LastResetSatus(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, LAST_RESET_ID)) {} + LastResetSatus(object_id_t objectId) + : StaticLocalDataSet(sid_t(objectId, RwDefinitions::SetIds::LAST_RESET_ID)) {} // If a reset occurs, the status code will be cached into this variable lp_var_t lastNonClearedResetStatus = @@ -143,9 +152,11 @@ class LastResetSatus : public StaticLocalDataSet { */ class TmDataset : public StaticLocalDataSet { public: - TmDataset(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, TM_SET_ID) {} + TmDataset(HasLocalDataPoolIF* owner) + : StaticLocalDataSet(owner, RwDefinitions::SetIds::TM_SET_ID) {} - TmDataset(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, TM_SET_ID)) {} + TmDataset(object_id_t objectId) + : StaticLocalDataSet(sid_t(objectId, RwDefinitions::SetIds::TM_SET_ID)) {} lp_var_t lastResetStatus = lp_var_t(sid.objectId, PoolIds::TM_LAST_RESET_STATUS, this); @@ -192,6 +203,27 @@ class TmDataset : public StaticLocalDataSet { lp_var_t(sid.objectId, PoolIds::SPI_TOTAL_ERRORS, this); }; +class RwSpeedActuationSet : StaticLocalDataSet<4> { + friend class ::RwHandler; + + public: + RwSpeedActuationSet(HasLocalDataPoolIF& owner) + : StaticLocalDataSet(&owner, RwDefinitions::SetIds::RW_SPEED) {} + RwSpeedActuationSet(object_id_t objectId) + : StaticLocalDataSet(sid_t(objectId, RwDefinitions::SetIds::RW_SPEED)) {} + + void setRwSpeed(int32_t rwSpeed_) { + if (rwSpeed.value != rwSpeed_) { + } + rwSpeed = rwSpeed_; + } + + void getRwSpeed(int32_t& rwSpeed_) { rwSpeed_ = rwSpeed.value; } + + private: + lp_var_t rwSpeed = lp_var_t(sid.objectId, RW_SPEED, this); +}; + } // namespace RwDefinitions #endif /* MISSION_DEVICES_DEVICEDEFINITIONS_RWDEFINITIONS_H_ */ From d01308f0ba9716dadf1530c3da4b0504d2c5ecb8 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 9 Feb 2023 17:17:58 +0100 Subject: [PATCH 242/330] reduced number of errors for hosted build --- bsp_hosted/ObjectFactory.cpp | 18 ------------------ bsp_hosted/fsfwconfig/returnvalues/classIds.h | 2 +- bsp_hosted/scheduling.cpp | 8 ++++---- dummies/ImtqDummy.cpp | 2 +- dummies/TemperatureSensorInserter.cpp | 9 +++++---- dummies/TemperatureSensorInserter.h | 5 ++--- dummies/helpers.cpp | 3 ++- fsfw | 2 +- mission/controller/ThermalController.cpp | 2 +- 9 files changed, 17 insertions(+), 34 deletions(-) diff --git a/bsp_hosted/ObjectFactory.cpp b/bsp_hosted/ObjectFactory.cpp index cc955148..f0308ee5 100644 --- a/bsp_hosted/ObjectFactory.cpp +++ b/bsp_hosted/ObjectFactory.cpp @@ -9,7 +9,6 @@ #include #include "OBSWConfig.h" -#include "devConf.h" #include "fsfw/platform.h" #include "fsfw_tests/integration/task/TestTask.h" @@ -22,30 +21,13 @@ #include "fsfw/osal/common/TcpTmTcServer.h" #endif -#include - #if OBSW_ADD_TEST_CODE == 1 #include #endif #include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "../dummies/TemperatureSensorInserter.h" #include "dummies/helpers.h" #include "mission/utility/GlobalConfigHandler.h" diff --git a/bsp_hosted/fsfwconfig/returnvalues/classIds.h b/bsp_hosted/fsfwconfig/returnvalues/classIds.h index d7c66f4c..16e6eab3 100644 --- a/bsp_hosted/fsfwconfig/returnvalues/classIds.h +++ b/bsp_hosted/fsfwconfig/returnvalues/classIds.h @@ -13,7 +13,7 @@ namespace CLASS_ID { enum { CLASS_ID_START = COMMON_CLASS_ID_END, - CLASS_ID_END // [EXPORT] : [END] + CLASS_ID_END // [EXPORT] : [END] }; } diff --git a/bsp_hosted/scheduling.cpp b/bsp_hosted/scheduling.cpp index 4e9f6b8c..cb97a27f 100644 --- a/bsp_hosted/scheduling.cpp +++ b/bsp_hosted/scheduling.cpp @@ -155,10 +155,10 @@ void scheduling::initTasks() { } // Disabled until more stable - //result = thermalTask->addComponent(objects::THERMAL_CONTROLLER); - //if (result != returnvalue::OK) { - // scheduling::printAddObjectError("THERMAL_CONTROLLER", objects::THERMAL_CONTROLLER); - //} + // result = thermalTask->addComponent(objects::THERMAL_CONTROLLER); + // if (result != returnvalue::OK) { + // scheduling::printAddObjectError("THERMAL_CONTROLLER", objects::THERMAL_CONTROLLER); + // } FixedTimeslotTaskIF* pstTask = factory->createFixedTimeslotTask( "DUMMY_PST", 75, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.5, missedDeadlineFunc); diff --git a/dummies/ImtqDummy.cpp b/dummies/ImtqDummy.cpp index bf8bcb1b..44a7e377 100644 --- a/dummies/ImtqDummy.cpp +++ b/dummies/ImtqDummy.cpp @@ -43,5 +43,5 @@ ReturnValue_t ImtqDummy::initializeLocalDataPool(localpool::DataPool &localDataP localDataPoolMap.emplace(IMTQ::ACTUATION_CAL_STATUS, new PoolEntry({0})); localDataPoolMap.emplace(IMTQ::MTM_RAW, new PoolEntry({0.12, 0.76, -0.45}, true)); localDataPoolMap.emplace(IMTQ::ACTUATION_RAW_STATUS, new PoolEntry({0})); - return returnvalue::OK; + return DeviceHandlerBase::initializeLocalDataPool(localDataPoolMap, poolManager); } diff --git a/dummies/TemperatureSensorInserter.cpp b/dummies/TemperatureSensorInserter.cpp index efbec2d0..c75b008c 100644 --- a/dummies/TemperatureSensorInserter.cpp +++ b/dummies/TemperatureSensorInserter.cpp @@ -4,13 +4,14 @@ #include #include +#include TemperatureSensorInserter::TemperatureSensorInserter(object_id_t objectId, - const Max31865DummyMap& tempSensorDummies_, - const Tmp1075DummyMap& tempTmpSensorDummies_) + Max31865DummyMap tempSensorDummies_, + Tmp1075DummyMap tempTmpSensorDummies_) : SystemObject(objects::THERMAL_TEMP_INSERTER), - max31865DummyMap(tempSensorDummies_), - tmp1075DummyMap(tempTmpSensorDummies_) {} + max31865DummyMap(std::move(tempSensorDummies_)), + tmp1075DummyMap(std::move(tempTmpSensorDummies_)) {} ReturnValue_t TemperatureSensorInserter::initialize() { if (performTest) { diff --git a/dummies/TemperatureSensorInserter.h b/dummies/TemperatureSensorInserter.h index ff3f939e..33d61443 100644 --- a/dummies/TemperatureSensorInserter.h +++ b/dummies/TemperatureSensorInserter.h @@ -10,9 +10,8 @@ class TemperatureSensorInserter : public ExecutableObjectIF, public SystemObject public: using Max31865DummyMap = std::map; using Tmp1075DummyMap = std::map; - explicit TemperatureSensorInserter(object_id_t objectId, - const Max31865DummyMap& tempSensorDummies_, - const Tmp1075DummyMap& tempTmpSensorDummies_); + explicit TemperatureSensorInserter(object_id_t objectId, Max31865DummyMap tempSensorDummies_, + Tmp1075DummyMap tempTmpSensorDummies_); ReturnValue_t initialize() override; diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index 6231fe78..adcb82bb 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -46,7 +46,8 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) { if (cfg.addSyrlinksDummies) { new SyrlinksDummy(objects::SYRLINKS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); } - new ImtqDummy(objects::IMTQ_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + auto* imtqDummy = new ImtqDummy(objects::IMTQ_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + imtqDummy->setUpThermalModule(ThermalStateCfg()); if (cfg.addPowerDummies) { new AcuDummy(objects::ACU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); new PduDummy(objects::PDU1_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); diff --git a/fsfw b/fsfw index 6ce80ea6..1841f929 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 6ce80ea6c5b7621876422d2c7614096cbca6f302 +Subproject commit 1841f929442d7945fd0c9401de4accc72031003d diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 8915071e..9ff3b7d8 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -21,7 +21,7 @@ ThermalController::ThermalController(object_id_t objectId, HeaterHandler& heater sensorTemperatures(this), susTemperatures(this), deviceTemperatures(this), - imtqThermalSet(objects::IMTQ_HANDLER), + imtqThermalSet(objects::IMTQ_HANDLER, ThermalStateCfg()), max31865Set0(objects::RTD_0_IC3_PLOC_HEATSPREADER, EiveMax31855::RtdCommands::EXCHANGE_SET_ID), max31865Set1(objects::RTD_1_IC4_PLOC_MISSIONBOARD, From 29eda50e35527ed65d88121e2716b2fbcdb8ff06 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 9 Feb 2023 17:23:30 +0100 Subject: [PATCH 243/330] EM compiles --- bsp_q7s/core/ObjectFactory.cpp | 2 +- bsp_q7s/em/emObjectFactory.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 0c0701ad..448c0e09 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -926,7 +926,7 @@ void ObjectFactory::createImtqComponents(PowerSwitchIF* pwrSwitcher) { I2cCookie* imtqI2cCookie = new I2cCookie(addresses::IMTQ, IMTQ::MAX_REPLY_SIZE, q7s::I2C_PL_EIVE); auto imtqHandler = new ImtqHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie, pcdu::Switches::PDU1_CH3_MGT_5V); - imtqHandler->setThermalStateRequestPoolIds(); + imtqHandler->setUpThermalModule(ThermalStateCfg()); imtqHandler->setPowerSwitcher(pwrSwitcher); imtqHandler->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); static_cast(imtqHandler); diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 1627a858..1a838b17 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -112,6 +112,8 @@ void ObjectFactory::produce(void* args) { pcdu::Switches::PDU1_CH5_SOLAR_CELL_EXP_5V); #endif createAcsController(true); - createThermalController(); + HeaterHandler* heaterHandler = nullptr; + ObjectFactory::createGenericHeaterComponents(*gpioComIF, *pwrSwitcher, heaterHandler); + createThermalController(*heaterHandler); satsystem::com::init(); } From a3eaace4a55504e3a6dc13b933031e3e1b13963b Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 9 Feb 2023 17:31:26 +0100 Subject: [PATCH 244/330] added RwSpeedActuationSets to AcsController --- mission/controller/AcsController.cpp | 51 ++++++++++++++++++++++++++-- mission/controller/AcsController.h | 8 ++++- 2 files changed, 56 insertions(+), 3 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 1b4f54a9..bee21d71 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -189,8 +189,23 @@ void AcsController::performSafe() { // PoolReadGuard pg(&dipoleSet); // MutexGuard mg(torquer::lazyLock()); // torquer::NEW_ACTUATION_FLAG = true; - // dipoleSet.setDipoles(cmdDipolUnits[0], cmdDipolUnits[1], cmdDipolUnits[2], - // torqueDuration); + // dipoleSet.setDipoles(dipolCmdUnits[0], dipolCmdUnits[1], dipolCmdUnits[2], 0); + // } + // { + // PoolReadGuard pg(&rw1SpeedSet); + // rw1SpeedSet.setRwSpeed(0); + // } + // { + // PoolReadGuard pg(&rw2SpeedSet); + // rw2SpeedSet.setRwSpeed(0); + // } + // { + // PoolReadGuard pg(&rw3SpeedSet); + // rw3SpeedSet.setRwSpeed(0); + // } + // { + // PoolReadGuard pg(&rw4SpeedSet); + // rw4SpeedSet.setRwSpeed(0); // } } @@ -251,6 +266,22 @@ void AcsController::performDetumble() { // dipoleSet.setDipoles(cmdDipolUnitsInt[0], cmdDipolUnitsInt[1], cmdDipolUnitsInt[2], // torqueDuration); // } + // { + // PoolReadGuard pg(&rw1SpeedSet); + // rw1SpeedSet.setRwSpeed(0); + // } + // { + // PoolReadGuard pg(&rw2SpeedSet); + // rw2SpeedSet.setRwSpeed(0); + // } + // { + // PoolReadGuard pg(&rw3SpeedSet); + // rw3SpeedSet.setRwSpeed(0); + // } + // { + // PoolReadGuard pg(&rw4SpeedSet); + // rw4SpeedSet.setRwSpeed(0); + // } } void AcsController::performPointingCtrl() { @@ -431,6 +462,22 @@ void AcsController::performPointingCtrl() { // dipoleSet.setDipoles(cmdDipolUnitsInt[0], cmdDipolUnitsInt[1], cmdDipolUnitsInt[2], // torqueDuration); // } + // { + // PoolReadGuard pg(&rw1SpeedSet); + // rw1SpeedSet.setRwSpeed(cmdRwSpeedInt[0]); + // } + // { + // PoolReadGuard pg(&rw2SpeedSet); + // rw2SpeedSet.setRwSpeed(cmdRwSpeedInt[1]); + // } + // { + // PoolReadGuard pg(&rw3SpeedSet); + // rw3SpeedSet.setRwSpeed(cmdRwSpeedInt[2]); + // } + // { + // PoolReadGuard pg(&rw4SpeedSet); + // rw4SpeedSet.setRwSpeed(cmdRwSpeedInt[3]); + // } } ReturnValue_t AcsController::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index 1e017099..d427bd5b 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -17,6 +17,7 @@ #include "eive/objects.h" #include "fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h" #include "fsfw_hal/devicehandlers/MgmRM3100Handler.h" +#include "mission/devices/devicedefinitions/RwDefinitions.h" #include "mission/devices/devicedefinitions/SusDefinitions.h" #include "mission/devices/devicedefinitions/imtqHandlerDefinitions.h" @@ -72,8 +73,13 @@ class AcsController : public ExtendedControllerBase, public ReceivesParameterMes /* ACS Sensor Values */ ACS::SensorValues sensorValues; - /* ACS Datasets */ + /* ACS Actuation Datasets */ IMTQ::DipoleActuationSet dipoleSet = IMTQ::DipoleActuationSet(objects::IMTQ_HANDLER); + RwDefinitions::RwSpeedActuationSet rw1SpeedSet = RwDefinitions::RwSpeedActuationSet(objects::RW1); + RwDefinitions::RwSpeedActuationSet rw2SpeedSet = RwDefinitions::RwSpeedActuationSet(objects::RW2); + RwDefinitions::RwSpeedActuationSet rw3SpeedSet = RwDefinitions::RwSpeedActuationSet(objects::RW3); + RwDefinitions::RwSpeedActuationSet rw4SpeedSet = RwDefinitions::RwSpeedActuationSet(objects::RW4); + /* ACS Datasets */ // MGMs acsctrl::MgmDataRaw mgmDataRaw; PoolEntry mgm0VecRaw = PoolEntry(3); From 4bb802362babdb4321dcca62ec2841b0b1319d8f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 9 Feb 2023 17:32:40 +0100 Subject: [PATCH 245/330] disable thermal ctrl loop, throws too many useless events --- bsp_hosted/scheduling.cpp | 9 ++-- mission/controller/ThermalController.cpp | 52 +++++++++++++----------- mission/controller/ThermalController.h | 1 + 3 files changed, 33 insertions(+), 29 deletions(-) diff --git a/bsp_hosted/scheduling.cpp b/bsp_hosted/scheduling.cpp index cb97a27f..843b2892 100644 --- a/bsp_hosted/scheduling.cpp +++ b/bsp_hosted/scheduling.cpp @@ -154,11 +154,10 @@ void scheduling::initTasks() { scheduling::printAddObjectError("Core controller dummy", objects::CORE_CONTROLLER); } - // Disabled until more stable - // result = thermalTask->addComponent(objects::THERMAL_CONTROLLER); - // if (result != returnvalue::OK) { - // scheduling::printAddObjectError("THERMAL_CONTROLLER", objects::THERMAL_CONTROLLER); - // } + result = thermalTask->addComponent(objects::THERMAL_CONTROLLER); + if (result != returnvalue::OK) { + scheduling::printAddObjectError("THERMAL_CONTROLLER", objects::THERMAL_CONTROLLER); + } FixedTimeslotTaskIF* pstTask = factory->createFixedTimeslotTask( "DUMMY_PST", 75, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.5, missedDeadlineFunc); diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 9ff3b7d8..947119ad 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -109,30 +109,7 @@ void ThermalController::performControlOperation() { deviceTemperatures.commit(); } - ctrlCameraBody(); - ctrlAcsBoard(); - ctrlMgt(); - ctrlRw(); - ctrlStr(); - ctrlIfBoard(); - ctrlAcsBoard(); - ctrlObc(); - ctrlObcIfBoard(); - ctrlSBandTransceiver(); - ctrlPcduP60Board(); - ctrlPcduAcu(); - ctrlPcduPdu(); - ctrlPlPcduBoard(); - ctrlPlocMissionBoard(); - ctrlPlocProcessingBoard(); - ctrlDac(); - - ctrlDro(); - ctrlX8(); - ctrlHpa(); - ctrlTx(); - ctrlMpa(); - ctrlScexBoard(); + //performThermalModuleCtrl(); } ReturnValue_t ThermalController::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, @@ -1338,6 +1315,33 @@ void ThermalController::ctrlHpa() { } } +void ThermalController::performThermalModuleCtrl() { + ctrlCameraBody(); + ctrlAcsBoard(); + ctrlMgt(); + ctrlRw(); + ctrlStr(); + ctrlIfBoard(); + ctrlAcsBoard(); + ctrlObc(); + ctrlObcIfBoard(); + ctrlSBandTransceiver(); + ctrlPcduP60Board(); + ctrlPcduAcu(); + ctrlPcduPdu(); + ctrlPlPcduBoard(); + ctrlPlocMissionBoard(); + ctrlPlocProcessingBoard(); + ctrlDac(); + + ctrlDro(); + ctrlX8(); + ctrlHpa(); + ctrlTx(); + ctrlMpa(); + ctrlScexBoard(); +} + void ThermalController::ctrlScexBoard() { sensors[0].first = sensorTemperatures.sensor_scex.isValid(); sensors[0].second = sensorTemperatures.sensor_scex.value; diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 79ef4a95..03c7954c 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -44,6 +44,7 @@ class ThermalController : public ExtendedControllerBase { ReturnValue_t initialize() override; protected: + void performThermalModuleCtrl(); ReturnValue_t handleCommandMessage(CommandMessage* message) override; void performControlOperation() override; ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, From 51629da4a068e1aad1364692a339048e64accc49 Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 9 Feb 2023 17:55:20 +0100 Subject: [PATCH 246/330] naming fixes --- mission/devices/devicedefinitions/RwDefinitions.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mission/devices/devicedefinitions/RwDefinitions.h b/mission/devices/devicedefinitions/RwDefinitions.h index 4016b23c..a4e8e96d 100644 --- a/mission/devices/devicedefinitions/RwDefinitions.h +++ b/mission/devices/devicedefinitions/RwDefinitions.h @@ -82,7 +82,7 @@ enum SetIds : uint32_t { STATUS_SET_ID = GET_RW_STATUS, LAST_RESET_ID = GET_LAST_RESET_STATUS, TM_SET_ID = GET_TM, - RW_SPEED = 10, + SPEED_CMD_SET = 10, }; static const size_t SIZE_GET_RESET_STATUS = 5; @@ -204,13 +204,13 @@ class TmDataset : public StaticLocalDataSet { }; class RwSpeedActuationSet : StaticLocalDataSet<4> { - friend class ::RwHandler; + friend class RwHandler; public: RwSpeedActuationSet(HasLocalDataPoolIF& owner) - : StaticLocalDataSet(&owner, RwDefinitions::SetIds::RW_SPEED) {} + : StaticLocalDataSet(&owner, RwDefinitions::SetIds::SPEED_CMD_SET) {} RwSpeedActuationSet(object_id_t objectId) - : StaticLocalDataSet(sid_t(objectId, RwDefinitions::SetIds::RW_SPEED)) {} + : StaticLocalDataSet(sid_t(objectId, RwDefinitions::SetIds::SPEED_CMD_SET)) {} void setRwSpeed(int32_t rwSpeed_) { if (rwSpeed.value != rwSpeed_) { @@ -221,7 +221,8 @@ class RwSpeedActuationSet : StaticLocalDataSet<4> { void getRwSpeed(int32_t& rwSpeed_) { rwSpeed_ = rwSpeed.value; } private: - lp_var_t rwSpeed = lp_var_t(sid.objectId, RW_SPEED, this); + lp_var_t rwSpeed = + lp_var_t(sid.objectId, RwDefinitions::PoolIds::RW_SPEED, this); }; } // namespace RwDefinitions From ea7b43234e7f27660f2d8b8d401c0217d314cab5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 9 Feb 2023 17:56:20 +0100 Subject: [PATCH 247/330] gps bugfix --- CHANGELOG.md | 5 ++++ generators/.run/all.run.xml | 24 ++++++++++++++++++++ linux/devices/GpsHyperionLinuxController.cpp | 1 + 3 files changed, 30 insertions(+) create mode 100644 generators/.run/all.run.xml diff --git a/CHANGELOG.md b/CHANGELOG.md index d92d6113..f63fbafe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,11 @@ change warranting a new major release: - Reworked dummy handling for the TCS controller. - Generator scripts now generate files for hosted and for Q7S build. +## Fixed + +- GPS Controller: Set fix value to 0 when switching off to allow + `GPS_FIX_CHANGE` to work when switching the GPS back on. + # [v1.26.2] 2023-02-08 ## Changed diff --git a/generators/.run/all.run.xml b/generators/.run/all.run.xml new file mode 100644 index 00000000..089f02d0 --- /dev/null +++ b/generators/.run/all.run.xml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/linux/devices/GpsHyperionLinuxController.cpp b/linux/devices/GpsHyperionLinuxController.cpp index d3f1f868..afc76fcf 100644 --- a/linux/devices/GpsHyperionLinuxController.cpp +++ b/linux/devices/GpsHyperionLinuxController.cpp @@ -47,6 +47,7 @@ ReturnValue_t GpsHyperionLinuxController::checkModeCommand(Mode_t mode, Submode_ gpsSet.setValidity(false, true); // There can't be a fix with a device that is off. triggerEvent(GpsHyperion::GPS_FIX_CHANGE, gpsSet.fixMode.value, 0); + gpsSet.fixMode.value = 0; oneShotSwitches.reset(); modeCommanded = false; } From 99e5d3bb03968a07cdc2b85c7e0ebb62ff0dab01 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 9 Feb 2023 18:01:55 +0100 Subject: [PATCH 248/330] prep v1.27.0 --- CHANGELOG.md | 4 ++++ CMakeLists.txt | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f63fbafe..8d322221 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ change warranting a new major release: # [unreleased] +# [v1.27.0] 2023-02-09 + +eive-tmtc: v2.12.2 + ## Added - First version of a TCS controller heater control loop. diff --git a/CMakeLists.txt b/CMakeLists.txt index a221f578..60b4bf0b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,8 +10,8 @@ cmake_minimum_required(VERSION 3.13) set(OBSW_VERSION_MAJOR 1) -set(OBSW_VERSION_MINOR 26) -set(OBSW_VERSION_REVISION 2) +set(OBSW_VERSION_MINOR 27) +set(OBSW_VERSION_REVISION 0) # set(CMAKE_VERBOSE TRUE) From bcec465f9a7f51540d69bf64ea3f46b6dee3d13d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 9 Feb 2023 18:03:37 +0100 Subject: [PATCH 249/330] prev v1.26.3 --- CHANGELOG.md | 5 +++-- CMakeLists.txt | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d322221..18f99dff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,13 +17,14 @@ change warranting a new major release: # [unreleased] -# [v1.27.0] 2023-02-09 +# [v1.26.3] 2023-02-09 eive-tmtc: v2.12.2 ## Added -- First version of a TCS controller heater control loop. +- First version of a TCS controller heater control loop, but + the loop is disabled for now. ## Changed diff --git a/CMakeLists.txt b/CMakeLists.txt index 60b4bf0b..f52bc9f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,8 +10,8 @@ cmake_minimum_required(VERSION 3.13) set(OBSW_VERSION_MAJOR 1) -set(OBSW_VERSION_MINOR 27) -set(OBSW_VERSION_REVISION 0) +set(OBSW_VERSION_MINOR 26) +set(OBSW_VERSION_REVISION 3) # set(CMAKE_VERBOSE TRUE) From 57aab39b8b470107b67ec45a86c441c2d136d5aa Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 9 Feb 2023 18:13:02 +0100 Subject: [PATCH 250/330] bump fsfw --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 1841f929..f4d188c3 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 1841f929442d7945fd0c9401de4accc72031003d +Subproject commit f4d188c36f0f08c94d678048a979261d373e7642 From 22fdb6994a8101a890b77d6900fdde7065faee8e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 9 Feb 2023 18:14:12 +0100 Subject: [PATCH 251/330] bump fsfw --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index f4d188c3..820a7f05 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit f4d188c36f0f08c94d678048a979261d373e7642 +Subproject commit 820a7f059c05d4b2f2012536bfe9482c1625961d From c5e856aaa62d1f1714a9bb86ddfdac93b8f54e9b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 9 Feb 2023 18:26:02 +0100 Subject: [PATCH 252/330] bump fsfw again --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 820a7f05..e4fd424d 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 820a7f059c05d4b2f2012536bfe9482c1625961d +Subproject commit e4fd424d66e3e6972418aa89184af867d9ce6588 From d73946e005f975c2d0e7efa4d8c64bad5b44db97 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 9 Feb 2023 18:31:56 +0100 Subject: [PATCH 253/330] bump fsfw for typo fix --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index e4fd424d..14a92b3d 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit e4fd424d66e3e6972418aa89184af867d9ce6588 +Subproject commit 14a92b3d89e37d50ccd46b250826cac293185d68 From 9dfd8491d26aee8b619818c3883da58e104afdb6 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 10 Feb 2023 10:25:13 +0100 Subject: [PATCH 254/330] added rampTime and torqueDuration to AcsParameters --- mission/controller/acs/AcsParameters.cpp | 5 +++++ mission/controller/acs/AcsParameters.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/mission/controller/acs/AcsParameters.cpp b/mission/controller/acs/AcsParameters.cpp index 13642fe9..30264963 100644 --- a/mission/controller/acs/AcsParameters.cpp +++ b/mission/controller/acs/AcsParameters.cpp @@ -278,6 +278,8 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, case 0x4: parameterWrapper->set(rwHandlingParameters.stictionTorque); break; + case 0x5: + parameterWrapper->set(rwHandlingParameters.rampTime); default: return INVALID_IDENTIFIER_ID; } @@ -584,6 +586,9 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, case 0x5: parameterWrapper->set(magnetorquesParameter.DipolMax); break; + case 0x6: + parameterWrapper->set(magnetorquesParameter.torqueDuration); + break; default: return INVALID_IDENTIFIER_ID; } diff --git a/mission/controller/acs/AcsParameters.h b/mission/controller/acs/AcsParameters.h index f1c0fb63..35e316f1 100644 --- a/mission/controller/acs/AcsParameters.h +++ b/mission/controller/acs/AcsParameters.h @@ -792,6 +792,8 @@ class AcsParameters : public HasParametersIF { double stictionSpeed = 100; // 80; // RPM double stictionReleaseSpeed = 120; // RPM double stictionTorque = 0.0006; + + uint16_t rampTime = 10; } rwHandlingParameters; struct RwMatrices { @@ -910,6 +912,7 @@ class AcsParameters : public HasParametersIF { double inverseAlignment[3][3] = {{0, -1, 0}, {0, 0, 1}, {-1, 0, 0}}; double DipolMax = 0.2; // [Am^2] + uint16_t torqueDuration = 300; // [ms] } magnetorquesParameter; struct DetumbleParameter { From 9041a3376c18cae282a1afcfbcd39c3ef3b09c47 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 10 Feb 2023 10:56:50 +0100 Subject: [PATCH 255/330] ActuatorCmd now output their solutions as integers as expected by the sensors --- mission/controller/acs/ActuatorCmd.cpp | 27 +++++++++++++++++--------- mission/controller/acs/ActuatorCmd.h | 6 +++--- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/mission/controller/acs/ActuatorCmd.cpp b/mission/controller/acs/ActuatorCmd.cpp index 4e0052e0..cbe24e5b 100644 --- a/mission/controller/acs/ActuatorCmd.cpp +++ b/mission/controller/acs/ActuatorCmd.cpp @@ -38,27 +38,32 @@ void ActuatorCmd::scalingTorqueRws(const double *rwTrq, double *rwTrqScaled) { } } -void ActuatorCmd::cmdSpeedToRws(const int32_t *speedRw0, const int32_t *speedRw1, - const int32_t *speedRw2, const int32_t *speedRw3, - const double *rwTorque, double *rwCmdSpeed) { +void ActuatorCmd::cmdSpeedToRws(const int32_t speedRw0, const int32_t speedRw1, + const int32_t speedRw2, const int32_t speedRw3, + const double *rwTorque, int32_t *rwCmdSpeed) { using namespace Math; // Calculating the commanded speed in RPM for every reaction wheel - double speedRws[4] = {(double)*speedRw0, (double)*speedRw1, (double)*speedRw2, (double)*speedRw3}; + int32_t speedRws[4] = {speedRw0, speedRw1, speedRw2, speedRw3}; double deltaSpeed[4] = {0, 0, 0, 0}; double commandTime = acsParameters.onBoardParams.sampleTime, inertiaWheel = acsParameters.rwHandlingParameters.inertiaWheel; double radToRpm = 60 / (2 * PI); // factor for conversion to RPM // W_RW = Torque_RW / I_RW * delta t [rad/s] double factor = commandTime / inertiaWheel * radToRpm; + int32_t deltaSpeedInt[4] = {0, 0, 0, 0}; VectorOperations::mulScalar(rwTorque, factor, deltaSpeed, 4); - VectorOperations::add(speedRws, deltaSpeed, rwCmdSpeed, 4); + for (int i = 0; i < 4; i++) { + deltaSpeedInt[i] = std::round(deltaSpeed[i]); + } + VectorOperations::add(speedRws, deltaSpeedInt, rwCmdSpeed, 4); } -void ActuatorCmd::cmdDipolMtq(const double *dipolMoment, double *dipolMomentActuator) { +void ActuatorCmd::cmdDipolMtq(const double *dipolMoment, int16_t *dipolMomentActuator) { // Convert to actuator frame + double dipolMomentActuatorDouble[3] = {0, 0, 0}; MatrixOperations::multiply(*acsParameters.magnetorquesParameter.inverseAlignment, - dipolMoment, dipolMomentActuator, 3, 3, 1); + dipolMoment, dipolMomentActuatorDouble, 3, 3, 1); // Scaling along largest element if dipol exceeds maximum double maxDipol = acsParameters.magnetorquesParameter.DipolMax; double maxValue = 0; @@ -69,8 +74,12 @@ void ActuatorCmd::cmdDipolMtq(const double *dipolMoment, double *dipolMomentActu } if (maxValue > maxDipol) { double scalingFactor = maxDipol / maxValue; - VectorOperations::mulScalar(dipolMomentActuator, scalingFactor, dipolMomentActuator, 3); + VectorOperations::mulScalar(dipolMomentActuatorDouble, scalingFactor, + dipolMomentActuatorDouble, 3); } // scale dipole from 1 Am^2 to 1e^-4 Am^2 - VectorOperations::mulScalar(dipolMomentActuator, 1e4, dipolMomentActuator, 3); + VectorOperations::mulScalar(dipolMomentActuatorDouble, 1e4, dipolMomentActuatorDouble, 3); + for (int i = 0; i < 3; i++) { + dipolMomentActuator[i] = std::round(dipolMomentActuatorDouble[i]); + } } diff --git a/mission/controller/acs/ActuatorCmd.h b/mission/controller/acs/ActuatorCmd.h index 04e2b61f..969bd782 100644 --- a/mission/controller/acs/ActuatorCmd.h +++ b/mission/controller/acs/ActuatorCmd.h @@ -28,8 +28,8 @@ class ActuatorCmd { * rwCmdSpeed output revolutions per minute for every * reaction wheel */ - void cmdSpeedToRws(const int32_t *speedRw0, const int32_t *speedRw1, const int32_t *speedRw2, - const int32_t *speedRw3, const double *rwTorque, double *rwCmdSpeed); + void cmdSpeedToRws(const int32_t speedRw0, const int32_t speedRw1, const int32_t speedRw2, + const int32_t speedRw3, const double *rwTorque, int32_t *rwCmdSpeed); /* * @brief: cmdDipolMtq() gives the commanded dipol moment for the magnetorques @@ -37,7 +37,7 @@ class ActuatorCmd { * @param: dipolMoment given dipol moment in spacecraft frame * dipolMomentActuator resulting dipol moment in actuator reference frame */ - void cmdDipolMtq(const double *dipolMoment, double *dipolMomentActuator); + void cmdDipolMtq(const double *dipolMoment, int16_t *dipolMomentActuator); protected: private: From c2079dcbbad994877c3dc3a638c25ea325699f0d Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 10 Feb 2023 11:26:46 +0100 Subject: [PATCH 256/330] added rampTime and made dataSet public --- .../devices/devicedefinitions/RwDefinitions.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/mission/devices/devicedefinitions/RwDefinitions.h b/mission/devices/devicedefinitions/RwDefinitions.h index a4e8e96d..b3cb0fe4 100644 --- a/mission/devices/devicedefinitions/RwDefinitions.h +++ b/mission/devices/devicedefinitions/RwDefinitions.h @@ -54,6 +54,7 @@ enum PoolIds : lp_id_t { SPI_TOTAL_ERRORS, RW_SPEED, + RAMP_TIME, }; enum States : uint8_t { STATE_ERROR, IDLE, COASTING, RUNNING_SPEED_STABLE, RUNNING_SPEED_CHANGING }; @@ -203,7 +204,7 @@ class TmDataset : public StaticLocalDataSet { lp_var_t(sid.objectId, PoolIds::SPI_TOTAL_ERRORS, this); }; -class RwSpeedActuationSet : StaticLocalDataSet<4> { +class RwSpeedActuationSet : public StaticLocalDataSet<2> { friend class RwHandler; public: @@ -212,17 +213,25 @@ class RwSpeedActuationSet : StaticLocalDataSet<4> { RwSpeedActuationSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, RwDefinitions::SetIds::SPEED_CMD_SET)) {} - void setRwSpeed(int32_t rwSpeed_) { + void setRwSpeed(int32_t rwSpeed_, uint16_t rampTime_) { if (rwSpeed.value != rwSpeed_) { + rwSpeed = rwSpeed_; + } + if (rampTime.value != rampTime_) { + rampTime = rampTime_; } - rwSpeed = rwSpeed_; } - void getRwSpeed(int32_t& rwSpeed_) { rwSpeed_ = rwSpeed.value; } + void getRwSpeed(int32_t& rwSpeed_, uint16_t& rampTime_) { + rwSpeed_ = rwSpeed.value; + rampTime_ = rampTime.value; + } private: lp_var_t rwSpeed = lp_var_t(sid.objectId, RwDefinitions::PoolIds::RW_SPEED, this); + lp_var_t rampTime = + lp_var_t(sid.objectId, RwDefinitions::PoolIds::RAMP_TIME, this); }; } // namespace RwDefinitions From 01d6060111ee96cedc8e40e3368aae3414a38562 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 10 Feb 2023 11:27:02 +0100 Subject: [PATCH 257/330] added ramp time --- mission/devices/RwHandler.cpp | 1 + mission/devices/RwHandler.h | 1 + 2 files changed, 2 insertions(+) diff --git a/mission/devices/RwHandler.cpp b/mission/devices/RwHandler.cpp index d859f9d0..e9383c4a 100644 --- a/mission/devices/RwHandler.cpp +++ b/mission/devices/RwHandler.cpp @@ -244,6 +244,7 @@ uint32_t RwHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { retur ReturnValue_t RwHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) { localDataPoolMap.emplace(RwDefinitions::RW_SPEED, &rwSpeed); + localDataPoolMap.emplace(RwDefinitions::RAMP_TIME, &rampTime); localDataPoolMap.emplace(RwDefinitions::TEMPERATURE_C, new PoolEntry({0})); diff --git a/mission/devices/RwHandler.h b/mission/devices/RwHandler.h index 43deb579..17f2b396 100644 --- a/mission/devices/RwHandler.h +++ b/mission/devices/RwHandler.h @@ -97,6 +97,7 @@ class RwHandler : public DeviceHandlerBase { uint8_t commandBuffer[RwDefinitions::MAX_CMD_SIZE]; PoolEntry rwSpeed = PoolEntry(0, false); + PoolEntry rampTime = PoolEntry(10, false); enum class InternalState { GET_RESET_STATUS, CLEAR_RESET_STATUS, READ_TEMPERATURE, GET_RW_SATUS }; From ea32d87c25955912be952335696348cb003b659a Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 10 Feb 2023 11:27:25 +0100 Subject: [PATCH 258/330] function now handles actuator cmd --- mission/controller/AcsController.cpp | 163 ++++++++++----------------- mission/controller/AcsController.h | 4 + 2 files changed, 66 insertions(+), 101 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index bee21d71..29bd06b6 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -116,10 +116,10 @@ void AcsController::performSafe() { navigation.useMekf(&sensorValues, &gyrDataProcessed, &mgmDataProcessed, &susDataProcessed, &mekfData, &validMekf); - // Give desired satellite rate and sun direction to align + // give desired satellite rate and sun direction to align double satRateSafe[3] = {0, 0, 0}, sunTargetDir[3] = {0, 0, 0}; guidance.getTargetParamsSafe(sunTargetDir, satRateSafe); - // IF MEKF is working + // if MEKF is working double magMomMtq[3] = {0, 0, 0}, errAng = 0.0; bool magMomMtqValid = false; if (validMekf == returnvalue::OK) { @@ -137,8 +137,8 @@ void AcsController::performSafe() { sunTargetDir, satRateSafe, &errAng, magMomMtq, &magMomMtqValid); } - double dipolCmdUnits[3] = {0, 0, 0}; - actuatorCmd.cmdDipolMtq(magMomMtq, dipolCmdUnits); + int16_t cmdDipolMtqs[3] = {0, 0, 0}; + actuatorCmd.cmdDipolMtq(magMomMtq, cmdDipolMtqs); { PoolReadGuard pg(&ctrlValData); @@ -180,33 +180,15 @@ void AcsController::performSafe() { actuatorCmdData.rwTargetTorque.setValid(false); std::memcpy(actuatorCmdData.rwTargetSpeed.value, zeroVec, 4 * sizeof(int32_t)); actuatorCmdData.rwTargetSpeed.setValid(false); - std::memcpy(actuatorCmdData.mtqTargetDipole.value, dipolCmdUnits, 3 * sizeof(int16_t)); + std::memcpy(actuatorCmdData.mtqTargetDipole.value, cmdDipolMtqs, 3 * sizeof(int16_t)); actuatorCmdData.mtqTargetDipole.setValid(true); actuatorCmdData.setValidity(true, false); } } - // { - // PoolReadGuard pg(&dipoleSet); - // MutexGuard mg(torquer::lazyLock()); - // torquer::NEW_ACTUATION_FLAG = true; - // dipoleSet.setDipoles(dipolCmdUnits[0], dipolCmdUnits[1], dipolCmdUnits[2], 0); - // } - // { - // PoolReadGuard pg(&rw1SpeedSet); - // rw1SpeedSet.setRwSpeed(0); - // } - // { - // PoolReadGuard pg(&rw2SpeedSet); - // rw2SpeedSet.setRwSpeed(0); - // } - // { - // PoolReadGuard pg(&rw3SpeedSet); - // rw3SpeedSet.setRwSpeed(0); - // } - // { - // PoolReadGuard pg(&rw4SpeedSet); - // rw4SpeedSet.setRwSpeed(0); - // } + + commandActuators(cmdDipolMtqs[0], cmdDipolMtqs[1], cmdDipolMtqs[2], + acsParameters.magnetorquesParameter.torqueDuration, 0, 0, 0, 0, + acsParameters.rwHandlingParameters.rampTime); } void AcsController::performDetumble() { @@ -223,8 +205,8 @@ void AcsController::performDetumble() { detumble.bDotLaw(mgmDataProcessed.mgmVecTotDerivative.value, mgmDataProcessed.mgmVecTotDerivative.isValid(), mgmDataProcessed.mgmVecTot.value, mgmDataProcessed.mgmVecTot.isValid(), magMomMtq); - double dipolCmdUnits[3] = {0, 0, 0}; - actuatorCmd.cmdDipolMtq(magMomMtq, dipolCmdUnits); + int16_t cmdDipolMtqs[3] = {0, 0, 0}; + actuatorCmd.cmdDipolMtq(magMomMtq, cmdDipolMtqs); if (mekfData.satRotRateMekf.isValid() && VectorOperations::norm(mekfData.satRotRateMekf.value, 3) < @@ -243,10 +225,6 @@ void AcsController::performDetumble() { triggerEvent(acs::SAFE_RATE_RECOVERY); } - int16_t cmdDipolUnitsInt[3] = {0, 0, 0}; - for (int i = 0; i < 3; ++i) { - cmdDipolUnitsInt[i] = std::round(dipolCmdUnits[i]); - } { PoolReadGuard pg(&actuatorCmdData); if (pg.getReadResult() == returnvalue::OK) { @@ -254,34 +232,15 @@ void AcsController::performDetumble() { actuatorCmdData.rwTargetTorque.setValid(false); std::memset(actuatorCmdData.rwTargetSpeed.value, 0, 4 * sizeof(int32_t)); actuatorCmdData.rwTargetSpeed.setValid(false); - std::memcpy(actuatorCmdData.mtqTargetDipole.value, cmdDipolUnitsInt, 3 * sizeof(int16_t)); + std::memcpy(actuatorCmdData.mtqTargetDipole.value, cmdDipolMtqs, 3 * sizeof(int16_t)); actuatorCmdData.mtqTargetDipole.setValid(true); actuatorCmdData.setValidity(true, false); } } - // { - // PoolReadGuard pg(&dipoleSet); - // MutexGuard mg(torquer::lazyLock()); - // torquer::NEW_ACTUATION_FLAG = true; - // dipoleSet.setDipoles(cmdDipolUnitsInt[0], cmdDipolUnitsInt[1], cmdDipolUnitsInt[2], - // torqueDuration); - // } - // { - // PoolReadGuard pg(&rw1SpeedSet); - // rw1SpeedSet.setRwSpeed(0); - // } - // { - // PoolReadGuard pg(&rw2SpeedSet); - // rw2SpeedSet.setRwSpeed(0); - // } - // { - // PoolReadGuard pg(&rw3SpeedSet); - // rw3SpeedSet.setRwSpeed(0); - // } - // { - // PoolReadGuard pg(&rw4SpeedSet); - // rw4SpeedSet.setRwSpeed(0); - // } + + commandActuators(cmdDipolMtqs[0], cmdDipolMtqs[1], cmdDipolMtqs[2], + acsParameters.magnetorquesParameter.torqueDuration, 0, 0, 0, 0, + acsParameters.rwHandlingParameters.rampTime); } void AcsController::performPointingCtrl() { @@ -304,7 +263,7 @@ void AcsController::performPointingCtrl() { guidance.getDistributionMatrixRw(&sensorValues, *rwPseudoInv); double torquePtgRws[4] = {0, 0, 0, 0}, rwTrqNs[4] = {0, 0, 0, 0}; double torqueRws[4] = {0, 0, 0, 0}, torqueRwsScaled[4] = {0, 0, 0, 0}; - double mgtDpDes[3] = {0, 0, 0}, dipolUnits[3] = {0, 0, 0}; // Desaturation Dipol + double mgtDpDes[3] = {0, 0, 0}; switch (submode) { case acs::PTG_IDLE: @@ -424,60 +383,62 @@ void AcsController::performPointingCtrl() { if (enableAntiStiction) { bool rwAvailable[4] = {true, true, true, true}; // WHICH INPUT SENSOR SET? - int32_t rwSpeed[4] = { - (sensorValues.rw1Set.currSpeed.value), (sensorValues.rw2Set.currSpeed.value), - (sensorValues.rw3Set.currSpeed.value), (sensorValues.rw4Set.currSpeed.value)}; + int32_t rwSpeed[4] = {sensorValues.rw1Set.currSpeed.value, sensorValues.rw2Set.currSpeed.value, + sensorValues.rw3Set.currSpeed.value, sensorValues.rw4Set.currSpeed.value}; ptgCtrl.rwAntistiction(rwAvailable, rwSpeed, torqueRwsScaled); } - double cmdSpeedRws[4] = {0, 0, 0, 0}; // Should be given to the actuator reaction wheel as input - actuatorCmd.cmdSpeedToRws(&(sensorValues.rw1Set.currSpeed.value), - &(sensorValues.rw2Set.currSpeed.value), - &(sensorValues.rw3Set.currSpeed.value), - &(sensorValues.rw4Set.currSpeed.value), torqueRwsScaled, cmdSpeedRws); - actuatorCmd.cmdDipolMtq(mgtDpDes, dipolUnits); - - int16_t cmdDipolUnitsInt[3] = {0, 0, 0}; - for (int i = 0; i < 3; ++i) { - cmdDipolUnitsInt[i] = std::round(dipolUnits[i]); - } - int32_t cmdRwSpeedInt[4] = {0, 0, 0, 0}; - for (int i = 0; i < 4; ++i) { - cmdRwSpeedInt[i] = std::round(cmdSpeedRws[i]); - } + int32_t cmdSpeedRws[4] = {0, 0, 0, 0}; + actuatorCmd.cmdSpeedToRws(sensorValues.rw1Set.currSpeed.value, + sensorValues.rw2Set.currSpeed.value, + sensorValues.rw3Set.currSpeed.value, + sensorValues.rw4Set.currSpeed.value, torqueRwsScaled, cmdSpeedRws); + int16_t cmdDipolMtqs[3] = {0, 0, 0}; + actuatorCmd.cmdDipolMtq(mgtDpDes, cmdDipolMtqs); { PoolReadGuard pg(&actuatorCmdData); if (pg.getReadResult() == returnvalue::OK) { std::memcpy(actuatorCmdData.rwTargetTorque.value, rwTrqNs, 4 * sizeof(double)); - std::memcpy(actuatorCmdData.rwTargetSpeed.value, cmdRwSpeedInt, 4 * sizeof(int32_t)); - std::memcpy(actuatorCmdData.mtqTargetDipole.value, cmdDipolUnitsInt, 3 * sizeof(int16_t)); + std::memcpy(actuatorCmdData.rwTargetSpeed.value, cmdSpeedRws, 4 * sizeof(int32_t)); + std::memcpy(actuatorCmdData.mtqTargetDipole.value, cmdDipolMtqs, 3 * sizeof(int16_t)); actuatorCmdData.setValidity(true, true); } } - // { - // PoolReadGuard pg(&dipoleSet); - // MutexGuard mg(torquer::lazyLock()); - // torquer::NEW_ACTUATION_FLAG = true; - // dipoleSet.setDipoles(cmdDipolUnitsInt[0], cmdDipolUnitsInt[1], cmdDipolUnitsInt[2], - // torqueDuration); - // } - // { - // PoolReadGuard pg(&rw1SpeedSet); - // rw1SpeedSet.setRwSpeed(cmdRwSpeedInt[0]); - // } - // { - // PoolReadGuard pg(&rw2SpeedSet); - // rw2SpeedSet.setRwSpeed(cmdRwSpeedInt[1]); - // } - // { - // PoolReadGuard pg(&rw3SpeedSet); - // rw3SpeedSet.setRwSpeed(cmdRwSpeedInt[2]); - // } - // { - // PoolReadGuard pg(&rw4SpeedSet); - // rw4SpeedSet.setRwSpeed(cmdRwSpeedInt[3]); - // } + + commandActuators(cmdDipolMtqs[0], cmdDipolMtqs[1], cmdDipolMtqs[2], + acsParameters.magnetorquesParameter.torqueDuration, cmdSpeedRws[0], + cmdSpeedRws[1], cmdSpeedRws[2], cmdSpeedRws[3], + acsParameters.rwHandlingParameters.rampTime); +} + +ReturnValue_t AcsController::commandActuators(int16_t xDipole, int16_t yDipole, int16_t zDipole, + uint16_t dipoleTorqueDuration, int32_t rw1Speed, + int32_t rw2Speed, int32_t rw3Speed, int32_t rw4Speed, + uint16_t rampTime) { + { + PoolReadGuard pg(&dipoleSet); + MutexGuard mg(torquer::lazyLock()); + torquer::NEW_ACTUATION_FLAG = true; + dipoleSet.setDipoles(xDipole, yDipole, zDipole, dipoleTorqueDuration); + } + { + PoolReadGuard pg(&rw1SpeedSet); + rw1SpeedSet.setRwSpeed(rw1Speed, rampTime); + } + { + PoolReadGuard pg(&rw2SpeedSet); + rw2SpeedSet.setRwSpeed(rw2Speed, rampTime); + } + { + PoolReadGuard pg(&rw3SpeedSet); + rw3SpeedSet.setRwSpeed(rw3Speed, rampTime); + } + { + PoolReadGuard pg(&rw4SpeedSet); + rw4SpeedSet.setRwSpeed(rw4Speed, rampTime); + } + return returnvalue::OK; } ReturnValue_t AcsController::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index d427bd5b..c79e4426 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -70,6 +70,10 @@ class AcsController : public ExtendedControllerBase, public ReceivesParameterMes void modeChanged(Mode_t mode, Submode_t submode); void announceMode(bool recursive); + ReturnValue_t commandActuators(int16_t xDipole, int16_t yDipole, int16_t zDipole, + uint16_t dipoleTorqueDuration, int32_t rw1Speed, int32_t rw2Speed, + int32_t rw3Speed, int32_t rw4Speed, uint16_t rampTime); + /* ACS Sensor Values */ ACS::SensorValues sensorValues; From 109560feb263f6078fb31db12fde99d9d091ae55 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 10 Feb 2023 11:30:52 +0100 Subject: [PATCH 259/330] disabled actCmd from acsCtrl again for now --- mission/controller/AcsController.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 29bd06b6..7ed66045 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -186,9 +186,9 @@ void AcsController::performSafe() { } } - commandActuators(cmdDipolMtqs[0], cmdDipolMtqs[1], cmdDipolMtqs[2], - acsParameters.magnetorquesParameter.torqueDuration, 0, 0, 0, 0, - acsParameters.rwHandlingParameters.rampTime); + // commandActuators(cmdDipolMtqs[0], cmdDipolMtqs[1], cmdDipolMtqs[2], + // acsParameters.magnetorquesParameter.torqueDuration, 0, 0, 0, 0, + // acsParameters.rwHandlingParameters.rampTime); } void AcsController::performDetumble() { @@ -238,9 +238,9 @@ void AcsController::performDetumble() { } } - commandActuators(cmdDipolMtqs[0], cmdDipolMtqs[1], cmdDipolMtqs[2], - acsParameters.magnetorquesParameter.torqueDuration, 0, 0, 0, 0, - acsParameters.rwHandlingParameters.rampTime); + // commandActuators(cmdDipolMtqs[0], cmdDipolMtqs[1], cmdDipolMtqs[2], + // acsParameters.magnetorquesParameter.torqueDuration, 0, 0, 0, 0, + // acsParameters.rwHandlingParameters.rampTime); } void AcsController::performPointingCtrl() { @@ -406,10 +406,10 @@ void AcsController::performPointingCtrl() { } } - commandActuators(cmdDipolMtqs[0], cmdDipolMtqs[1], cmdDipolMtqs[2], - acsParameters.magnetorquesParameter.torqueDuration, cmdSpeedRws[0], - cmdSpeedRws[1], cmdSpeedRws[2], cmdSpeedRws[3], - acsParameters.rwHandlingParameters.rampTime); + // commandActuators(cmdDipolMtqs[0], cmdDipolMtqs[1], cmdDipolMtqs[2], + // acsParameters.magnetorquesParameter.torqueDuration, cmdSpeedRws[0], + // cmdSpeedRws[1], cmdSpeedRws[2], cmdSpeedRws[3], + // acsParameters.rwHandlingParameters.rampTime); } ReturnValue_t AcsController::commandActuators(int16_t xDipole, int16_t yDipole, int16_t zDipole, From bc4c6c3a5466e66fac8a02e2f2c1245cdd2acd35 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 10 Feb 2023 12:07:45 +0100 Subject: [PATCH 260/330] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d92d6113..1bbc760d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,11 +20,13 @@ change warranting a new major release: ## Added - First version of a TCS controller heater control loop. +- Function for the ACS controller to command MTQ and RWs called by all subroutines ## Changed - Reworked dummy handling for the TCS controller. - Generator scripts now generate files for hosted and for Q7S build. +- ActCmds now returns command vectors as integers as required by the actuators # [v1.26.2] 2023-02-08 From 33684f2ef7eeaba440382d3a5a51dfcd61d5724c Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 10 Feb 2023 12:48:17 +0100 Subject: [PATCH 261/330] fixed imtq setDipoles check --- mission/devices/devicedefinitions/imtqHandlerDefinitions.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mission/devices/devicedefinitions/imtqHandlerDefinitions.h b/mission/devices/devicedefinitions/imtqHandlerDefinitions.h index 2abf1c21..c3bc3d36 100644 --- a/mission/devices/devicedefinitions/imtqHandlerDefinitions.h +++ b/mission/devices/devicedefinitions/imtqHandlerDefinitions.h @@ -492,14 +492,14 @@ class DipoleActuationSet : public StaticLocalDataSet<4> { void setDipoles(int16_t xDipole_, int16_t yDipole_, int16_t zDipole_, uint16_t currentTorqueDurationMs_) { if (xDipole.value != xDipole_) { + xDipole = xDipole_; } - xDipole = xDipole_; if (yDipole.value != yDipole_) { + yDipole = yDipole_; } - yDipole = yDipole_; if (zDipole.value != zDipole_) { + zDipole = zDipole_; } - zDipole = zDipole_; currentTorqueDurationMs = currentTorqueDurationMs_; } From 08df102f3684b880c295a64b374793e84eef87e0 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 10 Feb 2023 13:16:50 +0100 Subject: [PATCH 262/330] rwHandler rwSpeedActuationSet handling --- mission/devices/RwHandler.cpp | 62 +++++++++++++++++++++++------------ mission/devices/RwHandler.h | 12 ++++--- 2 files changed, 49 insertions(+), 25 deletions(-) diff --git a/mission/devices/RwHandler.cpp b/mission/devices/RwHandler.cpp index e9383c4a..7a8b52f3 100644 --- a/mission/devices/RwHandler.cpp +++ b/mission/devices/RwHandler.cpp @@ -13,7 +13,8 @@ RwHandler::RwHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCooki enableGpio(enableGpio), statusSet(this), lastResetStatusSet(this), - tmDataset(this) { + tmDataset(this), + rwSpeedActuationSet(*this) { if (comCookie == nullptr) { sif::error << "RwHandler: Invalid com cookie" << std::endl; } @@ -97,16 +98,36 @@ ReturnValue_t RwHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand return returnvalue::OK; } case (RwDefinitions::SET_SPEED): { - if (commandDataLen != 6) { + if (commandData != nullptr && commandDataLen != 6) { sif::error << "RwHandler::buildCommandFromCommand: Received set speed command with" << " invalid length" << std::endl; return SET_SPEED_COMMAND_INVALID_LENGTH; } - result = checkSpeedAndRampTime(commandData, commandDataLen); + // Commands override anything which was set in the software + if (commandData != nullptr) { + rwSpeedActuationSet.setValidityBufferGeneration(false); + result = rwSpeedActuationSet.deSerialize(&commandData, &commandDataLen, + SerializeIF::Endianness::NETWORK); + rwSpeedActuationSet.setValidityBufferGeneration(true); + if (result != returnvalue::OK) { + return result; + } + } else { + // Read set rw speed value from local pool + PoolReadGuard pg(&rwSpeedActuationSet); + } + if (ACTUATION_WIRETAPPING) { + int32_t speed; + uint16_t rampTime; + rwSpeedActuationSet.getRwSpeed(speed, rampTime); + sif::debug << "Actuating RW with speed = " << speed << " and rampTime = " << rampTime + << std::endl; + } + result = checkSpeedAndRampTime(); if (result != returnvalue::OK) { return result; } - prepareSetSpeedCmd(commandData, commandDataLen); + result = prepareSetSpeedCmd(); return result; } case (RwDefinitions::GET_TEMPERATURE): { @@ -298,17 +319,15 @@ void RwHandler::prepareSimpleCommand(DeviceCommandId_t id) { rawPacketLen = 3; } -ReturnValue_t RwHandler::checkSpeedAndRampTime(const uint8_t* commandData, size_t commandDataLen) { - int32_t speed = - *commandData << 24 | *(commandData + 1) << 16 | *(commandData + 2) << 8 | *(commandData + 3); - +ReturnValue_t RwHandler::checkSpeedAndRampTime() { + int32_t speed = 0; + uint16_t rampTime = 0; + rwSpeedActuationSet.getRwSpeed(speed, rampTime); if ((speed < -65000 || speed > 65000 || (speed > -1000 && speed < 1000)) && (speed != 0)) { sif::error << "RwHandler::checkSpeedAndRampTime: Command has invalid speed" << std::endl; return INVALID_SPEED; } - uint16_t rampTime = (*(commandData + 4) << 8) | *(commandData + 5); - if (rampTime < 10 || rampTime > 20000) { sif::error << "RwHandler::checkSpeedAndRampTime: Command has invalid ramp time" << std::endl; return INVALID_RAMP_TIME; @@ -317,23 +336,24 @@ ReturnValue_t RwHandler::checkSpeedAndRampTime(const uint8_t* commandData, size_ return returnvalue::OK; } -void RwHandler::prepareSetSpeedCmd(const uint8_t* commandData, size_t commandDataLen) { +ReturnValue_t RwHandler::prepareSetSpeedCmd() { commandBuffer[0] = static_cast(RwDefinitions::SET_SPEED); - - /** Speed (0.1 RPM) */ - commandBuffer[1] = *(commandData + 3); - commandBuffer[2] = *(commandData + 2); - commandBuffer[3] = *(commandData + 1); - commandBuffer[4] = *commandData; - /** Ramp time (ms) */ - commandBuffer[5] = *(commandData + 5); - commandBuffer[6] = *(commandData + 4); + uint8_t* serPtr = commandBuffer + 1; + size_t serSize = 1; + rwSpeedActuationSet.setValidityBufferGeneration(false); + ReturnValue_t result = rwSpeedActuationSet.serialize(&serPtr, &serSize, sizeof(commandBuffer), + SerializeIF::Endianness::LITTLE); + rwSpeedActuationSet.setValidityBufferGeneration(true); + if (result != returnvalue::OK) { + return result; + } uint16_t crc = CRC::crc16ccitt(commandBuffer, 7, 0xFFFF); commandBuffer[7] = static_cast(crc & 0xFF); - commandBuffer[8] = static_cast(crc >> 8 & 0xFF); + commandBuffer[8] = static_cast((crc >> 8) & 0xFF); rawPacket = commandBuffer; rawPacketLen = 9; + return result; } void RwHandler::handleResetStatusReply(const uint8_t* packet) { diff --git a/mission/devices/RwHandler.h b/mission/devices/RwHandler.h index 17f2b396..af59caa1 100644 --- a/mission/devices/RwHandler.h +++ b/mission/devices/RwHandler.h @@ -9,6 +9,8 @@ #include "events/subsystemIdRanges.h" #include "returnvalues/classIds.h" +static constexpr bool ACTUATION_WIRETAPPING = false; + class GpioIF; /** @@ -93,6 +95,7 @@ class RwHandler : public DeviceHandlerBase { RwDefinitions::StatusSet statusSet; RwDefinitions::LastResetSatus lastResetStatusSet; RwDefinitions::TmDataset tmDataset; + RwDefinitions::RwSpeedActuationSet rwSpeedActuationSet; uint8_t commandBuffer[RwDefinitions::MAX_CMD_SIZE]; @@ -117,13 +120,14 @@ class RwHandler : public DeviceHandlerBase { * range. * @return returnvalue::OK if successful, otherwise error code. */ - ReturnValue_t checkSpeedAndRampTime(const uint8_t* commandData, size_t commandDataLen); + ReturnValue_t checkSpeedAndRampTime(); /** - * @brief This function prepares the set speed command from the commandData received with - * an action message. + * @brief This function prepares the set speed command from the dataSet received with + * an action message or set in the software. + * @return returnvalue::OK if successful, otherwise error code. */ - void prepareSetSpeedCmd(const uint8_t* commandData, size_t commandDataLen); + ReturnValue_t prepareSetSpeedCmd(); /** * @brief This function writes the last reset status retrieved with the get last reset status From 285bd7116b2a8b08472e6ccfcc39dbce2362b678 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 10 Feb 2023 13:17:52 +0100 Subject: [PATCH 263/330] bump changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bbc760d..6f1896d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ change warranting a new major release: - First version of a TCS controller heater control loop. - Function for the ACS controller to command MTQ and RWs called by all subroutines +- RwHandler now handles commanding of RW speeds via RwSpeedActuationSet ## Changed From 35172185f9da2b55ea0e85018bf3a5543579519b Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 10 Feb 2023 13:29:13 +0100 Subject: [PATCH 264/330] fix --- mission/controller/acs/AcsParameters.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/mission/controller/acs/AcsParameters.cpp b/mission/controller/acs/AcsParameters.cpp index 30264963..44bed15f 100644 --- a/mission/controller/acs/AcsParameters.cpp +++ b/mission/controller/acs/AcsParameters.cpp @@ -280,6 +280,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId, break; case 0x5: parameterWrapper->set(rwHandlingParameters.rampTime); + break; default: return INVALID_IDENTIFIER_ID; } From 37b786898eebf35822e808ad02139212de44d275 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 10 Feb 2023 14:02:27 +0100 Subject: [PATCH 265/330] prep v1.26.4 --- CHANGELOG.md | 4 ++++ bsp_hosted/scheduling.cpp | 28 +++++++++++++++++++----- bsp_q7s/core/ObjectFactory.cpp | 2 +- dummies/helpers.cpp | 2 +- fsfw | 2 +- mission/controller/ThermalController.cpp | 2 +- mission/core/GenericFactory.cpp | 1 + tmtc | 2 +- 8 files changed, 32 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 18f99dff..cd03ac35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ change warranting a new major release: # [unreleased] +# [v1.26.4] 2023-02-10 + +eive-tmtc: v2.12.3 + # [v1.26.3] 2023-02-09 eive-tmtc: v2.12.2 diff --git a/bsp_hosted/scheduling.cpp b/bsp_hosted/scheduling.cpp index 843b2892..270de82e 100644 --- a/bsp_hosted/scheduling.cpp +++ b/bsp_hosted/scheduling.cpp @@ -56,26 +56,30 @@ void scheduling::initTasks() { /* TMTC Distribution */ PeriodicTaskIF* tmtcDistributor = factory->createPeriodicTask( - "DIST", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc); + "DIST", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc); ReturnValue_t result = tmtcDistributor->addComponent(objects::CCSDS_PACKET_DISTRIBUTOR); if (result != returnvalue::OK) { - sif::error << "Object add component failed" << std::endl; + sif::error << "adding CCSDS distributor failed" << std::endl; } result = tmtcDistributor->addComponent(objects::PUS_PACKET_DISTRIBUTOR); if (result != returnvalue::OK) { - sif::error << "Object add component failed" << std::endl; + sif::error << "adding PUS distributor failed" << std::endl; } result = tmtcDistributor->addComponent(objects::TM_FUNNEL); if (result != returnvalue::OK) { - sif::error << "Object add component failed" << std::endl; + sif::error << "adding TM funnel failed" << std::endl; + } + result = tmtcDistributor->addComponent(objects::CFDP_DISTRIBUTOR); + if (result != returnvalue::OK) { + sif::error << "adding CFDP distributor failed" << std::endl; } result = tmtcDistributor->addComponent(objects::UDP_TMTC_SERVER); if (result != returnvalue::OK) { - sif::error << "Add component UDP Unix Bridge failed" << std::endl; + sif::error << "adding UDP server failed" << std::endl; } result = tmtcDistributor->addComponent(objects::TCP_TMTC_SERVER); if (result != returnvalue::OK) { - sif::error << "Add component UDP Unix Bridge failed" << std::endl; + sif::error << "adding TCP server failed" << std::endl; } PeriodicTaskIF* udpPollingTask = factory->createPeriodicTask( @@ -166,6 +170,15 @@ void scheduling::initTasks() { sif::error << "Failed to add dummy pst to fixed timeslot task" << std::endl; } +#if OBSW_ADD_CFDP_COMPONENTS == 1 + PeriodicTaskIF* cfdpTask = factory->createPeriodicTask( + "CFDP Handler", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.4, missedDeadlineFunc); + result = cfdpTask->addComponent(objects::CFDP_HANDLER); + if (result != returnvalue::OK) { + scheduling::printAddObjectError("CFDP Handler", objects::CFDP_HANDLER); + } +#endif + #if OBSW_ADD_PLOC_SUPERVISOR == 1 PeriodicTaskIF* supvHelperTask = factory->createPeriodicTask( "PLOC_SUPV_HELPER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, missedDeadlineFunc); @@ -222,6 +235,9 @@ void scheduling::initTasks() { #if OBSW_ADD_PLOC_SUPERVISOR == 1 || OBSW_ADD_PLOC_MPSOC == 1 plTask->startTask(); #endif +#if OBSW_ADD_CFDP_COMPONENTS == 1 + cfdpTask->startTask(); +#endif #if OBSW_ADD_TEST_CODE == 1 testTask->startTask(); diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 448c0e09..d7bd02e5 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -926,7 +926,7 @@ void ObjectFactory::createImtqComponents(PowerSwitchIF* pwrSwitcher) { I2cCookie* imtqI2cCookie = new I2cCookie(addresses::IMTQ, IMTQ::MAX_REPLY_SIZE, q7s::I2C_PL_EIVE); auto imtqHandler = new ImtqHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie, pcdu::Switches::PDU1_CH3_MGT_5V); - imtqHandler->setUpThermalModule(ThermalStateCfg()); + imtqHandler->enableThermalModule(ThermalStateCfg()); imtqHandler->setPowerSwitcher(pwrSwitcher); imtqHandler->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); static_cast(imtqHandler); diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index adcb82bb..7c8fab1c 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -47,7 +47,7 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) { new SyrlinksDummy(objects::SYRLINKS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); } auto* imtqDummy = new ImtqDummy(objects::IMTQ_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - imtqDummy->setUpThermalModule(ThermalStateCfg()); + imtqDummy->enableThermalModule(ThermalStateCfg()); if (cfg.addPowerDummies) { new AcuDummy(objects::ACU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); new PduDummy(objects::PDU1_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); diff --git a/fsfw b/fsfw index 14a92b3d..d302ba71 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 14a92b3d89e37d50ccd46b250826cac293185d68 +Subproject commit d302ba71858edfa15834ff8b28d6cce2c2cbbb84 diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 947119ad..0521d9aa 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -109,7 +109,7 @@ void ThermalController::performControlOperation() { deviceTemperatures.commit(); } - //performThermalModuleCtrl(); + // performThermalModuleCtrl(); } ReturnValue_t ThermalController::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index a9ead006..b833b5db 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -175,6 +175,7 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun #if OBSW_ADD_CFDP_COMPONENTS == 1 using namespace cfdp; + MessageQueueIF* cfdpMsgQueue = QueueFactory::instance()->createMessageQueue(32); CfdpDistribCfg distribCfg(objects::CFDP_DISTRIBUTOR, *tcStore, cfdpMsgQueue); new CfdpDistributor(distribCfg); diff --git a/tmtc b/tmtc index 84178059..5fa97273 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 841780593ebe35ce01ea95dc5e21b78237f1d861 +Subproject commit 5fa9727375b3c870203bf1bb911de4a1f2298d4e From 1cad31657567ec7c26ec5f2aaef319abc20fe298 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 10 Feb 2023 14:03:13 +0100 Subject: [PATCH 266/330] prep v1.26.4 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f52bc9f3..e298c352 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ cmake_minimum_required(VERSION 3.13) set(OBSW_VERSION_MAJOR 1) set(OBSW_VERSION_MINOR 26) -set(OBSW_VERSION_REVISION 3) +set(OBSW_VERSION_REVISION 4) # set(CMAKE_VERBOSE TRUE) From bd455b750c5f25928cc2a9b9f55443a3b9318ca7 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 10 Feb 2023 14:09:39 +0100 Subject: [PATCH 267/330] small fix in SD card manager --- CHANGELOG.md | 4 ++++ bsp_q7s/fs/SdCardManager.cpp | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd03ac35..744082ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,10 @@ change warranting a new major release: eive-tmtc: v2.12.3 +## Fixed + +- `SdCardManager.cpp` `isSdCardUsable`: Use `ext4` instead of `vfat` to check read-only state. + # [v1.26.3] 2023-02-09 eive-tmtc: v2.12.2 diff --git a/bsp_q7s/fs/SdCardManager.cpp b/bsp_q7s/fs/SdCardManager.cpp index 9d5fcd6e..c0b1184e 100644 --- a/bsp_q7s/fs/SdCardManager.cpp +++ b/bsp_q7s/fs/SdCardManager.cpp @@ -505,9 +505,9 @@ bool SdCardManager::isSdCardUsable(std::optional sdCard) { ReturnValue_t SdCardManager::isSdCardMountedReadOnly(sd::SdCard sdcard, bool& readOnly) { std::ostringstream command; if (sdcard == sd::SdCard::SLOT_0) { - command << "grep -q '" << config::SD_0_MOUNT_POINT << " vfat ro,' /proc/mounts"; + command << "grep -q '" << config::SD_0_MOUNT_POINT << " ext4 ro,' /proc/mounts"; } else if (sdcard == sd::SdCard::SLOT_1) { - command << "grep -q '" << config::SD_1_MOUNT_POINT << " vfat ro,' /proc/mounts"; + command << "grep -q '" << config::SD_1_MOUNT_POINT << " ext4 ro,' /proc/mounts"; } else { return returnvalue::FAILED; } From b3202623f47bde9a5ebd534a28941f7b84145e2b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 10 Feb 2023 16:32:15 +0100 Subject: [PATCH 268/330] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 5fa97273..8d23f29f 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 5fa9727375b3c870203bf1bb911de4a1f2298d4e +Subproject commit 8d23f29f947e2a4f79e1fc0910cd9ad59a4fc346 From 62eb39923f77c88f710807a4de150f083455418c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 10 Feb 2023 17:52:46 +0100 Subject: [PATCH 269/330] add eive system first impl --- mission/system/tree/acsModeTree.cpp | 3 +- mission/system/tree/acsModeTree.h | 2 +- mission/system/tree/comModeTree.cpp | 3 +- mission/system/tree/comModeTree.h | 2 +- mission/system/tree/payloadModeTree.cpp | 5 +- mission/system/tree/payloadModeTree.h | 6 +- mission/system/tree/system.cpp | 94 +++++++++++++++++++++++-- mission/system/tree/system.h | 6 +- mission/system/tree/tcsModeTree.cpp | 3 +- mission/system/tree/tcsModeTree.h | 2 +- tmtc | 2 +- 11 files changed, 111 insertions(+), 17 deletions(-) diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index 0474d0a1..55b4ac70 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -94,7 +94,7 @@ auto ACS_TABLE_PTG_TARGET_INERTIAL_TGT = auto ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1 = std::make_pair((acs::AcsMode::PTG_INERTIAL << 24) | 3, FixedArrayList()); -void satsystem::acs::init() { +Subsystem& satsystem::acs::init() { ModeListEntry entry; const char* ctxc = "satsystem::acs::init: generic target"; // Insert Helper Table @@ -123,6 +123,7 @@ void satsystem::acs::init() { buildTargetPtNadirSequence(ACS_SUBSYSTEM, entry); buildTargetPtInertialSequence(ACS_SUBSYSTEM, entry); ACS_SUBSYSTEM.setInitialMode(::acs::AcsMode::SAFE); + return ACS_SUBSYSTEM; } namespace { diff --git a/mission/system/tree/acsModeTree.h b/mission/system/tree/acsModeTree.h index 134a86a7..27236fba 100644 --- a/mission/system/tree/acsModeTree.h +++ b/mission/system/tree/acsModeTree.h @@ -4,7 +4,7 @@ namespace satsystem { namespace acs { extern AcsSubsystem ACS_SUBSYSTEM; -void init(); +Subsystem& init(); } // namespace acs } // namespace satsystem diff --git a/mission/system/tree/comModeTree.cpp b/mission/system/tree/comModeTree.cpp index e08ba5ba..4474cc62 100644 --- a/mission/system/tree/comModeTree.cpp +++ b/mission/system/tree/comModeTree.cpp @@ -62,13 +62,14 @@ void buildTxAndRxDefaultRateSequence(Subsystem& ss, ModeListEntry& eh); } // namespace -void satsystem::com::init() { +Subsystem& satsystem::com::init() { ModeListEntry entry; buildRxOnlySequence(SUBSYSTEM, entry); buildTxAndRxLowRateSequence(SUBSYSTEM, entry); buildTxAndRxHighRateSequence(SUBSYSTEM, entry); buildTxAndRxDefaultRateSequence(SUBSYSTEM, entry); SUBSYSTEM.setInitialMode(NML, ::com::Submode::RX_ONLY); + return SUBSYSTEM; } namespace { diff --git a/mission/system/tree/comModeTree.h b/mission/system/tree/comModeTree.h index ccc7f15f..f4648598 100644 --- a/mission/system/tree/comModeTree.h +++ b/mission/system/tree/comModeTree.h @@ -8,7 +8,7 @@ namespace satsystem { namespace com { extern ComSubsystem SUBSYSTEM; -void init(); +Subsystem& init(); } // namespace com } // namespace satsystem diff --git a/mission/system/tree/payloadModeTree.cpp b/mission/system/tree/payloadModeTree.cpp index ccb3dd2c..5262c61e 100644 --- a/mission/system/tree/payloadModeTree.cpp +++ b/mission/system/tree/payloadModeTree.cpp @@ -20,7 +20,7 @@ void initEarthObsvSequence(Subsystem& ss, ModeListEntry& eh); void initScexSequence(Subsystem& ss, ModeListEntry& eh); } // namespace -Subsystem satsystem::pl::SUBSYSTEM = Subsystem(objects::PL_SUBSYSTEM, 12, 24); +PayloadSubsystem satsystem::pl::SUBSYSTEM = PayloadSubsystem(objects::PL_SUBSYSTEM, 12, 24); const auto check = subsystem::checkInsert; static const auto OFF = HasModesIF::MODE_OFF; @@ -77,7 +77,7 @@ auto PL_TABLE_SCEX_TGT = auto PL_TABLE_SCEX_TRANS_0 = std::make_pair((payload::Mode::SCEX << 24) | 2, FixedArrayList()); -void satsystem::pl::init() { +Subsystem& satsystem::pl::init() { ModeListEntry entry; initOffSequence(SUBSYSTEM, entry); initPlMpsocStreamSequence(SUBSYSTEM, entry); @@ -86,6 +86,7 @@ void satsystem::pl::init() { initEarthObsvSequence(SUBSYSTEM, entry); initScexSequence(SUBSYSTEM, entry); SUBSYSTEM.setInitialMode(OFF); + return SUBSYSTEM; } namespace { diff --git a/mission/system/tree/payloadModeTree.h b/mission/system/tree/payloadModeTree.h index d1eae4d7..55cd6991 100644 --- a/mission/system/tree/payloadModeTree.h +++ b/mission/system/tree/payloadModeTree.h @@ -1,15 +1,15 @@ #ifndef MISSION_SYSTEM_TREE_PAYLOADMODETREE_H_ #define MISSION_SYSTEM_TREE_PAYLOADMODETREE_H_ -#include +#include namespace satsystem { namespace pl { -extern Subsystem SUBSYSTEM; +extern PayloadSubsystem SUBSYSTEM; -void init(); +Subsystem& init(); } // namespace pl } // namespace satsystem diff --git a/mission/system/tree/system.cpp b/mission/system/tree/system.cpp index bf6cea9d..b176efe6 100644 --- a/mission/system/tree/system.cpp +++ b/mission/system/tree/system.cpp @@ -1,13 +1,99 @@ #include "system.h" +#include +#include +#include + #include "acsModeTree.h" #include "comModeTree.h" +#include "eive/objects.h" #include "payloadModeTree.h" #include "tcsModeTree.h" +#include "util.h" + +namespace { +// Alias for checker function +const auto check = subsystem::checkInsert; + +void buildSafeSequence(Subsystem& ss, ModeListEntry& eh); +} // namespace + +static const auto OFF = HasModesIF::MODE_OFF; +static const auto NML = DeviceHandlerIF::MODE_NORMAL; void satsystem::init() { - acs::init(); - pl::init(); - tcs::init(); - com::init(); + auto& acsSubsystem = acs::init(); + acsSubsystem.connectModeTreeParent(EIVE_SYSTEM); + auto& payloadSubsystem = pl::init(); + payloadSubsystem.connectModeTreeParent(EIVE_SYSTEM); + auto& tcsSubsystem = tcs::init(); + tcsSubsystem.connectModeTreeParent(EIVE_SYSTEM); + auto& comSubsystem = com::init(); + comSubsystem.connectModeTreeParent(EIVE_SYSTEM); + ModeListEntry entry; + buildSafeSequence(EIVE_SYSTEM, entry); } + +EiveSystem satsystem::EIVE_SYSTEM = EiveSystem(objects::EIVE_SYSTEM, 12, 24); + +auto EIVE_SEQUENCE_SAFE = std::make_pair(acs::AcsMode::SAFE, FixedArrayList()); +auto EIVE_TABLE_SAFE_TGT = + std::make_pair((acs::AcsMode::SAFE << 24) | 1, FixedArrayList()); +auto EIVE_TABLE_SAFE_TRANS_0 = + std::make_pair((acs::AcsMode::SAFE << 24) | 2, FixedArrayList()); +auto EIVE_TABLE_SAFE_TRANS_1 = + std::make_pair((acs::AcsMode::SAFE << 24) | 3, FixedArrayList()); + +auto EIVE_SEQUENCE_IDLE = + std::make_pair(acs::AcsMode::PTG_IDLE, FixedArrayList()); +auto EIVE_TABLE_IDLE_TGT = + std::make_pair((acs::AcsMode::PTG_IDLE << 24) | 1, FixedArrayList()); +auto EIVE_TABLE_IDLE_TRANS_0 = + std::make_pair((acs::AcsMode::PTG_IDLE << 24) | 2, FixedArrayList()); + +namespace { + +void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) { + std::string context = "satsystem::buildSafeSequence"; + auto ctxc = context.c_str(); + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, ArrayList& table) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + check(table.insert(eh), ctxc); + }; + // Insert Helper Sequence + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + check(sequence.insert(eh), ctxc); + }; + + // Only tracks that payload is off + iht(objects::PL_SUBSYSTEM, OFF, 0, EIVE_TABLE_SAFE_TGT.second); + check(ss.addTable(TableEntry(EIVE_TABLE_IDLE_TGT.first, &EIVE_TABLE_IDLE_TGT.second)), ctxc); + + // Build SAFE transition 0 + iht(objects::TCS_SUBSYSTEM, NML, 0, EIVE_TABLE_SAFE_TRANS_0.second); + check(ss.addTable(TableEntry(EIVE_TABLE_SAFE_TRANS_0.first, &EIVE_TABLE_SAFE_TRANS_0.second)), + ctxc); + + // Build SAFE transition 1 + iht(objects::PL_SUBSYSTEM, OFF, 0, EIVE_TABLE_SAFE_TRANS_1.second); + iht(objects::ACS_SUBSYSTEM, acs::AcsMode::SAFE, 0, EIVE_TABLE_SAFE_TRANS_1.second); + check(ss.addTable(TableEntry(EIVE_TABLE_SAFE_TRANS_1.first, &EIVE_TABLE_SAFE_TRANS_1.second)), + ctxc); + + // Build Safe sequence + ihs(EIVE_SEQUENCE_SAFE.second, EIVE_TABLE_SAFE_TGT.first, 0, false); + ihs(EIVE_SEQUENCE_SAFE.second, EIVE_TABLE_SAFE_TRANS_0.first, 0, false); + ihs(EIVE_SEQUENCE_SAFE.second, EIVE_TABLE_SAFE_TRANS_1.first, 2, false); + check(ss.addSequence(SequenceEntry(EIVE_SEQUENCE_SAFE.first, &EIVE_SEQUENCE_SAFE.second, + EIVE_SEQUENCE_SAFE.first)), + ctxc); +} + +} // namespace diff --git a/mission/system/tree/system.h b/mission/system/tree/system.h index a8599121..b1c90c82 100644 --- a/mission/system/tree/system.h +++ b/mission/system/tree/system.h @@ -1,10 +1,14 @@ #ifndef MISSION_SYSTEM_TREE_SYSTEM_H_ #define MISSION_SYSTEM_TREE_SYSTEM_H_ +#include + namespace satsystem { void init(); -} +extern EiveSystem EIVE_SYSTEM; + +} // namespace satsystem #endif /* MISSION_SYSTEM_TREE_SYSTEM_H_ */ diff --git a/mission/system/tree/tcsModeTree.cpp b/mission/system/tree/tcsModeTree.cpp index 51b0ec79..96b936bf 100644 --- a/mission/system/tree/tcsModeTree.cpp +++ b/mission/system/tree/tcsModeTree.cpp @@ -27,11 +27,12 @@ auto TCS_TABLE_NORMAL_TGT = std::make_pair((NML << 24) | 1, FixedArrayList()); auto TCS_TABLE_NORMAL_TRANS_1 = std::make_pair((NML << 24) | 3, FixedArrayList()); -void satsystem::tcs::init() { +Subsystem& satsystem::tcs::init() { ModeListEntry entry; buildOffSequence(SUBSYSTEM, entry); buildNormalSequence(SUBSYSTEM, entry); SUBSYSTEM.setInitialMode(OFF); + return SUBSYSTEM; } namespace { diff --git a/mission/system/tree/tcsModeTree.h b/mission/system/tree/tcsModeTree.h index 33fe7701..af10e60b 100644 --- a/mission/system/tree/tcsModeTree.h +++ b/mission/system/tree/tcsModeTree.h @@ -6,7 +6,7 @@ namespace satsystem { namespace tcs { extern Subsystem SUBSYSTEM; -void init(); +Subsystem& init(); } // namespace tcs } // namespace satsystem diff --git a/tmtc b/tmtc index 8d23f29f..6db34aac 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 8d23f29f947e2a4f79e1fc0910cd9ad59a4fc346 +Subproject commit 6db34aacaabedf69f05b330d71e25cc7cedb5632 From 6b919c727da8377717b1818c57e0f54ef5b8550a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 10 Feb 2023 17:59:16 +0100 Subject: [PATCH 270/330] build idle system sequence --- mission/system/tree/system.cpp | 52 ++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/mission/system/tree/system.cpp b/mission/system/tree/system.cpp index b176efe6..7206678e 100644 --- a/mission/system/tree/system.cpp +++ b/mission/system/tree/system.cpp @@ -16,6 +16,7 @@ namespace { const auto check = subsystem::checkInsert; void buildSafeSequence(Subsystem& ss, ModeListEntry& eh); +void buildIdleSequence(Subsystem& ss, ModeListEntry& eh); } // namespace static const auto OFF = HasModesIF::MODE_OFF; @@ -32,6 +33,7 @@ void satsystem::init() { comSubsystem.connectModeTreeParent(EIVE_SYSTEM); ModeListEntry entry; buildSafeSequence(EIVE_SYSTEM, entry); + buildIdleSequence(EIVE_SYSTEM, entry); } EiveSystem satsystem::EIVE_SYSTEM = EiveSystem(objects::EIVE_SYSTEM, 12, 24); @@ -50,6 +52,8 @@ auto EIVE_TABLE_IDLE_TGT = std::make_pair((acs::AcsMode::PTG_IDLE << 24) | 1, FixedArrayList()); auto EIVE_TABLE_IDLE_TRANS_0 = std::make_pair((acs::AcsMode::PTG_IDLE << 24) | 2, FixedArrayList()); +auto EIVE_TABLE_IDLE_TRANS_1 = + std::make_pair((acs::AcsMode::PTG_IDLE << 24) | 3, FixedArrayList()); namespace { @@ -72,9 +76,9 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) { check(sequence.insert(eh), ctxc); }; - // Only tracks that payload is off + iht(objects::ACS_SUBSYSTEM, acs::AcsMode::SAFE, 0, EIVE_TABLE_SAFE_TGT.second); iht(objects::PL_SUBSYSTEM, OFF, 0, EIVE_TABLE_SAFE_TGT.second); - check(ss.addTable(TableEntry(EIVE_TABLE_IDLE_TGT.first, &EIVE_TABLE_IDLE_TGT.second)), ctxc); + check(ss.addTable(TableEntry(EIVE_TABLE_SAFE_TGT.first, &EIVE_TABLE_SAFE_TGT.second)), ctxc); // Build SAFE transition 0 iht(objects::TCS_SUBSYSTEM, NML, 0, EIVE_TABLE_SAFE_TRANS_0.second); @@ -90,10 +94,52 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) { // Build Safe sequence ihs(EIVE_SEQUENCE_SAFE.second, EIVE_TABLE_SAFE_TGT.first, 0, false); ihs(EIVE_SEQUENCE_SAFE.second, EIVE_TABLE_SAFE_TRANS_0.first, 0, false); - ihs(EIVE_SEQUENCE_SAFE.second, EIVE_TABLE_SAFE_TRANS_1.first, 2, false); + ihs(EIVE_SEQUENCE_SAFE.second, EIVE_TABLE_SAFE_TRANS_1.first, 0, false); check(ss.addSequence(SequenceEntry(EIVE_SEQUENCE_SAFE.first, &EIVE_SEQUENCE_SAFE.second, EIVE_SEQUENCE_SAFE.first)), ctxc); } +void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) { + std::string context = "satsystem::buildIdleSequence"; + auto ctxc = context.c_str(); + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, ArrayList& table) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + check(table.insert(eh), ctxc); + }; + // Insert Helper Sequence + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + check(sequence.insert(eh), ctxc); + }; + + iht(objects::ACS_SUBSYSTEM, acs::AcsMode::PTG_IDLE, 0, EIVE_TABLE_IDLE_TGT.second); + check(ss.addTable(TableEntry(EIVE_TABLE_IDLE_TGT.first, &EIVE_TABLE_IDLE_TGT.second)), ctxc); + + // Build SAFE transition 0 + iht(objects::TCS_SUBSYSTEM, NML, 0, EIVE_TABLE_IDLE_TRANS_0.second); + check(ss.addTable(TableEntry(EIVE_TABLE_IDLE_TRANS_0.first, &EIVE_TABLE_IDLE_TRANS_0.second)), + ctxc); + + // Build SAFE transition 1 + iht(objects::PL_SUBSYSTEM, OFF, 0, EIVE_TABLE_IDLE_TRANS_1.second); + iht(objects::ACS_SUBSYSTEM, acs::AcsMode::PTG_IDLE, 0, EIVE_TABLE_IDLE_TRANS_1.second); + check(ss.addTable(TableEntry(EIVE_TABLE_IDLE_TRANS_1.first, &EIVE_TABLE_IDLE_TRANS_1.second)), + ctxc); + + // Build Safe sequence + ihs(EIVE_SEQUENCE_IDLE.second, EIVE_TABLE_IDLE_TGT.first, 0, false); + ihs(EIVE_SEQUENCE_IDLE.second, EIVE_TABLE_IDLE_TRANS_0.first, 0, false); + ihs(EIVE_SEQUENCE_IDLE.second, EIVE_TABLE_IDLE_TRANS_1.first, 0, false); + check(ss.addSequence(SequenceEntry(EIVE_SEQUENCE_IDLE.first, &EIVE_SEQUENCE_IDLE.second, + EIVE_SEQUENCE_IDLE.first)), + ctxc); +} + } // namespace From b0c84f92848d74b831fe2323142df840da7c8d2a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 10 Feb 2023 17:59:37 +0100 Subject: [PATCH 271/330] safe mode fallback --- mission/system/tree/system.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/system/tree/system.cpp b/mission/system/tree/system.cpp index 7206678e..aae11110 100644 --- a/mission/system/tree/system.cpp +++ b/mission/system/tree/system.cpp @@ -138,7 +138,7 @@ void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) { ihs(EIVE_SEQUENCE_IDLE.second, EIVE_TABLE_IDLE_TRANS_0.first, 0, false); ihs(EIVE_SEQUENCE_IDLE.second, EIVE_TABLE_IDLE_TRANS_1.first, 0, false); check(ss.addSequence(SequenceEntry(EIVE_SEQUENCE_IDLE.first, &EIVE_SEQUENCE_IDLE.second, - EIVE_SEQUENCE_IDLE.first)), + EIVE_SEQUENCE_SAFE.first)), ctxc); } From 84a4d093bc550613f49ffd532cd40c41facc5eab Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 10 Feb 2023 18:07:44 +0100 Subject: [PATCH 272/330] schedule new EIVE system --- bsp_q7s/core/scheduling.cpp | 40 ++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index 43bde435..713550c4 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -80,16 +80,12 @@ void scheduling::initTasks() { } #endif - PeriodicTaskIF* sysTask = factory->createPeriodicTask( + PeriodicTaskIF* coreCtrlTask = factory->createPeriodicTask( "CORE_CTRL", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.4, missedDeadlineFunc); - result = sysTask->addComponent(objects::CORE_CONTROLLER); + result = coreCtrlTask->addComponent(objects::CORE_CONTROLLER); if (result != returnvalue::OK) { scheduling::printAddObjectError("CORE_CTRL", objects::CORE_CONTROLLER); } - result = sysTask->addComponent(objects::PL_SUBSYSTEM); - if (result != returnvalue::OK) { - scheduling::printAddObjectError("PL_SUBSYSTEM", objects::PL_SUBSYSTEM); - } /* TMTC Distribution */ PeriodicTaskIF* tmTcDistributor = factory->createPeriodicTask( @@ -144,15 +140,23 @@ void scheduling::initTasks() { #endif #endif - PeriodicTaskIF* comTask = factory->createPeriodicTask( - "COM_TASK", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, missedDeadlineFunc); - result = comTask->addComponent(objects::COM_SUBSYSTEM); + PeriodicTaskIF* genericSysTask = factory->createPeriodicTask( + "SYSTEM_TASK", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.5, missedDeadlineFunc); + result = genericSysTask->addComponent(objects::EIVE_SYSTEM); if (result != returnvalue::OK) { - scheduling::printAddObjectError("COM subsystem", objects::COM_SUBSYSTEM); + scheduling::printAddObjectError("EIVE_SYSTEM", objects::EIVE_SYSTEM); + } + result = genericSysTask->addComponent(objects::COM_SUBSYSTEM); + if (result != returnvalue::OK) { + scheduling::printAddObjectError("COM_SUBSYSTEM", objects::COM_SUBSYSTEM); + } + result = genericSysTask->addComponent(objects::PL_SUBSYSTEM); + if (result != returnvalue::OK) { + scheduling::printAddObjectError("PL_SUBSYSTEM", objects::PL_SUBSYSTEM); } #if OBSW_ADD_CCSDS_IP_CORES == 1 - result = comTask->addComponent(objects::CCSDS_HANDLER); + result = genericSysTask->addComponent(objects::CCSDS_HANDLER); if (result != returnvalue::OK) { scheduling::printAddObjectError("CCSDS Handler", objects::CCSDS_HANDLER); } @@ -185,8 +189,12 @@ void scheduling::initTasks() { #endif /* OBSW_ADD_GPS_CTRL */ PeriodicTaskIF* acsSysTask = factory->createPeriodicTask( - "SYS_TASK", 55, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); + "ACS_SYS_TASK", 55, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); static_cast(acsSysTask); + result = acsSysTask->addComponent(objects::ACS_SUBSYSTEM); + if (result != returnvalue::OK) { + scheduling::printAddObjectError("ACS_SUBSYSTEM", objects::ACS_SUBSYSTEM); + } #if OBSW_ADD_ACS_BOARD == 1 result = acsSysTask->addComponent(objects::ACS_BOARD_ASS); if (result != returnvalue::OK) { @@ -205,10 +213,6 @@ void scheduling::initTasks() { scheduling::printAddObjectError("SUS_BOARD_ASS", objects::SUS_BOARD_ASS); } #endif - result = acsSysTask->addComponent(objects::ACS_SUBSYSTEM); - if (result != returnvalue::OK) { - scheduling::printAddObjectError("ACS_SUBSYSTEM", objects::ACS_SUBSYSTEM); - } #if OBSW_ADD_RTD_DEVICES == 1 PeriodicTaskIF* tcsPollingTask = factory->createPeriodicTask( @@ -327,12 +331,12 @@ void scheduling::initTasks() { #endif #endif - comTask->startTask(); + genericSysTask->startTask(); #if OBSW_ADD_CCSDS_IP_CORES == 1 pdecHandlerTask->startTask(); #endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */ - sysTask->startTask(); + coreCtrlTask->startTask(); #if OBSW_ADD_SA_DEPL == 1 solarArrayDeplTask->startTask(); #endif From 767618f61f8c91efe6c8ef8ba0154fc7c3f57eab Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 12 Feb 2023 18:57:24 +0100 Subject: [PATCH 273/330] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 6db34aac..d47da4c3 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 6db34aacaabedf69f05b330d71e25cc7cedb5632 +Subproject commit d47da4c314837e63b054d5dfe22db7c0f3794b90 From f5b5ef66b71d6c664f0e818b11f0a1458bfc6d7b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 12 Feb 2023 20:01:20 +0100 Subject: [PATCH 274/330] some tweaks for SPI, some fixes --- bsp_q7s/core/ObjectFactory.cpp | 8 ++++++ linux/devices/Max31865RtdLowlevelHandler.cpp | 30 ++++++++++---------- linux/devices/ploc/PlocSupervisorHandler.cpp | 5 +++- linux/devices/ploc/PlocSupervisorHandler.h | 5 ++++ mission/system/tree/system.cpp | 5 ++-- 5 files changed, 35 insertions(+), 18 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index d7bd02e5..15cd4baf 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -347,6 +347,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo SpiCookie* spiCookie = new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED); + spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, 40); auto mgmLis3Handler0 = new MgmLIS3MDLHandler( objects::MGM_0_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::LIS3_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::MGM_0_LIS3_HANDLER); @@ -362,6 +363,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo spiCookie = new SpiCookie(addresses::MGM_1_RM3100, gpioIds::MGM_1_RM3100_CS, RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED); + spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, 40); auto mgmRm3100Handler1 = new MgmRM3100Handler(objects::MGM_1_RM3100_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::RM3100_TRANSITION_DELAY); @@ -378,6 +380,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo spiCookie = new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED); + spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, 40); auto* mgmLis3Handler2 = new MgmLIS3MDLHandler( objects::MGM_2_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::LIS3_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::MGM_2_LIS3_HANDLER); @@ -393,6 +396,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo spiCookie = new SpiCookie(addresses::MGM_3_RM3100, gpioIds::MGM_3_RM3100_CS, RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED); + spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, 40); auto* mgmRm3100Handler3 = new MgmRM3100Handler(objects::MGM_3_RM3100_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::RM3100_TRANSITION_DELAY); @@ -411,6 +415,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo spiCookie = new SpiCookie(addresses::GYRO_0_ADIS, gpioIds::GYRO_0_ADIS_CS, ADIS1650X::MAXIMUM_REPLY_SIZE, spi::DEFAULT_ADIS16507_MODE, spi::DEFAULT_ADIS16507_SPEED); + spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, 40); auto adisHandler = new GyroADIS1650XHandler(objects::GYRO_0_ADIS_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, ADIS1650X::Type::ADIS16505); @@ -427,6 +432,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo // Gyro 1 Side A spiCookie = new SpiCookie(addresses::GYRO_1_L3G, gpioIds::GYRO_1_L3G_CS, L3GD20H::MAX_BUFFER_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED); + spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, 40); auto gyroL3gHandler1 = new GyroHandlerL3GD20H( objects::GYRO_1_L3G_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::L3G_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::GYRO_1_L3G_HANDLER); @@ -443,6 +449,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo spiCookie = new SpiCookie(addresses::GYRO_2_ADIS, gpioIds::GYRO_2_ADIS_CS, ADIS1650X::MAXIMUM_REPLY_SIZE, spi::DEFAULT_ADIS16507_MODE, spi::DEFAULT_ADIS16507_SPEED); + spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, 40); adisHandler = new GyroADIS1650XHandler(objects::GYRO_2_ADIS_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, ADIS1650X::Type::ADIS16505); fdir = new AcsBoardFdir(objects::GYRO_2_ADIS_HANDLER); @@ -455,6 +462,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo // Gyro 3 Side B spiCookie = new SpiCookie(addresses::GYRO_3_L3G, gpioIds::GYRO_3_L3G_CS, L3GD20H::MAX_BUFFER_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED); + spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, 40); auto gyroL3gHandler3 = new GyroHandlerL3GD20H( objects::GYRO_3_L3G_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::L3G_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::GYRO_3_L3G_HANDLER); diff --git a/linux/devices/Max31865RtdLowlevelHandler.cpp b/linux/devices/Max31865RtdLowlevelHandler.cpp index 14ef9659..594389d3 100644 --- a/linux/devices/Max31865RtdLowlevelHandler.cpp +++ b/linux/devices/Max31865RtdLowlevelHandler.cpp @@ -58,17 +58,17 @@ bool Max31865RtdReader::rtdIsActive(uint8_t idx) { bool Max31865RtdReader::periodicInitHandling() { using namespace MAX31865; - MutexGuard mg(readerMutex); ReturnValue_t result = returnvalue::OK; - if (mg.getLockResult() != returnvalue::OK) { - sif::warning << "Max31865RtdReader::periodicInitHandling: Mutex lock failed" << std::endl; - return false; - } for (auto& rtd : rtds) { if (rtd == nullptr) { continue; } + MutexGuard mg(readerMutex); + if (mg.getLockResult() != returnvalue::OK) { + sif::warning << "Max31865RtdReader::periodicInitHandling: Mutex lock failed" << std::endl; + return false; + } if ((rtd->on or rtd->db.active) and not rtd->db.configured and rtd->cd.hasTimedOut()) { ManualCsLockWrapper mg(csLock, gpioIF, rtd->spiCookie, csTimeoutType, csTimeoutMs); if (mg.lockResult != returnvalue::OK or mg.gpioResult != returnvalue::OK) { @@ -116,16 +116,16 @@ bool Max31865RtdReader::periodicInitHandling() { ReturnValue_t Max31865RtdReader::periodicReadReqHandling() { using namespace MAX31865; - MutexGuard mg(readerMutex); - if (mg.getLockResult() != returnvalue::OK) { - sif::warning << "Max31865RtdReader::periodicReadReqHandling: Mutex lock failed" << std::endl; - return returnvalue::FAILED; - } // Now request one shot config for all active RTDs for (auto& rtd : rtds) { if (rtd == nullptr) { continue; } + MutexGuard mg(readerMutex); + if (mg.getLockResult() != returnvalue::OK) { + sif::warning << "Max31865RtdReader::periodicReadReqHandling: Mutex lock failed" << std::endl; + return returnvalue::FAILED; + } if (rtdIsActive(rtd->idx)) { ReturnValue_t result = writeCfgReg(rtd->spiCookie, BASE_CFG | (1 << CfgBitPos::ONE_SHOT)); if (result != returnvalue::OK) { @@ -141,16 +141,16 @@ ReturnValue_t Max31865RtdReader::periodicReadReqHandling() { ReturnValue_t Max31865RtdReader::periodicReadHandling() { using namespace MAX31865; auto result = returnvalue::OK; - MutexGuard mg(readerMutex); - if (mg.getLockResult() != returnvalue::OK) { - sif::warning << "Max31865RtdReader::periodicReadHandling: Mutex lock failed" << std::endl; - return returnvalue::FAILED; - } // Now read the RTD values for (auto& rtd : rtds) { if (rtd == nullptr) { continue; } + MutexGuard mg(readerMutex); + if (mg.getLockResult() != returnvalue::OK) { + sif::warning << "Max31865RtdReader::periodicReadHandling: Mutex lock failed" << std::endl; + return returnvalue::FAILED; + } if (rtdIsActive(rtd->idx)) { uint16_t rtdVal = 0; bool faultBitSet = false; diff --git a/linux/devices/ploc/PlocSupervisorHandler.cpp b/linux/devices/ploc/PlocSupervisorHandler.cpp index 17657b50..8537d011 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.cpp +++ b/linux/devices/ploc/PlocSupervisorHandler.cpp @@ -704,8 +704,9 @@ ReturnValue_t PlocSupervisorHandler::initializeLocalDataPool(localpool::DataPool localDataPoolMap.emplace(supv::NVM0_1_STATE, new PoolEntry({0})); localDataPoolMap.emplace(supv::NVM3_STATE, new PoolEntry({0})); localDataPoolMap.emplace(supv::MISSION_IO_STATE, new PoolEntry({0})); - localDataPoolMap.emplace(supv::FMC_STATE, new PoolEntry({0})); + localDataPoolMap.emplace(supv::FMC_STATE, &fmcStateEntry); localDataPoolMap.emplace(supv::NUM_TCS, new PoolEntry({0})); + localDataPoolMap.emplace(supv::TEMP_SUP, &tempSupEntry); localDataPoolMap.emplace(supv::UPTIME, new PoolEntry({0})); localDataPoolMap.emplace(supv::CPULOAD, new PoolEntry({0})); localDataPoolMap.emplace(supv::AVAILABLEHEAP, new PoolEntry({0})); @@ -718,6 +719,8 @@ ReturnValue_t PlocSupervisorHandler::initializeLocalDataPool(localpool::DataPool localDataPoolMap.emplace(supv::BP0_STATE, new PoolEntry({0})); localDataPoolMap.emplace(supv::BP1_STATE, new PoolEntry({0})); localDataPoolMap.emplace(supv::BP2_STATE, new PoolEntry({0})); + localDataPoolMap.emplace(supv::BOOT_STATE, &bootStateEntry); + localDataPoolMap.emplace(supv::BOOT_CYCLES, &bootCyclesEntry); localDataPoolMap.emplace(supv::LATCHUP_ID, new PoolEntry({0})); localDataPoolMap.emplace(supv::CNT0, new PoolEntry({0})); diff --git a/linux/devices/ploc/PlocSupervisorHandler.h b/linux/devices/ploc/PlocSupervisorHandler.h index 52e2619b..dcad9d09 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.h +++ b/linux/devices/ploc/PlocSupervisorHandler.h @@ -156,6 +156,11 @@ class PlocSupervisorHandler : public DeviceHandlerBase { Countdown bootTimeout = Countdown(BOOT_TIMEOUT); Countdown mramDumpTimeout = Countdown(MRAM_DUMP_TIMEOUT); + PoolEntry fmcStateEntry = PoolEntry(1); + PoolEntry bootStateEntry = PoolEntry(1); + PoolEntry bootCyclesEntry = PoolEntry(1); + PoolEntry tempSupEntry = PoolEntry(1); + /** * @brief Adjusts the timeout of the execution report dependent on command */ diff --git a/mission/system/tree/system.cpp b/mission/system/tree/system.cpp index aae11110..e8f9d5b1 100644 --- a/mission/system/tree/system.cpp +++ b/mission/system/tree/system.cpp @@ -80,7 +80,8 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) { iht(objects::PL_SUBSYSTEM, OFF, 0, EIVE_TABLE_SAFE_TGT.second); check(ss.addTable(TableEntry(EIVE_TABLE_SAFE_TGT.first, &EIVE_TABLE_SAFE_TGT.second)), ctxc); - // Build SAFE transition 0 + // Build SAFE transition 0. Two transitions to reduce number of consecutive events and because + // consecutive commanding of TCS and ACS can lead to SPI issues. iht(objects::TCS_SUBSYSTEM, NML, 0, EIVE_TABLE_SAFE_TRANS_0.second); check(ss.addTable(TableEntry(EIVE_TABLE_SAFE_TRANS_0.first, &EIVE_TABLE_SAFE_TRANS_0.second)), ctxc); @@ -94,7 +95,7 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) { // Build Safe sequence ihs(EIVE_SEQUENCE_SAFE.second, EIVE_TABLE_SAFE_TGT.first, 0, false); ihs(EIVE_SEQUENCE_SAFE.second, EIVE_TABLE_SAFE_TRANS_0.first, 0, false); - ihs(EIVE_SEQUENCE_SAFE.second, EIVE_TABLE_SAFE_TRANS_1.first, 0, false); + ihs(EIVE_SEQUENCE_SAFE.second, EIVE_TABLE_SAFE_TRANS_1.first, 3, false); check(ss.addSequence(SequenceEntry(EIVE_SEQUENCE_SAFE.first, &EIVE_SEQUENCE_SAFE.second, EIVE_SEQUENCE_SAFE.first)), ctxc); From e94af34ef063ffca86e9ab0ece9cab13fea56954 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 12 Feb 2023 20:41:20 +0100 Subject: [PATCH 275/330] some more tests to avoid SPI issue --- bsp_q7s/obsw.cpp | 14 ++++++++++ common/config/devConf.h | 2 ++ fsfw | 2 +- linux/ObjectFactory.cpp | 12 +++++++++ mission/devices/ImtqHandler.cpp | 2 +- mission/system/tree/acsModeTree.cpp | 42 ++++++++++++++++++++--------- mission/system/tree/system.cpp | 2 +- 7 files changed, 61 insertions(+), 15 deletions(-) diff --git a/bsp_q7s/obsw.cpp b/bsp_q7s/obsw.cpp index 91bad041..3ae795fc 100644 --- a/bsp_q7s/obsw.cpp +++ b/bsp_q7s/obsw.cpp @@ -13,6 +13,8 @@ #include "core/scheduling.h" #include "fsfw/tasks/TaskFactory.h" #include "fsfw/version.h" +#include "mission/acsDefs.h" +#include "mission/system/tree/system.h" #include "q7sConfig.h" #include "watchdog/definitions.h" @@ -72,6 +74,18 @@ int obsw::obsw() { scheduling::initMission(); + // Command the EIVE system to safe mode + /* + auto sysQueueId = satsystem::EIVE_SYSTEM.getCommandQueue(); + CommandMessage msg; + ModeMessage::setCmdModeMessage(msg, acs::AcsMode::SAFE, 0); + ReturnValue_t result = + MessageQueueSenderIF::sendMessage(sysQueueId, &msg, MessageQueueIF::NO_QUEUE, false); + if (result != returnvalue::OK) { + sif::error << "Sending safe mode command to EIVE system failed" << std::endl; + } + */ + for (;;) { /* Suspend main thread by sleeping it. */ TaskFactory::delayTask(5000); diff --git a/common/config/devConf.h b/common/config/devConf.h index beb01282..d212835f 100644 --- a/common/config/devConf.h +++ b/common/config/devConf.h @@ -51,6 +51,8 @@ static constexpr dur_millis_t RTD_CS_TIMEOUT = 50; static constexpr uint32_t RTD_SPEED = 2'000'000; static constexpr spi::SpiModes RTD_MODE = spi::SpiModes::MODE_3; +static constexpr dur_millis_t SUS_CS_TIMEOUT = 50; + } // namespace spi namespace uart { diff --git a/fsfw b/fsfw index d302ba71..7fae6cbd 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit d302ba71858edfa15834ff8b28d6cce2c2cbbb84 +Subproject commit 7fae6cbd6db588d69fc00198e4b2a9d8a7c12f59 diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index 3e206cf9..1003ead4 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -79,6 +79,7 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo std::array susHandlers = {}; SpiCookie* spiCookie = new SpiCookie(addresses::SUS_0, gpioIds::CS_SUS_0, SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); + spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, spi::SUS_CS_TIMEOUT); susHandlers[0] = new SusHandler(objects::SUS_0_N_LOC_XFYFZM_PT_XF, 0, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_0_N_LOC_XFYFZM_PT_XF); @@ -86,6 +87,7 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo spiCookie = new SpiCookie(addresses::SUS_1, gpioIds::CS_SUS_1, SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); + spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, spi::SUS_CS_TIMEOUT); susHandlers[1] = new SusHandler(objects::SUS_1_N_LOC_XBYFZM_PT_XB, 1, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_1_N_LOC_XBYFZM_PT_XB); @@ -93,6 +95,7 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo spiCookie = new SpiCookie(addresses::SUS_2, gpioIds::CS_SUS_2, SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); + spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, spi::SUS_CS_TIMEOUT); susHandlers[2] = new SusHandler(objects::SUS_2_N_LOC_XFYBZB_PT_YB, 2, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_2_N_LOC_XFYBZB_PT_YB); @@ -100,6 +103,7 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo spiCookie = new SpiCookie(addresses::SUS_3, gpioIds::CS_SUS_3, SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); + spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, spi::SUS_CS_TIMEOUT); susHandlers[3] = new SusHandler(objects::SUS_3_N_LOC_XFYBZF_PT_YF, 3, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_3_N_LOC_XFYBZF_PT_YF); @@ -107,6 +111,7 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo spiCookie = new SpiCookie(addresses::SUS_4, gpioIds::CS_SUS_4, SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); + spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, spi::SUS_CS_TIMEOUT); susHandlers[4] = new SusHandler(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, 4, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_4_N_LOC_XMYFZF_PT_ZF); @@ -114,6 +119,7 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo spiCookie = new SpiCookie(addresses::SUS_5, gpioIds::CS_SUS_5, SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); + spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, spi::SUS_CS_TIMEOUT); susHandlers[5] = new SusHandler(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, 5, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_5_N_LOC_XFYMZB_PT_ZB); @@ -121,6 +127,7 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo spiCookie = new SpiCookie(addresses::SUS_6, gpioIds::CS_SUS_6, SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); + spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, spi::SUS_CS_TIMEOUT); susHandlers[6] = new SusHandler(objects::SUS_6_R_LOC_XFYBZM_PT_XF, 6, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_6_R_LOC_XFYBZM_PT_XF); @@ -128,6 +135,7 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo spiCookie = new SpiCookie(addresses::SUS_7, gpioIds::CS_SUS_7, SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); + spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, spi::SUS_CS_TIMEOUT); susHandlers[7] = new SusHandler(objects::SUS_7_R_LOC_XBYBZM_PT_XB, 7, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_7_R_LOC_XBYBZM_PT_XB); @@ -135,6 +143,7 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo spiCookie = new SpiCookie(addresses::SUS_8, gpioIds::CS_SUS_8, SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); + spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, spi::SUS_CS_TIMEOUT); susHandlers[8] = new SusHandler(objects::SUS_8_R_LOC_XBYBZB_PT_YB, 8, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_8_R_LOC_XBYBZB_PT_YB); @@ -142,6 +151,7 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo spiCookie = new SpiCookie(addresses::SUS_9, gpioIds::CS_SUS_9, SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); + spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, spi::SUS_CS_TIMEOUT); susHandlers[9] = new SusHandler(objects::SUS_9_R_LOC_XBYBZB_PT_YF, 9, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_9_R_LOC_XBYBZB_PT_YF); @@ -149,6 +159,7 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo spiCookie = new SpiCookie(addresses::SUS_10, gpioIds::CS_SUS_10, SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); + spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, spi::SUS_CS_TIMEOUT); susHandlers[10] = new SusHandler(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, 10, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_10_N_LOC_XMYBZF_PT_ZF); @@ -156,6 +167,7 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo spiCookie = new SpiCookie(addresses::SUS_11, gpioIds::CS_SUS_11, SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); + spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, spi::SUS_CS_TIMEOUT); susHandlers[11] = new SusHandler(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, 11, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_11_R_LOC_XBYMZB_PT_ZB); diff --git a/mission/devices/ImtqHandler.cpp b/mission/devices/ImtqHandler.cpp index 8cdb8de6..0e75c06d 100644 --- a/mission/devices/ImtqHandler.cpp +++ b/mission/devices/ImtqHandler.cpp @@ -707,7 +707,7 @@ ReturnValue_t ImtqHandler::initializeLocalDataPool(localpool::DataPool& localDat subdp::DiagnosticsHkPeriodicParams(calMtmMeasurementSet.getSid(), false, 10.0)); poolManager.subscribeForDiagPeriodicPacket( subdp::DiagnosticsHkPeriodicParams(rawMtmMeasurementSet.getSid(), false, 10.0)); - return returnvalue::OK; + return DeviceHandlerBase::initializeLocalDataPool(localDataPoolMap, poolManager); } ReturnValue_t ImtqHandler::getSelfTestCommandId(DeviceCommandId_t* id) { diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index 55b4ac70..7d3fef4f 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -30,6 +30,8 @@ void buildTargetPtInertialSequence(Subsystem& ss, ModeListEntry& entryHelper); static const auto OFF = HasModesIF::MODE_OFF; static const auto NML = DeviceHandlerIF::MODE_NORMAL; +auto SUS_BOARD_NML_TRANS = std::make_pair(0x20, FixedArrayList()); + auto ACS_SEQUENCE_OFF = std::make_pair(acs::AcsMode::OFF, FixedArrayList()); auto ACS_TABLE_OFF_TGT = std::make_pair((acs::AcsMode::OFF << 24) | 1, FixedArrayList()); @@ -39,56 +41,56 @@ auto ACS_TABLE_OFF_TRANS_1 = std::make_pair((acs::AcsMode::OFF << 24) | 3, FixedArrayList()); auto ACS_SEQUENCE_DETUMBLE = - std::make_pair(acs::AcsMode::DETUMBLE, FixedArrayList()); + std::make_pair(acs::AcsMode::DETUMBLE, FixedArrayList()); auto ACS_TABLE_DETUMBLE_TGT = std::make_pair((acs::AcsMode::DETUMBLE << 24) | 1, FixedArrayList()); auto ACS_TABLE_DETUMBLE_TRANS_0 = std::make_pair((acs::AcsMode::DETUMBLE << 24) | 2, FixedArrayList()); auto ACS_TABLE_DETUMBLE_TRANS_1 = - std::make_pair((acs::AcsMode::DETUMBLE << 24) | 3, FixedArrayList()); + std::make_pair((acs::AcsMode::DETUMBLE << 24) | 3, FixedArrayList()); -auto ACS_SEQUENCE_SAFE = std::make_pair(acs::AcsMode::SAFE, FixedArrayList()); +auto ACS_SEQUENCE_SAFE = std::make_pair(acs::AcsMode::SAFE, FixedArrayList()); auto ACS_TABLE_SAFE_TGT = std::make_pair((acs::AcsMode::SAFE << 24) | 1, FixedArrayList()); auto ACS_TABLE_SAFE_TRANS_0 = std::make_pair((acs::AcsMode::SAFE << 24) | 2, FixedArrayList()); auto ACS_TABLE_SAFE_TRANS_1 = - std::make_pair((acs::AcsMode::SAFE << 24) | 3, FixedArrayList()); + std::make_pair((acs::AcsMode::SAFE << 24) | 3, FixedArrayList()); -auto ACS_SEQUENCE_IDLE = std::make_pair(acs::AcsMode::PTG_IDLE, FixedArrayList()); +auto ACS_SEQUENCE_IDLE = std::make_pair(acs::AcsMode::PTG_IDLE, FixedArrayList()); auto ACS_TABLE_IDLE_TGT = std::make_pair((acs::AcsMode::PTG_IDLE << 24) | 1, FixedArrayList()); auto ACS_TABLE_IDLE_TRANS_0 = std::make_pair((acs::AcsMode::PTG_IDLE << 24) | 2, FixedArrayList()); auto ACS_TABLE_IDLE_TRANS_1 = - std::make_pair((acs::AcsMode::PTG_IDLE << 24) | 3, FixedArrayList()); + std::make_pair((acs::AcsMode::PTG_IDLE << 24) | 3, FixedArrayList()); auto ACS_TABLE_PTG_TRANS_0 = std::make_pair((acs::AcsMode::PTG_TARGET << 24) | 2, FixedArrayList()); auto ACS_SEQUENCE_PTG_TARGET = - std::make_pair(acs::AcsMode::PTG_TARGET, FixedArrayList()); + std::make_pair(acs::AcsMode::PTG_TARGET, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_TGT = std::make_pair((acs::AcsMode::PTG_TARGET << 24) | 1, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_TRANS_1 = std::make_pair((acs::AcsMode::PTG_TARGET << 24) | 3, FixedArrayList()); auto ACS_SEQUENCE_PTG_TARGET_GS = - std::make_pair(acs::AcsMode::PTG_TARGET_GS, FixedArrayList()); + std::make_pair(acs::AcsMode::PTG_TARGET_GS, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_GS_TGT = std::make_pair((acs::AcsMode::PTG_TARGET_GS << 24) | 1, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_GS_TRANS_1 = std::make_pair((acs::AcsMode::PTG_TARGET_GS << 24) | 3, FixedArrayList()); auto ACS_SEQUENCE_PTG_TARGET_NADIR = - std::make_pair(acs::AcsMode::PTG_NADIR, FixedArrayList()); + std::make_pair(acs::AcsMode::PTG_NADIR, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_NADIR_TGT = std::make_pair((acs::AcsMode::PTG_NADIR << 24) | 1, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_NADIR_TRANS_1 = std::make_pair((acs::AcsMode::PTG_NADIR << 24) | 3, FixedArrayList()); auto ACS_SEQUENCE_PTG_TARGET_INERTIAL = - std::make_pair(acs::AcsMode::PTG_INERTIAL, FixedArrayList()); + std::make_pair(acs::AcsMode::PTG_INERTIAL, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_INERTIAL_TGT = std::make_pair((acs::AcsMode::PTG_INERTIAL << 24) | 1, FixedArrayList()); auto ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1 = @@ -114,6 +116,10 @@ Subsystem& satsystem::acs::init() { TableEntry(ACS_TABLE_PTG_TRANS_0.first, &ACS_TABLE_PTG_TRANS_0.second)), ctxc); + // Build SUS board transition + iht(objects::SUS_BOARD_ASS, NML, 0, SUS_BOARD_NML_TRANS.second); + check(ACS_SUBSYSTEM.addTable(TableEntry(SUS_BOARD_NML_TRANS.first, &SUS_BOARD_NML_TRANS.second)), ctxc); + buildOffSequence(ACS_SUBSYSTEM, entry); buildSafeSequence(ACS_SUBSYSTEM, entry); buildDetumbleSequence(ACS_SUBSYSTEM, entry); @@ -158,7 +164,6 @@ void buildOffSequence(Subsystem& ss, ModeListEntry& eh) { iht(objects::IMTQ_HANDLER, OFF, 0, ACS_TABLE_OFF_TRANS_1.second); iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_OFF_TRANS_1.second); iht(objects::ACS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS_1.second); - iht(objects::SUS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS_1.second); iht(objects::RW_ASS, OFF, 0, ACS_TABLE_OFF_TRANS_1.second); check(ss.addTable(TableEntry(ACS_TABLE_OFF_TRANS_1.first, &ACS_TABLE_OFF_TRANS_1.second)), ctxc); @@ -199,13 +204,14 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) { // Build SAFE transition 0 iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_SAFE_TRANS_0.second); - iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TRANS_0.second); iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TRANS_0.second); iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second); iht(objects::RW_ASS, 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), ctxc); + // SUS board transition table is defined above + // Build SAFE transition 1 iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::SAFE, ACS_TABLE_SAFE_TRANS_1.second); check(ss.addTable(&ACS_TABLE_SAFE_TRANS_1.second, ACS_TABLE_SAFE_TRANS_1.first, false, true), @@ -213,6 +219,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, 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, @@ -247,6 +254,8 @@ void buildDetumbleSequence(Subsystem& ss, ModeListEntry& eh) { 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_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); @@ -265,6 +274,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, 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, @@ -299,6 +309,8 @@ void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) { iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second); 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_HANDLER, NML, 0, ACS_TABLE_IDLE_TRANS_0.second); iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TRANS_0.second); @@ -313,6 +325,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, 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, @@ -349,6 +362,7 @@ void buildTargetPtSequence(Subsystem& ss, ModeListEntry& eh) { 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); @@ -358,6 +372,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, 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, @@ -407,6 +422,7 @@ void buildTargetPtNadirSequence(Subsystem& ss, ModeListEntry& eh) { // Build IDLE sequence ihs(ACS_SEQUENCE_PTG_TARGET_NADIR.second, ACS_TABLE_PTG_TARGET_NADIR_TGT.first, 0, true); + ihs(ACS_SEQUENCE_PTG_TARGET_NADIR.second, SUS_BOARD_NML_TRANS.first, 0, true); ihs(ACS_SEQUENCE_PTG_TARGET_NADIR.second, ACS_TABLE_PTG_TRANS_0.first, 0, true); ihs(ACS_SEQUENCE_PTG_TARGET_NADIR.second, ACS_TABLE_PTG_TARGET_NADIR_TRANS_1.first, 0, true); check( @@ -457,6 +473,7 @@ void buildTargetPtGsSequence(Subsystem& ss, ModeListEntry& eh) { // Build IDLE sequence ihs(ACS_SEQUENCE_PTG_TARGET_GS.second, ACS_TABLE_PTG_TARGET_GS_TGT.first, 0, true); + ihs(ACS_SEQUENCE_PTG_TARGET_GS.second, SUS_BOARD_NML_TRANS.first, 0, true); ihs(ACS_SEQUENCE_PTG_TARGET_GS.second, ACS_TABLE_PTG_TRANS_0.first, 0, true); ihs(ACS_SEQUENCE_PTG_TARGET_GS.second, ACS_TABLE_PTG_TARGET_GS_TRANS_1.first, 0, true); check(ss.addSequence(SequenceEntry(ACS_SEQUENCE_PTG_TARGET_GS.first, @@ -506,6 +523,7 @@ void buildTargetPtInertialSequence(Subsystem& ss, ModeListEntry& eh) { // Build IDLE sequence ihs(ACS_SEQUENCE_PTG_TARGET_INERTIAL.second, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.first, 0, true); + ihs(ACS_SEQUENCE_PTG_TARGET_INERTIAL.second, SUS_BOARD_NML_TRANS.first, 0, true); ihs(ACS_SEQUENCE_PTG_TARGET_INERTIAL.second, ACS_TABLE_PTG_TRANS_0.first, 0, true); ihs(ACS_SEQUENCE_PTG_TARGET_INERTIAL.second, ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1.first, 0, true); diff --git a/mission/system/tree/system.cpp b/mission/system/tree/system.cpp index e8f9d5b1..5c3bacf9 100644 --- a/mission/system/tree/system.cpp +++ b/mission/system/tree/system.cpp @@ -95,7 +95,7 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) { // Build Safe sequence ihs(EIVE_SEQUENCE_SAFE.second, EIVE_TABLE_SAFE_TGT.first, 0, false); ihs(EIVE_SEQUENCE_SAFE.second, EIVE_TABLE_SAFE_TRANS_0.first, 0, false); - ihs(EIVE_SEQUENCE_SAFE.second, EIVE_TABLE_SAFE_TRANS_1.first, 3, false); + ihs(EIVE_SEQUENCE_SAFE.second, EIVE_TABLE_SAFE_TRANS_1.first, 4, false); check(ss.addSequence(SequenceEntry(EIVE_SEQUENCE_SAFE.first, &EIVE_SEQUENCE_SAFE.second, EIVE_SEQUENCE_SAFE.first)), ctxc); From 6521e419eb3689ba3d8440a05c73196ee6f34ce9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 12 Feb 2023 21:07:33 +0100 Subject: [PATCH 276/330] issues with SPI.. --- bsp_q7s/obsw.cpp | 2 -- common/config/devConf.h | 4 ++-- fsfw | 2 +- linux/devices/Max31865RtdLowlevelHandler.cpp | 11 +++++++++-- linux/devices/Max31865RtdLowlevelHandler.h | 6 ++++-- mission/system/tree/acsModeTree.cpp | 3 ++- 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/bsp_q7s/obsw.cpp b/bsp_q7s/obsw.cpp index 3ae795fc..9c071882 100644 --- a/bsp_q7s/obsw.cpp +++ b/bsp_q7s/obsw.cpp @@ -75,7 +75,6 @@ int obsw::obsw() { scheduling::initMission(); // Command the EIVE system to safe mode - /* auto sysQueueId = satsystem::EIVE_SYSTEM.getCommandQueue(); CommandMessage msg; ModeMessage::setCmdModeMessage(msg, acs::AcsMode::SAFE, 0); @@ -84,7 +83,6 @@ int obsw::obsw() { if (result != returnvalue::OK) { sif::error << "Sending safe mode command to EIVE system failed" << std::endl; } - */ for (;;) { /* Suspend main thread by sleeping it. */ diff --git a/common/config/devConf.h b/common/config/devConf.h index d212835f..68b765d3 100644 --- a/common/config/devConf.h +++ b/common/config/devConf.h @@ -47,11 +47,11 @@ static constexpr spi::SpiModes DEFAULT_ADIS16507_MODE = spi::SpiModes::MODE_3; static constexpr uint32_t RW_SPEED = 300'000; static constexpr spi::SpiModes RW_MODE = spi::SpiModes::MODE_0; -static constexpr dur_millis_t RTD_CS_TIMEOUT = 50; +static constexpr dur_millis_t RTD_CS_TIMEOUT = 100; static constexpr uint32_t RTD_SPEED = 2'000'000; static constexpr spi::SpiModes RTD_MODE = spi::SpiModes::MODE_3; -static constexpr dur_millis_t SUS_CS_TIMEOUT = 50; +static constexpr dur_millis_t SUS_CS_TIMEOUT = 100; } // namespace spi diff --git a/fsfw b/fsfw index 7fae6cbd..8b4f73a9 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 7fae6cbd6db588d69fc00198e4b2a9d8a7c12f59 +Subproject commit 8b4f73a97b15f27e314932538d468707c57f965a diff --git a/linux/devices/Max31865RtdLowlevelHandler.cpp b/linux/devices/Max31865RtdLowlevelHandler.cpp index 594389d3..a6fe2061 100644 --- a/linux/devices/Max31865RtdLowlevelHandler.cpp +++ b/linux/devices/Max31865RtdLowlevelHandler.cpp @@ -73,11 +73,12 @@ bool Max31865RtdReader::periodicInitHandling() { ManualCsLockWrapper mg(csLock, gpioIF, rtd->spiCookie, csTimeoutType, csTimeoutMs); if (mg.lockResult != returnvalue::OK or mg.gpioResult != returnvalue::OK) { sif::error << "Max31865RtdReader::periodicInitHandling: Manual CS lock failed" << std::endl; - break; + continue; } result = writeCfgReg(rtd->spiCookie, BASE_CFG); if (result != returnvalue::OK) { handleSpiError(rtd, result, "writeCfgReg"); + continue; } if (rtd->writeLowThreshold) { result = writeLowThreshold(rtd->spiCookie, rtd->lowThreshold); @@ -152,16 +153,22 @@ ReturnValue_t Max31865RtdReader::periodicReadHandling() { return returnvalue::FAILED; } if (rtdIsActive(rtd->idx)) { + ManualCsLockWrapper mg(csLock, gpioIF, rtd->spiCookie, csTimeoutType, csTimeoutMs); + if (mg.lockResult != returnvalue::OK or mg.gpioResult != returnvalue::OK) { + sif::error << "Max31865RtdReader::periodicInitHandling: Manual CS lock failed" << std::endl; + continue; + } uint16_t rtdVal = 0; bool faultBitSet = false; result = writeCfgReg(rtd->spiCookie, BASE_CFG); if (result != returnvalue::OK) { handleSpiError(rtd, result, "writeCfgReg"); + continue; } result = readRtdVal(rtd->spiCookie, rtdVal, faultBitSet); if (result != returnvalue::OK) { handleSpiError(rtd, result, "readRtdVal"); - return returnvalue::FAILED; + continue; } if (faultBitSet) { rtd->db.faultBitSet = faultBitSet; diff --git a/linux/devices/Max31865RtdLowlevelHandler.h b/linux/devices/Max31865RtdLowlevelHandler.h index 89d66350..4854ef3b 100644 --- a/linux/devices/Max31865RtdLowlevelHandler.h +++ b/linux/devices/Max31865RtdLowlevelHandler.h @@ -3,9 +3,11 @@ #include #include +#include #include #include +#include "devConf.h" #include "fsfw/devicehandlers/DeviceCommunicationIF.h" #include "mission/devices/devicedefinitions/Max31865Definitions.h" @@ -50,8 +52,8 @@ class Max31865RtdReader : public SystemObject, SpiComIF* comIF; GpioIF* gpioIF; - MutexIF::TimeoutType csTimeoutType = MutexIF::TimeoutType::BLOCKING; - uint32_t csTimeoutMs = 0; + MutexIF::TimeoutType csTimeoutType = MutexIF::TimeoutType::WAITING; + uint32_t csTimeoutMs = spi::RTD_CS_TIMEOUT; MutexIF* csLock = nullptr; bool periodicInitHandling(); diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index 7d3fef4f..62fb76ed 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -118,7 +118,8 @@ Subsystem& satsystem::acs::init() { // Build SUS board transition iht(objects::SUS_BOARD_ASS, NML, 0, SUS_BOARD_NML_TRANS.second); - check(ACS_SUBSYSTEM.addTable(TableEntry(SUS_BOARD_NML_TRANS.first, &SUS_BOARD_NML_TRANS.second)), ctxc); + check(ACS_SUBSYSTEM.addTable(TableEntry(SUS_BOARD_NML_TRANS.first, &SUS_BOARD_NML_TRANS.second)), + ctxc); buildOffSequence(ACS_SUBSYSTEM, entry); buildSafeSequence(ACS_SUBSYSTEM, entry); From 2f2d164526c97c2248e97e0b0cea2ef1cfb6f1cc Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 12 Feb 2023 21:27:10 +0100 Subject: [PATCH 277/330] this is crap but might just work --- bsp_q7s/OBSWConfig.h.in | 2 -- bsp_q7s/core/ObjectFactory.cpp | 16 ++++++++-------- common/config/commonConfig.h.in | 2 ++ common/config/devConf.h | 12 ++++++++++-- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/bsp_q7s/OBSWConfig.h.in b/bsp_q7s/OBSWConfig.h.in index faee473f..9273e4e9 100644 --- a/bsp_q7s/OBSWConfig.h.in +++ b/bsp_q7s/OBSWConfig.h.in @@ -9,8 +9,6 @@ #include "commonConfig.h" #include "q7sConfig.h" -#cmakedefine RELEASE_BUILD - /*******************************************************************/ /** All of the following flags should be enabled for mission code */ /*******************************************************************/ diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 15cd4baf..17170252 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -347,7 +347,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo SpiCookie* spiCookie = new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED); - spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, 40); + spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, spi::ACS_BOARD_CS_TIMEOUT); auto mgmLis3Handler0 = new MgmLIS3MDLHandler( objects::MGM_0_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::LIS3_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::MGM_0_LIS3_HANDLER); @@ -363,7 +363,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo spiCookie = new SpiCookie(addresses::MGM_1_RM3100, gpioIds::MGM_1_RM3100_CS, RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED); - spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, 40); + spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, spi::ACS_BOARD_CS_TIMEOUT); auto mgmRm3100Handler1 = new MgmRM3100Handler(objects::MGM_1_RM3100_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::RM3100_TRANSITION_DELAY); @@ -380,7 +380,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo spiCookie = new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED); - spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, 40); + spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, spi::ACS_BOARD_CS_TIMEOUT); auto* mgmLis3Handler2 = new MgmLIS3MDLHandler( objects::MGM_2_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::LIS3_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::MGM_2_LIS3_HANDLER); @@ -396,7 +396,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo spiCookie = new SpiCookie(addresses::MGM_3_RM3100, gpioIds::MGM_3_RM3100_CS, RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED); - spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, 40); + spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, spi::ACS_BOARD_CS_TIMEOUT); auto* mgmRm3100Handler3 = new MgmRM3100Handler(objects::MGM_3_RM3100_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::RM3100_TRANSITION_DELAY); @@ -415,7 +415,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo spiCookie = new SpiCookie(addresses::GYRO_0_ADIS, gpioIds::GYRO_0_ADIS_CS, ADIS1650X::MAXIMUM_REPLY_SIZE, spi::DEFAULT_ADIS16507_MODE, spi::DEFAULT_ADIS16507_SPEED); - spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, 40); + spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, spi::ACS_BOARD_CS_TIMEOUT); auto adisHandler = new GyroADIS1650XHandler(objects::GYRO_0_ADIS_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, ADIS1650X::Type::ADIS16505); @@ -432,7 +432,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo // Gyro 1 Side A spiCookie = new SpiCookie(addresses::GYRO_1_L3G, gpioIds::GYRO_1_L3G_CS, L3GD20H::MAX_BUFFER_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED); - spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, 40); + spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, spi::ACS_BOARD_CS_TIMEOUT); auto gyroL3gHandler1 = new GyroHandlerL3GD20H( objects::GYRO_1_L3G_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::L3G_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::GYRO_1_L3G_HANDLER); @@ -449,7 +449,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo spiCookie = new SpiCookie(addresses::GYRO_2_ADIS, gpioIds::GYRO_2_ADIS_CS, ADIS1650X::MAXIMUM_REPLY_SIZE, spi::DEFAULT_ADIS16507_MODE, spi::DEFAULT_ADIS16507_SPEED); - spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, 40); + spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, spi::ACS_BOARD_CS_TIMEOUT); adisHandler = new GyroADIS1650XHandler(objects::GYRO_2_ADIS_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, ADIS1650X::Type::ADIS16505); fdir = new AcsBoardFdir(objects::GYRO_2_ADIS_HANDLER); @@ -462,7 +462,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo // Gyro 3 Side B spiCookie = new SpiCookie(addresses::GYRO_3_L3G, gpioIds::GYRO_3_L3G_CS, L3GD20H::MAX_BUFFER_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED); - spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, 40); + spiCookie->setMutexParams(MutexIF::TimeoutType::WAITING, spi::ACS_BOARD_CS_TIMEOUT); auto gyroL3gHandler3 = new GyroHandlerL3GD20H( objects::GYRO_3_L3G_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::L3G_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::GYRO_3_L3G_HANDLER); diff --git a/common/config/commonConfig.h.in b/common/config/commonConfig.h.in index a6b7faab..96dc948a 100644 --- a/common/config/commonConfig.h.in +++ b/common/config/commonConfig.h.in @@ -4,6 +4,8 @@ #include #include "fsfw/version.h" +#cmakedefine RELEASE_BUILD + #cmakedefine RASPBERRY_PI #cmakedefine XIPHOS_Q7S #cmakedefine BEAGLEBONEBLACK diff --git a/common/config/devConf.h b/common/config/devConf.h index 68b765d3..27167397 100644 --- a/common/config/devConf.h +++ b/common/config/devConf.h @@ -5,6 +5,7 @@ #include +#include "commonConfig.h" #include "fsfw/timemanager/clockDefinitions.h" #include "fsfw_hal/linux/serial/SerialCookie.h" #include "fsfw_hal/linux/spi/spiDefinitions.h" @@ -47,11 +48,18 @@ static constexpr spi::SpiModes DEFAULT_ADIS16507_MODE = spi::SpiModes::MODE_3; static constexpr uint32_t RW_SPEED = 300'000; static constexpr spi::SpiModes RW_MODE = spi::SpiModes::MODE_0; -static constexpr dur_millis_t RTD_CS_TIMEOUT = 100; +#ifdef RELEASE_BUILD +static constexpr uint8_t CS_FACTOR = 1; +#else +static constexpr uint8_t CS_FACTOR = 3; +#endif + +static constexpr dur_millis_t RTD_CS_TIMEOUT = 50 * CS_FACTOR; static constexpr uint32_t RTD_SPEED = 2'000'000; static constexpr spi::SpiModes RTD_MODE = spi::SpiModes::MODE_3; -static constexpr dur_millis_t SUS_CS_TIMEOUT = 100; +static constexpr dur_millis_t SUS_CS_TIMEOUT = 50 * CS_FACTOR; +static constexpr dur_millis_t ACS_BOARD_CS_TIMEOUT = 50 * CS_FACTOR; } // namespace spi From 4b36313fea33a1ae6c33727596fb72a9ba5d3aa2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 12 Feb 2023 21:34:55 +0100 Subject: [PATCH 278/330] update config files --- bsp_q7s/OBSWConfig.h.in | 29 +++++++++++++---------------- bsp_q7s/obsw.cpp | 2 ++ 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/bsp_q7s/OBSWConfig.h.in b/bsp_q7s/OBSWConfig.h.in index 9273e4e9..687d9363 100644 --- a/bsp_q7s/OBSWConfig.h.in +++ b/bsp_q7s/OBSWConfig.h.in @@ -13,6 +13,12 @@ /** All of the following flags should be enabled for mission code */ /*******************************************************************/ +#define OBSW_ENABLE_PERIODIC_HK 0 +#define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0 +// This switch will cause the SW to command the EIVE system object to safe mode. This will +// trigger a lot of events, so it can make sense to disable this for debugging purposes +#define OBSW_COMMAND_SAFE_MODE_AT_STARTUP 1 + #define OBSW_ADD_GOMSPACE_PCDU @OBSW_ADD_GOMSPACE_PCDU@ #define OBSW_ADD_MGT @OBSW_ADD_MGT@ #define OBSW_ADD_BPX_BATTERY_HANDLER @OBSW_ADD_BPX_BATTERY_HANDLER@ @@ -39,25 +45,23 @@ #define OBSW_TM_TO_PTME @OBSW_TM_TO_PTME@ // Set to 1 if telecommands are received via the PDEC IP Core #define OBSW_TC_FROM_PDEC @OBSW_TC_FROM_PDEC@ -#define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0 // Configuration parameter which causes the core controller to try to keep at least one SD card // working #define OBSW_SD_CARD_MUST_BE_ON 1 #define OBSW_ENABLE_TIMERS 1 -// This is a really tricky switch.. It initializes the PCDU switches to their default states -// at powerup. I think it would be better -// to leave it off for now. It makes testing a lot more difficult and it might mess with -// something the operators might want to do by giving the software too much intelligence -// at the wrong place. The system component might command all the Switches accordingly anyway -#define OBSW_INITIALIZE_SWITCHES 0 -#define OBSW_ENABLE_PERIODIC_HK 0 - /*******************************************************************/ /** All of the following flags should be disabled for mission code */ /*******************************************************************/ +// Use TCP instead of UDP for the TMTC bridge. This allows using the TMTC client locally +// because UDP packets are not allowed in the VPN +// This will cause the OBSW to initialize the TMTC bridge responsible for exchanging data with the +// CCSDS IP Cores. +#define OBSW_ADD_TMTC_TCP_SERVER 1 +#define OBSW_ADD_TMTC_UDP_SERVER 1 + // Can be used to switch device to NORMAL mode immediately #define OBSW_SWITCH_TO_NORMAL_MODE_AFTER_STARTUP 0 #define OBSW_PRINT_MISSED_DEADLINES 1 @@ -119,13 +123,6 @@ /** CMake Defines */ /*******************************************************************/ -// Use TCP instead of UDP for the TMTC bridge. This allows using the TMTC client locally -// because UDP packets are not allowed in the VPN -// This will cause the OBSW to initialize the TMTC bridge responsible for exchanging data with the -// CCSDS IP Cores. -#define OBSW_ADD_TMTC_TCP_SERVER 1 -#define OBSW_ADD_TMTC_UDP_SERVER 1 - #cmakedefine EIVE_BUILD_GPSD_GPS_HANDLER #cmakedefine LIBGPS_VERSION_MAJOR @LIBGPS_VERSION_MAJOR@ diff --git a/bsp_q7s/obsw.cpp b/bsp_q7s/obsw.cpp index 9c071882..6df92158 100644 --- a/bsp_q7s/obsw.cpp +++ b/bsp_q7s/obsw.cpp @@ -74,6 +74,7 @@ int obsw::obsw() { scheduling::initMission(); +#if OBSW_COMMAND_SAFE_MODE_AT_STARTUP == 1 // Command the EIVE system to safe mode auto sysQueueId = satsystem::EIVE_SYSTEM.getCommandQueue(); CommandMessage msg; @@ -83,6 +84,7 @@ int obsw::obsw() { if (result != returnvalue::OK) { sif::error << "Sending safe mode command to EIVE system failed" << std::endl; } +#endif for (;;) { /* Suspend main thread by sleeping it. */ From 1d40e40691c7800ec03ff17887fd2f0705f22203 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 12 Feb 2023 21:36:24 +0100 Subject: [PATCH 279/330] remove obsolete code --- mission/devices/PcduHandler.cpp | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/mission/devices/PcduHandler.cpp b/mission/devices/PcduHandler.cpp index 06d296b4..46106796 100644 --- a/mission/devices/PcduHandler.cpp +++ b/mission/devices/PcduHandler.cpp @@ -457,22 +457,7 @@ void PCDUHandler::checkAndUpdatePduSwitch(GOMSPACE::Pdu pdu, pcdu::Switches swit uint8_t setValue) { using namespace pcdu; if (switchStates[switchIdx] != setValue) { -#if OBSW_INITIALIZE_SWITCHES == 1 - // This code initializes the switches to the default init switch states on every reboot. - // This is not done by the PCDU unless it is power-cycled. - if (((pdu == GOMSPACE::Pdu::PDU1) and firstSwitchInfoPdu1) or - ((pdu == GOMSPACE::Pdu::PDU2) and firstSwitchInfoPdu2)) { - ReturnValue_t state = PowerSwitchIF::SWITCH_OFF; - if (INIT_SWITCH_STATES[switchIdx] == ON) { - state = PowerSwitchIF::SWITCH_ON; - } - sendSwitchCommand(switchIdx, state); - } else { - triggerEvent(power::SWITCH_HAS_CHANGED, setValue, switchIdx); - } -#else triggerEvent(power::SWITCH_HAS_CHANGED, setValue, switchIdx); -#endif } switchStates[switchIdx] = setValue; } From c5a4fcd6747753ecdbae5e765fb9379d1b6b6b71 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 12 Feb 2023 21:44:23 +0100 Subject: [PATCH 280/330] that delay is unecessary --- mission/system/tree/system.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/system/tree/system.cpp b/mission/system/tree/system.cpp index 5c3bacf9..3ea56639 100644 --- a/mission/system/tree/system.cpp +++ b/mission/system/tree/system.cpp @@ -95,7 +95,7 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) { // Build Safe sequence ihs(EIVE_SEQUENCE_SAFE.second, EIVE_TABLE_SAFE_TGT.first, 0, false); ihs(EIVE_SEQUENCE_SAFE.second, EIVE_TABLE_SAFE_TRANS_0.first, 0, false); - ihs(EIVE_SEQUENCE_SAFE.second, EIVE_TABLE_SAFE_TRANS_1.first, 4, false); + ihs(EIVE_SEQUENCE_SAFE.second, EIVE_TABLE_SAFE_TRANS_1.first, 0, false); check(ss.addSequence(SequenceEntry(EIVE_SEQUENCE_SAFE.first, &EIVE_SEQUENCE_SAFE.second, EIVE_SEQUENCE_SAFE.first)), ctxc); From 3759b5d34a9bd996c5ef3e71e9afec24fb688d55 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Feb 2023 01:26:30 +0100 Subject: [PATCH 281/330] I am happy with this version --- CHANGELOG.md | 36 ++++++++++++++++++++++ CMakeLists.txt | 5 ++++ bsp_q7s/core/scheduling.cpp | 2 +- common/config/eive/definitions.h | 2 +- fsfw | 2 +- linux/fsfwconfig/FSFWConfig.h.in | 2 +- mission/CMakeLists.txt | 2 ++ mission/acsDefs.cpp | 40 +++++++++++++++++++++++++ mission/acsDefs.h | 4 ++- mission/controller/AcsController.cpp | 10 +++++-- mission/core/GenericFactory.cpp | 2 +- mission/system/objects/AcsSubsystem.cpp | 6 ++++ mission/system/objects/AcsSubsystem.h | 1 + mission/system/objects/CMakeLists.txt | 1 + mission/system/objects/EiveSystem.cpp | 38 +++++++++++++++++++++++ mission/system/objects/EiveSystem.h | 1 + mission/system/objects/TcsSubsystem.cpp | 27 +++++++++++++++++ mission/system/objects/TcsSubsystem.h | 13 ++++++++ mission/system/tree/system.cpp | 4 ++- mission/system/tree/tcsModeTree.cpp | 2 +- mission/system/tree/tcsModeTree.h | 5 ++-- 21 files changed, 193 insertions(+), 12 deletions(-) create mode 100644 mission/acsDefs.cpp create mode 100644 mission/system/objects/TcsSubsystem.cpp create mode 100644 mission/system/objects/TcsSubsystem.h diff --git a/CHANGELOG.md b/CHANGELOG.md index 744082ad..fe6a7434 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,42 @@ change warranting a new major release: # [unreleased] +# [v1.27.0] 2023-02-13 + +Added EIVE system top mode component. Currently, only SAFE and IDLE mode are +implemented, and the system does not do more than commanding TCS and ACS +into the correct modes. It does not have a lot of mode tracking capabilities +yet because the ACS controller might alternate between SAFE and DETUMBLE. +It takes around 5-10 seconds for the EIVE system to reach the SAFE mode. + +The new system is used at software boot to command the satellite into safe mode +on each reboot. This behaviour can be disabled with the +`OBSW_SWITCH_TO_NORMAL_MODE_AFTER_STARTUP` flag. + +## Added + +- New EIVE system component like explained above. + +## Changed + +- The satellite now commands itself into SAFE mode on each reboot, which + triggers a lot of events on each SW reboot. The TCS subsystem will commanded + to NORMAL mode immediately while the ACS subsystem will be commanded to + SAFE mode. The payload subsystem will be commanded OFF. +- `RELEASE_BUILD` flag moved to `commonConfig.h` +- The ACS subsystem transitions are now staggered: The SUS board assembly + is commanded as a separate transition. This reduces the risk of long bus lockups. +- No INFO mode event translations for release builds to reduce number of + printouts. +- More granular locking inside the MAX31865 low level read handler. + +## Fixed + +- More DHB thermal module fixes. +- ACS PST frequency extended to 0.8 seconds in debug builds to avoid SPI + bus lockups. +- Local datapool fixes for the `PlocSupervisorHandler` + # [v1.26.4] 2023-02-10 eive-tmtc: v2.12.3 diff --git a/CMakeLists.txt b/CMakeLists.txt index e298c352..d99711b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -307,6 +307,11 @@ endif() include(BuildType) set_build_type() +set(FSFW_DEBUG_INFO 0) +if(RELEASE_BUILD MATCHES 0) + set(FSFW_DEBUG_INFO 1) +endif() + # Configuration files configure_file(${COMMON_CONFIG_PATH}/commonConfig.h.in commonConfig.h) configure_file(${FSFW_CONFIG_PATH}/FSFWConfig.h.in FSFWConfig.h) diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index 713550c4..e4dcdb2d 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -390,7 +390,7 @@ void scheduling::createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction #ifdef RELEASE_BUILD static constexpr float acsPstPeriod = 0.4; #else - static constexpr float acsPstPeriod = 0.6; + static constexpr float acsPstPeriod = 0.8; #endif FixedTimeslotTaskIF* acsPst = factory.createFixedTimeslotTask( "ACS_PST", 85, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, acsPstPeriod, missedDeadlineFunc); diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index 8e0ac7b7..c572e21a 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -53,7 +53,7 @@ static constexpr uint8_t VC3_QUEUE_SIZE = 50; static constexpr uint32_t MAX_PUS_FUNNEL_QUEUE_DEPTH = 100; static constexpr uint32_t MAX_STORED_CMDS_UDP = 120; -static constexpr uint32_t MAX_STORED_CMDS_TCP = 120; +static constexpr uint32_t MAX_STORED_CMDS_TCP = 150; namespace acs { diff --git a/fsfw b/fsfw index 8b4f73a9..dac2d210 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 8b4f73a97b15f27e314932538d468707c57f965a +Subproject commit dac2d210b597adfaf45bd5ae6a4c027599927601 diff --git a/linux/fsfwconfig/FSFWConfig.h.in b/linux/fsfwconfig/FSFWConfig.h.in index 25772ce7..387ef724 100644 --- a/linux/fsfwconfig/FSFWConfig.h.in +++ b/linux/fsfwconfig/FSFWConfig.h.in @@ -34,7 +34,7 @@ #if FSFW_OBJ_EVENT_TRANSLATION == 1 //! Specify whether info events are printed too. -#define FSFW_DEBUG_INFO 1 +#define FSFW_DEBUG_INFO @FSFW_DEBUG_INFO@ #include "objects/translateObjects.h" #include "events/translateEvents.h" #else diff --git a/mission/CMakeLists.txt b/mission/CMakeLists.txt index d3782d4b..f284a675 100644 --- a/mission/CMakeLists.txt +++ b/mission/CMakeLists.txt @@ -8,3 +8,5 @@ add_subdirectory(system) add_subdirectory(csp) add_subdirectory(cfdp) add_subdirectory(config) + +target_sources(${LIB_EIVE_MISSION} PRIVATE acsDefs.cpp) diff --git a/mission/acsDefs.cpp b/mission/acsDefs.cpp new file mode 100644 index 00000000..00686b15 --- /dev/null +++ b/mission/acsDefs.cpp @@ -0,0 +1,40 @@ +#include "acsDefs.h" + +const char* acs::getModeStr(AcsMode mode) { + static const char* modeStr = "UNKNOWN"; + switch (mode) { + case (acs::AcsMode::OFF): { + modeStr = "OFF"; + break; + } + case (acs::AcsMode::SAFE): { + modeStr = "SAFE"; + break; + } + case (acs::AcsMode::DETUMBLE): { + modeStr = "DETUBMLE"; + break; + } + case (acs::AcsMode::PTG_NADIR): { + modeStr = "POITNING NADIR"; + break; + } + case (acs::AcsMode::PTG_IDLE): { + modeStr = "POINTING IDLE"; + break; + } + case (acs::AcsMode::PTG_INERTIAL): { + modeStr = "POINTING INERTIAL"; + break; + } + case (acs::AcsMode::PTG_TARGET): { + modeStr = "POINTING TARGET"; + break; + } + case (acs::AcsMode::PTG_TARGET_GS): { + modeStr = "POINTING TARGET GS"; + break; + } + } + return modeStr; +} diff --git a/mission/acsDefs.h b/mission/acsDefs.h index ac093f6f..57ae4730 100644 --- a/mission/acsDefs.h +++ b/mission/acsDefs.h @@ -7,7 +7,7 @@ namespace acs { // These modes are the submodes of the ACS controller and the modes of the ACS subsystem. -enum AcsMode { +enum AcsMode : Mode_t { OFF = HasModesIF::MODE_OFF, SAFE = 10, DETUMBLE = 11, @@ -24,6 +24,8 @@ static const Event SAFE_RATE_VIOLATION = MAKE_EVENT(0, severity::MEDIUM); //!< The system has recovered from a safe rate rotation violation. static constexpr Event SAFE_RATE_RECOVERY = MAKE_EVENT(1, severity::MEDIUM); +extern const char* getModeStr(AcsMode mode); + } // namespace acs #endif /* MISSION_ACSDEFS_H_ */ diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 1b4f54a9..b4f015b2 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -566,9 +566,15 @@ ReturnValue_t AcsController::checkModeCommand(Mode_t mode, Submode_t submode, return INVALID_MODE; } -void AcsController::modeChanged(Mode_t mode, Submode_t submode) {} +void AcsController::modeChanged(Mode_t mode, Submode_t submode) { + return ExtendedControllerBase::modeChanged(mode, submode); +} -void AcsController::announceMode(bool recursive) {} +void AcsController::announceMode(bool recursive) { + const char *modeStr = acs::getModeStr(static_cast(mode)); + sif::info << "ACS controller is now in " << modeStr << " mode" << std::endl; + return ExtendedControllerBase::announceMode(recursive); +} void AcsController::copyMgmData() { ACS::SensorValues sensorValues; diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index b833b5db..8c05ed4f 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -94,7 +94,7 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun } { - PoolManager::LocalPoolConfig poolCfg = {{400, 32}, {350, 64}, {200, 128}, + PoolManager::LocalPoolConfig poolCfg = {{400, 32}, {400, 64}, {250, 128}, {150, 512}, {150, 1024}, {150, 2048}}; tmStore = new PoolManager(objects::TM_STORE, poolCfg); } diff --git a/mission/system/objects/AcsSubsystem.cpp b/mission/system/objects/AcsSubsystem.cpp index dcf4e67b..b4ee3d52 100644 --- a/mission/system/objects/AcsSubsystem.cpp +++ b/mission/system/objects/AcsSubsystem.cpp @@ -81,3 +81,9 @@ void AcsSubsystem::handleEventMessages() { } } } + +void AcsSubsystem::announceMode(bool recursive) { + const char* modeStr = acs::getModeStr(static_cast(mode)); + sif::info << "ACS subsystem is now in " << modeStr << " mode" << std::endl; + return Subsystem::announceMode(recursive); +} diff --git a/mission/system/objects/AcsSubsystem.h b/mission/system/objects/AcsSubsystem.h index df5bbbf3..c6c77fef 100644 --- a/mission/system/objects/AcsSubsystem.h +++ b/mission/system/objects/AcsSubsystem.h @@ -10,6 +10,7 @@ class AcsSubsystem : public Subsystem { private: ReturnValue_t initialize() override; void performChildOperation() override; + void announceMode(bool recursive) override; void handleEventMessages(); diff --git a/mission/system/objects/CMakeLists.txt b/mission/system/objects/CMakeLists.txt index 75526486..0290a311 100644 --- a/mission/system/objects/CMakeLists.txt +++ b/mission/system/objects/CMakeLists.txt @@ -4,6 +4,7 @@ target_sources( CamSwitcher.cpp AcsSubsystem.cpp ComSubsystem.cpp + TcsSubsystem.cpp PayloadSubsystem.cpp AcsBoardAssembly.cpp Stack5VHandler.cpp diff --git a/mission/system/objects/EiveSystem.cpp b/mission/system/objects/EiveSystem.cpp index a870214d..26707bf1 100644 --- a/mission/system/objects/EiveSystem.cpp +++ b/mission/system/objects/EiveSystem.cpp @@ -1,5 +1,43 @@ #include "EiveSystem.h" +#include + EiveSystem::EiveSystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables) : Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) {} + +void EiveSystem::announceMode(bool recursive) { + const char* modeStr = "UNKNOWN"; + switch (mode) { + case (acs::AcsMode::OFF): { + modeStr = "OFF"; + break; + } + case (acs::AcsMode::SAFE): { + modeStr = "SAFE"; + break; + } + case (acs::AcsMode::DETUMBLE): { + modeStr = "DETUBMLE"; + break; + } + case (acs::AcsMode::PTG_IDLE): { + modeStr = "POINTING IDLE"; + break; + } + case (acs::AcsMode::PTG_INERTIAL): { + modeStr = "POINTING INERTIAL"; + break; + } + case (acs::AcsMode::PTG_TARGET): { + modeStr = "POINTING TARGET"; + break; + } + case (acs::AcsMode::PTG_TARGET_GS): { + modeStr = "POINTING TARGET GS"; + break; + } + } + sif::info << "EIVE system is now in " << modeStr << " mode" << std::endl; + return Subsystem::announceMode(recursive); +} diff --git a/mission/system/objects/EiveSystem.h b/mission/system/objects/EiveSystem.h index e88d2402..59acf82e 100644 --- a/mission/system/objects/EiveSystem.h +++ b/mission/system/objects/EiveSystem.h @@ -8,6 +8,7 @@ class EiveSystem : public Subsystem { EiveSystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables); private: + void announceMode(bool recursive) override; }; #endif /* MISSION_SYSTEM_EIVESYSTEM_H_ */ diff --git a/mission/system/objects/TcsSubsystem.cpp b/mission/system/objects/TcsSubsystem.cpp new file mode 100644 index 00000000..85cf644d --- /dev/null +++ b/mission/system/objects/TcsSubsystem.cpp @@ -0,0 +1,27 @@ +#include "TcsSubsystem.h" + +#include "fsfw/devicehandlers/DeviceHandlerIF.h" + +TcsSubsystem::TcsSubsystem(object_id_t objectId, uint32_t maxNumberOfSequences, + uint32_t maxNumberOfTables) + : Subsystem(objectId, maxNumberOfSequences, maxNumberOfTables) {} + +void TcsSubsystem::announceMode(bool recursive) { + const char* modeStr = "UNKNOWN"; + switch (mode) { + case (HasModesIF::MODE_OFF): { + modeStr = "OFF"; + break; + } + case (HasModesIF::MODE_ON): { + modeStr = "ON"; + break; + } + case (DeviceHandlerIF::MODE_NORMAL): { + modeStr = "NORMAL"; + break; + } + } + sif::info << "TCS subsystem is now in " << modeStr << " mode" << std::endl; + return Subsystem::announceMode(recursive); +} diff --git a/mission/system/objects/TcsSubsystem.h b/mission/system/objects/TcsSubsystem.h new file mode 100644 index 00000000..4218f9b2 --- /dev/null +++ b/mission/system/objects/TcsSubsystem.h @@ -0,0 +1,13 @@ +#ifndef MISSION_SYSTEM_OBJECTS_TCSSUBSYSTEM_H_ +#define MISSION_SYSTEM_OBJECTS_TCSSUBSYSTEM_H_ +#include + +class TcsSubsystem : public Subsystem { + public: + TcsSubsystem(object_id_t objectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables); + + private: + void announceMode(bool recursive) override; +}; + +#endif /* MISSION_SYSTEM_OBJECTS_TCSSUBSYSTEM_H_ */ diff --git a/mission/system/tree/system.cpp b/mission/system/tree/system.cpp index 3ea56639..69345bf3 100644 --- a/mission/system/tree/system.cpp +++ b/mission/system/tree/system.cpp @@ -76,7 +76,9 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) { check(sequence.insert(eh), ctxc); }; - iht(objects::ACS_SUBSYSTEM, acs::AcsMode::SAFE, 0, EIVE_TABLE_SAFE_TGT.second); + // Do no track ACS for now because it might jump to detumble mode and back to safe as part of + // normal operations. + // iht(objects::ACS_SUBSYSTEM, acs::AcsMode::SAFE, 0, EIVE_TABLE_SAFE_TGT.second); iht(objects::PL_SUBSYSTEM, OFF, 0, EIVE_TABLE_SAFE_TGT.second); check(ss.addTable(TableEntry(EIVE_TABLE_SAFE_TGT.first, &EIVE_TABLE_SAFE_TGT.second)), ctxc); diff --git a/mission/system/tree/tcsModeTree.cpp b/mission/system/tree/tcsModeTree.cpp index 96b936bf..d411161a 100644 --- a/mission/system/tree/tcsModeTree.cpp +++ b/mission/system/tree/tcsModeTree.cpp @@ -5,7 +5,7 @@ #include "fsfw/subsystem/Subsystem.h" #include "mission/system/tree/util.h" -Subsystem satsystem::tcs::SUBSYSTEM(objects::TCS_SUBSYSTEM, 12, 24); +TcsSubsystem satsystem::tcs::SUBSYSTEM(objects::TCS_SUBSYSTEM, 12, 24); namespace { // Alias for checker function diff --git a/mission/system/tree/tcsModeTree.h b/mission/system/tree/tcsModeTree.h index af10e60b..ca576a6d 100644 --- a/mission/system/tree/tcsModeTree.h +++ b/mission/system/tree/tcsModeTree.h @@ -1,11 +1,12 @@ #ifndef MISSION_SYSTEM_TREE_TCSMODETREE_H_ #define MISSION_SYSTEM_TREE_TCSMODETREE_H_ -#include + +#include namespace satsystem { namespace tcs { -extern Subsystem SUBSYSTEM; +extern TcsSubsystem SUBSYSTEM; Subsystem& init(); } // namespace tcs From 7e3de3ca9573bb9a16d12b9c08ab5c6232ef7598 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Feb 2023 09:56:57 +0100 Subject: [PATCH 282/330] timing problem does not fully disappear.. --- bsp_q7s/core/scheduling.cpp | 4 ++-- mission/controller/AcsController.cpp | 13 +++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index e4dcdb2d..cc3108e8 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -216,14 +216,14 @@ void scheduling::initTasks() { #if OBSW_ADD_RTD_DEVICES == 1 PeriodicTaskIF* tcsPollingTask = factory->createPeriodicTask( - "TCS_POLLING_TASK", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.5, missedDeadlineFunc); + "TCS_POLLING_TASK", 75, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.5, missedDeadlineFunc); result = tcsPollingTask->addComponent(objects::SPI_RTD_COM_IF); if (result != returnvalue::OK) { scheduling::printAddObjectError("SPI_RTD_POLLING", objects::SPI_RTD_COM_IF); } PeriodicTaskIF* tcsTask = factory->createPeriodicTask( - "TCS_TASK", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc); + "TCS_TASK", 55, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc); scheduling::scheduleRtdSensors(tcsTask); #endif diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index b4f015b2..f2a126dd 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -571,8 +571,17 @@ void AcsController::modeChanged(Mode_t mode, Submode_t submode) { } void AcsController::announceMode(bool recursive) { - const char *modeStr = acs::getModeStr(static_cast(mode)); - sif::info << "ACS controller is now in " << modeStr << " mode" << std::endl; + const char* modeStr = "UNKNOWN"; + if(mode == HasModesIF::MODE_OFF) { + modeStr = "OFF"; + } else if(mode == HasModesIF::MODE_ON) { + modeStr = "ON"; + } else if(mode == DeviceHandlerIF::MODE_NORMAL) { + modeStr = "NORMAL"; + } + const char *submodeStr = acs::getModeStr(static_cast(mode)); + sif::info << "ACS controller is now in " << modeStr << " mode with " << + submodeStr << " submode" << std::endl; return ExtendedControllerBase::announceMode(recursive); } From 2c0efdee5aea79409fd627646d4708a8324d3c54 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Feb 2023 10:03:16 +0100 Subject: [PATCH 283/330] printout corrections --- mission/controller/AcsController.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index f2a126dd..ef590b8c 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -571,17 +571,17 @@ void AcsController::modeChanged(Mode_t mode, Submode_t submode) { } void AcsController::announceMode(bool recursive) { - const char* modeStr = "UNKNOWN"; - if(mode == HasModesIF::MODE_OFF) { + const char *modeStr = "UNKNOWN"; + if (mode == HasModesIF::MODE_OFF) { modeStr = "OFF"; - } else if(mode == HasModesIF::MODE_ON) { + } else if (mode == HasModesIF::MODE_ON) { modeStr = "ON"; - } else if(mode == DeviceHandlerIF::MODE_NORMAL) { + } else if (mode == DeviceHandlerIF::MODE_NORMAL) { modeStr = "NORMAL"; } - const char *submodeStr = acs::getModeStr(static_cast(mode)); - sif::info << "ACS controller is now in " << modeStr << " mode with " << - submodeStr << " submode" << std::endl; + const char *submodeStr = acs::getModeStr(static_cast(submode)); + sif::info << "ACS controller is now in " << modeStr << " mode with " << submodeStr << " submode" + << std::endl; return ExtendedControllerBase::announceMode(recursive); } From 577915db13ad1756bac3bb305487fed4c75bdc52 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Feb 2023 10:04:05 +0100 Subject: [PATCH 284/330] prep next version --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d99711b3..8af127a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,8 +10,8 @@ cmake_minimum_required(VERSION 3.13) set(OBSW_VERSION_MAJOR 1) -set(OBSW_VERSION_MINOR 26) -set(OBSW_VERSION_REVISION 4) +set(OBSW_VERSION_MINOR 27) +set(OBSW_VERSION_REVISION 0) # set(CMAKE_VERBOSE TRUE) From c90d6f1f554ad8c0e690cb3e0a41af455432076c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Feb 2023 10:07:21 +0100 Subject: [PATCH 285/330] bump tmtc --- CHANGELOG.md | 2 ++ tmtc | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe6a7434..431606a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ change warranting a new major release: # [v1.27.0] 2023-02-13 +eive-tmtc: v2.12.5 + Added EIVE system top mode component. Currently, only SAFE and IDLE mode are implemented, and the system does not do more than commanding TCS and ACS into the correct modes. It does not have a lot of mode tracking capabilities diff --git a/tmtc b/tmtc index d47da4c3..09cf9603 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit d47da4c314837e63b054d5dfe22db7c0f3794b90 +Subproject commit 09cf960350911a62308733d051a57e6b4e45d157 From 4958fa73d103b2f9637d1db301b80d2f8e69e5ff Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Feb 2023 10:08:42 +0100 Subject: [PATCH 286/330] re-run generators --- .../fsfwconfig/events/translateEvents.cpp | 2 +- .../fsfwconfig/objects/translateObjects.cpp | 2 +- generators/bsp_hosted_returnvalues.csv | 662 +++++++-------- generators/bsp_q7s_returnvalues.csv | 768 +++++++++--------- generators/events/translateEvents.cpp | 2 +- generators/objects/translateObjects.cpp | 2 +- linux/fsfwconfig/events/translateEvents.cpp | 2 +- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- tmtc | 2 +- 9 files changed, 722 insertions(+), 722 deletions(-) diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index 076be623..42156029 100644 --- a/bsp_hosted/fsfwconfig/events/translateEvents.cpp +++ b/bsp_hosted/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 256 translations. * @details - * Generated on: 2023-02-09 15:57:01 + * Generated on: 2023-02-13 10:07:30 */ #include "translateEvents.h" diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index 09224cd4..8f23a6d4 100644 --- a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp +++ b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 147 translations. - * Generated on: 2023-02-09 15:57:01 + * Generated on: 2023-02-13 10:07:30 */ #include "translateObjects.h" diff --git a/generators/bsp_hosted_returnvalues.csv b/generators/bsp_hosted_returnvalues.csv index 44bc8078..b707b0be 100644 --- a/generators/bsp_hosted_returnvalues.csv +++ b/generators/bsp_hosted_returnvalues.csv @@ -1,23 +1,13 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x0000;OK;System-wide code for ok.;0;HasReturnvaluesIF;fsfw/returnvalues/returnvalue.h 0x0001;Failed;Unspecified system-wide code for failed.;1;HasReturnvaluesIF;fsfw/returnvalues/returnvalue.h -0x63a0;NVMB_KeyNotExists;Specified key does not exist in json file;160;NVM_PARAM_BASE;mission/memory/NVMParameterBase.h -0x6300;NVMB_Busy;;0;NVM_PARAM_BASE;mission/system/objects/Stack5VHandler.h -0x58a0;SUSS_ErrorUnlockMutex;;160;SUS_HANDLER;mission/devices/SusHandler.h -0x58a1;SUSS_ErrorLockMutex;;161;SUS_HANDLER;mission/devices/SusHandler.h -0x66a0;SADPL_CommandNotSupported;;160;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h -0x66a1;SADPL_DeploymentAlreadyExecuting;;161;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h -0x66a2;SADPL_MainSwitchTimeoutFailure;;162;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h -0x66a3;SADPL_SwitchingDeplSa1Failed;;163;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h -0x66a4;SADPL_SwitchingDeplSa2Failed;;164;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h -0x51a0;IMTQ_InvalidCommandCode;;160;IMTQ_HANDLER;mission/devices/ImtqHandler.h -0x51a1;IMTQ_ParameterMissing;;161;IMTQ_HANDLER;mission/devices/ImtqHandler.h -0x51a2;IMTQ_ParameterInvalid;;162;IMTQ_HANDLER;mission/devices/ImtqHandler.h -0x51a3;IMTQ_CcUnavailable;;163;IMTQ_HANDLER;mission/devices/ImtqHandler.h -0x51a4;IMTQ_InternalProcessingError;;164;IMTQ_HANDLER;mission/devices/ImtqHandler.h -0x51a5;IMTQ_RejectedWithoutReason;;165;IMTQ_HANDLER;mission/devices/ImtqHandler.h -0x51a6;IMTQ_CmdErrUnknown;;166;IMTQ_HANDLER;mission/devices/ImtqHandler.h -0x51a7;IMTQ_UnexpectedSelfTestReply;The status reply to a self test command was received but no self test command has been sent. This should normally never happen.;167;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x60a0;CCSDS_CommandNotImplemented;Received action message with unknown action id;160;CCSDS_HANDLER;mission/tmtc/CcsdsIpCoreHandler.h +0x5d00;GOMS_PacketTooLong;;0;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5d01;GOMS_InvalidTableId;;1;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5d02;GOMS_InvalidAddress;;2;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5d03;GOMS_InvalidParamSize;;3;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5d04;GOMS_InvalidPayloadSize;;4;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5d05;GOMS_UnknownReplyId;;5;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h 0x52b0;RWHA_SpiWriteFailure;;176;RW_HANDLER;mission/devices/RwHandler.h 0x52b1;RWHA_SpiReadFailure;Used by the spi send function to tell a failing read call;177;RW_HANDLER;mission/devices/RwHandler.h 0x52b2;RWHA_MissingStartSign;Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E;178;RW_HANDLER;mission/devices/RwHandler.h @@ -30,6 +20,21 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x52a2;RWHA_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;162;RW_HANDLER;mission/devices/RwHandler.h 0x52a3;RWHA_ExecutionFailed;Command execution failed;163;RW_HANDLER;mission/devices/RwHandler.h 0x52a4;RWHA_CrcError;Reaction wheel reply has invalid crc;164;RW_HANDLER;mission/devices/RwHandler.h +0x4fa1;HEATER_CommandNotSupported;;161;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x4fa2;HEATER_InitFailed;;162;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x4fa3;HEATER_InvalidSwitchNr;;163;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x4fa4;HEATER_MainSwitchSetTimeout;;164;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x4fa5;HEATER_CommandAlreadyWaiting;;165;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x58a0;SUSS_ErrorUnlockMutex;;160;SUS_HANDLER;mission/devices/SusHandler.h +0x58a1;SUSS_ErrorLockMutex;;161;SUS_HANDLER;mission/devices/SusHandler.h +0x51a0;IMTQ_InvalidCommandCode;;160;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x51a1;IMTQ_ParameterMissing;;161;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x51a2;IMTQ_ParameterInvalid;;162;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x51a3;IMTQ_CcUnavailable;;163;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x51a4;IMTQ_InternalProcessingError;;164;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x51a5;IMTQ_RejectedWithoutReason;;165;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x51a6;IMTQ_CmdErrUnknown;;166;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x51a7;IMTQ_UnexpectedSelfTestReply;The status reply to a self test command was received but no self test command has been sent. This should normally never happen.;167;IMTQ_HANDLER;mission/devices/ImtqHandler.h 0x50a0;SYRLINKS_CrcFailure;;160;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h 0x50a1;SYRLINKS_UartFraminOrParityErrorAck;;161;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h 0x50a2;SYRLINKS_BadCharacterAck;;162;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h @@ -39,123 +44,137 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x50a6;SYRLINKS_BadCrcAck;;166;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h 0x50a7;SYRLINKS_ReplyWrongSize;;167;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h 0x50a8;SYRLINKS_MissingStartFrameCharacter;;168;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h -0x5d00;GOMS_PacketTooLong;;0;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x5d01;GOMS_InvalidTableId;;1;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x5d02;GOMS_InvalidAddress;;2;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x5d03;GOMS_InvalidParamSize;;3;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x5d04;GOMS_InvalidPayloadSize;;4;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x5d05;GOMS_UnknownReplyId;;5;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x4fa1;HEATER_CommandNotSupported;;161;HEATER_HANDLER;mission/devices/HeaterHandler.h -0x4fa2;HEATER_InitFailed;;162;HEATER_HANDLER;mission/devices/HeaterHandler.h -0x4fa3;HEATER_InvalidSwitchNr;;163;HEATER_HANDLER;mission/devices/HeaterHandler.h -0x4fa4;HEATER_MainSwitchSetTimeout;;164;HEATER_HANDLER;mission/devices/HeaterHandler.h -0x4fa5;HEATER_CommandAlreadyWaiting;;165;HEATER_HANDLER;mission/devices/HeaterHandler.h -0x60a0;CCSDS_CommandNotImplemented;Received action message with unknown action id;160;CCSDS_HANDLER;mission/tmtc/CcsdsIpCoreHandler.h -0x6a01;ACSSAF_SafectrlMekfInputInvalid;;1;ACS_SAFE;mission/controller/acs/control/SafeCtrl.h +0x66a0;SADPL_CommandNotSupported;;160;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x66a1;SADPL_DeploymentAlreadyExecuting;;161;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x66a2;SADPL_MainSwitchTimeoutFailure;;162;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x66a3;SADPL_SwitchingDeplSa1Failed;;163;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x66a4;SADPL_SwitchingDeplSa2Failed;;164;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x6600;SADPL_Busy;;0;SA_DEPL_HANDLER;mission/system/objects/Stack5VHandler.h 0x6b01;ACSPTG_PtgctrlMekfInputInvalid;;1;ACS_PTG;mission/controller/acs/control/PtgCtrl.h +0x6a01;ACSSAF_SafectrlMekfInputInvalid;;1;ACS_SAFE;mission/controller/acs/control/SafeCtrl.h 0x6c01;ACSDTB_DetumbleNoSensordata;;1;ACS_DETUMBLE;mission/controller/acs/control/Detumble.h 0x6901;ACSKAL_KalmanNoGyrMeas;;1;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h 0x6902;ACSKAL_KalmanNoModel;;2;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h 0x6903;ACSKAL_KalmanInversionFailed;;3;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h -0x4500;HSPI_OpeningFileFailed;;0;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h -0x4501;HSPI_FullDuplexTransferFailed;;1;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h -0x4502;HSPI_HalfDuplexTransferFailed;;2;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h -0x4801;HGIO_UnknownGpioId;;1;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4802;HGIO_DriveGpioFailure;;2;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4803;HGIO_GpioTypeFailure;;3;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4804;HGIO_GpioInvalidInstance;;4;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4805;HGIO_GpioDuplicateDetected;;5;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4806;HGIO_GpioInitFailed;;6;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4807;HGIO_GpioGetValueFailed;;7;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4601;HURT_UartReadFailure;;1;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h -0x4602;HURT_UartReadSizeMissmatch;;2;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h -0x4603;HURT_UartRxBufferTooSmall;;3;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h -0x4400;UXOS_ExecutionFinished;Execution of the current command has finished;0;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4401;UXOS_CommandPending;Command is pending. This will also be returned if the user tries to load another command but a command is still pending;1;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4402;UXOS_BytesRead;Some bytes have been read from the executing process;2;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4403;UXOS_CommandError;Command execution failed;3;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4404;UXOS_NoCommandLoadedOrPending;;4;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4406;UXOS_PcloseCallError;;6;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x2801;SM_DataTooLarge;;1;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h -0x2802;SM_DataStorageFull;;2;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h -0x2803;SM_IllegalStorageId;;3;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h -0x2804;SM_DataDoesNotExist;;4;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h -0x2805;SM_IllegalAddress;;5;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h -0x2806;SM_PoolTooLarge;;6;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h -0x0601;PP_DoItMyself;;1;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x0602;PP_PointsToVariable;;2;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x0603;PP_PointsToMemory;;3;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x0604;PP_ActivityCompleted;;4;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x0605;PP_PointsToVectorUint8;;5;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x0606;PP_PointsToVectorUint16;;6;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x0607;PP_PointsToVectorUint32;;7;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x0608;PP_PointsToVectorFloat;;8;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x06a0;PP_DumpNotSupported;;160;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x06e0;PP_InvalidSize;;224;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x06e1;PP_InvalidAddress;;225;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x06e2;PP_InvalidContent;;226;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x06e3;PP_UnalignedAccess;;227;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x06e4;PP_WriteProtected;;228;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x13e0;MH_UnknownCmd;;224;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h -0x13e1;MH_InvalidAddress;;225;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h -0x13e2;MH_InvalidSize;;226;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h -0x13e3;MH_StateMismatch;;227;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h -0x38a1;SGP4_InvalidEccentricity;;161;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38a2;SGP4_InvalidMeanMotion;;162;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38a3;SGP4_InvalidPerturbationElements;;163;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38a4;SGP4_InvalidSemiLatusRectum;;164;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38a5;SGP4_InvalidEpochElements;;165;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38a6;SGP4_SatelliteHasDecayed;;166;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38b1;SGP4_TleTooOld;;177;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38b2;SGP4_TleNotInitialized;;178;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x1801;FF_Full;;1;FIFO_CLASS;fsfw/src/fsfw/container/FIFOBase.h -0x1802;FF_Empty;;2;FIFO_CLASS;fsfw/src/fsfw/container/FIFOBase.h -0x1601;FMM_MapFull;;1;FIXED_MULTIMAP;fsfw/src/fsfw/container/FixedOrderedMultimap.h -0x1602;FMM_KeyDoesNotExist;;2;FIXED_MULTIMAP;fsfw/src/fsfw/container/FixedOrderedMultimap.h -0x3901;MUX_NotEnoughResources;;1;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3902;MUX_InsufficientMemory;;2;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3903;MUX_NoPrivilege;;3;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3904;MUX_WrongAttributeSetting;;4;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3905;MUX_MutexAlreadyLocked;;5;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3906;MUX_MutexNotFound;;6;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3907;MUX_MutexMaxLocks;;7;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3908;MUX_CurrThreadAlreadyOwnsMutex;;8;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3909;MUX_CurrThreadDoesNotOwnMutex;;9;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x390a;MUX_MutexTimeout;;10;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x390b;MUX_MutexInvalidId;;11;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x390c;MUX_MutexDestroyedWhileWaiting;;12;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3a01;MQI_Empty;;1;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h -0x3a02;MQI_Full;No space left for more messages;2;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h -0x3a03;MQI_NoReplyPartner;Returned if a reply method was called without partner;3;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h -0x3a04;MQI_DestinationInvalid;Returned if the target destination is invalid.;4;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h -0x0f01;CM_UnknownCommand;;1;COMMAND_MESSAGE;fsfw/src/fsfw/ipc/CommandMessageIF.h +0x63a0;NVMB_KeyNotExists;Specified key does not exist in json file;160;NVM_PARAM_BASE;mission/memory/NVMParameterBase.h +0x2c01;CCS_BcIsSetVrCommand;;1;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2c02;CCS_BcIsUnlockCommand;;2;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cb0;CCS_BcIllegalCommand;;176;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cb1;CCS_BoardReadingNotFinished;;177;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cf0;CCS_NsPositiveW;;240;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cf1;CCS_NsNegativeW;;241;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cf2;CCS_NsLockout;;242;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cf3;CCS_FarmInLockout;;243;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cf4;CCS_FarmInWait;;244;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce0;CCS_WrongSymbol;;224;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce1;CCS_DoubleStart;;225;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce2;CCS_StartSymbolMissed;;226;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce3;CCS_EndWithoutStart;;227;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce4;CCS_TooLarge;;228;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce5;CCS_TooShort;;229;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce6;CCS_WrongTfVersion;;230;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce7;CCS_WrongSpacecraftId;;231;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce8;CCS_NoValidFrameType;;232;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce9;CCS_CrcFailed;;233;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cea;CCS_VcNotFound;;234;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ceb;CCS_ForwardingFailed;;235;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cec;CCS_ContentTooLarge;;236;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ced;CCS_ResidualData;;237;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cee;CCS_DataCorrupted;;238;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cef;CCS_IllegalSegmentationFlag;;239;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cd0;CCS_IllegalFlagCombination;;208;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cd1;CCS_ShorterThanHeader;;209;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cd2;CCS_TooShortBlockedPacket;;210;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cd3;CCS_TooShortMapExtraction;;211;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x3b00;SPH_ConnBroken;;0;SEMAPHORE_IF;fsfw/src/fsfw/osal/common/TcpTmTcServer.h +0x2a01;IEC_NoConfigurationTable;;1;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a02;IEC_NoCpuTable;;2;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a03;IEC_InvalidWorkspaceAddress;;3;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a04;IEC_TooLittleWorkspace;;4;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a05;IEC_WorkspaceAllocation;;5;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a06;IEC_InterruptStackTooSmall;;6;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a07;IEC_ThreadExitted;;7;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a08;IEC_InconsistentMpInformation;;8;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a09;IEC_InvalidNode;;9;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0a;IEC_NoMpci;;10;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0b;IEC_BadPacket;;11;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0c;IEC_OutOfPackets;;12;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0d;IEC_OutOfGlobalObjects;;13;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0e;IEC_OutOfProxies;;14;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0f;IEC_InvalidGlobalId;;15;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a10;IEC_BadStackHook;;16;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a11;IEC_BadAttributes;;17;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a12;IEC_ImplementationKeyCreateInconsistency;;18;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a13;IEC_ImplementationBlockingOperationCancel;;19;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a14;IEC_MutexObtainFromBadState;;20;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a15;IEC_UnlimitedAndMaximumIs0;;21;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h 0x0e01;HM_InvalidMode;;1;HAS_MODES_IF;fsfw/src/fsfw/modes/HasModesIF.h 0x0e02;HM_TransNotAllowed;;2;HAS_MODES_IF;fsfw/src/fsfw/modes/HasModesIF.h 0x0e03;HM_InTransition;;3;HAS_MODES_IF;fsfw/src/fsfw/modes/HasModesIF.h 0x0e04;HM_InvalidSubmode;;4;HAS_MODES_IF;fsfw/src/fsfw/modes/HasModesIF.h -0x0c02;MS_InvalidEntry;;2;MODE_STORE_IF;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h -0x0c03;MS_TooManyElements;;3;MODE_STORE_IF;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h -0x0c04;MS_CantStoreEmpty;;4;MODE_STORE_IF;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h -0x0b01;SB_ChildNotFound;;1;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h -0x0b02;SB_ChildInfoUpdated;;2;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h -0x0b03;SB_ChildDoesntHaveModes;;3;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h -0x0b04;SB_CouldNotInsertChild;;4;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h -0x0b05;SB_TableContainsInvalidObjectId;;5;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h -0x0d01;SS_SequenceAlreadyExists;;1;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d02;SS_TableAlreadyExists;;2;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d03;SS_TableDoesNotExist;;3;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d04;SS_TableOrSequenceLengthInvalid;;4;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d05;SS_SequenceDoesNotExist;;5;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d06;SS_TableContainsInvalidObjectId;;6;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d07;SS_FallbackSequenceDoesNotExist;;7;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d08;SS_NoTargetTable;;8;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d09;SS_SequenceOrTableTooLong;;9;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d0b;SS_IsFallbackSequence;;11;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d0c;SS_AccessDenied;;12;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d0e;SS_TableInUse;;14;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0da1;SS_TargetTableNotReached;;161;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0da2;SS_TableCheckFailed;;162;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x2501;EV_ListenerNotFound;;1;EVENT_MANAGER_IF;fsfw/src/fsfw/events/EventManagerIF.h +0x2e01;HPA_InvalidIdentifierId;;1;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h +0x2e02;HPA_InvalidDomainId;;2;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h +0x2e03;HPA_InvalidValue;;3;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h +0x2e05;HPA_ReadOnly;;5;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h +0x2d01;PAW_UnknownDatatype;;1;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d02;PAW_DatatypeMissmatch;;2;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d03;PAW_Readonly;;3;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d04;PAW_TooBig;;4;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d05;PAW_SourceNotSet;;5;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d06;PAW_OutOfBounds;;6;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d07;PAW_NotSet;;7;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d08;PAW_ColumnOrRowsZero;;8;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x3201;CF_ObjectHasNoFunctions;;1;COMMANDS_ACTIONS_IF;fsfw/src/fsfw/action/CommandsActionsIF.h +0x3202;CF_AlreadyCommanding;;2;COMMANDS_ACTIONS_IF;fsfw/src/fsfw/action/CommandsActionsIF.h +0x3301;HF_IsBusy;;1;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h +0x3302;HF_InvalidParameters;;2;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h +0x3303;HF_ExecutionFinished;;3;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h +0x3304;HF_InvalidActionId;;4;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h +0x0201;OM_InsertionFailed;;1;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h +0x0202;OM_NotFound;;2;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h +0x0203;OM_ChildInitFailed;;3;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h +0x0204;OM_InternalErrReporterUninit;;4;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h +0x2600;FDI_YourFault;;0;HANDLES_FAILURES_IF;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h +0x2601;FDI_MyFault;;1;HANDLES_FAILURES_IF;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h +0x2602;FDI_ConfirmLater;;2;HANDLES_FAILURES_IF;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h +0x2201;TMF_Busy;;1;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2202;TMF_LastPacketFound;;2;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2203;TMF_StopFetch;;3;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2204;TMF_Timeout;;4;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2205;TMF_TmChannelFull;;5;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2206;TMF_NotStored;;6;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2207;TMF_AllDeleted;;7;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2208;TMF_InvalidData;;8;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2209;TMF_NotReady;;9;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2101;TMB_Busy;;1;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2102;TMB_Full;;2;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2103;TMB_Empty;;3;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2104;TMB_NullRequested;;4;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2105;TMB_TooLarge;;5;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2106;TMB_NotReady;;6;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2107;TMB_DumpError;;7;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2108;TMB_CrcError;;8;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2109;TMB_Timeout;;9;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210a;TMB_IdlePacketFound;;10;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210b;TMB_TelecommandFound;;11;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210c;TMB_NoPusATm;;12;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210d;TMB_TooSmall;;13;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210e;TMB_BlockNotFound;;14;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210f;TMB_InvalidRequest;;15;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x1c01;TCD_PacketLost;;1;PACKET_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/TcDistributorBase.h +0x1c02;TCD_DestinationNotFound;;2;PACKET_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/TcDistributorBase.h +0x1c03;TCD_ServiceIdAlreadyExists;;3;PACKET_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/TcDistributorBase.h +0x1b00;TCC_NoDestinationFound;;0;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b01;TCC_InvalidCcsdsVersion;;1;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b02;TCC_InvalidApid;;2;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b03;TCC_InvalidPacketType;;3;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b04;TCC_InvalidSecHeaderField;;4;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b05;TCC_IncorrectPrimaryHeader;;5;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b07;TCC_IncompletePacket;;7;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b08;TCC_InvalidPusVersion;;8;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b09;TCC_IncorrectChecksum;;9;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b0a;TCC_IllegalPacketSubtype;;10;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b0b;TCC_IncorrectSecondaryHeader;;11;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h 0x04e1;RMP_CommandNoDescriptorsAvailable;;225;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h 0x04e2;RMP_CommandBufferFull;;226;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h 0x04e3;RMP_CommandChannelOutOfRange;;227;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h @@ -196,9 +215,95 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x040a;RMP_ReplyCommandNotImplementedOrNotAuthorised;;10;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h 0x040b;RMP_ReplyRmwDataLengthError;;11;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h 0x040c;RMP_ReplyInvalidTargetLogicalAddress;;12;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h -0x1401;SE_BufferTooShort;;1;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h -0x1402;SE_StreamTooShort;;2;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h -0x1403;SE_TooManyElements;;3;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h +0x2801;SM_DataTooLarge;;1;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x2802;SM_DataStorageFull;;2;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x2803;SM_IllegalStorageId;;3;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x2804;SM_DataDoesNotExist;;4;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x2805;SM_IllegalAddress;;5;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x2806;SM_PoolTooLarge;;6;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x38a1;SGP4_InvalidEccentricity;;161;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38a2;SGP4_InvalidMeanMotion;;162;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38a3;SGP4_InvalidPerturbationElements;;163;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38a4;SGP4_InvalidSemiLatusRectum;;164;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38a5;SGP4_InvalidEpochElements;;165;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38a6;SGP4_SatelliteHasDecayed;;166;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38b1;SGP4_TleTooOld;;177;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38b2;SGP4_TleNotInitialized;;178;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x2401;MT_NoPacketFound;;1;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/DleParser.h +0x2402;MT_PossiblePacketLoss;;2;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/DleParser.h +0x2403;MT_NoMatch;;3;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h +0x2404;MT_Full;;4;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h +0x2405;MT_NewNodeCreated;;5;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h +0x3f01;DLEE_StreamTooShort;;1;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h +0x3f02;DLEE_DecodingError;;2;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h +0x2f01;ASC_TooLongForTargetType;;1;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h +0x2f02;ASC_InvalidCharacters;;2;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h +0x2f03;ASC_BufferTooSmall;;3;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h +0x0f01;CM_UnknownCommand;;1;COMMAND_MESSAGE;fsfw/src/fsfw/ipc/CommandMessageIF.h +0x3a01;MQI_Empty;;1;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h +0x3a02;MQI_Full;No space left for more messages;2;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h +0x3a03;MQI_NoReplyPartner;Returned if a reply method was called without partner;3;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h +0x3a04;MQI_DestinationInvalid;Returned if the target destination is invalid.;4;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h +0x3901;MUX_NotEnoughResources;;1;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3902;MUX_InsufficientMemory;;2;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3903;MUX_NoPrivilege;;3;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3904;MUX_WrongAttributeSetting;;4;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3905;MUX_MutexAlreadyLocked;;5;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3906;MUX_MutexNotFound;;6;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3907;MUX_MutexMaxLocks;;7;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3908;MUX_CurrThreadAlreadyOwnsMutex;;8;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3909;MUX_CurrThreadDoesNotOwnMutex;;9;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x390a;MUX_MutexTimeout;;10;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x390b;MUX_MutexInvalidId;;11;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x390c;MUX_MutexDestroyedWhileWaiting;;12;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3b01;SPH_SemaphoreTimeout;;1;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h +0x3b02;SPH_SemaphoreNotOwned;;2;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h +0x3b03;SPH_SemaphoreInvalid;;3;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h +0x1e00;PUS_InvalidPusVersion;;0;PUS_IF;fsfw/src/fsfw/tmtcpacket/pus/PusIF.h +0x1e01;PUS_InvalidCrc16;;1;PUS_IF;fsfw/src/fsfw/tmtcpacket/pus/PusIF.h +0x3601;CFDP_InvalidTlvType;;1;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3602;CFDP_InvalidDirectiveField;;2;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3603;CFDP_InvalidPduDatafieldLen;;3;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3604;CFDP_InvalidAckDirectiveFields;;4;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3605;CFDP_MetadataCantParseOptions;;5;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3606;CFDP_NakCantParseOptions;;6;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3607;CFDP_FinishedCantParseFsResponses;;7;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3608;CFDP_FilestoreRequiresSecondFile;;8;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3609;CFDP_FilestoreResponseCantParseFsMessage;;9;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x360a;CFDP_InvalidPduFormat;;10;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x2901;TC_InvalidTargetState;;1;THERMAL_COMPONENT_IF;fsfw/src/fsfw/thermal/ThermalComponentIF.h +0x29f1;TC_AboveOperationalLimit;;241;THERMAL_COMPONENT_IF;fsfw/src/fsfw/thermal/ThermalComponentIF.h +0x29f2;TC_BelowOperationalLimit;;242;THERMAL_COMPONENT_IF;fsfw/src/fsfw/thermal/ThermalComponentIF.h +0x0c02;MS_InvalidEntry;;2;MODE_STORE_IF;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h +0x0c03;MS_TooManyElements;;3;MODE_STORE_IF;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h +0x0c04;MS_CantStoreEmpty;;4;MODE_STORE_IF;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h +0x0d01;SS_SequenceAlreadyExists;;1;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d02;SS_TableAlreadyExists;;2;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d03;SS_TableDoesNotExist;;3;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d04;SS_TableOrSequenceLengthInvalid;;4;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d05;SS_SequenceDoesNotExist;;5;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d06;SS_TableContainsInvalidObjectId;;6;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d07;SS_FallbackSequenceDoesNotExist;;7;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d08;SS_NoTargetTable;;8;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d09;SS_SequenceOrTableTooLong;;9;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d0b;SS_IsFallbackSequence;;11;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d0c;SS_AccessDenied;;12;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d0e;SS_TableInUse;;14;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0da1;SS_TargetTableNotReached;;161;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0da2;SS_TableCheckFailed;;162;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0b01;SB_ChildNotFound;;1;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h +0x0b02;SB_ChildInfoUpdated;;2;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h +0x0b03;SB_ChildDoesntHaveModes;;3;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h +0x0b04;SB_CouldNotInsertChild;;4;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h +0x0b05;SB_TableContainsInvalidObjectId;;5;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h +0x3e00;HKM_QueueOrDestinationInvalid;;0;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3e01;HKM_WrongHkPacketType;;1;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3e02;HKM_ReportingStatusUnchanged;;2;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3e03;HKM_PeriodicHelperInvalid;;3;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3e04;HKM_PoolobjectNotFound;;4;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3e05;HKM_DatasetNotFound;;5;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3c00;LPIF_PoolEntryNotFound;;0;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h +0x3c01;LPIF_PoolEntryTypeConflict;;1;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h 0x3da0;PVA_InvalidReadWriteMode;;160;POOL_VARIABLE_IF;fsfw/src/fsfw/datapool/PoolVariableIF.h 0x3da1;PVA_InvalidPoolEntry;;161;POOL_VARIABLE_IF;fsfw/src/fsfw/datapool/PoolVariableIF.h 0x0801;DPS_InvalidParameterDefinition;;1;DATA_SET_CLASS;fsfw/src/fsfw/datapool/DataSetIF.h @@ -207,20 +312,35 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x0804;DPS_DataSetUninitialised;;4;DATA_SET_CLASS;fsfw/src/fsfw/datapool/DataSetIF.h 0x0805;DPS_DataSetFull;;5;DATA_SET_CLASS;fsfw/src/fsfw/datapool/DataSetIF.h 0x0806;DPS_PoolVarNull;;6;DATA_SET_CLASS;fsfw/src/fsfw/datapool/DataSetIF.h -0x1c01;TCD_PacketLost;;1;PACKET_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/TcDistributorBase.h -0x1c02;TCD_DestinationNotFound;;2;PACKET_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/TcDistributorBase.h -0x1c03;TCD_ServiceIdAlreadyExists;;3;PACKET_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/TcDistributorBase.h -0x1b00;TCC_NoDestinationFound;;0;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b01;TCC_InvalidCcsdsVersion;;1;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b02;TCC_InvalidApid;;2;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b03;TCC_InvalidPacketType;;3;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b04;TCC_InvalidSecHeaderField;;4;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b05;TCC_IncorrectPrimaryHeader;;5;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b07;TCC_IncompletePacket;;7;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b08;TCC_InvalidPusVersion;;8;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b09;TCC_IncorrectChecksum;;9;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b0a;TCC_IllegalPacketSubtype;;10;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b0b;TCC_IncorrectSecondaryHeader;;11;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1000;TIM_UnsupportedTimeFormat;;0;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x1001;TIM_NotEnoughInformationForTargetFormat;;1;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x1002;TIM_LengthMismatch;;2;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x1003;TIM_InvalidTimeFormat;;3;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x1004;TIM_InvalidDayOfYear;;4;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x1005;TIM_TimeDoesNotFitFormat;;5;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x3701;TSI_BadTimestamp;;1;TIME_STAMPER_IF;fsfw/src/fsfw/timemanager/TimeStampIF.h +0x1d01;ATC_ActivityStarted;;1;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h +0x1d02;ATC_InvalidSubservice;;2;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h +0x1d03;ATC_IllegalApplicationData;;3;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h +0x1d04;ATC_SendTmFailed;;4;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h +0x1d05;ATC_Timeout;;5;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h +0x4c00;SPPA_NoPacketFound;;0;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h +0x4c01;SPPA_SplitPacket;;1;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h +0x2001;CSB_ExecutionComplete;;1;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2002;CSB_NoStepMessage;;2;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2003;CSB_ObjectBusy;;3;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2004;CSB_Busy;;4;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2005;CSB_InvalidTc;;5;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2006;CSB_InvalidObject;;6;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2007;CSB_InvalidReply;;7;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x1801;FF_Full;;1;FIFO_CLASS;fsfw/src/fsfw/container/FIFOBase.h +0x1802;FF_Empty;;2;FIFO_CLASS;fsfw/src/fsfw/container/FIFOBase.h +0x1601;FMM_MapFull;;1;FIXED_MULTIMAP;fsfw/src/fsfw/container/FixedOrderedMultimap.h +0x1602;FMM_KeyDoesNotExist;;2;FIXED_MULTIMAP;fsfw/src/fsfw/container/FixedOrderedMultimap.h +0x2501;EV_ListenerNotFound;;1;EVENT_MANAGER_IF;fsfw/src/fsfw/events/EventManagerIF.h +0x1701;HHI_ObjectNotHealthy;;1;HAS_HEALTH_IF;fsfw/src/fsfw/health/HasHealthIF.h +0x1702;HHI_InvalidHealthState;;2;HAS_HEALTH_IF;fsfw/src/fsfw/health/HasHealthIF.h +0x1703;HHI_IsExternallyControlled;;3;HAS_HEALTH_IF;fsfw/src/fsfw/health/HasHealthIF.h 0x3001;POS_InPowerTransition;;1;POWER_SWITCHER;fsfw/src/fsfw/power/PowerSwitcher.h 0x3002;POS_SwitchStateMismatch;;2;POWER_SWITCHER;fsfw/src/fsfw/power/PowerSwitcher.h 0x0501;PS_SwitchOn;;1;POWER_SWITCH_IF;fsfw/src/fsfw/power/PowerSwitchIF.h @@ -228,76 +348,23 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x0502;PS_SwitchTimeout;;2;POWER_SWITCH_IF;fsfw/src/fsfw/power/PowerSwitchIF.h 0x0503;PS_FuseOn;;3;POWER_SWITCH_IF;fsfw/src/fsfw/power/PowerSwitchIF.h 0x0504;PS_FuseOff;;4;POWER_SWITCH_IF;fsfw/src/fsfw/power/PowerSwitchIF.h -0x3b00;SPH_ConnBroken;;0;SEMAPHORE_IF;fsfw/src/fsfw/osal/common/TcpTmTcServer.h -0x2a01;IEC_NoConfigurationTable;;1;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a02;IEC_NoCpuTable;;2;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a03;IEC_InvalidWorkspaceAddress;;3;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a04;IEC_TooLittleWorkspace;;4;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a05;IEC_WorkspaceAllocation;;5;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a06;IEC_InterruptStackTooSmall;;6;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a07;IEC_ThreadExitted;;7;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a08;IEC_InconsistentMpInformation;;8;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a09;IEC_InvalidNode;;9;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a0a;IEC_NoMpci;;10;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a0b;IEC_BadPacket;;11;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a0c;IEC_OutOfPackets;;12;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a0d;IEC_OutOfGlobalObjects;;13;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a0e;IEC_OutOfProxies;;14;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a0f;IEC_InvalidGlobalId;;15;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a10;IEC_BadStackHook;;16;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a11;IEC_BadAttributes;;17;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a12;IEC_ImplementationKeyCreateInconsistency;;18;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a13;IEC_ImplementationBlockingOperationCancel;;19;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a14;IEC_MutexObtainFromBadState;;20;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a15;IEC_UnlimitedAndMaximumIs0;;21;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2600;FDI_YourFault;;0;HANDLES_FAILURES_IF;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h -0x2601;FDI_MyFault;;1;HANDLES_FAILURES_IF;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h -0x2602;FDI_ConfirmLater;;2;HANDLES_FAILURES_IF;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h -0x1e00;PUS_InvalidPusVersion;;0;PUS_IF;fsfw/src/fsfw/tmtcpacket/pus/PusIF.h -0x1e01;PUS_InvalidCrc16;;1;PUS_IF;fsfw/src/fsfw/tmtcpacket/pus/PusIF.h -0x0201;OM_InsertionFailed;;1;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h -0x0202;OM_NotFound;;2;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h -0x0203;OM_ChildInitFailed;;3;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h -0x0204;OM_InternalErrReporterUninit;;4;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h -0x2201;TMF_Busy;;1;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2202;TMF_LastPacketFound;;2;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2203;TMF_StopFetch;;3;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2204;TMF_Timeout;;4;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2205;TMF_TmChannelFull;;5;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2206;TMF_NotStored;;6;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2207;TMF_AllDeleted;;7;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2208;TMF_InvalidData;;8;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2209;TMF_NotReady;;9;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2101;TMB_Busy;;1;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2102;TMB_Full;;2;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2103;TMB_Empty;;3;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2104;TMB_NullRequested;;4;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2105;TMB_TooLarge;;5;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2106;TMB_NotReady;;6;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2107;TMB_DumpError;;7;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2108;TMB_CrcError;;8;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2109;TMB_Timeout;;9;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x210a;TMB_IdlePacketFound;;10;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x210b;TMB_TelecommandFound;;11;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x210c;TMB_NoPusATm;;12;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x210d;TMB_TooSmall;;13;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x210e;TMB_BlockNotFound;;14;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x210f;TMB_InvalidRequest;;15;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2d01;PAW_UnknownDatatype;;1;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2d02;PAW_DatatypeMissmatch;;2;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2d03;PAW_Readonly;;3;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2d04;PAW_TooBig;;4;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2d05;PAW_SourceNotSet;;5;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2d06;PAW_OutOfBounds;;6;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2d07;PAW_NotSet;;7;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2d08;PAW_ColumnOrRowsZero;;8;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2e01;HPA_InvalidIdentifierId;;1;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h -0x2e02;HPA_InvalidDomainId;;2;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h -0x2e03;HPA_InvalidValue;;3;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h -0x2e05;HPA_ReadOnly;;5;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h -0x3b01;SPH_SemaphoreTimeout;;1;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h -0x3b02;SPH_SemaphoreNotOwned;;2;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h -0x3b03;SPH_SemaphoreInvalid;;3;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h +0x4300;FILS_GenericFileError;;0;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4301;FILS_GenericDirError;;1;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4302;FILS_FilesystemInactive;;2;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4303;FILS_GenericRenameError;;3;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4304;FILS_IsBusy;;4;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4305;FILS_InvalidParameters;;5;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x430a;FILS_FileDoesNotExist;;10;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x430b;FILS_FileAlreadyExists;;11;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x430c;FILS_NotAFile;;12;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x430d;FILS_FileLocked;;13;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x430e;FILS_PermissionDenied;;14;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4315;FILS_DirectoryDoesNotExist;;21;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4316;FILS_DirectoryAlreadyExists;;22;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4317;FILS_NotADirectory;;23;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4318;FILS_DirectoryNotEmpty;;24;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x431e;FILS_SequencePacketMissingWrite;;30;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x431f;FILS_SequencePacketMissingRead;;31;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h 0x1a01;TRC_NotEnoughSensors;;1;TRIPLE_REDUNDACY_CHECK;fsfw/src/fsfw/monitoring/TriplexMonitor.h 0x1a02;TRC_LowestValueOol;;2;TRIPLE_REDUNDACY_CHECK;fsfw/src/fsfw/monitoring/TriplexMonitor.h 0x1a03;TRC_HighestValueOol;;3;TRIPLE_REDUNDACY_CHECK;fsfw/src/fsfw/monitoring/TriplexMonitor.h @@ -316,74 +383,36 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x31e2;LIM_WrongPid;;226;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h 0x31e3;LIM_WrongLimitId;;227;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h 0x31ee;LIM_MonitorNotFound;;238;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h -0x3601;CFDP_InvalidTlvType;;1;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3602;CFDP_InvalidDirectiveField;;2;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3603;CFDP_InvalidPduDatafieldLen;;3;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3604;CFDP_InvalidAckDirectiveFields;;4;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3605;CFDP_MetadataCantParseOptions;;5;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3606;CFDP_NakCantParseOptions;;6;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3607;CFDP_FinishedCantParseFsResponses;;7;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3608;CFDP_FilestoreRequiresSecondFile;;8;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3609;CFDP_FilestoreResponseCantParseFsMessage;;9;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x360a;CFDP_InvalidPduFormat;;10;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x4300;FILS_GenericFileError;;0;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4301;FILS_GenericDirError;;1;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4302;FILS_FilesystemInactive;;2;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4303;FILS_GenericRenameError;;3;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4304;FILS_IsBusy;;4;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4305;FILS_InvalidParameters;;5;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x430a;FILS_FileDoesNotExist;;10;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x430b;FILS_FileAlreadyExists;;11;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x430c;FILS_NotAFile;;12;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x430d;FILS_FileLocked;;13;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x430e;FILS_PermissionDenied;;14;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4315;FILS_DirectoryDoesNotExist;;21;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4316;FILS_DirectoryAlreadyExists;;22;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4317;FILS_NotADirectory;;23;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4318;FILS_DirectoryNotEmpty;;24;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x431e;FILS_SequencePacketMissingWrite;;30;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x431f;FILS_SequencePacketMissingRead;;31;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x2c01;CCS_BcIsSetVrCommand;;1;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2c02;CCS_BcIsUnlockCommand;;2;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cb0;CCS_BcIllegalCommand;;176;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cb1;CCS_BoardReadingNotFinished;;177;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cf0;CCS_NsPositiveW;;240;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cf1;CCS_NsNegativeW;;241;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cf2;CCS_NsLockout;;242;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cf3;CCS_FarmInLockout;;243;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cf4;CCS_FarmInWait;;244;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce0;CCS_WrongSymbol;;224;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce1;CCS_DoubleStart;;225;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce2;CCS_StartSymbolMissed;;226;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce3;CCS_EndWithoutStart;;227;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce4;CCS_TooLarge;;228;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce5;CCS_TooShort;;229;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce6;CCS_WrongTfVersion;;230;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce7;CCS_WrongSpacecraftId;;231;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce8;CCS_NoValidFrameType;;232;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce9;CCS_CrcFailed;;233;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cea;CCS_VcNotFound;;234;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ceb;CCS_ForwardingFailed;;235;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cec;CCS_ContentTooLarge;;236;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ced;CCS_ResidualData;;237;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cee;CCS_DataCorrupted;;238;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cef;CCS_IllegalSegmentationFlag;;239;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cd0;CCS_IllegalFlagCombination;;208;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cd1;CCS_ShorterThanHeader;;209;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cd2;CCS_TooShortBlockedPacket;;210;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cd3;CCS_TooShortMapExtraction;;211;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h 0x4201;PUS11_InvalidTypeTimeWindow;;1;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 0x4202;PUS11_InvalidTimeWindow;;2;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 0x4203;PUS11_TimeshiftingNotPossible;;3;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 0x4204;PUS11_InvalidRelativeTime;;4;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 0x4205;PUS11_ContainedTcTooSmall;;5;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 0x4206;PUS11_ContainedTcCrcMissmatch;;6;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h -0x3401;DC_NoReplyReceived;;1;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h -0x3402;DC_ProtocolError;;2;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h -0x3403;DC_Nullpointer;;3;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h -0x3404;DC_InvalidCookieType;;4;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h -0x3405;DC_NotActive;;5;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h -0x3406;DC_TooMuchData;;6;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h +0x0601;PP_DoItMyself;;1;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0602;PP_PointsToVariable;;2;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0603;PP_PointsToMemory;;3;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0604;PP_ActivityCompleted;;4;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0605;PP_PointsToVectorUint8;;5;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0606;PP_PointsToVectorUint16;;6;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0607;PP_PointsToVectorUint32;;7;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0608;PP_PointsToVectorFloat;;8;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06a0;PP_DumpNotSupported;;160;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06e0;PP_InvalidSize;;224;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06e1;PP_InvalidAddress;;225;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06e2;PP_InvalidContent;;226;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06e3;PP_UnalignedAccess;;227;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06e4;PP_WriteProtected;;228;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x13e0;MH_UnknownCmd;;224;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h +0x13e1;MH_InvalidAddress;;225;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h +0x13e2;MH_InvalidSize;;226;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h +0x13e3;MH_StateMismatch;;227;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h +0x1201;AB_NeedSecondStep;;1;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x1202;AB_NeedToReconfigure;;2;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x1203;AB_ModeFallback;;3;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x1204;AB_ChildNotCommandable;;4;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x1205;AB_NeedToChangeHealth;;5;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x12a1;AB_NotEnoughChildrenInCorrectState;;161;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h 0x03a0;DHB_InvalidChannel;;160;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h 0x03b0;DHB_AperiodicReply;;176;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h 0x03b1;DHB_IgnoreReplyData;;177;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h @@ -393,12 +422,12 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x03d0;DHB_NoSwitch;;208;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h 0x03e0;DHB_ChildTimeout;;224;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h 0x03e1;DHB_SwitchFailed;;225;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h -0x1201;AB_NeedSecondStep;;1;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h -0x1202;AB_NeedToReconfigure;;2;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h -0x1203;AB_ModeFallback;;3;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h -0x1204;AB_ChildNotCommandable;;4;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h -0x1205;AB_NeedToChangeHealth;;5;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h -0x12a1;AB_NotEnoughChildrenInCorrectState;;161;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x3401;DC_NoReplyReceived;;1;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h +0x3402;DC_ProtocolError;;2;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h +0x3403;DC_Nullpointer;;3;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h +0x3404;DC_InvalidCookieType;;4;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h +0x3405;DC_NotActive;;5;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h +0x3406;DC_TooMuchData;;6;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h 0x27a0;DHI_NoCommandData;;160;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h 0x27a1;DHI_CommandNotSupported;;161;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h 0x27a2;DHI_CommandAlreadySent;;162;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h @@ -420,54 +449,25 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x27c3;DHI_DeviceReplyInvalid;;195;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h 0x27d0;DHI_InvalidCommandParameter;;208;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h 0x27d1;DHI_InvalidNumberOrLengthOfParameters;;209;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -0x2401;MT_TooDetailedRequest;;1;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h -0x2402;MT_TooGeneralRequest;;2;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h -0x2403;MT_NoMatch;;3;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h -0x2404;MT_Full;;4;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h -0x2405;MT_NewNodeCreated;;5;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h -0x3f01;DLEE_NoPacketFound;;1;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleParser.h -0x3f02;DLEE_PossiblePacketLoss;;2;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleParser.h -0x2f01;ASC_TooLongForTargetType;;1;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h -0x2f02;ASC_InvalidCharacters;;2;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h -0x2f03;ASC_BufferTooSmall;;3;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h -0x1701;HHI_ObjectNotHealthy;;1;HAS_HEALTH_IF;fsfw/src/fsfw/health/HasHealthIF.h -0x1702;HHI_InvalidHealthState;;2;HAS_HEALTH_IF;fsfw/src/fsfw/health/HasHealthIF.h -0x1703;HHI_IsExternallyControlled;;3;HAS_HEALTH_IF;fsfw/src/fsfw/health/HasHealthIF.h -0x3201;CF_ObjectHasNoFunctions;;1;COMMANDS_ACTIONS_IF;fsfw/src/fsfw/action/CommandsActionsIF.h -0x3202;CF_AlreadyCommanding;;2;COMMANDS_ACTIONS_IF;fsfw/src/fsfw/action/CommandsActionsIF.h -0x3301;HF_IsBusy;;1;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h -0x3302;HF_InvalidParameters;;2;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h -0x3303;HF_ExecutionFinished;;3;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h -0x3304;HF_InvalidActionId;;4;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h -0x1000;TIM_UnsupportedTimeFormat;;0;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h -0x1001;TIM_NotEnoughInformationForTargetFormat;;1;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h -0x1002;TIM_LengthMismatch;;2;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h -0x1003;TIM_InvalidTimeFormat;;3;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h -0x1004;TIM_InvalidDayOfYear;;4;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h -0x1005;TIM_TimeDoesNotFitFormat;;5;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h -0x3701;TSI_BadTimestamp;;1;TIME_STAMPER_IF;fsfw/src/fsfw/timemanager/TimeStampIF.h -0x3c00;LPIF_PoolEntryNotFound;;0;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h -0x3c01;LPIF_PoolEntryTypeConflict;;1;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h -0x3e00;HKM_QueueOrDestinationInvalid;;0;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3e01;HKM_WrongHkPacketType;;1;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3e02;HKM_ReportingStatusUnchanged;;2;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3e03;HKM_PeriodicHelperInvalid;;3;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3e04;HKM_PoolobjectNotFound;;4;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3e05;HKM_DatasetNotFound;;5;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x2901;TC_InvalidTargetState;;1;THERMAL_COMPONENT_IF;fsfw/src/fsfw/thermal/ThermalComponentIF.h -0x29f1;TC_AboveOperationalLimit;;241;THERMAL_COMPONENT_IF;fsfw/src/fsfw/thermal/ThermalComponentIF.h -0x29f2;TC_BelowOperationalLimit;;242;THERMAL_COMPONENT_IF;fsfw/src/fsfw/thermal/ThermalComponentIF.h -0x2001;CSB_ExecutionComplete;;1;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h -0x2002;CSB_NoStepMessage;;2;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h -0x2003;CSB_ObjectBusy;;3;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h -0x2004;CSB_Busy;;4;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h -0x2005;CSB_InvalidTc;;5;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h -0x2006;CSB_InvalidObject;;6;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h -0x2007;CSB_InvalidReply;;7;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h -0x4c00;SPPA_NoPacketFound;;0;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h -0x4c01;SPPA_SplitPacket;;1;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h -0x1d01;ATC_ActivityStarted;;1;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h -0x1d02;ATC_InvalidSubservice;;2;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h -0x1d03;ATC_IllegalApplicationData;;3;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h -0x1d04;ATC_SendTmFailed;;4;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h -0x1d05;ATC_Timeout;;5;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h +0x1401;SE_BufferTooShort;;1;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h +0x1402;SE_StreamTooShort;;2;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h +0x1403;SE_TooManyElements;;3;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h +0x4500;HSPI_HalTimeoutRetval;;0;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h +0x4501;HSPI_HalBusyRetval;;1;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h +0x4502;HSPI_HalErrorRetval;;2;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h +0x4601;HURT_UartReadFailure;;1;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h +0x4602;HURT_UartReadSizeMissmatch;;2;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h +0x4603;HURT_UartRxBufferTooSmall;;3;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h +0x4801;HGIO_UnknownGpioId;;1;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4802;HGIO_DriveGpioFailure;;2;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4803;HGIO_GpioTypeFailure;;3;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4804;HGIO_GpioInvalidInstance;;4;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4805;HGIO_GpioDuplicateDetected;;5;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4806;HGIO_GpioInitFailed;;6;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4807;HGIO_GpioGetValueFailed;;7;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4400;UXOS_ExecutionFinished;Execution of the current command has finished;0;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4401;UXOS_CommandPending;Command is pending. This will also be returned if the user tries to load another command but a command is still pending;1;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4402;UXOS_BytesRead;Some bytes have been read from the executing process;2;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4403;UXOS_CommandError;Command execution failed;3;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4404;UXOS_NoCommandLoadedOrPending;;4;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4406;UXOS_PcloseCallError;;6;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h diff --git a/generators/bsp_q7s_returnvalues.csv b/generators/bsp_q7s_returnvalues.csv index 2b343f4a..2741ae71 100644 --- a/generators/bsp_q7s_returnvalues.csv +++ b/generators/bsp_q7s_returnvalues.csv @@ -1,23 +1,13 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x0000;OK;System-wide code for ok.;0;HasReturnvaluesIF;fsfw/returnvalues/returnvalue.h 0x0001;Failed;Unspecified system-wide code for failed.;1;HasReturnvaluesIF;fsfw/returnvalues/returnvalue.h -0x63a0;NVMB_KeyNotExists;Specified key does not exist in json file;160;NVM_PARAM_BASE;mission/memory/NVMParameterBase.h -0x6300;NVMB_Busy;;0;NVM_PARAM_BASE;mission/system/objects/Stack5VHandler.h -0x58a0;SUSS_ErrorUnlockMutex;;160;SUS_HANDLER;mission/devices/SusHandler.h -0x58a1;SUSS_ErrorLockMutex;;161;SUS_HANDLER;mission/devices/SusHandler.h -0x66a0;SADPL_CommandNotSupported;;160;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h -0x66a1;SADPL_DeploymentAlreadyExecuting;;161;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h -0x66a2;SADPL_MainSwitchTimeoutFailure;;162;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h -0x66a3;SADPL_SwitchingDeplSa1Failed;;163;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h -0x66a4;SADPL_SwitchingDeplSa2Failed;;164;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h -0x51a0;IMTQ_InvalidCommandCode;;160;IMTQ_HANDLER;mission/devices/ImtqHandler.h -0x51a1;IMTQ_ParameterMissing;;161;IMTQ_HANDLER;mission/devices/ImtqHandler.h -0x51a2;IMTQ_ParameterInvalid;;162;IMTQ_HANDLER;mission/devices/ImtqHandler.h -0x51a3;IMTQ_CcUnavailable;;163;IMTQ_HANDLER;mission/devices/ImtqHandler.h -0x51a4;IMTQ_InternalProcessingError;;164;IMTQ_HANDLER;mission/devices/ImtqHandler.h -0x51a5;IMTQ_RejectedWithoutReason;;165;IMTQ_HANDLER;mission/devices/ImtqHandler.h -0x51a6;IMTQ_CmdErrUnknown;;166;IMTQ_HANDLER;mission/devices/ImtqHandler.h -0x51a7;IMTQ_UnexpectedSelfTestReply;The status reply to a self test command was received but no self test command has been sent. This should normally never happen.;167;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x60a0;CCSDS_CommandNotImplemented;Received action message with unknown action id;160;CCSDS_HANDLER;mission/tmtc/CcsdsIpCoreHandler.h +0x5d00;GOMS_PacketTooLong;;0;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5d01;GOMS_InvalidTableId;;1;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5d02;GOMS_InvalidAddress;;2;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5d03;GOMS_InvalidParamSize;;3;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5d04;GOMS_InvalidPayloadSize;;4;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h +0x5d05;GOMS_UnknownReplyId;;5;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h 0x52b0;RWHA_SpiWriteFailure;;176;RW_HANDLER;mission/devices/RwHandler.h 0x52b1;RWHA_SpiReadFailure;Used by the spi send function to tell a failing read call;177;RW_HANDLER;mission/devices/RwHandler.h 0x52b2;RWHA_MissingStartSign;Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E;178;RW_HANDLER;mission/devices/RwHandler.h @@ -30,6 +20,21 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x52a2;RWHA_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;162;RW_HANDLER;mission/devices/RwHandler.h 0x52a3;RWHA_ExecutionFailed;Command execution failed;163;RW_HANDLER;mission/devices/RwHandler.h 0x52a4;RWHA_CrcError;Reaction wheel reply has invalid crc;164;RW_HANDLER;mission/devices/RwHandler.h +0x4fa1;HEATER_CommandNotSupported;;161;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x4fa2;HEATER_InitFailed;;162;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x4fa3;HEATER_InvalidSwitchNr;;163;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x4fa4;HEATER_MainSwitchSetTimeout;;164;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x4fa5;HEATER_CommandAlreadyWaiting;;165;HEATER_HANDLER;mission/devices/HeaterHandler.h +0x58a0;SUSS_ErrorUnlockMutex;;160;SUS_HANDLER;mission/devices/SusHandler.h +0x58a1;SUSS_ErrorLockMutex;;161;SUS_HANDLER;mission/devices/SusHandler.h +0x51a0;IMTQ_InvalidCommandCode;;160;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x51a1;IMTQ_ParameterMissing;;161;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x51a2;IMTQ_ParameterInvalid;;162;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x51a3;IMTQ_CcUnavailable;;163;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x51a4;IMTQ_InternalProcessingError;;164;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x51a5;IMTQ_RejectedWithoutReason;;165;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x51a6;IMTQ_CmdErrUnknown;;166;IMTQ_HANDLER;mission/devices/ImtqHandler.h +0x51a7;IMTQ_UnexpectedSelfTestReply;The status reply to a self test command was received but no self test command has been sent. This should normally never happen.;167;IMTQ_HANDLER;mission/devices/ImtqHandler.h 0x50a0;SYRLINKS_CrcFailure;;160;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h 0x50a1;SYRLINKS_UartFraminOrParityErrorAck;;161;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h 0x50a2;SYRLINKS_BadCharacterAck;;162;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h @@ -39,123 +44,137 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x50a6;SYRLINKS_BadCrcAck;;166;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h 0x50a7;SYRLINKS_ReplyWrongSize;;167;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h 0x50a8;SYRLINKS_MissingStartFrameCharacter;;168;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h -0x5d00;GOMS_PacketTooLong;;0;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x5d01;GOMS_InvalidTableId;;1;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x5d02;GOMS_InvalidAddress;;2;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x5d03;GOMS_InvalidParamSize;;3;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x5d04;GOMS_InvalidPayloadSize;;4;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x5d05;GOMS_UnknownReplyId;;5;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h -0x4fa1;HEATER_CommandNotSupported;;161;HEATER_HANDLER;mission/devices/HeaterHandler.h -0x4fa2;HEATER_InitFailed;;162;HEATER_HANDLER;mission/devices/HeaterHandler.h -0x4fa3;HEATER_InvalidSwitchNr;;163;HEATER_HANDLER;mission/devices/HeaterHandler.h -0x4fa4;HEATER_MainSwitchSetTimeout;;164;HEATER_HANDLER;mission/devices/HeaterHandler.h -0x4fa5;HEATER_CommandAlreadyWaiting;;165;HEATER_HANDLER;mission/devices/HeaterHandler.h -0x60a0;CCSDS_CommandNotImplemented;Received action message with unknown action id;160;CCSDS_HANDLER;mission/tmtc/CcsdsIpCoreHandler.h -0x6a01;ACSSAF_SafectrlMekfInputInvalid;;1;ACS_SAFE;mission/controller/acs/control/SafeCtrl.h +0x66a0;SADPL_CommandNotSupported;;160;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x66a1;SADPL_DeploymentAlreadyExecuting;;161;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x66a2;SADPL_MainSwitchTimeoutFailure;;162;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x66a3;SADPL_SwitchingDeplSa1Failed;;163;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x66a4;SADPL_SwitchingDeplSa2Failed;;164;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h +0x6600;SADPL_Busy;;0;SA_DEPL_HANDLER;mission/system/objects/Stack5VHandler.h 0x6b01;ACSPTG_PtgctrlMekfInputInvalid;;1;ACS_PTG;mission/controller/acs/control/PtgCtrl.h +0x6a01;ACSSAF_SafectrlMekfInputInvalid;;1;ACS_SAFE;mission/controller/acs/control/SafeCtrl.h 0x6c01;ACSDTB_DetumbleNoSensordata;;1;ACS_DETUMBLE;mission/controller/acs/control/Detumble.h 0x6901;ACSKAL_KalmanNoGyrMeas;;1;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h 0x6902;ACSKAL_KalmanNoModel;;2;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h 0x6903;ACSKAL_KalmanInversionFailed;;3;ACS_KALMAN;mission/controller/acs/MultiplicativeKalmanFilter.h -0x4500;HSPI_OpeningFileFailed;;0;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h -0x4501;HSPI_FullDuplexTransferFailed;;1;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h -0x4502;HSPI_HalfDuplexTransferFailed;;2;HAL_SPI;fsfw/src/fsfw_hal/linux/spi/SpiComIF.h -0x4801;HGIO_UnknownGpioId;;1;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4802;HGIO_DriveGpioFailure;;2;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4803;HGIO_GpioTypeFailure;;3;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4804;HGIO_GpioInvalidInstance;;4;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4805;HGIO_GpioDuplicateDetected;;5;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4806;HGIO_GpioInitFailed;;6;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4807;HGIO_GpioGetValueFailed;;7;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h -0x4601;HURT_UartReadFailure;;1;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h -0x4602;HURT_UartReadSizeMissmatch;;2;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h -0x4603;HURT_UartRxBufferTooSmall;;3;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h -0x4400;UXOS_ExecutionFinished;Execution of the current command has finished;0;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4401;UXOS_CommandPending;Command is pending. This will also be returned if the user tries to load another command but a command is still pending;1;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4402;UXOS_BytesRead;Some bytes have been read from the executing process;2;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4403;UXOS_CommandError;Command execution failed;3;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4404;UXOS_NoCommandLoadedOrPending;;4;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x4406;UXOS_PcloseCallError;;6;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h -0x2801;SM_DataTooLarge;;1;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h -0x2802;SM_DataStorageFull;;2;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h -0x2803;SM_IllegalStorageId;;3;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h -0x2804;SM_DataDoesNotExist;;4;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h -0x2805;SM_IllegalAddress;;5;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h -0x2806;SM_PoolTooLarge;;6;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h -0x0601;PP_DoItMyself;;1;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x0602;PP_PointsToVariable;;2;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x0603;PP_PointsToMemory;;3;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x0604;PP_ActivityCompleted;;4;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x0605;PP_PointsToVectorUint8;;5;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x0606;PP_PointsToVectorUint16;;6;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x0607;PP_PointsToVectorUint32;;7;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x0608;PP_PointsToVectorFloat;;8;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x06a0;PP_DumpNotSupported;;160;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x06e0;PP_InvalidSize;;224;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x06e1;PP_InvalidAddress;;225;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x06e2;PP_InvalidContent;;226;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x06e3;PP_UnalignedAccess;;227;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x06e4;PP_WriteProtected;;228;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h -0x13e0;MH_UnknownCmd;;224;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h -0x13e1;MH_InvalidAddress;;225;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h -0x13e2;MH_InvalidSize;;226;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h -0x13e3;MH_StateMismatch;;227;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h -0x38a1;SGP4_InvalidEccentricity;;161;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38a2;SGP4_InvalidMeanMotion;;162;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38a3;SGP4_InvalidPerturbationElements;;163;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38a4;SGP4_InvalidSemiLatusRectum;;164;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38a5;SGP4_InvalidEpochElements;;165;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38a6;SGP4_SatelliteHasDecayed;;166;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38b1;SGP4_TleTooOld;;177;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x38b2;SGP4_TleNotInitialized;;178;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h -0x1801;FF_Full;;1;FIFO_CLASS;fsfw/src/fsfw/container/FIFOBase.h -0x1802;FF_Empty;;2;FIFO_CLASS;fsfw/src/fsfw/container/FIFOBase.h -0x1601;FMM_MapFull;;1;FIXED_MULTIMAP;fsfw/src/fsfw/container/FixedOrderedMultimap.h -0x1602;FMM_KeyDoesNotExist;;2;FIXED_MULTIMAP;fsfw/src/fsfw/container/FixedOrderedMultimap.h -0x3901;MUX_NotEnoughResources;;1;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3902;MUX_InsufficientMemory;;2;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3903;MUX_NoPrivilege;;3;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3904;MUX_WrongAttributeSetting;;4;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3905;MUX_MutexAlreadyLocked;;5;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3906;MUX_MutexNotFound;;6;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3907;MUX_MutexMaxLocks;;7;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3908;MUX_CurrThreadAlreadyOwnsMutex;;8;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3909;MUX_CurrThreadDoesNotOwnMutex;;9;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x390a;MUX_MutexTimeout;;10;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x390b;MUX_MutexInvalidId;;11;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x390c;MUX_MutexDestroyedWhileWaiting;;12;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h -0x3a01;MQI_Empty;;1;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h -0x3a02;MQI_Full;No space left for more messages;2;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h -0x3a03;MQI_NoReplyPartner;Returned if a reply method was called without partner;3;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h -0x3a04;MQI_DestinationInvalid;Returned if the target destination is invalid.;4;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h -0x0f01;CM_UnknownCommand;;1;COMMAND_MESSAGE;fsfw/src/fsfw/ipc/CommandMessageIF.h +0x63a0;NVMB_KeyNotExists;Specified key does not exist in json file;160;NVM_PARAM_BASE;mission/memory/NVMParameterBase.h +0x2c01;CCS_BcIsSetVrCommand;;1;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2c02;CCS_BcIsUnlockCommand;;2;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cb0;CCS_BcIllegalCommand;;176;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cb1;CCS_BoardReadingNotFinished;;177;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cf0;CCS_NsPositiveW;;240;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cf1;CCS_NsNegativeW;;241;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cf2;CCS_NsLockout;;242;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cf3;CCS_FarmInLockout;;243;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cf4;CCS_FarmInWait;;244;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce0;CCS_WrongSymbol;;224;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce1;CCS_DoubleStart;;225;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce2;CCS_StartSymbolMissed;;226;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce3;CCS_EndWithoutStart;;227;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce4;CCS_TooLarge;;228;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce5;CCS_TooShort;;229;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce6;CCS_WrongTfVersion;;230;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce7;CCS_WrongSpacecraftId;;231;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce8;CCS_NoValidFrameType;;232;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ce9;CCS_CrcFailed;;233;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cea;CCS_VcNotFound;;234;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ceb;CCS_ForwardingFailed;;235;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cec;CCS_ContentTooLarge;;236;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2ced;CCS_ResidualData;;237;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cee;CCS_DataCorrupted;;238;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cef;CCS_IllegalSegmentationFlag;;239;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cd0;CCS_IllegalFlagCombination;;208;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cd1;CCS_ShorterThanHeader;;209;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cd2;CCS_TooShortBlockedPacket;;210;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x2cd3;CCS_TooShortMapExtraction;;211;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h +0x3b00;SPH_ConnBroken;;0;SEMAPHORE_IF;fsfw/src/fsfw/osal/common/TcpTmTcServer.h +0x2a01;IEC_NoConfigurationTable;;1;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a02;IEC_NoCpuTable;;2;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a03;IEC_InvalidWorkspaceAddress;;3;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a04;IEC_TooLittleWorkspace;;4;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a05;IEC_WorkspaceAllocation;;5;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a06;IEC_InterruptStackTooSmall;;6;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a07;IEC_ThreadExitted;;7;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a08;IEC_InconsistentMpInformation;;8;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a09;IEC_InvalidNode;;9;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0a;IEC_NoMpci;;10;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0b;IEC_BadPacket;;11;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0c;IEC_OutOfPackets;;12;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0d;IEC_OutOfGlobalObjects;;13;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0e;IEC_OutOfProxies;;14;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a0f;IEC_InvalidGlobalId;;15;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a10;IEC_BadStackHook;;16;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a11;IEC_BadAttributes;;17;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a12;IEC_ImplementationKeyCreateInconsistency;;18;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a13;IEC_ImplementationBlockingOperationCancel;;19;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a14;IEC_MutexObtainFromBadState;;20;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h +0x2a15;IEC_UnlimitedAndMaximumIs0;;21;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h 0x0e01;HM_InvalidMode;;1;HAS_MODES_IF;fsfw/src/fsfw/modes/HasModesIF.h 0x0e02;HM_TransNotAllowed;;2;HAS_MODES_IF;fsfw/src/fsfw/modes/HasModesIF.h 0x0e03;HM_InTransition;;3;HAS_MODES_IF;fsfw/src/fsfw/modes/HasModesIF.h 0x0e04;HM_InvalidSubmode;;4;HAS_MODES_IF;fsfw/src/fsfw/modes/HasModesIF.h -0x0c02;MS_InvalidEntry;;2;MODE_STORE_IF;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h -0x0c03;MS_TooManyElements;;3;MODE_STORE_IF;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h -0x0c04;MS_CantStoreEmpty;;4;MODE_STORE_IF;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h -0x0b01;SB_ChildNotFound;;1;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h -0x0b02;SB_ChildInfoUpdated;;2;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h -0x0b03;SB_ChildDoesntHaveModes;;3;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h -0x0b04;SB_CouldNotInsertChild;;4;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h -0x0b05;SB_TableContainsInvalidObjectId;;5;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h -0x0d01;SS_SequenceAlreadyExists;;1;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d02;SS_TableAlreadyExists;;2;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d03;SS_TableDoesNotExist;;3;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d04;SS_TableOrSequenceLengthInvalid;;4;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d05;SS_SequenceDoesNotExist;;5;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d06;SS_TableContainsInvalidObjectId;;6;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d07;SS_FallbackSequenceDoesNotExist;;7;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d08;SS_NoTargetTable;;8;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d09;SS_SequenceOrTableTooLong;;9;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d0b;SS_IsFallbackSequence;;11;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d0c;SS_AccessDenied;;12;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0d0e;SS_TableInUse;;14;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0da1;SS_TargetTableNotReached;;161;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x0da2;SS_TableCheckFailed;;162;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h -0x2501;EV_ListenerNotFound;;1;EVENT_MANAGER_IF;fsfw/src/fsfw/events/EventManagerIF.h +0x2e01;HPA_InvalidIdentifierId;;1;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h +0x2e02;HPA_InvalidDomainId;;2;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h +0x2e03;HPA_InvalidValue;;3;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h +0x2e05;HPA_ReadOnly;;5;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h +0x2d01;PAW_UnknownDatatype;;1;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d02;PAW_DatatypeMissmatch;;2;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d03;PAW_Readonly;;3;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d04;PAW_TooBig;;4;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d05;PAW_SourceNotSet;;5;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d06;PAW_OutOfBounds;;6;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d07;PAW_NotSet;;7;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x2d08;PAW_ColumnOrRowsZero;;8;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h +0x3201;CF_ObjectHasNoFunctions;;1;COMMANDS_ACTIONS_IF;fsfw/src/fsfw/action/CommandsActionsIF.h +0x3202;CF_AlreadyCommanding;;2;COMMANDS_ACTIONS_IF;fsfw/src/fsfw/action/CommandsActionsIF.h +0x3301;HF_IsBusy;;1;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h +0x3302;HF_InvalidParameters;;2;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h +0x3303;HF_ExecutionFinished;;3;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h +0x3304;HF_InvalidActionId;;4;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h +0x0201;OM_InsertionFailed;;1;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h +0x0202;OM_NotFound;;2;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h +0x0203;OM_ChildInitFailed;;3;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h +0x0204;OM_InternalErrReporterUninit;;4;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h +0x2600;FDI_YourFault;;0;HANDLES_FAILURES_IF;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h +0x2601;FDI_MyFault;;1;HANDLES_FAILURES_IF;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h +0x2602;FDI_ConfirmLater;;2;HANDLES_FAILURES_IF;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h +0x2201;TMF_Busy;;1;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2202;TMF_LastPacketFound;;2;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2203;TMF_StopFetch;;3;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2204;TMF_Timeout;;4;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2205;TMF_TmChannelFull;;5;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2206;TMF_NotStored;;6;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2207;TMF_AllDeleted;;7;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2208;TMF_InvalidData;;8;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2209;TMF_NotReady;;9;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h +0x2101;TMB_Busy;;1;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2102;TMB_Full;;2;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2103;TMB_Empty;;3;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2104;TMB_NullRequested;;4;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2105;TMB_TooLarge;;5;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2106;TMB_NotReady;;6;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2107;TMB_DumpError;;7;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2108;TMB_CrcError;;8;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x2109;TMB_Timeout;;9;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210a;TMB_IdlePacketFound;;10;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210b;TMB_TelecommandFound;;11;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210c;TMB_NoPusATm;;12;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210d;TMB_TooSmall;;13;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210e;TMB_BlockNotFound;;14;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x210f;TMB_InvalidRequest;;15;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h +0x1c01;TCD_PacketLost;;1;PACKET_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/TcDistributorBase.h +0x1c02;TCD_DestinationNotFound;;2;PACKET_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/TcDistributorBase.h +0x1c03;TCD_ServiceIdAlreadyExists;;3;PACKET_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/TcDistributorBase.h +0x1b00;TCC_NoDestinationFound;;0;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b01;TCC_InvalidCcsdsVersion;;1;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b02;TCC_InvalidApid;;2;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b03;TCC_InvalidPacketType;;3;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b04;TCC_InvalidSecHeaderField;;4;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b05;TCC_IncorrectPrimaryHeader;;5;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b07;TCC_IncompletePacket;;7;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b08;TCC_InvalidPusVersion;;8;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b09;TCC_IncorrectChecksum;;9;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b0a;TCC_IllegalPacketSubtype;;10;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1b0b;TCC_IncorrectSecondaryHeader;;11;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h 0x04e1;RMP_CommandNoDescriptorsAvailable;;225;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h 0x04e2;RMP_CommandBufferFull;;226;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h 0x04e3;RMP_CommandChannelOutOfRange;;227;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h @@ -196,9 +215,95 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x040a;RMP_ReplyCommandNotImplementedOrNotAuthorised;;10;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h 0x040b;RMP_ReplyRmwDataLengthError;;11;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h 0x040c;RMP_ReplyInvalidTargetLogicalAddress;;12;RMAP_CHANNEL;fsfw/src/fsfw/rmap/RMAP.h -0x1401;SE_BufferTooShort;;1;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h -0x1402;SE_StreamTooShort;;2;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h -0x1403;SE_TooManyElements;;3;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h +0x2801;SM_DataTooLarge;;1;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x2802;SM_DataStorageFull;;2;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x2803;SM_IllegalStorageId;;3;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x2804;SM_DataDoesNotExist;;4;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x2805;SM_IllegalAddress;;5;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x2806;SM_PoolTooLarge;;6;STORAGE_MANAGER_IF;fsfw/src/fsfw/storagemanager/StorageManagerIF.h +0x38a1;SGP4_InvalidEccentricity;;161;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38a2;SGP4_InvalidMeanMotion;;162;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38a3;SGP4_InvalidPerturbationElements;;163;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38a4;SGP4_InvalidSemiLatusRectum;;164;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38a5;SGP4_InvalidEpochElements;;165;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38a6;SGP4_SatelliteHasDecayed;;166;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38b1;SGP4_TleTooOld;;177;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x38b2;SGP4_TleNotInitialized;;178;SGP4PROPAGATOR_CLASS;fsfw/src/fsfw/coordinates/Sgp4Propagator.h +0x2401;MT_NoPacketFound;;1;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/DleParser.h +0x2402;MT_PossiblePacketLoss;;2;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/DleParser.h +0x2403;MT_NoMatch;;3;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h +0x2404;MT_Full;;4;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h +0x2405;MT_NewNodeCreated;;5;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h +0x3f01;DLEE_StreamTooShort;;1;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h +0x3f02;DLEE_DecodingError;;2;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleEncoder.h +0x2f01;ASC_TooLongForTargetType;;1;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h +0x2f02;ASC_InvalidCharacters;;2;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h +0x2f03;ASC_BufferTooSmall;;3;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h +0x0f01;CM_UnknownCommand;;1;COMMAND_MESSAGE;fsfw/src/fsfw/ipc/CommandMessageIF.h +0x3a01;MQI_Empty;;1;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h +0x3a02;MQI_Full;No space left for more messages;2;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h +0x3a03;MQI_NoReplyPartner;Returned if a reply method was called without partner;3;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h +0x3a04;MQI_DestinationInvalid;Returned if the target destination is invalid.;4;MESSAGE_QUEUE_IF;fsfw/src/fsfw/ipc/MessageQueueIF.h +0x3901;MUX_NotEnoughResources;;1;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3902;MUX_InsufficientMemory;;2;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3903;MUX_NoPrivilege;;3;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3904;MUX_WrongAttributeSetting;;4;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3905;MUX_MutexAlreadyLocked;;5;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3906;MUX_MutexNotFound;;6;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3907;MUX_MutexMaxLocks;;7;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3908;MUX_CurrThreadAlreadyOwnsMutex;;8;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3909;MUX_CurrThreadDoesNotOwnMutex;;9;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x390a;MUX_MutexTimeout;;10;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x390b;MUX_MutexInvalidId;;11;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x390c;MUX_MutexDestroyedWhileWaiting;;12;MUTEX_IF;fsfw/src/fsfw/ipc/MutexIF.h +0x3b01;SPH_SemaphoreTimeout;;1;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h +0x3b02;SPH_SemaphoreNotOwned;;2;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h +0x3b03;SPH_SemaphoreInvalid;;3;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h +0x1e00;PUS_InvalidPusVersion;;0;PUS_IF;fsfw/src/fsfw/tmtcpacket/pus/PusIF.h +0x1e01;PUS_InvalidCrc16;;1;PUS_IF;fsfw/src/fsfw/tmtcpacket/pus/PusIF.h +0x3601;CFDP_InvalidTlvType;;1;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3602;CFDP_InvalidDirectiveField;;2;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3603;CFDP_InvalidPduDatafieldLen;;3;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3604;CFDP_InvalidAckDirectiveFields;;4;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3605;CFDP_MetadataCantParseOptions;;5;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3606;CFDP_NakCantParseOptions;;6;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3607;CFDP_FinishedCantParseFsResponses;;7;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3608;CFDP_FilestoreRequiresSecondFile;;8;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x3609;CFDP_FilestoreResponseCantParseFsMessage;;9;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x360a;CFDP_InvalidPduFormat;;10;CFDP;fsfw/src/fsfw/cfdp/definitions.h +0x2901;TC_InvalidTargetState;;1;THERMAL_COMPONENT_IF;fsfw/src/fsfw/thermal/ThermalComponentIF.h +0x29f1;TC_AboveOperationalLimit;;241;THERMAL_COMPONENT_IF;fsfw/src/fsfw/thermal/ThermalComponentIF.h +0x29f2;TC_BelowOperationalLimit;;242;THERMAL_COMPONENT_IF;fsfw/src/fsfw/thermal/ThermalComponentIF.h +0x0c02;MS_InvalidEntry;;2;MODE_STORE_IF;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h +0x0c03;MS_TooManyElements;;3;MODE_STORE_IF;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h +0x0c04;MS_CantStoreEmpty;;4;MODE_STORE_IF;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h +0x0d01;SS_SequenceAlreadyExists;;1;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d02;SS_TableAlreadyExists;;2;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d03;SS_TableDoesNotExist;;3;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d04;SS_TableOrSequenceLengthInvalid;;4;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d05;SS_SequenceDoesNotExist;;5;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d06;SS_TableContainsInvalidObjectId;;6;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d07;SS_FallbackSequenceDoesNotExist;;7;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d08;SS_NoTargetTable;;8;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d09;SS_SequenceOrTableTooLong;;9;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d0b;SS_IsFallbackSequence;;11;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d0c;SS_AccessDenied;;12;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0d0e;SS_TableInUse;;14;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0da1;SS_TargetTableNotReached;;161;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0da2;SS_TableCheckFailed;;162;SUBSYSTEM;fsfw/src/fsfw/subsystem/Subsystem.h +0x0b01;SB_ChildNotFound;;1;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h +0x0b02;SB_ChildInfoUpdated;;2;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h +0x0b03;SB_ChildDoesntHaveModes;;3;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h +0x0b04;SB_CouldNotInsertChild;;4;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h +0x0b05;SB_TableContainsInvalidObjectId;;5;SUBSYSTEM_BASE;fsfw/src/fsfw/subsystem/SubsystemBase.h +0x3e00;HKM_QueueOrDestinationInvalid;;0;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3e01;HKM_WrongHkPacketType;;1;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3e02;HKM_ReportingStatusUnchanged;;2;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3e03;HKM_PeriodicHelperInvalid;;3;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3e04;HKM_PoolobjectNotFound;;4;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3e05;HKM_DatasetNotFound;;5;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h +0x3c00;LPIF_PoolEntryNotFound;;0;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h +0x3c01;LPIF_PoolEntryTypeConflict;;1;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h 0x3da0;PVA_InvalidReadWriteMode;;160;POOL_VARIABLE_IF;fsfw/src/fsfw/datapool/PoolVariableIF.h 0x3da1;PVA_InvalidPoolEntry;;161;POOL_VARIABLE_IF;fsfw/src/fsfw/datapool/PoolVariableIF.h 0x0801;DPS_InvalidParameterDefinition;;1;DATA_SET_CLASS;fsfw/src/fsfw/datapool/DataSetIF.h @@ -207,20 +312,35 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x0804;DPS_DataSetUninitialised;;4;DATA_SET_CLASS;fsfw/src/fsfw/datapool/DataSetIF.h 0x0805;DPS_DataSetFull;;5;DATA_SET_CLASS;fsfw/src/fsfw/datapool/DataSetIF.h 0x0806;DPS_PoolVarNull;;6;DATA_SET_CLASS;fsfw/src/fsfw/datapool/DataSetIF.h -0x1c01;TCD_PacketLost;;1;PACKET_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/TcDistributorBase.h -0x1c02;TCD_DestinationNotFound;;2;PACKET_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/TcDistributorBase.h -0x1c03;TCD_ServiceIdAlreadyExists;;3;PACKET_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/TcDistributorBase.h -0x1b00;TCC_NoDestinationFound;;0;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b01;TCC_InvalidCcsdsVersion;;1;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b02;TCC_InvalidApid;;2;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b03;TCC_InvalidPacketType;;3;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b04;TCC_InvalidSecHeaderField;;4;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b05;TCC_IncorrectPrimaryHeader;;5;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b07;TCC_IncompletePacket;;7;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b08;TCC_InvalidPusVersion;;8;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b09;TCC_IncorrectChecksum;;9;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b0a;TCC_IllegalPacketSubtype;;10;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h -0x1b0b;TCC_IncorrectSecondaryHeader;;11;TMTC_DISTRIBUTION;fsfw/src/fsfw/tcdistribution/definitions.h +0x1000;TIM_UnsupportedTimeFormat;;0;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x1001;TIM_NotEnoughInformationForTargetFormat;;1;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x1002;TIM_LengthMismatch;;2;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x1003;TIM_InvalidTimeFormat;;3;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x1004;TIM_InvalidDayOfYear;;4;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x1005;TIM_TimeDoesNotFitFormat;;5;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h +0x3701;TSI_BadTimestamp;;1;TIME_STAMPER_IF;fsfw/src/fsfw/timemanager/TimeStampIF.h +0x1d01;ATC_ActivityStarted;;1;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h +0x1d02;ATC_InvalidSubservice;;2;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h +0x1d03;ATC_IllegalApplicationData;;3;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h +0x1d04;ATC_SendTmFailed;;4;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h +0x1d05;ATC_Timeout;;5;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h +0x4c00;SPPA_NoPacketFound;;0;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h +0x4c01;SPPA_SplitPacket;;1;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h +0x2001;CSB_ExecutionComplete;;1;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2002;CSB_NoStepMessage;;2;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2003;CSB_ObjectBusy;;3;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2004;CSB_Busy;;4;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2005;CSB_InvalidTc;;5;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2006;CSB_InvalidObject;;6;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x2007;CSB_InvalidReply;;7;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h +0x1801;FF_Full;;1;FIFO_CLASS;fsfw/src/fsfw/container/FIFOBase.h +0x1802;FF_Empty;;2;FIFO_CLASS;fsfw/src/fsfw/container/FIFOBase.h +0x1601;FMM_MapFull;;1;FIXED_MULTIMAP;fsfw/src/fsfw/container/FixedOrderedMultimap.h +0x1602;FMM_KeyDoesNotExist;;2;FIXED_MULTIMAP;fsfw/src/fsfw/container/FixedOrderedMultimap.h +0x2501;EV_ListenerNotFound;;1;EVENT_MANAGER_IF;fsfw/src/fsfw/events/EventManagerIF.h +0x1701;HHI_ObjectNotHealthy;;1;HAS_HEALTH_IF;fsfw/src/fsfw/health/HasHealthIF.h +0x1702;HHI_InvalidHealthState;;2;HAS_HEALTH_IF;fsfw/src/fsfw/health/HasHealthIF.h +0x1703;HHI_IsExternallyControlled;;3;HAS_HEALTH_IF;fsfw/src/fsfw/health/HasHealthIF.h 0x3001;POS_InPowerTransition;;1;POWER_SWITCHER;fsfw/src/fsfw/power/PowerSwitcher.h 0x3002;POS_SwitchStateMismatch;;2;POWER_SWITCHER;fsfw/src/fsfw/power/PowerSwitcher.h 0x0501;PS_SwitchOn;;1;POWER_SWITCH_IF;fsfw/src/fsfw/power/PowerSwitchIF.h @@ -228,76 +348,23 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x0502;PS_SwitchTimeout;;2;POWER_SWITCH_IF;fsfw/src/fsfw/power/PowerSwitchIF.h 0x0503;PS_FuseOn;;3;POWER_SWITCH_IF;fsfw/src/fsfw/power/PowerSwitchIF.h 0x0504;PS_FuseOff;;4;POWER_SWITCH_IF;fsfw/src/fsfw/power/PowerSwitchIF.h -0x3b00;SPH_ConnBroken;;0;SEMAPHORE_IF;fsfw/src/fsfw/osal/common/TcpTmTcServer.h -0x2a01;IEC_NoConfigurationTable;;1;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a02;IEC_NoCpuTable;;2;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a03;IEC_InvalidWorkspaceAddress;;3;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a04;IEC_TooLittleWorkspace;;4;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a05;IEC_WorkspaceAllocation;;5;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a06;IEC_InterruptStackTooSmall;;6;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a07;IEC_ThreadExitted;;7;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a08;IEC_InconsistentMpInformation;;8;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a09;IEC_InvalidNode;;9;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a0a;IEC_NoMpci;;10;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a0b;IEC_BadPacket;;11;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a0c;IEC_OutOfPackets;;12;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a0d;IEC_OutOfGlobalObjects;;13;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a0e;IEC_OutOfProxies;;14;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a0f;IEC_InvalidGlobalId;;15;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a10;IEC_BadStackHook;;16;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a11;IEC_BadAttributes;;17;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a12;IEC_ImplementationKeyCreateInconsistency;;18;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a13;IEC_ImplementationBlockingOperationCancel;;19;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a14;IEC_MutexObtainFromBadState;;20;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2a15;IEC_UnlimitedAndMaximumIs0;;21;INTERNAL_ERROR_CODES;fsfw/src/fsfw/osal/InternalErrorCodes.h -0x2600;FDI_YourFault;;0;HANDLES_FAILURES_IF;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h -0x2601;FDI_MyFault;;1;HANDLES_FAILURES_IF;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h -0x2602;FDI_ConfirmLater;;2;HANDLES_FAILURES_IF;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h -0x1e00;PUS_InvalidPusVersion;;0;PUS_IF;fsfw/src/fsfw/tmtcpacket/pus/PusIF.h -0x1e01;PUS_InvalidCrc16;;1;PUS_IF;fsfw/src/fsfw/tmtcpacket/pus/PusIF.h -0x0201;OM_InsertionFailed;;1;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h -0x0202;OM_NotFound;;2;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h -0x0203;OM_ChildInitFailed;;3;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h -0x0204;OM_InternalErrReporterUninit;;4;OBJECT_MANAGER_IF;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h -0x2201;TMF_Busy;;1;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2202;TMF_LastPacketFound;;2;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2203;TMF_StopFetch;;3;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2204;TMF_Timeout;;4;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2205;TMF_TmChannelFull;;5;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2206;TMF_NotStored;;6;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2207;TMF_AllDeleted;;7;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2208;TMF_InvalidData;;8;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2209;TMF_NotReady;;9;TM_STORE_FRONTEND_IF;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h -0x2101;TMB_Busy;;1;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2102;TMB_Full;;2;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2103;TMB_Empty;;3;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2104;TMB_NullRequested;;4;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2105;TMB_TooLarge;;5;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2106;TMB_NotReady;;6;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2107;TMB_DumpError;;7;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2108;TMB_CrcError;;8;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2109;TMB_Timeout;;9;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x210a;TMB_IdlePacketFound;;10;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x210b;TMB_TelecommandFound;;11;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x210c;TMB_NoPusATm;;12;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x210d;TMB_TooSmall;;13;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x210e;TMB_BlockNotFound;;14;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x210f;TMB_InvalidRequest;;15;TM_STORE_BACKEND_IF;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h -0x2d01;PAW_UnknownDatatype;;1;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2d02;PAW_DatatypeMissmatch;;2;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2d03;PAW_Readonly;;3;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2d04;PAW_TooBig;;4;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2d05;PAW_SourceNotSet;;5;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2d06;PAW_OutOfBounds;;6;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2d07;PAW_NotSet;;7;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2d08;PAW_ColumnOrRowsZero;;8;PARAMETER_WRAPPER;fsfw/src/fsfw/parameters/ParameterWrapper.h -0x2e01;HPA_InvalidIdentifierId;;1;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h -0x2e02;HPA_InvalidDomainId;;2;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h -0x2e03;HPA_InvalidValue;;3;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h -0x2e05;HPA_ReadOnly;;5;HAS_PARAMETERS_IF;fsfw/src/fsfw/parameters/HasParametersIF.h -0x3b01;SPH_SemaphoreTimeout;;1;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h -0x3b02;SPH_SemaphoreNotOwned;;2;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h -0x3b03;SPH_SemaphoreInvalid;;3;SEMAPHORE_IF;fsfw/src/fsfw/tasks/SemaphoreIF.h +0x4300;FILS_GenericFileError;;0;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4301;FILS_GenericDirError;;1;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4302;FILS_FilesystemInactive;;2;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4303;FILS_GenericRenameError;;3;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4304;FILS_IsBusy;;4;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4305;FILS_InvalidParameters;;5;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x430a;FILS_FileDoesNotExist;;10;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x430b;FILS_FileAlreadyExists;;11;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x430c;FILS_NotAFile;;12;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x430d;FILS_FileLocked;;13;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x430e;FILS_PermissionDenied;;14;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4315;FILS_DirectoryDoesNotExist;;21;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4316;FILS_DirectoryAlreadyExists;;22;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4317;FILS_NotADirectory;;23;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x4318;FILS_DirectoryNotEmpty;;24;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x431e;FILS_SequencePacketMissingWrite;;30;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h +0x431f;FILS_SequencePacketMissingRead;;31;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h 0x1a01;TRC_NotEnoughSensors;;1;TRIPLE_REDUNDACY_CHECK;fsfw/src/fsfw/monitoring/TriplexMonitor.h 0x1a02;TRC_LowestValueOol;;2;TRIPLE_REDUNDACY_CHECK;fsfw/src/fsfw/monitoring/TriplexMonitor.h 0x1a03;TRC_HighestValueOol;;3;TRIPLE_REDUNDACY_CHECK;fsfw/src/fsfw/monitoring/TriplexMonitor.h @@ -316,74 +383,36 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x31e2;LIM_WrongPid;;226;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h 0x31e3;LIM_WrongLimitId;;227;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h 0x31ee;LIM_MonitorNotFound;;238;LIMITS_IF;fsfw/src/fsfw/monitoring/MonitoringIF.h -0x3601;CFDP_InvalidTlvType;;1;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3602;CFDP_InvalidDirectiveField;;2;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3603;CFDP_InvalidPduDatafieldLen;;3;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3604;CFDP_InvalidAckDirectiveFields;;4;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3605;CFDP_MetadataCantParseOptions;;5;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3606;CFDP_NakCantParseOptions;;6;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3607;CFDP_FinishedCantParseFsResponses;;7;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3608;CFDP_FilestoreRequiresSecondFile;;8;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x3609;CFDP_FilestoreResponseCantParseFsMessage;;9;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x360a;CFDP_InvalidPduFormat;;10;CFDP;fsfw/src/fsfw/cfdp/definitions.h -0x4300;FILS_GenericFileError;;0;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4301;FILS_GenericDirError;;1;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4302;FILS_FilesystemInactive;;2;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4303;FILS_GenericRenameError;;3;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4304;FILS_IsBusy;;4;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4305;FILS_InvalidParameters;;5;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x430a;FILS_FileDoesNotExist;;10;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x430b;FILS_FileAlreadyExists;;11;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x430c;FILS_NotAFile;;12;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x430d;FILS_FileLocked;;13;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x430e;FILS_PermissionDenied;;14;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4315;FILS_DirectoryDoesNotExist;;21;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4316;FILS_DirectoryAlreadyExists;;22;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4317;FILS_NotADirectory;;23;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x4318;FILS_DirectoryNotEmpty;;24;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x431e;FILS_SequencePacketMissingWrite;;30;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x431f;FILS_SequencePacketMissingRead;;31;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h -0x2c01;CCS_BcIsSetVrCommand;;1;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2c02;CCS_BcIsUnlockCommand;;2;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cb0;CCS_BcIllegalCommand;;176;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cb1;CCS_BoardReadingNotFinished;;177;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cf0;CCS_NsPositiveW;;240;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cf1;CCS_NsNegativeW;;241;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cf2;CCS_NsLockout;;242;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cf3;CCS_FarmInLockout;;243;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cf4;CCS_FarmInWait;;244;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce0;CCS_WrongSymbol;;224;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce1;CCS_DoubleStart;;225;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce2;CCS_StartSymbolMissed;;226;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce3;CCS_EndWithoutStart;;227;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce4;CCS_TooLarge;;228;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce5;CCS_TooShort;;229;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce6;CCS_WrongTfVersion;;230;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce7;CCS_WrongSpacecraftId;;231;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce8;CCS_NoValidFrameType;;232;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ce9;CCS_CrcFailed;;233;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cea;CCS_VcNotFound;;234;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ceb;CCS_ForwardingFailed;;235;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cec;CCS_ContentTooLarge;;236;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2ced;CCS_ResidualData;;237;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cee;CCS_DataCorrupted;;238;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cef;CCS_IllegalSegmentationFlag;;239;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cd0;CCS_IllegalFlagCombination;;208;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cd1;CCS_ShorterThanHeader;;209;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cd2;CCS_TooShortBlockedPacket;;210;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h -0x2cd3;CCS_TooShortMapExtraction;;211;CCSDS_HANDLER_IF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h 0x4201;PUS11_InvalidTypeTimeWindow;;1;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 0x4202;PUS11_InvalidTimeWindow;;2;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 0x4203;PUS11_TimeshiftingNotPossible;;3;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 0x4204;PUS11_InvalidRelativeTime;;4;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 0x4205;PUS11_ContainedTcTooSmall;;5;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 0x4206;PUS11_ContainedTcCrcMissmatch;;6;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h -0x3401;DC_NoReplyReceived;;1;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h -0x3402;DC_ProtocolError;;2;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h -0x3403;DC_Nullpointer;;3;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h -0x3404;DC_InvalidCookieType;;4;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h -0x3405;DC_NotActive;;5;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h -0x3406;DC_TooMuchData;;6;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h +0x0601;PP_DoItMyself;;1;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0602;PP_PointsToVariable;;2;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0603;PP_PointsToMemory;;3;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0604;PP_ActivityCompleted;;4;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0605;PP_PointsToVectorUint8;;5;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0606;PP_PointsToVectorUint16;;6;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0607;PP_PointsToVectorUint32;;7;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x0608;PP_PointsToVectorFloat;;8;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06a0;PP_DumpNotSupported;;160;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06e0;PP_InvalidSize;;224;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06e1;PP_InvalidAddress;;225;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06e2;PP_InvalidContent;;226;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06e3;PP_UnalignedAccess;;227;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x06e4;PP_WriteProtected;;228;HAS_MEMORY_IF;fsfw/src/fsfw/memory/HasMemoryIF.h +0x13e0;MH_UnknownCmd;;224;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h +0x13e1;MH_InvalidAddress;;225;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h +0x13e2;MH_InvalidSize;;226;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h +0x13e3;MH_StateMismatch;;227;MEMORY_HELPER;fsfw/src/fsfw/memory/MemoryHelper.h +0x1201;AB_NeedSecondStep;;1;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x1202;AB_NeedToReconfigure;;2;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x1203;AB_ModeFallback;;3;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x1204;AB_ChildNotCommandable;;4;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x1205;AB_NeedToChangeHealth;;5;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x12a1;AB_NotEnoughChildrenInCorrectState;;161;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h 0x03a0;DHB_InvalidChannel;;160;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h 0x03b0;DHB_AperiodicReply;;176;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h 0x03b1;DHB_IgnoreReplyData;;177;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h @@ -393,12 +422,12 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x03d0;DHB_NoSwitch;;208;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h 0x03e0;DHB_ChildTimeout;;224;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h 0x03e1;DHB_SwitchFailed;;225;DEVICE_HANDLER_BASE;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h -0x1201;AB_NeedSecondStep;;1;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h -0x1202;AB_NeedToReconfigure;;2;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h -0x1203;AB_ModeFallback;;3;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h -0x1204;AB_ChildNotCommandable;;4;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h -0x1205;AB_NeedToChangeHealth;;5;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h -0x12a1;AB_NotEnoughChildrenInCorrectState;;161;ASSEMBLY_BASE;fsfw/src/fsfw/devicehandlers/AssemblyBase.h +0x3401;DC_NoReplyReceived;;1;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h +0x3402;DC_ProtocolError;;2;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h +0x3403;DC_Nullpointer;;3;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h +0x3404;DC_InvalidCookieType;;4;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h +0x3405;DC_NotActive;;5;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h +0x3406;DC_TooMuchData;;6;DEVICE_COMMUNICATION_IF;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h 0x27a0;DHI_NoCommandData;;160;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h 0x27a1;DHI_CommandNotSupported;;161;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h 0x27a2;DHI_CommandAlreadySent;;162;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h @@ -420,58 +449,28 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x27c3;DHI_DeviceReplyInvalid;;195;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h 0x27d0;DHI_InvalidCommandParameter;;208;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h 0x27d1;DHI_InvalidNumberOrLengthOfParameters;;209;DEVICE_HANDLER_IF;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h -0x2401;MT_TooDetailedRequest;;1;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h -0x2402;MT_TooGeneralRequest;;2;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h -0x2403;MT_NoMatch;;3;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h -0x2404;MT_Full;;4;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h -0x2405;MT_NewNodeCreated;;5;MATCH_TREE_CLASS;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h -0x3f01;DLEE_NoPacketFound;;1;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleParser.h -0x3f02;DLEE_PossiblePacketLoss;;2;DLE_ENCODER;fsfw/src/fsfw/globalfunctions/DleParser.h -0x2f01;ASC_TooLongForTargetType;;1;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h -0x2f02;ASC_InvalidCharacters;;2;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h -0x2f03;ASC_BufferTooSmall;;3;ASCII_CONVERTER;fsfw/src/fsfw/globalfunctions/AsciiConverter.h -0x1701;HHI_ObjectNotHealthy;;1;HAS_HEALTH_IF;fsfw/src/fsfw/health/HasHealthIF.h -0x1702;HHI_InvalidHealthState;;2;HAS_HEALTH_IF;fsfw/src/fsfw/health/HasHealthIF.h -0x1703;HHI_IsExternallyControlled;;3;HAS_HEALTH_IF;fsfw/src/fsfw/health/HasHealthIF.h -0x3201;CF_ObjectHasNoFunctions;;1;COMMANDS_ACTIONS_IF;fsfw/src/fsfw/action/CommandsActionsIF.h -0x3202;CF_AlreadyCommanding;;2;COMMANDS_ACTIONS_IF;fsfw/src/fsfw/action/CommandsActionsIF.h -0x3301;HF_IsBusy;;1;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h -0x3302;HF_InvalidParameters;;2;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h -0x3303;HF_ExecutionFinished;;3;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h -0x3304;HF_InvalidActionId;;4;HAS_ACTIONS_IF;fsfw/src/fsfw/action/HasActionsIF.h -0x1000;TIM_UnsupportedTimeFormat;;0;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h -0x1001;TIM_NotEnoughInformationForTargetFormat;;1;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h -0x1002;TIM_LengthMismatch;;2;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h -0x1003;TIM_InvalidTimeFormat;;3;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h -0x1004;TIM_InvalidDayOfYear;;4;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h -0x1005;TIM_TimeDoesNotFitFormat;;5;CCSDS_TIME_HELPER_CLASS;fsfw/src/fsfw/timemanager/CCSDSTime.h -0x3701;TSI_BadTimestamp;;1;TIME_STAMPER_IF;fsfw/src/fsfw/timemanager/TimeStampIF.h -0x3c00;LPIF_PoolEntryNotFound;;0;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h -0x3c01;LPIF_PoolEntryTypeConflict;;1;LOCAL_POOL_OWNER_IF;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h -0x3e00;HKM_QueueOrDestinationInvalid;;0;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3e01;HKM_WrongHkPacketType;;1;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3e02;HKM_ReportingStatusUnchanged;;2;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3e03;HKM_PeriodicHelperInvalid;;3;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3e04;HKM_PoolobjectNotFound;;4;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x3e05;HKM_DatasetNotFound;;5;HOUSEKEEPING_MANAGER;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h -0x2901;TC_InvalidTargetState;;1;THERMAL_COMPONENT_IF;fsfw/src/fsfw/thermal/ThermalComponentIF.h -0x29f1;TC_AboveOperationalLimit;;241;THERMAL_COMPONENT_IF;fsfw/src/fsfw/thermal/ThermalComponentIF.h -0x29f2;TC_BelowOperationalLimit;;242;THERMAL_COMPONENT_IF;fsfw/src/fsfw/thermal/ThermalComponentIF.h -0x2001;CSB_ExecutionComplete;;1;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h -0x2002;CSB_NoStepMessage;;2;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h -0x2003;CSB_ObjectBusy;;3;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h -0x2004;CSB_Busy;;4;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h -0x2005;CSB_InvalidTc;;5;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h -0x2006;CSB_InvalidObject;;6;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h -0x2007;CSB_InvalidReply;;7;COMMAND_SERVICE_BASE;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h -0x4c00;SPPA_NoPacketFound;;0;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h -0x4c01;SPPA_SplitPacket;;1;SPACE_PACKET_PARSER;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h -0x1d01;ATC_ActivityStarted;;1;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h -0x1d02;ATC_InvalidSubservice;;2;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h -0x1d03;ATC_IllegalApplicationData;;3;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h -0x1d04;ATC_SendTmFailed;;4;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h -0x1d05;ATC_Timeout;;5;ACCEPTS_TELECOMMANDS_IF;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h -0x7000;SCBU_KeyNotFound;;0;SCRATCH_BUFFER;bsp_q7s/memory/scratchApi.h +0x1401;SE_BufferTooShort;;1;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h +0x1402;SE_StreamTooShort;;2;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h +0x1403;SE_TooManyElements;;3;SERIALIZE_IF;fsfw/src/fsfw/serialize/SerializeIF.h +0x4500;HSPI_HalTimeoutRetval;;0;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h +0x4501;HSPI_HalBusyRetval;;1;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h +0x4502;HSPI_HalErrorRetval;;2;HAL_SPI;fsfw/src/fsfw_hal/stm32h7/spi/spiDefinitions.h +0x4601;HURT_UartReadFailure;;1;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h +0x4602;HURT_UartReadSizeMissmatch;;2;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h +0x4603;HURT_UartRxBufferTooSmall;;3;HAL_UART;fsfw/src/fsfw_hal/linux/serial/SerialComIF.h +0x4801;HGIO_UnknownGpioId;;1;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4802;HGIO_DriveGpioFailure;;2;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4803;HGIO_GpioTypeFailure;;3;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4804;HGIO_GpioInvalidInstance;;4;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4805;HGIO_GpioDuplicateDetected;;5;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4806;HGIO_GpioInitFailed;;6;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4807;HGIO_GpioGetValueFailed;;7;HAL_GPIO;fsfw/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +0x4400;UXOS_ExecutionFinished;Execution of the current command has finished;0;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4401;UXOS_CommandPending;Command is pending. This will also be returned if the user tries to load another command but a command is still pending;1;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4402;UXOS_BytesRead;Some bytes have been read from the executing process;2;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4403;UXOS_CommandError;Command execution failed;3;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4404;UXOS_NoCommandLoadedOrPending;;4;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h +0x4406;UXOS_PcloseCallError;;6;LINUX_OSAL;fsfw/src/fsfw_hal/linux/CommandExecutor.h 0x64a0;FSHLP_SdNotMounted;SD card specified with path string not mounted;160;FILE_SYSTEM_HELPER;bsp_q7s/fs/FilesystemHelper.h 0x64a1;FSHLP_FileNotExists;Specified file does not exist on filesystem;161;FILE_SYSTEM_HELPER;bsp_q7s/fs/FilesystemHelper.h 0x6f00;SDMA_OpOngoing;;0;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h @@ -484,9 +483,7 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x6f0d;SDMA_UnmountError;;13;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h 0x6f0e;SDMA_SystemCallError;;14;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h 0x6f0f;SDMA_PopenCallError;;15;SD_CARD_MANAGER;bsp_q7s/fs/SdCardManager.h -0x65a0;PLMPHLP_FileClosedAccidentally;File accidentally close;160;PLOC_MPSOC_HELPER;linux/devices/ploc/PlocMPSoCHelper.h -0x5ea0;PLMEMDUMP_MramAddressTooHigh;The capacity of the MRAM amounts to 512 kB. Thus the maximum address must not be higher than 0x7d000.;160;PLOC_MEMORY_DUMPER;linux/devices/ploc/PlocMemoryDumper.h -0x5ea1;PLMEMDUMP_MramInvalidAddressCombination;The specified end address is lower than the start address;161;PLOC_MEMORY_DUMPER;linux/devices/ploc/PlocMemoryDumper.h +0x7000;SCBU_KeyNotFound;;0;SCRATCH_BUFFER;bsp_q7s/memory/scratchApi.h 0x57a0;PLSPVhLP_FileClosedAccidentally;File accidentally close;160;PLOC_SUPV_HELPER;linux/devices/ploc/PlocSupvUartMan.h 0x57a1;PLSPVhLP_ProcessTerminated;Process has been terminated by command;161;PLOC_SUPV_HELPER;linux/devices/ploc/PlocSupvUartMan.h 0x57a2;PLSPVhLP_PathNotExists;Received command with invalid pathname;162;PLOC_SUPV_HELPER;linux/devices/ploc/PlocSupvUartMan.h @@ -497,16 +494,46 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x5703;PLSPVhLP_PossiblePacketLossConsecutiveStart;;3;PLOC_SUPV_HELPER;linux/devices/ploc/PlocSupvUartMan.h 0x5704;PLSPVhLP_PossiblePacketLossConsecutiveEnd;;4;PLOC_SUPV_HELPER;linux/devices/ploc/PlocSupvUartMan.h 0x5705;PLSPVhLP_HdlcError;;5;PLOC_SUPV_HELPER;linux/devices/ploc/PlocSupvUartMan.h -0x67a0;MPSOCRTVIF_CrcFailure;Space Packet received from PLOC has invalid CRC;160;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h -0x67a1;MPSOCRTVIF_ReceivedAckFailure;Received ACK failure reply from PLOC;161;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h -0x67a2;MPSOCRTVIF_ReceivedExeFailure;Received execution failure reply from PLOC;162;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h -0x67a3;MPSOCRTVIF_InvalidApid;Received space packet with invalid APID from PLOC;163;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h -0x67a4;MPSOCRTVIF_InvalidLength;Received command with invalid length;164;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h -0x67a5;MPSOCRTVIF_FilenameTooLong;Filename of file in OBC filesystem is too long;165;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h -0x67a6;MPSOCRTVIF_MpsocHelperExecuting;MPSoC helper is currently executing a command;166;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h -0x67a7;MPSOCRTVIF_MpsocFilenameTooLong;Filename of MPSoC file is to long (max. 256 bytes);167;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h -0x67a8;MPSOCRTVIF_InvalidParameter;Command has invalid parameter;168;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h -0x67a9;MPSOCRTVIF_NameTooLong;Received command has file string with invalid length;169;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h +0x65a0;PLMPHLP_FileClosedAccidentally;File accidentally close;160;PLOC_MPSOC_HELPER;linux/devices/ploc/PlocMPSoCHelper.h +0x5ea0;PLMEMDUMP_MramAddressTooHigh;The capacity of the MRAM amounts to 512 kB. Thus the maximum address must not be higher than 0x7d000.;160;PLOC_MEMORY_DUMPER;linux/devices/ploc/PlocMemoryDumper.h +0x5ea1;PLMEMDUMP_MramInvalidAddressCombination;The specified end address is lower than the start address;161;PLOC_MEMORY_DUMPER;linux/devices/ploc/PlocMemoryDumper.h +0x53a0;STRH_TemperatureReqFailed;Status in temperature reply signals error;160;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53a1;STRH_PingFailed;Ping command failed;161;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53a2;STRH_VersionReqFailed;Status in version reply signals error;162;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x6201;JSONBASE_JsonFileNotExists;Specified json file does not exist;1;ARCSEC_JSON_BASE;linux/devices/startracker/ArcsecJsonParamBase.h +0x6202;JSONBASE_SetNotExists;Requested set does not exist in json file;2;ARCSEC_JSON_BASE;linux/devices/startracker/ArcsecJsonParamBase.h +0x6203;JSONBASE_ParamNotExists;Requested parameter does not exist in json file;3;ARCSEC_JSON_BASE;linux/devices/startracker/ArcsecJsonParamBase.h +0x53a3;STRH_InterfaceReqFailed;Status in interface reply signals error;163;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53a4;STRH_PowerReqFailed;Status in power reply signals error;164;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53a5;STRH_SetParamFailed;Status of reply to parameter set command signals error;165;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53a6;STRH_ActionFailed;Status of reply to action command signals error;166;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53a7;STRH_FilePathTooLong;Received invalid path string. Exceeds allowed length;167;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53a8;STRH_FilenameTooLong;Name of file received with command is too long;168;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53a9;STRH_InvalidProgram;Received version reply with invalid program ID;169;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53aa;STRH_ReplyError;Status field reply signals error;170;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53ab;STRH_CommandTooShort;Received command which is too short (some data is missing for proper execution);171;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53ac;STRH_InvalidLength;Received command with invalid length (too few or too many parameters);172;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53ad;STRH_RegionMismatch;Region mismatch between send and received data;173;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53ae;STRH_AddressMismatch;Address mismatch between send and received data;174;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53af;STRH_LengthMismatch;Length field mismatch between send and received data;175;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53b0;STRH_FileNotExists;Specified file does not exist;176;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53b1;STRH_InvalidType;Download blob pixel command has invalid type field;177;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53b2;STRH_InvalidId;Received FPGA action command with invalid ID;178;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53b3;STRH_ReplyTooShort;Received reply is too short;179;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53b4;STRH_CrcFailure;Received reply with invalid CRC;180;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53b5;STRH_StrHelperExecuting;Star tracker handler currently executing a command and using the communication interface;181;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53b6;STRH_StartrackerAlreadyBooted;Star tracker is already in firmware mode;182;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53b7;STRH_StartrackerRunningFirmware;Star tracker is in firmware mode but must be in bootloader mode to execute this command;183;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x53b8;STRH_StartrackerRunningBootloader;Star tracker is in bootloader mode but must be in firmware mode to execute this command;184;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h +0x5ca0;STRHLP_SdNotMounted;SD card specified in path string not mounted;160;STR_HELPER;linux/devices/startracker/StrHelper.h +0x5ca1;STRHLP_FileNotExists;Specified file does not exist on filesystem;161;STR_HELPER;linux/devices/startracker/StrHelper.h +0x5ca2;STRHLP_PathNotExists;Specified path does not exist;162;STR_HELPER;linux/devices/startracker/StrHelper.h +0x5ca3;STRHLP_FileCreationFailed;Failed to create download image or read flash file;163;STR_HELPER;linux/devices/startracker/StrHelper.h +0x5ca4;STRHLP_RegionMismatch;Region in flash write/read reply does not match expected region;164;STR_HELPER;linux/devices/startracker/StrHelper.h +0x5ca5;STRHLP_AddressMismatch;Address in flash write/read reply does not match expected address;165;STR_HELPER;linux/devices/startracker/StrHelper.h +0x5ca6;STRHLP_LengthMismatch;Length in flash write/read reply does not match expected length;166;STR_HELPER;linux/devices/startracker/StrHelper.h +0x5ca7;STRHLP_StatusError;Status field in reply signals error;167;STR_HELPER;linux/devices/startracker/StrHelper.h +0x5ca8;STRHLP_InvalidTypeId;Reply has invalid type ID (should be of action reply type);168;STR_HELPER;linux/devices/startracker/StrHelper.h 0x68a0;SPVRTVIF_CrcFailure;Space Packet received from PLOC supervisor has invalid CRC;160;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h 0x68a1;SPVRTVIF_InvalidServiceId;;161;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h 0x68a2;SPVRTVIF_ReceivedAckFailure;Received ACK failure reply from PLOC supervisor;162;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h @@ -531,46 +558,20 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x68b5;SPVRTVIF_SupvHelperExecuting;Supervisor helper task ist currently executing a command (wait until helper tas has finished or interrupt by sending the terminate command);181;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h 0x68c0;SPVRTVIF_BufTooSmall;;192;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h 0x68c1;SPVRTVIF_NoReplyTimeout;;193;SUPV_RETURN_VALUES_IF;linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +0x67a0;MPSOCRTVIF_CrcFailure;Space Packet received from PLOC has invalid CRC;160;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h +0x67a1;MPSOCRTVIF_ReceivedAckFailure;Received ACK failure reply from PLOC;161;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h +0x67a2;MPSOCRTVIF_ReceivedExeFailure;Received execution failure reply from PLOC;162;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h +0x67a3;MPSOCRTVIF_InvalidApid;Received space packet with invalid APID from PLOC;163;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h +0x67a4;MPSOCRTVIF_InvalidLength;Received command with invalid length;164;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h +0x67a5;MPSOCRTVIF_FilenameTooLong;Filename of file in OBC filesystem is too long;165;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h +0x67a6;MPSOCRTVIF_MpsocHelperExecuting;MPSoC helper is currently executing a command;166;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h +0x67a7;MPSOCRTVIF_MpsocFilenameTooLong;Filename of MPSoC file is to long (max. 256 bytes);167;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h +0x67a8;MPSOCRTVIF_InvalidParameter;Command has invalid parameter;168;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h +0x67a9;MPSOCRTVIF_NameTooLong;Received command has file string with invalid length;169;MPSOC_RETURN_VALUES_IF;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h 0x54e0;DWLPWRON_InvalidMode;Received command has invalid JESD mode (valid modes are 0 - 5);224;DWLPWRON_CMD;linux/devices/devicedefinitions/PlocMPSoCDefinitions.h 0x54e1;DWLPWRON_InvalidLaneRate;Received command has invalid lane rate (valid lane rate are 0 - 9);225;DWLPWRON_CMD;linux/devices/devicedefinitions/PlocMPSoCDefinitions.h -0x6201;JSONBASE_JsonFileNotExists;Specified json file does not exist;1;ARCSEC_JSON_BASE;linux/devices/startracker/ArcsecJsonParamBase.h -0x6202;JSONBASE_SetNotExists;Requested set does not exist in json file;2;ARCSEC_JSON_BASE;linux/devices/startracker/ArcsecJsonParamBase.h -0x6203;JSONBASE_ParamNotExists;Requested parameter does not exist in json file;3;ARCSEC_JSON_BASE;linux/devices/startracker/ArcsecJsonParamBase.h -0x53a0;STRH_TemperatureReqFailed;Status in temperature reply signals error;160;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h -0x53a1;STRH_PingFailed;Ping command failed;161;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h -0x53a2;STRH_VersionReqFailed;Status in version reply signals error;162;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h -0x5ca0;STRHLP_SdNotMounted;SD card specified in path string not mounted;160;STR_HELPER;linux/devices/startracker/StrHelper.h -0x5ca1;STRHLP_FileNotExists;Specified file does not exist on filesystem;161;STR_HELPER;linux/devices/startracker/StrHelper.h -0x5ca2;STRHLP_PathNotExists;Specified path does not exist;162;STR_HELPER;linux/devices/startracker/StrHelper.h -0x5ca3;STRHLP_FileCreationFailed;Failed to create download image or read flash file;163;STR_HELPER;linux/devices/startracker/StrHelper.h -0x5ca4;STRHLP_RegionMismatch;Region in flash write/read reply does not match expected region;164;STR_HELPER;linux/devices/startracker/StrHelper.h -0x5ca5;STRHLP_AddressMismatch;Address in flash write/read reply does not match expected address;165;STR_HELPER;linux/devices/startracker/StrHelper.h -0x5ca6;STRHLP_LengthMismatch;Length in flash write/read reply does not match expected length;166;STR_HELPER;linux/devices/startracker/StrHelper.h -0x5ca7;STRHLP_StatusError;Status field in reply signals error;167;STR_HELPER;linux/devices/startracker/StrHelper.h -0x5ca8;STRHLP_InvalidTypeId;Reply has invalid type ID (should be of action reply type);168;STR_HELPER;linux/devices/startracker/StrHelper.h -0x53a3;STRH_InterfaceReqFailed;Status in interface reply signals error;163;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h -0x53a4;STRH_PowerReqFailed;Status in power reply signals error;164;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h -0x53a5;STRH_SetParamFailed;Status of reply to parameter set command signals error;165;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h -0x53a6;STRH_ActionFailed;Status of reply to action command signals error;166;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h -0x53a7;STRH_FilePathTooLong;Received invalid path string. Exceeds allowed length;167;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h -0x53a8;STRH_FilenameTooLong;Name of file received with command is too long;168;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h -0x53a9;STRH_InvalidProgram;Received version reply with invalid program ID;169;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h -0x53aa;STRH_ReplyError;Status field reply signals error;170;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h -0x53ab;STRH_CommandTooShort;Received command which is too short (some data is missing for proper execution);171;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h -0x53ac;STRH_InvalidLength;Received command with invalid length (too few or too many parameters);172;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h -0x53ad;STRH_RegionMismatch;Region mismatch between send and received data;173;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h -0x53ae;STRH_AddressMismatch;Address mismatch between send and received data;174;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h -0x53af;STRH_LengthMismatch;Length field mismatch between send and received data;175;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h -0x53b0;STRH_FileNotExists;Specified file does not exist;176;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h -0x53b1;STRH_InvalidType;Download blob pixel command has invalid type field;177;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h -0x53b2;STRH_InvalidId;Received FPGA action command with invalid ID;178;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h -0x53b3;STRH_ReplyTooShort;Received reply is too short;179;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h -0x53b4;STRH_CrcFailure;Received reply with invalid CRC;180;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h -0x53b5;STRH_StrHelperExecuting;Star tracker handler currently executing a command and using the communication interface;181;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h -0x53b6;STRH_StartrackerAlreadyBooted;Star tracker is already in firmware mode;182;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h -0x53b7;STRH_StartrackerRunningFirmware;Star tracker is in firmware mode but must be in bootloader mode to execute this command;183;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h -0x53b8;STRH_StartrackerRunningBootloader;Star tracker is in bootloader mode but must be in firmware mode to execute this command;184;STR_HANDLER;linux/devices/startracker/StarTrackerHandler.h -0x5302;STRH_InvalidCrc;;2;STR_HANDLER;linux/devices/ScexHelper.h +0x5402;DWLPWRON_InvalidCrc;;2;DWLPWRON_CMD;linux/devices/ScexHelper.h +0x59a0;IPCI_PapbBusy;;160;CCSDS_IP_CORE_BRIDGE;linux/ipcore/PapbVcInterface.h 0x5aa0;PTME_UnknownVcId;;160;PTME;linux/ipcore/Ptme.h 0x5fa0;PDEC_AbandonedCltu;;160;PDEC_HANDLER;linux/ipcore/PdecHandler.h 0x5fa1;PDEC_FrameDirty;;161;PDEC_HANDLER;linux/ipcore/PdecHandler.h @@ -591,4 +592,3 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x61a1;RS_BadBitRate;Bad bitrate has been commanded (e.g. 0);161;RATE_SETTER;linux/ipcore/PtmeConfig.h 0x61a2;RS_ClkInversionFailed;Failed to invert clock and thus change the time the data is updated with respect to the tx clock;162;RATE_SETTER;linux/ipcore/PtmeConfig.h 0x61a3;RS_TxManipulatorConfigFailed;Failed to change configuration bit of tx clock manipulator;163;RATE_SETTER;linux/ipcore/PtmeConfig.h -0x59a0;IPCI_PapbBusy;;160;CCSDS_IP_CORE_BRIDGE;linux/ipcore/PapbVcInterface.h diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 076be623..42156029 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 256 translations. * @details - * Generated on: 2023-02-09 15:57:01 + * Generated on: 2023-02-13 10:07:30 */ #include "translateEvents.h" diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 85fe0632..9eba7b06 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 152 translations. - * Generated on: 2023-02-09 15:57:01 + * Generated on: 2023-02-13 10:07:30 */ #include "translateObjects.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 076be623..42156029 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 256 translations. * @details - * Generated on: 2023-02-09 15:57:01 + * Generated on: 2023-02-13 10:07:30 */ #include "translateEvents.h" diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 85fe0632..9eba7b06 100644 --- a/linux/fsfwconfig/objects/translateObjects.cpp +++ b/linux/fsfwconfig/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 152 translations. - * Generated on: 2023-02-09 15:57:01 + * Generated on: 2023-02-13 10:07:30 */ #include "translateObjects.h" diff --git a/tmtc b/tmtc index 09cf9603..9b7471e9 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 09cf960350911a62308733d051a57e6b4e45d157 +Subproject commit 9b7471e9097edd410995ba0c76125b626440d9be From f4f6d1ed819f69a0291092584029fb6956a1467a Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 13 Feb 2023 10:33:08 +0100 Subject: [PATCH 287/330] added InternalState SET_SPEED to enable setting RW Speed from ACS Ctrl --- mission/devices/RwHandler.cpp | 7 ++++++- mission/devices/RwHandler.h | 10 ++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/mission/devices/RwHandler.cpp b/mission/devices/RwHandler.cpp index 7a8b52f3..88857b68 100644 --- a/mission/devices/RwHandler.cpp +++ b/mission/devices/RwHandler.cpp @@ -53,7 +53,11 @@ ReturnValue_t RwHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { break; case InternalState::GET_RW_SATUS: *id = RwDefinitions::GET_RW_STATUS; - internalState = InternalState::GET_RESET_STATUS; + internalState = InternalState::SET_SPEED; + break; + case InternalState::SET_SPEED: + *id = RwDefinitions::SET_SPEED; + internalState = InternalState::CLEAR_RESET_STATUS; break; case InternalState::CLEAR_RESET_STATUS: *id = RwDefinitions::CLEAR_LAST_RESET_STATUS; @@ -98,6 +102,7 @@ ReturnValue_t RwHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand return returnvalue::OK; } case (RwDefinitions::SET_SPEED): { + sif::debug << "hello" << std::endl; if (commandData != nullptr && commandDataLen != 6) { sif::error << "RwHandler::buildCommandFromCommand: Received set speed command with" << " invalid length" << std::endl; diff --git a/mission/devices/RwHandler.h b/mission/devices/RwHandler.h index af59caa1..148a6359 100644 --- a/mission/devices/RwHandler.h +++ b/mission/devices/RwHandler.h @@ -9,7 +9,7 @@ #include "events/subsystemIdRanges.h" #include "returnvalues/classIds.h" -static constexpr bool ACTUATION_WIRETAPPING = false; +static constexpr bool ACTUATION_WIRETAPPING = true; class GpioIF; @@ -102,7 +102,13 @@ class RwHandler : public DeviceHandlerBase { PoolEntry rwSpeed = PoolEntry(0, false); PoolEntry rampTime = PoolEntry(10, false); - enum class InternalState { GET_RESET_STATUS, CLEAR_RESET_STATUS, READ_TEMPERATURE, GET_RW_SATUS }; + enum class InternalState { + GET_RESET_STATUS, + CLEAR_RESET_STATUS, + READ_TEMPERATURE, + SET_SPEED, + GET_RW_SATUS + }; InternalState internalState = InternalState::GET_RESET_STATUS; From b5e096abcbad244e21eefa6226a4b92eb834c46b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Feb 2023 10:40:39 +0100 Subject: [PATCH 288/330] start work on EM satsystem --- bsp_q7s/em/emObjectFactory.cpp | 3 ++- dummies/helpers.cpp | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 1a838b17..693da405 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include "OBSWConfig.h" #include "bsp_q7s/core/CoreController.h" @@ -115,5 +116,5 @@ void ObjectFactory::produce(void* args) { HeaterHandler* heaterHandler = nullptr; ObjectFactory::createGenericHeaterComponents(*gpioComIF, *pwrSwitcher, heaterHandler); createThermalController(*heaterHandler); - satsystem::com::init(); + satsystem::init(); } diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index 7c8fab1c..d6bbf70f 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -24,6 +24,7 @@ #include "TemperatureSensorInserter.h" #include "dummies/Max31865Dummy.h" #include "dummies/Tmp1075Dummy.h" +#include "mission/system/tree/acsModeTree.h" using namespace dummy; @@ -48,6 +49,7 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) { } auto* imtqDummy = new ImtqDummy(objects::IMTQ_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); imtqDummy->enableThermalModule(ThermalStateCfg()); + imtqDummy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); if (cfg.addPowerDummies) { new AcuDummy(objects::ACU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); new PduDummy(objects::PDU1_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); From 53f31ca5a4df78887aaf3e22090159eb35d8509c Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 13 Feb 2023 10:42:05 +0100 Subject: [PATCH 289/330] lol --- .../pollingSequenceFactory.cpp | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index f9b69e45..6b184f58 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -639,6 +639,129 @@ ReturnValue_t pst::pstAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg) { } if (cfg.scheduleRws) { + thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + + thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::SEND_WRITE); + + thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::GET_WRITE); + + thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::SEND_READ); + + thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + + thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::SEND_WRITE); + + thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::GET_WRITE); + + thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::SEND_READ); + + thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + + thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::SEND_WRITE); + + thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::GET_WRITE); + + thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::SEND_READ); + + thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::GET_READ); + } + + if (cfg.scheduleRws) { + // this is the torquing cycle + thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::PERFORM_OPERATION); + + thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::SEND_WRITE); + + thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::GET_WRITE); + + thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::SEND_READ); + + thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RW3, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RW1, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::RW2, length * config::acs::SCHED_BLOCK_2_PERIOD, From 14c43c49dca652396a161dc083cb99acd6ed1ba8 Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 13 Feb 2023 10:58:12 +0100 Subject: [PATCH 290/330] scale rwCmdSpeed to appropriate range --- mission/controller/acs/ActuatorCmd.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/mission/controller/acs/ActuatorCmd.cpp b/mission/controller/acs/ActuatorCmd.cpp index cbe24e5b..b902593f 100644 --- a/mission/controller/acs/ActuatorCmd.cpp +++ b/mission/controller/acs/ActuatorCmd.cpp @@ -57,6 +57,7 @@ void ActuatorCmd::cmdSpeedToRws(const int32_t speedRw0, const int32_t speedRw1, deltaSpeedInt[i] = std::round(deltaSpeed[i]); } VectorOperations::add(speedRws, deltaSpeedInt, rwCmdSpeed, 4); + VectorOperations::mulScalar(rwCmdSpeed, 10, rwCmdSpeed, 4); } void ActuatorCmd::cmdDipolMtq(const double *dipolMoment, int16_t *dipolMomentActuator) { From 1d20c3b472e8e1d7e617d54204465a0c41302ebe Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 13 Feb 2023 11:04:43 +0100 Subject: [PATCH 291/330] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1dbd2f9c..57209a3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,8 @@ change warranting a new major release: ## Changed - ActCmds now returns command vectors as integers as required by the actuators + and scales them to the appropriate range +- All RwHandler are now polled five times per ACS cycle # [v1.27.0] 2023-02-13 From 068b31a3d6bac46dd3feaac02670af10c89250de Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 13 Feb 2023 11:07:09 +0100 Subject: [PATCH 292/330] changelog --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57209a3f..d3d64dce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,6 @@ change warranting a new major release: ## Added -- First version of a TCS controller heater control loop. - Function for the ACS controller to command MTQ and RWs called by all subroutines - RwHandler now handles commanding of RW speeds via RwSpeedActuationSet From 59a0a740327ce1b438460cfcc204d42d58602b10 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Feb 2023 11:49:26 +0100 Subject: [PATCH 293/330] start adding assy components for EM --- bsp_q7s/core/ObjectFactory.cpp | 21 ++++---------- bsp_q7s/fmObjectFactory.cpp | 2 +- dummies/helpers.cpp | 51 ++++++++++++++++++++++----------- linux/ObjectFactory.cpp | 23 +++++---------- linux/ObjectFactory.h | 2 +- mission/core/GenericFactory.cpp | 41 ++++++++++++++++++++++++++ mission/core/GenericFactory.h | 7 +++++ 7 files changed, 98 insertions(+), 49 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 17170252..65a12ba7 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -692,33 +692,24 @@ void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF, std::array rwIds = {objects::RW1, objects::RW2, objects::RW3, objects::RW4}; std::array rwGpioIds = {gpioIds::EN_RW1, gpioIds::EN_RW2, gpioIds::EN_RW3, gpioIds::EN_RW4}; - std::array rws = {}; + std::array rws = {}; for (uint8_t idx = 0; idx < rwCookies.size(); idx++) { rwCookies[idx] = new SpiCookie(rwCookieParams[idx].first, rwCookieParams[idx].second, RwDefinitions::MAX_REPLY_SIZE, spi::RW_MODE, spi::RW_SPEED, &rwSpiCallback::spiCallback, nullptr); - rws[idx] = new RwHandler(rwIds[idx], objects::SPI_RW_COM_IF, rwCookies[idx], gpioComIF, - rwGpioIds[idx]); + auto* rwHandler = new RwHandler(rwIds[idx], objects::SPI_RW_COM_IF, rwCookies[idx], gpioComIF, + rwGpioIds[idx]); rwCookies[idx]->setCallbackArgs(rws[idx]); #if OBSW_TEST_RW == 1 rws[idx]->setStartUpImmediately(); #endif #if OBSW_DEBUG_RW == 1 - rws[idx]->setDebugMode(true); + rwHandler->setDebugMode(true); #endif + rws[idx] = rwHandler; } - RwHelper rwHelper(rwIds); - auto* rwAss = - new RwAssembly(objects::RW_ASS, pwrSwitcher, pcdu::Switches::PDU2_CH2_RW_5V, rwHelper); - for (uint8_t idx = 0; idx < rws.size(); idx++) { - ReturnValue_t result = rws[idx]->connectModeTreeParent(*rwAss); - if (result != returnvalue::OK) { - sif::error << "Connecting RW " << static_cast(idx) << " to RW assembly failed" - << std::endl; - } - } - rwAss->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); + createRwAssy(*pwrSwitcher, pcdu::Switches::PDU2_CH2_RW_5V, rws, rwIds); #endif /* OBSW_ADD_RW == 1 */ } diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index 4ca45e43..034b7cc1 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -39,7 +39,7 @@ void ObjectFactory::produce(void* args) { createRadSensorComponent(gpioComIF, *stackHandler); #endif #if OBSW_ADD_SUN_SENSORS == 1 - createSunSensorComponents(gpioComIF, spiMainComIF, pwrSwitcher, q7s::SPI_DEFAULT_DEV, true); + createSunSensorComponents(gpioComIF, spiMainComIF, *pwrSwitcher, q7s::SPI_DEFAULT_DEV, true); #endif #if OBSW_ADD_ACS_BOARD == 1 diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index d6bbf70f..20d1555b 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -24,6 +24,8 @@ #include "TemperatureSensorInserter.h" #include "dummies/Max31865Dummy.h" #include "dummies/Tmp1075Dummy.h" +#include "mission/core/GenericFactory.h" +#include "mission/devices/devicedefinitions/GomspaceDefinitions.h" #include "mission/system/tree/acsModeTree.h" using namespace dummy; @@ -38,10 +40,13 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) { if (cfg.addRtdComIFDummy) { new ComIFDummy(objects::SPI_RTD_COM_IF); } - new RwDummy(objects::RW1, objects::DUMMY_COM_IF, comCookieDummy); - new RwDummy(objects::RW2, objects::DUMMY_COM_IF, comCookieDummy); - new RwDummy(objects::RW3, objects::DUMMY_COM_IF, comCookieDummy); - new RwDummy(objects::RW4, objects::DUMMY_COM_IF, comCookieDummy); + std::array rwIds = {objects::RW1, objects::RW2, objects::RW3, objects::RW4}; + std::array rws; + rws[0] = new RwDummy(objects::RW1, objects::DUMMY_COM_IF, comCookieDummy); + rws[1] = new RwDummy(objects::RW2, objects::DUMMY_COM_IF, comCookieDummy); + rws[2] = new RwDummy(objects::RW3, objects::DUMMY_COM_IF, comCookieDummy); + rws[3] = new RwDummy(objects::RW4, objects::DUMMY_COM_IF, comCookieDummy); + ObjectFactory::createRwAssy(pwrSwitch, pcdu::Switches::PDU2_CH2_RW_5V, rws, rwIds); new SaDeplDummy(objects::SOLAR_ARRAY_DEPL_HANDLER); new StarTrackerDummy(objects::STAR_TRACKER, objects::DUMMY_COM_IF, comCookieDummy); if (cfg.addSyrlinksDummies) { @@ -70,18 +75,32 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) { } if (cfg.addSusDummies) { - new SusDummy(objects::SUS_0_N_LOC_XFYFZM_PT_XF, objects::DUMMY_COM_IF, comCookieDummy); - new SusDummy(objects::SUS_1_N_LOC_XBYFZM_PT_XB, objects::DUMMY_COM_IF, comCookieDummy); - new SusDummy(objects::SUS_2_N_LOC_XFYBZB_PT_YB, objects::DUMMY_COM_IF, comCookieDummy); - new SusDummy(objects::SUS_3_N_LOC_XFYBZF_PT_YF, objects::DUMMY_COM_IF, comCookieDummy); - new SusDummy(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, objects::DUMMY_COM_IF, comCookieDummy); - new SusDummy(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, objects::DUMMY_COM_IF, comCookieDummy); - new SusDummy(objects::SUS_6_R_LOC_XFYBZM_PT_XF, objects::DUMMY_COM_IF, comCookieDummy); - new SusDummy(objects::SUS_7_R_LOC_XBYBZM_PT_XB, objects::DUMMY_COM_IF, comCookieDummy); - new SusDummy(objects::SUS_8_R_LOC_XBYBZB_PT_YB, objects::DUMMY_COM_IF, comCookieDummy); - new SusDummy(objects::SUS_9_R_LOC_XBYBZB_PT_YF, objects::DUMMY_COM_IF, comCookieDummy); - new SusDummy(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, objects::DUMMY_COM_IF, comCookieDummy); - new SusDummy(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, objects::DUMMY_COM_IF, comCookieDummy); + std::array suses; + suses[0] = + new SusDummy(objects::SUS_0_N_LOC_XFYFZM_PT_XF, objects::DUMMY_COM_IF, comCookieDummy); + suses[1] = + new SusDummy(objects::SUS_1_N_LOC_XBYFZM_PT_XB, objects::DUMMY_COM_IF, comCookieDummy); + suses[2] = + new SusDummy(objects::SUS_2_N_LOC_XFYBZB_PT_YB, objects::DUMMY_COM_IF, comCookieDummy); + suses[3] = + new SusDummy(objects::SUS_3_N_LOC_XFYBZF_PT_YF, objects::DUMMY_COM_IF, comCookieDummy); + suses[4] = + new SusDummy(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, objects::DUMMY_COM_IF, comCookieDummy); + suses[5] = + new SusDummy(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, objects::DUMMY_COM_IF, comCookieDummy); + suses[6] = + new SusDummy(objects::SUS_6_R_LOC_XFYBZM_PT_XF, objects::DUMMY_COM_IF, comCookieDummy); + suses[7] = + new SusDummy(objects::SUS_7_R_LOC_XBYBZM_PT_XB, objects::DUMMY_COM_IF, comCookieDummy); + suses[8] = + new SusDummy(objects::SUS_8_R_LOC_XBYBZB_PT_YB, objects::DUMMY_COM_IF, comCookieDummy); + suses[9] = + new SusDummy(objects::SUS_9_R_LOC_XBYBZB_PT_YF, objects::DUMMY_COM_IF, comCookieDummy); + suses[10] = + new SusDummy(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, objects::DUMMY_COM_IF, comCookieDummy); + suses[11] = + new SusDummy(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, objects::DUMMY_COM_IF, comCookieDummy); + ObjectFactory::createSusAssy(pwrSwitch, suses); } if (cfg.addTempSensorDummies) { diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index 1003ead4..add6a755 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -29,7 +30,7 @@ #include "mission/system/tree/tcsModeTree.h" void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiComIF, - PowerSwitchIF* pwrSwitcher, std::string spiDev, + PowerSwitchIF& pwrSwitcher, std::string spiDev, bool swap0And6) { using namespace gpio; GpioCookie* gpioCookieSus = new GpioCookie(); @@ -173,22 +174,8 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo fdir = new SusFdir(objects::SUS_11_R_LOC_XBYMZB_PT_ZB); susHandlers[11]->setCustomFdir(fdir); - std::array susIds = { - objects::SUS_0_N_LOC_XFYFZM_PT_XF, objects::SUS_1_N_LOC_XBYFZM_PT_XB, - objects::SUS_2_N_LOC_XFYBZB_PT_YB, objects::SUS_3_N_LOC_XFYBZF_PT_YF, - objects::SUS_4_N_LOC_XMYFZF_PT_ZF, objects::SUS_5_N_LOC_XFYMZB_PT_ZB, - objects::SUS_6_R_LOC_XFYBZM_PT_XF, objects::SUS_7_R_LOC_XBYBZM_PT_XB, - objects::SUS_8_R_LOC_XBYBZB_PT_YB, objects::SUS_9_R_LOC_XBYBZB_PT_YF, - objects::SUS_10_N_LOC_XMYBZF_PT_ZF, objects::SUS_11_R_LOC_XBYMZB_PT_ZB}; - SusAssHelper susAssHelper = SusAssHelper(susIds); - auto susAss = new SusAssembly(objects::SUS_BOARD_ASS, pwrSwitcher, susAssHelper); for (auto& sus : susHandlers) { if (sus != nullptr) { - ReturnValue_t result = sus->connectModeTreeParent(*susAss); - if (result != returnvalue::OK) { - sif::error << "Connecting SUS " << sus->getObjectId() << " to SUS assembly failed" - << std::endl; - } #if OBSW_TEST_SUS == 1 sus->setStartUpImmediately(); sus->setToGoToNormalMode(true); @@ -198,7 +185,11 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo #endif } } - susAss->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); + std::array susDhbs; + for (unsigned i = 0; i < susDhbs.size(); i++) { + susDhbs[i] = susHandlers[i]; + } + createSusAssy(pwrSwitcher, susDhbs); #endif /* OBSW_ADD_SUN_SENSORS == 1 */ } diff --git a/linux/ObjectFactory.h b/linux/ObjectFactory.h index c7b12f9b..0a7ab516 100644 --- a/linux/ObjectFactory.h +++ b/linux/ObjectFactory.h @@ -20,7 +20,7 @@ class AcsController; namespace ObjectFactory { -void createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiComIF, PowerSwitchIF* pwrSwitcher, +void createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiComIF, PowerSwitchIF& pwrSwitcher, std::string spiDev, bool swap0And6); void createRtdComponents(std::string spiDev, GpioIF* gpioComIF, PowerSwitchIF* pwrSwitcher, SpiComIF* comIF); diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index 8c05ed4f..56ca3d97 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -26,6 +26,8 @@ #include #include #include +#include +#include #include #include #include @@ -35,6 +37,8 @@ #include "eive/definitions.h" #include "fsfw/pus/Service11TelecommandScheduling.h" #include "mission/cfdp/Config.h" +#include "mission/system/objects/RwAssembly.h" +#include "mission/system/tree/acsModeTree.h" #include "mission/system/tree/tcsModeTree.h" #include "objects/systemObjectList.h" #include "tmtc/pusIds.h" @@ -218,3 +222,40 @@ void ObjectFactory::createThermalController(HeaterHandler& heaterHandler) { auto* tcsCtrl = new ThermalController(objects::THERMAL_CONTROLLER, heaterHandler); tcsCtrl->connectModeTreeParent(satsystem::tcs::SUBSYSTEM); } +void ObjectFactory::createRwAssy(PowerSwitchIF& pwrSwitcher, power::Switch_t theSwitch, + std::array rws, + std::array rwIds) { + RwHelper rwHelper(rwIds); + auto* rwAss = new RwAssembly(objects::RW_ASS, &pwrSwitcher, theSwitch, rwHelper); + for (uint8_t idx = 0; idx < rwIds.size(); idx++) { + ReturnValue_t result = rws[idx]->connectModeTreeParent(*rwAss); + if (result != returnvalue::OK) { + sif::error << "Connecting RW " << static_cast(idx) << " to RW assembly failed" + << std::endl; + } + } + rwAss->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); +} + +void ObjectFactory::createSusAssy(PowerSwitchIF& pwrSwitcher, + std::array suses) { + std::array susIds = { + objects::SUS_0_N_LOC_XFYFZM_PT_XF, objects::SUS_1_N_LOC_XBYFZM_PT_XB, + objects::SUS_2_N_LOC_XFYBZB_PT_YB, objects::SUS_3_N_LOC_XFYBZF_PT_YF, + objects::SUS_4_N_LOC_XMYFZF_PT_ZF, objects::SUS_5_N_LOC_XFYMZB_PT_ZB, + objects::SUS_6_R_LOC_XFYBZM_PT_XF, objects::SUS_7_R_LOC_XBYBZM_PT_XB, + objects::SUS_8_R_LOC_XBYBZB_PT_YB, objects::SUS_9_R_LOC_XBYBZB_PT_YF, + objects::SUS_10_N_LOC_XMYBZF_PT_ZF, objects::SUS_11_R_LOC_XBYMZB_PT_ZB}; + SusAssHelper susAssHelper = SusAssHelper(susIds); + auto susAss = new SusAssembly(objects::SUS_BOARD_ASS, &pwrSwitcher, susAssHelper); + for (auto& sus : suses) { + if (sus != nullptr) { + ReturnValue_t result = sus->connectModeTreeParent(*susAss); + if (result != returnvalue::OK) { + sif::error << "Connecting SUS " << sus->getObjectId() << " to SUS assembly failed" + << std::endl; + } + } + } + susAss->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); +} diff --git a/mission/core/GenericFactory.h b/mission/core/GenericFactory.h index 04802d51..89d7f0d5 100644 --- a/mission/core/GenericFactory.h +++ b/mission/core/GenericFactory.h @@ -1,6 +1,9 @@ #ifndef MISSION_CORE_GENERICFACTORY_H_ #define MISSION_CORE_GENERICFACTORY_H_ +#include + +#include "fsfw/objectmanager/SystemObjectIF.h" #include "fsfw/power/PowerSwitchIF.h" #include "fsfw_hal/common/gpio/GpioIF.h" @@ -17,6 +20,10 @@ void createGenericHeaterComponents(GpioIF& gpioIF, PowerSwitchIF& pwrSwitcher, HeaterHandler*& heaterHandler); void createThermalController(HeaterHandler& heaterHandler); +void createRwAssy(PowerSwitchIF& pwrSwitcher, power::Switch_t theSwitch, + std::array rws, std::array rwIds); +void createSusAssy(PowerSwitchIF& pwrSwitcher, std::array suses); + } // namespace ObjectFactory #endif /* MISSION_CORE_GENERICFACTORY_H_ */ From 97a001a1da86ce464eddfb3bffc989bbc0c80950 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Feb 2023 13:53:13 +0100 Subject: [PATCH 294/330] continue satsytem for EM --- bsp_q7s/core/ObjectFactory.cpp | 37 +++++++---------------- bsp_q7s/core/ObjectFactory.h | 2 +- bsp_q7s/fmObjectFactory.cpp | 2 +- dummies/CMakeLists.txt | 3 +- dummies/GpsCtrlDummy.cpp | 3 ++ dummies/GpsCtrlDummy.h | 12 ++++++++ dummies/{GpsDummy.cpp => GpsDhbDummy.cpp} | 27 ++++++++--------- dummies/{GpsDummy.h => GpsDhbDummy.h} | 12 ++++---- dummies/helpers.cpp | 30 +++++++++--------- dummies/helpers.h | 2 +- fsfw | 2 +- mission/core/GenericFactory.cpp | 22 ++++++++++++++ mission/core/GenericFactory.h | 3 ++ 13 files changed, 92 insertions(+), 65 deletions(-) create mode 100644 dummies/GpsCtrlDummy.cpp create mode 100644 dummies/GpsCtrlDummy.h rename dummies/{GpsDummy.cpp => GpsDhbDummy.cpp} (64%) rename dummies/{GpsDummy.h => GpsDhbDummy.h} (82%) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 65a12ba7..16ba3325 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -239,10 +239,10 @@ ReturnValue_t ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF, } void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialComIF* uartComIF, - PowerSwitchIF* pwrSwitcher) { + PowerSwitchIF& pwrSwitcher) { using namespace gpio; GpioCookie* gpioCookieAcsBoard = new GpioCookie(); - std::vector> assemblyChildren; + std::array assemblyChildren; std::stringstream consumer; GpiodRegularByLineName* gpio = nullptr; @@ -352,7 +352,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo objects::MGM_0_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::LIS3_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::MGM_0_LIS3_HANDLER); mgmLis3Handler0->setCustomFdir(fdir); - assemblyChildren.push_back(*mgmLis3Handler0); + assemblyChildren[0] = mgmLis3Handler0; #if OBSW_TEST_ACS == 1 mgmLis3Handler->setStartUpImmediately(); mgmLis3Handler->setToGoToNormalMode(true); @@ -369,7 +369,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo spi::RM3100_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::MGM_1_RM3100_HANDLER); mgmRm3100Handler1->setCustomFdir(fdir); - assemblyChildren.push_back(*mgmRm3100Handler1); + assemblyChildren[1] = mgmRm3100Handler1; #if OBSW_TEST_ACS == 1 mgmRm3100Handler->setStartUpImmediately(); mgmRm3100Handler->setToGoToNormalMode(true); @@ -385,7 +385,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo objects::MGM_2_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::LIS3_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::MGM_2_LIS3_HANDLER); mgmLis3Handler2->setCustomFdir(fdir); - assemblyChildren.push_back(*mgmLis3Handler2); + assemblyChildren[2] = mgmLis3Handler2; #if OBSW_TEST_ACS == 1 mgmLis3Handler->setStartUpImmediately(); mgmLis3Handler->setToGoToNormalMode(true); @@ -402,7 +402,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo spi::RM3100_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::MGM_3_RM3100_HANDLER); mgmRm3100Handler3->setCustomFdir(fdir); - assemblyChildren.push_back(*mgmRm3100Handler3); + assemblyChildren[3] = mgmRm3100Handler3; #if OBSW_TEST_ACS == 1 mgmRm3100Handler->setStartUpImmediately(); mgmRm3100Handler->setToGoToNormalMode(true); @@ -421,7 +421,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo ADIS1650X::Type::ADIS16505); fdir = new AcsBoardFdir(objects::GYRO_0_ADIS_HANDLER); adisHandler->setCustomFdir(fdir); - assemblyChildren.push_back(*adisHandler); + assemblyChildren[4] = adisHandler; #if OBSW_TEST_ACS == 1 adisHandler->setStartUpImmediately(); adisHandler->setToGoToNormalModeImmediately(); @@ -437,7 +437,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo objects::GYRO_1_L3G_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::L3G_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::GYRO_1_L3G_HANDLER); gyroL3gHandler1->setCustomFdir(fdir); - assemblyChildren.push_back(*gyroL3gHandler1); + assemblyChildren[5] = gyroL3gHandler1; #if OBSW_TEST_ACS == 1 gyroL3gHandler->setStartUpImmediately(); gyroL3gHandler->setToGoToNormalMode(true); @@ -454,7 +454,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo spiCookie, ADIS1650X::Type::ADIS16505); fdir = new AcsBoardFdir(objects::GYRO_2_ADIS_HANDLER); adisHandler->setCustomFdir(fdir); - assemblyChildren.push_back(*adisHandler); + assemblyChildren[6] = adisHandler; #if OBSW_TEST_ACS == 1 adisHandler->setStartUpImmediately(); adisHandler->setToGoToNormalModeImmediately(); @@ -467,7 +467,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo objects::GYRO_3_L3G_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::L3G_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::GYRO_3_L3G_HANDLER); gyroL3gHandler3->setCustomFdir(fdir); - assemblyChildren.push_back(*gyroL3gHandler3); + assemblyChildren[7] = gyroL3gHandler3; #if OBSW_TEST_ACS == 1 gyroL3gHandler->setStartUpImmediately(); gyroL3gHandler->setToGoToNormalMode(true); @@ -485,22 +485,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo new GpsHyperionLinuxController(objects::GPS_CONTROLLER, objects::NO_OBJECT, debugGps); gpsCtrl->setResetPinTriggerFunction(gps::triggerGpioResetPin, &RESET_ARGS_GNSS); - AcsBoardHelper acsBoardHelper = AcsBoardHelper( - objects::MGM_0_LIS3_HANDLER, objects::MGM_1_RM3100_HANDLER, objects::MGM_2_LIS3_HANDLER, - objects::MGM_3_RM3100_HANDLER, objects::GYRO_0_ADIS_HANDLER, objects::GYRO_1_L3G_HANDLER, - objects::GYRO_2_ADIS_HANDLER, objects::GYRO_3_L3G_HANDLER, objects::GPS_CONTROLLER); - auto acsAss = - new AcsBoardAssembly(objects::ACS_BOARD_ASS, pwrSwitcher, acsBoardHelper, gpioComIF); - static_cast(acsAss); - for (auto& assChild : assemblyChildren) { - ReturnValue_t result = assChild.get().connectModeTreeParent(*acsAss); - if (result != returnvalue::OK) { - sif::error << "Connecting assembly for ACS board component " << assChild.get().getObjectId() - << " failed" << std::endl; - } - } - gpsCtrl->connectModeTreeParent(*acsAss); - acsAss->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); + ObjectFactory::createAcsBoardAssy(pwrSwitcher, assemblyChildren, gpsCtrl, gpioComIF); #endif /* OBSW_ADD_ACS_HANDLERS == 1 */ } diff --git a/bsp_q7s/core/ObjectFactory.h b/bsp_q7s/core/ObjectFactory.h index 61b629c8..9d0e4ea3 100644 --- a/bsp_q7s/core/ObjectFactory.h +++ b/bsp_q7s/core/ObjectFactory.h @@ -33,7 +33,7 @@ void createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF, void createTmpComponents(); ReturnValue_t createRadSensorComponent(LinuxLibgpioIF* gpioComIF, Stack5VHandler& handler); void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialComIF* uartComIF, - PowerSwitchIF* pwrSwitcher); + PowerSwitchIF& pwrSwitcher); void createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwitcher, HealthTableIF* healthTable, HeaterHandler*& heaterHandler); void createImtqComponents(PowerSwitchIF* pwrSwitcher); diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index 034b7cc1..f04766eb 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -43,7 +43,7 @@ void ObjectFactory::produce(void* args) { #endif #if OBSW_ADD_ACS_BOARD == 1 - createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher); + createAcsBoardComponents(gpioComIF, uartComIF, *pwrSwitcher); #endif HeaterHandler* heaterHandler; createHeaterComponents(gpioComIF, pwrSwitcher, healthTable, heaterHandler); diff --git a/dummies/CMakeLists.txt b/dummies/CMakeLists.txt index 330aecfe..38527dd6 100644 --- a/dummies/CMakeLists.txt +++ b/dummies/CMakeLists.txt @@ -14,7 +14,8 @@ target_sources( PduDummy.cpp P60DockDummy.cpp SaDeploymentDummy.cpp - GpsDummy.cpp + GpsDhbDummy.cpp + GpsCtrlDummy.cpp GyroAdisDummy.cpp GyroL3GD20Dummy.cpp MgmLIS3MDLDummy.cpp diff --git a/dummies/GpsCtrlDummy.cpp b/dummies/GpsCtrlDummy.cpp new file mode 100644 index 00000000..3a1f61ba --- /dev/null +++ b/dummies/GpsCtrlDummy.cpp @@ -0,0 +1,3 @@ +#include "GpsCtrlDummy.h" + +GpsCtrlDummy::GpsCtrlDummy(object_id_t objectId): ExtendedControllerBase(objectId, 20) {} diff --git a/dummies/GpsCtrlDummy.h b/dummies/GpsCtrlDummy.h new file mode 100644 index 00000000..3d6f40bc --- /dev/null +++ b/dummies/GpsCtrlDummy.h @@ -0,0 +1,12 @@ +#ifndef DUMMIES_GPSCTRLDUMMY_H_ +#define DUMMIES_GPSCTRLDUMMY_H_ + +#include + +class GpsCtrlDummy: public ExtendedControllerBase { +public: + GpsCtrlDummy(object_id_t objectId); +private: +}; + +#endif /* DUMMIES_GPSCTRLDUMMY_H_ */ diff --git a/dummies/GpsDummy.cpp b/dummies/GpsDhbDummy.cpp similarity index 64% rename from dummies/GpsDummy.cpp rename to dummies/GpsDhbDummy.cpp index 893e8464..84c82da4 100644 --- a/dummies/GpsDummy.cpp +++ b/dummies/GpsDhbDummy.cpp @@ -1,41 +1,40 @@ -#include "GpsDummy.h" - +#include #include -GpsDummy::GpsDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie) +GpsDhbDummy::GpsDhbDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie) : DeviceHandlerBase(objectId, comif, comCookie) {} -GpsDummy::~GpsDummy() {} +GpsDhbDummy::~GpsDhbDummy() {} -void GpsDummy::doStartUp() {} +void GpsDhbDummy::doStartUp() {} -void GpsDummy::doShutDown() {} +void GpsDhbDummy::doShutDown() {} -ReturnValue_t GpsDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; } +ReturnValue_t GpsDhbDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; } -ReturnValue_t GpsDummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) { +ReturnValue_t GpsDhbDummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; } -ReturnValue_t GpsDummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand, +ReturnValue_t GpsDhbDummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t *commandData, size_t commandDataLen) { return returnvalue::OK; } -ReturnValue_t GpsDummy::scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId, +ReturnValue_t GpsDhbDummy::scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId, size_t *foundLen) { return returnvalue::OK; } -ReturnValue_t GpsDummy::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) { +ReturnValue_t GpsDhbDummy::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) { return returnvalue::OK; } -void GpsDummy::fillCommandAndReplyMap() {} +void GpsDhbDummy::fillCommandAndReplyMap() {} -uint32_t GpsDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 500; } +uint32_t GpsDhbDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 500; } -ReturnValue_t GpsDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, +ReturnValue_t GpsDhbDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { localDataPoolMap.emplace(GpsHyperion::LATITUDE, new PoolEntry({0.0}, 1)); localDataPoolMap.emplace(GpsHyperion::LONGITUDE, new PoolEntry({0.0}, 1)); diff --git a/dummies/GpsDummy.h b/dummies/GpsDhbDummy.h similarity index 82% rename from dummies/GpsDummy.h rename to dummies/GpsDhbDummy.h index b32b7f17..a1df7e45 100644 --- a/dummies/GpsDummy.h +++ b/dummies/GpsDhbDummy.h @@ -1,9 +1,9 @@ -#ifndef DUMMIES_GPSDUMMY_H_ -#define DUMMIES_GPSDUMMY_H_ +#ifndef DUMMIES_GPSDHBDUMMY_H_ +#define DUMMIES_GPSDHBDUMMY_H_ #include -class GpsDummy : public DeviceHandlerBase { +class GpsDhbDummy : public DeviceHandlerBase { public: static const DeviceCommandId_t SIMPLE_COMMAND = 1; static const DeviceCommandId_t PERIODIC_REPLY = 2; @@ -11,8 +11,8 @@ class GpsDummy : public DeviceHandlerBase { static const uint8_t SIMPLE_COMMAND_DATA = 1; static const uint8_t PERIODIC_REPLY_DATA = 2; - GpsDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie); - virtual ~GpsDummy(); + GpsDhbDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie); + virtual ~GpsDhbDummy(); protected: void doStartUp() override; @@ -30,4 +30,4 @@ class GpsDummy : public DeviceHandlerBase { LocalDataPoolManager &poolManager) override; }; -#endif /* DUMMIES_GPSDUMMY_H_ */ +#endif /* DUMMIES_GPSDHBDUMMY_H_ */ diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index 20d1555b..1fd8a37c 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include #include @@ -30,7 +30,7 @@ using namespace dummy; -void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) { +void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpioIF) { new ComIFDummy(objects::DUMMY_COM_IF); auto* comCookieDummy = new ComCookieDummy(); new BpxDummy(objects::BPX_BATT_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); @@ -46,7 +46,7 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) { rws[1] = new RwDummy(objects::RW2, objects::DUMMY_COM_IF, comCookieDummy); rws[2] = new RwDummy(objects::RW3, objects::DUMMY_COM_IF, comCookieDummy); rws[3] = new RwDummy(objects::RW4, objects::DUMMY_COM_IF, comCookieDummy); - ObjectFactory::createRwAssy(pwrSwitch, pcdu::Switches::PDU2_CH2_RW_5V, rws, rwIds); + ObjectFactory::createRwAssy(pwrSwitcher, pcdu::Switches::PDU2_CH2_RW_5V, rws, rwIds); new SaDeplDummy(objects::SOLAR_ARRAY_DEPL_HANDLER); new StarTrackerDummy(objects::STAR_TRACKER, objects::DUMMY_COM_IF, comCookieDummy); if (cfg.addSyrlinksDummies) { @@ -63,15 +63,17 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) { } if (cfg.addAcsBoardDummies) { - new GyroAdisDummy(objects::GYRO_0_ADIS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - new GyroL3GD20Dummy(objects::GYRO_1_L3G_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - new GyroAdisDummy(objects::GYRO_2_ADIS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - new GyroL3GD20Dummy(objects::GYRO_3_L3G_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - new MgmLIS3MDLDummy(objects::MGM_0_LIS3_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - new MgmLIS3MDLDummy(objects::MGM_2_LIS3_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - new MgmRm3100Dummy(objects::MGM_1_RM3100_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - new MgmRm3100Dummy(objects::MGM_3_RM3100_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - new GpsDummy(objects::GPS_CONTROLLER, objects::DUMMY_COM_IF, comCookieDummy); + std::array assemblyDhbs; + assemblyDhbs[0] = new MgmLIS3MDLDummy(objects::MGM_0_LIS3_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[1] = new MgmLIS3MDLDummy(objects::MGM_2_LIS3_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[2] = new MgmRm3100Dummy(objects::MGM_1_RM3100_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[3] = new MgmRm3100Dummy(objects::MGM_3_RM3100_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[4] = new GyroAdisDummy(objects::GYRO_0_ADIS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[5] = new GyroL3GD20Dummy(objects::GYRO_1_L3G_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[6] = new GyroAdisDummy(objects::GYRO_2_ADIS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[7] = new GyroL3GD20Dummy(objects::GYRO_3_L3G_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + auto* gpsCtrl = new GpsDhbDummy(objects::GPS_CONTROLLER, objects::DUMMY_COM_IF, comCookieDummy); + ObjectFactory::createAcsBoardAssy(pwrSwitcher, assemblyDhbs, gpsCtrl, gpioIF); } if (cfg.addSusDummies) { @@ -100,7 +102,7 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) { new SusDummy(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, objects::DUMMY_COM_IF, comCookieDummy); suses[11] = new SusDummy(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, objects::DUMMY_COM_IF, comCookieDummy); - ObjectFactory::createSusAssy(pwrSwitch, suses); + ObjectFactory::createSusAssy(pwrSwitcher, suses); } if (cfg.addTempSensorDummies) { @@ -174,6 +176,6 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) { new TemperatureSensorInserter(objects::THERMAL_TEMP_INSERTER, tempSensorDummies, tempTmpSensorDummies); } - new CamSwitcher(objects::CAM_SWITCHER, pwrSwitch, power::NO_SWITCH); + new CamSwitcher(objects::CAM_SWITCHER, pwrSwitcher, power::NO_SWITCH); new PlPcduDummy(objects::PLPCDU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); } diff --git a/dummies/helpers.h b/dummies/helpers.h index bbaab34d..1d30f451 100644 --- a/dummies/helpers.h +++ b/dummies/helpers.h @@ -14,6 +14,6 @@ struct DummyCfg { bool addRtdComIFDummy = true; }; -void createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch); +void createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch, GpioIF* gpioIF); } // namespace dummy diff --git a/fsfw b/fsfw index dac2d210..f0b8457b 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit dac2d210b597adfaf45bd5ae6a4c027599927601 +Subproject commit f0b8457ba2d9a34a42b10314c3cdccfd46ebf168 diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index 56ca3d97..6506c184 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -26,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -259,3 +261,23 @@ void ObjectFactory::createSusAssy(PowerSwitchIF& pwrSwitcher, } susAss->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); } + +void ObjectFactory::createAcsBoardAssy(PowerSwitchIF& pwrSwitcher, + std::array assemblyDhbs, + ExtendedControllerBase* gpsCtrl, GpioIF* gpioComIF) { + AcsBoardHelper acsBoardHelper = AcsBoardHelper( + objects::MGM_0_LIS3_HANDLER, objects::MGM_1_RM3100_HANDLER, objects::MGM_2_LIS3_HANDLER, + objects::MGM_3_RM3100_HANDLER, objects::GYRO_0_ADIS_HANDLER, objects::GYRO_1_L3G_HANDLER, + objects::GYRO_2_ADIS_HANDLER, objects::GYRO_3_L3G_HANDLER, objects::GPS_CONTROLLER); + auto acsAss = + new AcsBoardAssembly(objects::ACS_BOARD_ASS, &pwrSwitcher, acsBoardHelper, gpioComIF); + for (auto& assChild : assemblyDhbs) { + ReturnValue_t result = assChild->connectModeTreeParent(*acsAss); + if (result != returnvalue::OK) { + sif::error << "Connecting assembly for ACS board component " << assChild->getObjectId() + << " failed" << std::endl; + } + } + gpsCtrl->connectModeTreeParent(*acsAss); + acsAss->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); +} diff --git a/mission/core/GenericFactory.h b/mission/core/GenericFactory.h index 89d7f0d5..4b380336 100644 --- a/mission/core/GenericFactory.h +++ b/mission/core/GenericFactory.h @@ -11,6 +11,7 @@ class HeaterHandler; class HealthTableIF; class PusTmFunnel; class CfdpTmFunnel; +class ExtendedControllerBase; namespace ObjectFactory { @@ -23,6 +24,8 @@ void createThermalController(HeaterHandler& heaterHandler); void createRwAssy(PowerSwitchIF& pwrSwitcher, power::Switch_t theSwitch, std::array rws, std::array rwIds); void createSusAssy(PowerSwitchIF& pwrSwitcher, std::array suses); +void createAcsBoardAssy(PowerSwitchIF& pwrSwitcher, std::array assemblyDhbs, + ExtendedControllerBase* gpsCtrl, GpioIF* gpioComIF); } // namespace ObjectFactory From cec9ef6c5d90ea50a70daac85aba005e9492f498 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Feb 2023 14:19:07 +0100 Subject: [PATCH 295/330] some fixes --- CHANGELOG.md | 7 +++++++ fsfw | 2 +- linux/devices/Max31865RtdLowlevelHandler.cpp | 8 ++++---- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 431606a0..58d85ccd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,13 @@ change warranting a new major release: # [unreleased] +# [v1.27.1] 2023-02-13 + +## Fixed + +- Fix for SPI ComIF: Set transfer size to 0 for failed transfers +- Fix shadowing issue with locks in MAX31865 low level handler + # [v1.27.0] 2023-02-13 eive-tmtc: v2.12.5 diff --git a/fsfw b/fsfw index dac2d210..f0b8457b 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit dac2d210b597adfaf45bd5ae6a4c027599927601 +Subproject commit f0b8457ba2d9a34a42b10314c3cdccfd46ebf168 diff --git a/linux/devices/Max31865RtdLowlevelHandler.cpp b/linux/devices/Max31865RtdLowlevelHandler.cpp index a6fe2061..52a107dc 100644 --- a/linux/devices/Max31865RtdLowlevelHandler.cpp +++ b/linux/devices/Max31865RtdLowlevelHandler.cpp @@ -70,8 +70,8 @@ bool Max31865RtdReader::periodicInitHandling() { return false; } if ((rtd->on or rtd->db.active) and not rtd->db.configured and rtd->cd.hasTimedOut()) { - ManualCsLockWrapper mg(csLock, gpioIF, rtd->spiCookie, csTimeoutType, csTimeoutMs); - if (mg.lockResult != returnvalue::OK or mg.gpioResult != returnvalue::OK) { + ManualCsLockWrapper mg1(csLock, gpioIF, rtd->spiCookie, csTimeoutType, csTimeoutMs); + if (mg1.lockResult != returnvalue::OK or mg1.gpioResult != returnvalue::OK) { sif::error << "Max31865RtdReader::periodicInitHandling: Manual CS lock failed" << std::endl; continue; } @@ -153,8 +153,8 @@ ReturnValue_t Max31865RtdReader::periodicReadHandling() { return returnvalue::FAILED; } if (rtdIsActive(rtd->idx)) { - ManualCsLockWrapper mg(csLock, gpioIF, rtd->spiCookie, csTimeoutType, csTimeoutMs); - if (mg.lockResult != returnvalue::OK or mg.gpioResult != returnvalue::OK) { + ManualCsLockWrapper mg1(csLock, gpioIF, rtd->spiCookie, csTimeoutType, csTimeoutMs); + if (mg1.lockResult != returnvalue::OK or mg1.gpioResult != returnvalue::OK) { sif::error << "Max31865RtdReader::periodicInitHandling: Manual CS lock failed" << std::endl; continue; } From 323140c846c0707612fca3c7560ae59c9bd6512c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Feb 2023 14:19:24 +0100 Subject: [PATCH 296/330] bump revision --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8af127a1..782993be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ cmake_minimum_required(VERSION 3.13) set(OBSW_VERSION_MAJOR 1) set(OBSW_VERSION_MINOR 27) -set(OBSW_VERSION_REVISION 0) +set(OBSW_VERSION_REVISION 1) # set(CMAKE_VERBOSE TRUE) From b4d9ea6c1936cf99cce9ab96dba8220a33725442 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Feb 2023 15:37:42 +0100 Subject: [PATCH 297/330] lets see if this fixes issues --- bsp_q7s/core/scheduling.cpp | 18 +++--------------- .../pollingsequence/pollingSequenceFactory.cpp | 3 ++- .../pollingsequence/pollingSequenceFactory.h | 2 +- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index cc3108e8..32d64829 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -214,21 +214,9 @@ void scheduling::initTasks() { } #endif -#if OBSW_ADD_RTD_DEVICES == 1 - PeriodicTaskIF* tcsPollingTask = factory->createPeriodicTask( - "TCS_POLLING_TASK", 75, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.5, missedDeadlineFunc); - result = tcsPollingTask->addComponent(objects::SPI_RTD_COM_IF); - if (result != returnvalue::OK) { - scheduling::printAddObjectError("SPI_RTD_POLLING", objects::SPI_RTD_COM_IF); - } - - PeriodicTaskIF* tcsTask = factory->createPeriodicTask( - "TCS_TASK", 55, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc); - scheduling::scheduleRtdSensors(tcsTask); -#endif - PeriodicTaskIF* tcsSystemTask = factory->createPeriodicTask( - "TCS_TASK", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.5, missedDeadlineFunc); + "TCS_TASK", 55, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.5, missedDeadlineFunc); + scheduling::scheduleRtdSensors(tcsSystemTask); result = tcsSystemTask->addComponent(objects::TCS_SUBSYSTEM); if (result != returnvalue::OK) { scheduling::printAddObjectError("TCS_SUBSYSTEM", objects::TCS_SUBSYSTEM); @@ -394,7 +382,7 @@ void scheduling::createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction #endif FixedTimeslotTaskIF* acsPst = factory.createFixedTimeslotTask( "ACS_PST", 85, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, acsPstPeriod, missedDeadlineFunc); - result = pst::pstAcs(acsPst, cfg); + result = pst::pstTcsAndAcs(acsPst, cfg); if (result != returnvalue::OK) { if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { sif::warning << "scheduling::initTasks: ACS PST is empty" << std::endl; diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index f9b69e45..63b40df2 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -184,7 +184,7 @@ ReturnValue_t pst::pstTest(FixedTimeslotTaskIF *thisSequence) { return returnvalue::OK; } -ReturnValue_t pst::pstAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg) { +ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg) { /* Length of a communication cycle */ uint32_t length = thisSequence->getPeriodMs(); bool enableAside = true; @@ -684,5 +684,6 @@ ReturnValue_t pst::pstAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg) { thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_READ); } + thisSequence->addSlot(objects::SPI_RTD_COM_IF, length * 0.5, 0); return returnvalue::OK; } diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h index 3e5ead52..99fba4ad 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h @@ -49,7 +49,7 @@ ReturnValue_t pstGompaceCan(FixedTimeslotTaskIF* thisSequence); ReturnValue_t pstSpiAndSyrlinks(FixedTimeslotTaskIF* thisSequence); -ReturnValue_t pstAcs(FixedTimeslotTaskIF* thisSequence, AcsPstCfg cfg); +ReturnValue_t pstTcsAndAcs(FixedTimeslotTaskIF* thisSequence, AcsPstCfg cfg); ReturnValue_t pstI2c(FixedTimeslotTaskIF* thisSequence); From ebc32d1cc2ebb8a9332cf85f3eddcff3d5e30aea Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Feb 2023 15:42:45 +0100 Subject: [PATCH 298/330] changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58d85ccd..f94066d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,11 @@ change warranting a new major release: # [unreleased] +## Changed + +- Remove 2 TCS threads. +- Move low level polling into ACS PST, move high level device handlers into TCS system task. + # [v1.27.1] 2023-02-13 ## Fixed From efbb5d69c7c60b5785671cfa132e31ae9607d42e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Feb 2023 15:44:19 +0100 Subject: [PATCH 299/330] remove removed task start --- bsp_q7s/core/scheduling.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index 32d64829..2aad7a23 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -352,10 +352,6 @@ void scheduling::initTasks() { gpsTask->startTask(); #endif acsSysTask->startTask(); -#if OBSW_ADD_RTD_DEVICES == 1 - tcsPollingTask->startTask(); - tcsTask->startTask(); -#endif /* OBSW_ADD_RTD_DEVICES == 1 */ if (not tcsSystemTask->isEmpty()) { tcsSystemTask->startTask(); } From e2f8ca752f70d698de1d2138241c67f80610fb34 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Feb 2023 15:59:44 +0100 Subject: [PATCH 300/330] continue satsystem --- dummies/GpsCtrlDummy.cpp | 20 +++++++++++++++++++- dummies/GpsCtrlDummy.h | 14 +++++++++++--- dummies/GpsDhbDummy.cpp | 13 ++++++++----- dummies/helpers.cpp | 27 ++++++++++++++++++--------- dummies/helpers.h | 2 ++ 5 files changed, 58 insertions(+), 18 deletions(-) diff --git a/dummies/GpsCtrlDummy.cpp b/dummies/GpsCtrlDummy.cpp index 3a1f61ba..e69261b4 100644 --- a/dummies/GpsCtrlDummy.cpp +++ b/dummies/GpsCtrlDummy.cpp @@ -1,3 +1,21 @@ #include "GpsCtrlDummy.h" -GpsCtrlDummy::GpsCtrlDummy(object_id_t objectId): ExtendedControllerBase(objectId, 20) {} +GpsCtrlDummy::GpsCtrlDummy(object_id_t objectId) : ExtendedControllerBase(objectId, 20) {} + +ReturnValue_t GpsCtrlDummy::handleCommandMessage(CommandMessage* message) { + return returnvalue::OK; +} + +void GpsCtrlDummy::performControlOperation() {} + +ReturnValue_t GpsCtrlDummy::checkModeCommand(Mode_t mode, Submode_t submode, + uint32_t* msToReachTheMode) { + return returnvalue::OK; +} + +ReturnValue_t GpsCtrlDummy::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, + LocalDataPoolManager& poolManager) { + return returnvalue::OK; +} + +LocalPoolDataSetBase* GpsCtrlDummy::getDataSetHandle(sid_t sid) { return nullptr; } diff --git a/dummies/GpsCtrlDummy.h b/dummies/GpsCtrlDummy.h index 3d6f40bc..128a9a85 100644 --- a/dummies/GpsCtrlDummy.h +++ b/dummies/GpsCtrlDummy.h @@ -3,10 +3,18 @@ #include -class GpsCtrlDummy: public ExtendedControllerBase { -public: +class GpsCtrlDummy : public ExtendedControllerBase { + public: GpsCtrlDummy(object_id_t objectId); -private: + + private: + ReturnValue_t handleCommandMessage(CommandMessage* message) override; + void performControlOperation() override; + ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, + uint32_t* msToReachTheMode) override; + ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, + LocalDataPoolManager& poolManager) override; + LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; }; #endif /* DUMMIES_GPSCTRLDUMMY_H_ */ diff --git a/dummies/GpsDhbDummy.cpp b/dummies/GpsDhbDummy.cpp index 84c82da4..d46e6265 100644 --- a/dummies/GpsDhbDummy.cpp +++ b/dummies/GpsDhbDummy.cpp @@ -10,19 +10,22 @@ void GpsDhbDummy::doStartUp() {} void GpsDhbDummy::doShutDown() {} -ReturnValue_t GpsDhbDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; } +ReturnValue_t GpsDhbDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { + return NOTHING_TO_SEND; +} ReturnValue_t GpsDhbDummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; } ReturnValue_t GpsDhbDummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand, - const uint8_t *commandData, size_t commandDataLen) { + const uint8_t *commandData, + size_t commandDataLen) { return returnvalue::OK; } -ReturnValue_t GpsDhbDummy::scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId, - size_t *foundLen) { +ReturnValue_t GpsDhbDummy::scanForReply(const uint8_t *start, size_t len, + DeviceCommandId_t *foundId, size_t *foundLen) { return returnvalue::OK; } @@ -35,7 +38,7 @@ void GpsDhbDummy::fillCommandAndReplyMap() {} uint32_t GpsDhbDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 500; } ReturnValue_t GpsDhbDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, - LocalDataPoolManager &poolManager) { + LocalDataPoolManager &poolManager) { localDataPoolMap.emplace(GpsHyperion::LATITUDE, new PoolEntry({0.0}, 1)); localDataPoolMap.emplace(GpsHyperion::LONGITUDE, new PoolEntry({0.0}, 1)); localDataPoolMap.emplace(GpsHyperion::ALTITUDE, new PoolEntry({0.0})); diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index 1fd8a37c..b983f221 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -64,15 +65,23 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio if (cfg.addAcsBoardDummies) { std::array assemblyDhbs; - assemblyDhbs[0] = new MgmLIS3MDLDummy(objects::MGM_0_LIS3_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - assemblyDhbs[1] = new MgmLIS3MDLDummy(objects::MGM_2_LIS3_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - assemblyDhbs[2] = new MgmRm3100Dummy(objects::MGM_1_RM3100_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - assemblyDhbs[3] = new MgmRm3100Dummy(objects::MGM_3_RM3100_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - assemblyDhbs[4] = new GyroAdisDummy(objects::GYRO_0_ADIS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - assemblyDhbs[5] = new GyroL3GD20Dummy(objects::GYRO_1_L3G_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - assemblyDhbs[6] = new GyroAdisDummy(objects::GYRO_2_ADIS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - assemblyDhbs[7] = new GyroL3GD20Dummy(objects::GYRO_3_L3G_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - auto* gpsCtrl = new GpsDhbDummy(objects::GPS_CONTROLLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[0] = + new MgmLIS3MDLDummy(objects::MGM_0_LIS3_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[1] = + new MgmLIS3MDLDummy(objects::MGM_2_LIS3_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[2] = + new MgmRm3100Dummy(objects::MGM_1_RM3100_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[3] = + new MgmRm3100Dummy(objects::MGM_3_RM3100_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[4] = + new GyroAdisDummy(objects::GYRO_0_ADIS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[5] = + new GyroL3GD20Dummy(objects::GYRO_1_L3G_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[6] = + new GyroAdisDummy(objects::GYRO_2_ADIS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[7] = + new GyroL3GD20Dummy(objects::GYRO_3_L3G_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + auto* gpsCtrl = new GpsCtrlDummy(objects::GPS_CONTROLLER); ObjectFactory::createAcsBoardAssy(pwrSwitcher, assemblyDhbs, gpsCtrl, gpioIF); } diff --git a/dummies/helpers.h b/dummies/helpers.h index 1d30f451..878702e3 100644 --- a/dummies/helpers.h +++ b/dummies/helpers.h @@ -2,6 +2,8 @@ #include +class GpioIF; + namespace dummy { struct DummyCfg { From 99913594fda899dbc1b8f5a374502008d2afa66c Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 13 Feb 2023 16:10:58 +0100 Subject: [PATCH 301/330] rfrmt --- .../pollingsequence/pollingSequenceFactory.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 31606768..2944856e 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -240,7 +240,6 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); } - if (enableBside) { // B side thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::acs::SCHED_BLOCK_1_PERIOD, @@ -293,7 +292,6 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg } } // SUS: 16 ms - bool addSus0 = true; bool addSus1 = true; bool addSus2 = true; @@ -441,7 +439,6 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); } - if (addSus6) { thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * 0, DeviceHandlerIF::PERFORM_OPERATION); @@ -464,7 +461,6 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); } - if (addSus7) { thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * 0, DeviceHandlerIF::PERFORM_OPERATION); @@ -487,7 +483,6 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); } - if (addSus8) { thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * 0, DeviceHandlerIF::PERFORM_OPERATION); @@ -510,7 +505,6 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); } - if (addSus9) { thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0, DeviceHandlerIF::PERFORM_OPERATION); @@ -522,6 +516,7 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * 0, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_WRITE); @@ -532,7 +527,6 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); } - if (addSus10) { thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * 0, DeviceHandlerIF::PERFORM_OPERATION); @@ -555,7 +549,6 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, length * config::acs::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); } - if (addSus11) { thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, length * 0, DeviceHandlerIF::PERFORM_OPERATION); @@ -807,6 +800,8 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg thisSequence->addSlot(objects::RW4, length * config::acs::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_READ); } + thisSequence->addSlot(objects::SPI_RTD_COM_IF, length * 0.5, 0); + return returnvalue::OK; } From 6c0234149ea3be3361d2ab8c05f1cf73a46a909a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Feb 2023 16:19:14 +0100 Subject: [PATCH 302/330] compile fixes --- bsp_q7s/em/emObjectFactory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 693da405..1f94e0d6 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -55,7 +55,7 @@ void ObjectFactory::produce(void* args) { createPcduComponents(gpioComIF, &pwrSwitcher); #endif - dummy::createDummies(dummyCfg, *pwrSwitcher); + dummy::createDummies(dummyCfg, *pwrSwitcher, gpioComIF); new CoreController(objects::CORE_CONTROLLER); @@ -75,7 +75,7 @@ void ObjectFactory::produce(void* args) { // createRadSensorComponent(gpioComIF); #if OBSW_ADD_ACS_BOARD == 1 - createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher); + createAcsBoardComponents(gpioComIF, uartComIF, *pwrSwitcher); #endif #if OBSW_ADD_MGT == 1 From 2813d229bbf6034eb075bf2b5c08577c183168ad Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 13 Feb 2023 16:39:26 +0100 Subject: [PATCH 303/330] comntinue --- bsp_q7s/core/ObjectFactory.cpp | 1 - dummies/helpers.cpp | 8 ++++++-- mission/core/GenericFactory.cpp | 2 ++ mission/core/GenericFactory.h | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 16ba3325..e202105b 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -242,7 +242,6 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo PowerSwitchIF& pwrSwitcher) { using namespace gpio; GpioCookie* gpioCookieAcsBoard = new GpioCookie(); - std::array assemblyChildren; std::stringstream consumer; GpiodRegularByLineName* gpio = nullptr; diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index b983f221..98474289 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -28,6 +28,7 @@ #include "mission/core/GenericFactory.h" #include "mission/devices/devicedefinitions/GomspaceDefinitions.h" #include "mission/system/tree/acsModeTree.h" +#include "mission/system/tree/payloadModeTree.h" using namespace dummy; @@ -49,7 +50,9 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio rws[3] = new RwDummy(objects::RW4, objects::DUMMY_COM_IF, comCookieDummy); ObjectFactory::createRwAssy(pwrSwitcher, pcdu::Switches::PDU2_CH2_RW_5V, rws, rwIds); new SaDeplDummy(objects::SOLAR_ARRAY_DEPL_HANDLER); - new StarTrackerDummy(objects::STAR_TRACKER, objects::DUMMY_COM_IF, comCookieDummy); + auto* strDummy = + new StarTrackerDummy(objects::STAR_TRACKER, objects::DUMMY_COM_IF, comCookieDummy); + strDummy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); if (cfg.addSyrlinksDummies) { new SyrlinksDummy(objects::SYRLINKS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); } @@ -185,6 +188,7 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio new TemperatureSensorInserter(objects::THERMAL_TEMP_INSERTER, tempSensorDummies, tempTmpSensorDummies); } - new CamSwitcher(objects::CAM_SWITCHER, pwrSwitcher, power::NO_SWITCH); + auto* camSwitcher = new CamSwitcher(objects::CAM_SWITCHER, pwrSwitcher, power::NO_SWITCH); + camSwitcher->connectModeTreeParent(satsystem::pl::SUBSYSTEM); new PlPcduDummy(objects::PLPCDU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); } diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index 6506c184..7c8bd689 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -281,3 +281,5 @@ void ObjectFactory::createAcsBoardAssy(PowerSwitchIF& pwrSwitcher, gpsCtrl->connectModeTreeParent(*acsAss); acsAss->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); } + +void ObjectFactory::createTcsBoardAssy(PowerSwitchIF& pwrSwitcher) {} diff --git a/mission/core/GenericFactory.h b/mission/core/GenericFactory.h index 4b380336..dd7c6b18 100644 --- a/mission/core/GenericFactory.h +++ b/mission/core/GenericFactory.h @@ -26,6 +26,7 @@ void createRwAssy(PowerSwitchIF& pwrSwitcher, power::Switch_t theSwitch, void createSusAssy(PowerSwitchIF& pwrSwitcher, std::array suses); void createAcsBoardAssy(PowerSwitchIF& pwrSwitcher, std::array assemblyDhbs, ExtendedControllerBase* gpsCtrl, GpioIF* gpioComIF); +void createTcsBoardAssy(PowerSwitchIF& pwrSwitcher); } // namespace ObjectFactory From 17fa9a6e82f217c88fa830651e450da2247867a4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Feb 2023 17:04:04 +0100 Subject: [PATCH 304/330] add TCS board assy for EM --- bsp_q7s/core/ObjectFactory.cpp | 1 + dummies/helpers.cpp | 5 +++++ linux/ObjectFactory.cpp | 33 +++++++-------------------------- mission/core/GenericFactory.cpp | 9 ++++++++- mission/core/GenericFactory.h | 23 ++++++++++++++++++++++- 5 files changed, 43 insertions(+), 28 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index e202105b..2bf36743 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -343,6 +343,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo #if OBSW_ADD_ACS_BOARD == 1 std::string spiDev = q7s::SPI_DEFAULT_DEV; + std::array assemblyChildren; SpiCookie* spiCookie = new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED); diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index 98474289..2115867f 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include "TemperatureSensorInserter.h" #include "dummies/Max31865Dummy.h" @@ -187,6 +188,10 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio new TemperatureSensorInserter(objects::THERMAL_TEMP_INSERTER, tempSensorDummies, tempTmpSensorDummies); + TcsBoardAssembly* tcsBoardAssy = ObjectFactory::createTcsBoardAssy(pwrSwitcher); + for (auto& rtd : tempSensorDummies) { + rtd.second->connectModeTreeParent(*tcsBoardAssy); + } } auto* camSwitcher = new CamSwitcher(objects::CAM_SWITCHER, pwrSwitcher, power::NO_SWITCH); camSwitcher->connectModeTreeParent(satsystem::pl::SUBSYSTEM); diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index add6a755..1686eb03 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -270,32 +270,13 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF, {addresses::RTD_IC_18, gpioIds::RTD_IC_18}, }}; // HSPD: Heatspreader - std::array, NUM_RTDS> rtdInfos = {{ - {objects::RTD_0_IC3_PLOC_HEATSPREADER, "RTD_0_PLOC_HSPD"}, - {objects::RTD_1_IC4_PLOC_MISSIONBOARD, "RTD_1_PLOC_MISSIONBRD"}, - {objects::RTD_2_IC5_4K_CAMERA, "RTD_2_4K_CAMERA"}, - {objects::RTD_3_IC6_DAC_HEATSPREADER, "RTD_3_DAC_HSPD"}, - {objects::RTD_4_IC7_STARTRACKER, "RTD_4_STARTRACKER"}, - {objects::RTD_5_IC8_RW1_MX_MY, "RTD_5_RW1_MX_MY"}, - {objects::RTD_6_IC9_DRO, "RTD_6_DRO"}, - {objects::RTD_7_IC10_SCEX, "RTD_7_SCEX"}, - {objects::RTD_8_IC11_X8, "RTD_8_X8"}, - {objects::RTD_9_IC12_HPA, "RTD_9_HPA"}, - {objects::RTD_10_IC13_PL_TX, "RTD_10_PL_TX,"}, - {objects::RTD_11_IC14_MPA, "RTD_11_MPA"}, - {objects::RTD_12_IC15_ACU, "RTD_12_ACU"}, - {objects::RTD_13_IC16_PLPCDU_HEATSPREADER, "RTD_13_PLPCDU_HSPD"}, - {objects::RTD_14_IC17_TCS_BOARD, "RTD_14_TCS_BOARD"}, - {objects::RTD_15_IC18_IMTQ, "RTD_15_IMTQ"}, - }}; + std::array rtdCookies = {}; std::array rtds = {}; RtdFdir* rtdFdir = nullptr; - TcsBoardHelper helper(rtdInfos); - TcsBoardAssembly* tcsBoardAss = new TcsBoardAssembly( - objects::TCS_BOARD_ASS, pwrSwitcher, pcdu::Switches::PDU1_CH0_TCS_BOARD_3V3, helper); - tcsBoardAss->connectModeTreeParent(satsystem::tcs::SUBSYSTEM); + TcsBoardAssembly* tcsBoardAss = ObjectFactory::createTcsBoardAssy(*pwrSwitcher); + // Create special low level reader communication interface new Max31865RtdReader(objects::SPI_RTD_COM_IF, comIF, gpioComIF); for (uint8_t idx = 0; idx < NUM_RTDS; idx++) { @@ -303,16 +284,16 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF, MAX31865::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); rtdCookies[idx]->setMutexParams(MutexIF::TimeoutType::WAITING, spi::RTD_CS_TIMEOUT); Max31865ReaderCookie* rtdLowLevelCookie = - new Max31865ReaderCookie(rtdInfos[idx].first, idx, rtdInfos[idx].second, rtdCookies[idx]); + new Max31865ReaderCookie(RTD_INFOS[idx].first, idx, RTD_INFOS[idx].second, rtdCookies[idx]); rtds[idx] = - new Max31865EiveHandler(rtdInfos[idx].first, objects::SPI_RTD_COM_IF, rtdLowLevelCookie); - rtds[idx]->setDeviceInfo(idx, rtdInfos[idx].second); + new Max31865EiveHandler(RTD_INFOS[idx].first, objects::SPI_RTD_COM_IF, rtdLowLevelCookie); + rtds[idx]->setDeviceInfo(idx, RTD_INFOS[idx].second); ReturnValue_t result = rtds[idx]->connectModeTreeParent(*tcsBoardAss); if (result != returnvalue::OK) { sif::error << "Connecting RTD " << static_cast(idx) << " to RTD Assembly failed" << std::endl; } - rtdFdir = new RtdFdir(rtdInfos[idx].first); + rtdFdir = new RtdFdir(RTD_INFOS[idx].first); rtds[idx]->setCustomFdir(rtdFdir); #if OBSW_DEBUG_RTD == 1 rtds[idx]->setDebugMode(true, 5); diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index 7c8bd689..992c0093 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -282,4 +283,10 @@ void ObjectFactory::createAcsBoardAssy(PowerSwitchIF& pwrSwitcher, acsAss->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); } -void ObjectFactory::createTcsBoardAssy(PowerSwitchIF& pwrSwitcher) {} +TcsBoardAssembly* ObjectFactory::createTcsBoardAssy(PowerSwitchIF& pwrSwitcher) { + TcsBoardHelper helper(RTD_INFOS); + TcsBoardAssembly* tcsBoardAss = new TcsBoardAssembly( + objects::TCS_BOARD_ASS, &pwrSwitcher, pcdu::Switches::PDU1_CH0_TCS_BOARD_3V3, helper); + tcsBoardAss->connectModeTreeParent(satsystem::tcs::SUBSYSTEM); + return tcsBoardAss; +} diff --git a/mission/core/GenericFactory.h b/mission/core/GenericFactory.h index dd7c6b18..30f2d6bb 100644 --- a/mission/core/GenericFactory.h +++ b/mission/core/GenericFactory.h @@ -6,12 +6,33 @@ #include "fsfw/objectmanager/SystemObjectIF.h" #include "fsfw/power/PowerSwitchIF.h" #include "fsfw_hal/common/gpio/GpioIF.h" +#include "mission/devices/devicedefinitions/Max31865Definitions.h" class HeaterHandler; class HealthTableIF; class PusTmFunnel; class CfdpTmFunnel; class ExtendedControllerBase; +class TcsBoardAssembly; + +const std::array, EiveMax31855::NUM_RTDS> RTD_INFOS = {{ + {objects::RTD_0_IC3_PLOC_HEATSPREADER, "RTD_0_PLOC_HSPD"}, + {objects::RTD_1_IC4_PLOC_MISSIONBOARD, "RTD_1_PLOC_MISSIONBRD"}, + {objects::RTD_2_IC5_4K_CAMERA, "RTD_2_4K_CAMERA"}, + {objects::RTD_3_IC6_DAC_HEATSPREADER, "RTD_3_DAC_HSPD"}, + {objects::RTD_4_IC7_STARTRACKER, "RTD_4_STARTRACKER"}, + {objects::RTD_5_IC8_RW1_MX_MY, "RTD_5_RW1_MX_MY"}, + {objects::RTD_6_IC9_DRO, "RTD_6_DRO"}, + {objects::RTD_7_IC10_SCEX, "RTD_7_SCEX"}, + {objects::RTD_8_IC11_X8, "RTD_8_X8"}, + {objects::RTD_9_IC12_HPA, "RTD_9_HPA"}, + {objects::RTD_10_IC13_PL_TX, "RTD_10_PL_TX,"}, + {objects::RTD_11_IC14_MPA, "RTD_11_MPA"}, + {objects::RTD_12_IC15_ACU, "RTD_12_ACU"}, + {objects::RTD_13_IC16_PLPCDU_HEATSPREADER, "RTD_13_PLPCDU_HSPD"}, + {objects::RTD_14_IC17_TCS_BOARD, "RTD_14_TCS_BOARD"}, + {objects::RTD_15_IC18_IMTQ, "RTD_15_IMTQ"}, +}}; namespace ObjectFactory { @@ -26,7 +47,7 @@ void createRwAssy(PowerSwitchIF& pwrSwitcher, power::Switch_t theSwitch, void createSusAssy(PowerSwitchIF& pwrSwitcher, std::array suses); void createAcsBoardAssy(PowerSwitchIF& pwrSwitcher, std::array assemblyDhbs, ExtendedControllerBase* gpsCtrl, GpioIF* gpioComIF); -void createTcsBoardAssy(PowerSwitchIF& pwrSwitcher); +TcsBoardAssembly* createTcsBoardAssy(PowerSwitchIF& pwrSwitcher); } // namespace ObjectFactory From f5092b27ba86c36716d00476b8018ee5a81cb27c Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 13 Feb 2023 17:24:56 +0100 Subject: [PATCH 305/330] add SCEX dummy --- dummies/CMakeLists.txt | 1 + dummies/ScexDummy.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ dummies/ScexDummy.h | 34 ++++++++++++++++++++++++++++++++++ dummies/helpers.cpp | 3 +++ 4 files changed, 78 insertions(+) create mode 100644 dummies/ScexDummy.cpp create mode 100644 dummies/ScexDummy.h diff --git a/dummies/CMakeLists.txt b/dummies/CMakeLists.txt index 38527dd6..1e41f7d2 100644 --- a/dummies/CMakeLists.txt +++ b/dummies/CMakeLists.txt @@ -20,6 +20,7 @@ target_sources( GyroL3GD20Dummy.cpp MgmLIS3MDLDummy.cpp PlPcduDummy.cpp + ScexDummy.cpp CoreControllerDummy.cpp helpers.cpp MgmRm3100Dummy.cpp diff --git a/dummies/ScexDummy.cpp b/dummies/ScexDummy.cpp new file mode 100644 index 00000000..303570ff --- /dev/null +++ b/dummies/ScexDummy.cpp @@ -0,0 +1,40 @@ +#include "ScexDummy.h" + +ScexDummy::ScexDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie) + : DeviceHandlerBase(objectId, comif, comCookie) {} + +ScexDummy::~ScexDummy() {} + +void ScexDummy::doStartUp() {} + +void ScexDummy::doShutDown() {} + +ReturnValue_t ScexDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; } + +ReturnValue_t ScexDummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) { + return NOTHING_TO_SEND; +} + +ReturnValue_t ScexDummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand, + const uint8_t *commandData, + size_t commandDataLen) { + return returnvalue::OK; +} + +ReturnValue_t ScexDummy::scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId, + size_t *foundLen) { + return returnvalue::OK; +} + +ReturnValue_t ScexDummy::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) { + return returnvalue::OK; +} + +void ScexDummy::fillCommandAndReplyMap() {} + +uint32_t ScexDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 500; } + +ReturnValue_t ScexDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, + LocalDataPoolManager &poolManager) { + return returnvalue::OK; +} diff --git a/dummies/ScexDummy.h b/dummies/ScexDummy.h new file mode 100644 index 00000000..dc0cc73a --- /dev/null +++ b/dummies/ScexDummy.h @@ -0,0 +1,34 @@ +#ifndef DUMMIES_SCEXDUMMY_H_ +#define DUMMIES_SCEXDUMMY_H_ + +#include + +class ScexDummy : public DeviceHandlerBase { + public: + static const DeviceCommandId_t SIMPLE_COMMAND = 1; + static const DeviceCommandId_t PERIODIC_REPLY = 2; + + static const uint8_t SIMPLE_COMMAND_DATA = 1; + static const uint8_t PERIODIC_REPLY_DATA = 2; + + ScexDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie); + virtual ~ScexDummy(); + + protected: + void doStartUp() override; + void doShutDown() override; + ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t *id) override; + ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t *id) override; + ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t *commandData, + size_t commandDataLen) override; + ReturnValue_t scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId, + size_t *foundLen) override; + ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) override; + void fillCommandAndReplyMap() override; + uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override; + ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap, + LocalDataPoolManager &poolManager) override; +}; + + +#endif /* DUMMIES_SCEXDUMMY_H_ */ diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index 2115867f..ee509788 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -195,5 +196,7 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio } auto* camSwitcher = new CamSwitcher(objects::CAM_SWITCHER, pwrSwitcher, power::NO_SWITCH); camSwitcher->connectModeTreeParent(satsystem::pl::SUBSYSTEM); + auto* scexDummy = new ScexDummy(objects::SCEX, objects::DUMMY_COM_IF, comCookieDummy); + scexDummy->connectModeTreeParent(satsystem::pl::SUBSYSTEM); new PlPcduDummy(objects::PLPCDU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); } From 4cccafbe01bba0298c9a60837f93a37a6a98ecad Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 13 Feb 2023 17:59:08 +0100 Subject: [PATCH 306/330] no error im happy --- dummies/CMakeLists.txt | 2 + dummies/PlocMpsocDummy.cpp | 42 +++++++++++++++ dummies/PlocMpsocDummy.h | 30 +++++++++++ dummies/PlocSupervisorDummy.cpp | 44 +++++++++++++++ dummies/PlocSupervisorDummy.h | 30 +++++++++++ dummies/ScexDummy.h | 6 +-- dummies/helpers.cpp | 94 ++++++++++++++++++++------------- dummies/helpers.h | 1 + 8 files changed, 206 insertions(+), 43 deletions(-) create mode 100644 dummies/PlocMpsocDummy.cpp create mode 100644 dummies/PlocMpsocDummy.h create mode 100644 dummies/PlocSupervisorDummy.cpp create mode 100644 dummies/PlocSupervisorDummy.h diff --git a/dummies/CMakeLists.txt b/dummies/CMakeLists.txt index 1e41f7d2..810cc048 100644 --- a/dummies/CMakeLists.txt +++ b/dummies/CMakeLists.txt @@ -22,6 +22,8 @@ target_sources( PlPcduDummy.cpp ScexDummy.cpp CoreControllerDummy.cpp + PlocMpsocDummy.cpp + PlocSupervisorDummy.cpp helpers.cpp MgmRm3100Dummy.cpp Tmp1075Dummy.cpp) diff --git a/dummies/PlocMpsocDummy.cpp b/dummies/PlocMpsocDummy.cpp new file mode 100644 index 00000000..2df55b1d --- /dev/null +++ b/dummies/PlocMpsocDummy.cpp @@ -0,0 +1,42 @@ +#include "PlocMpsocDummy.h" + +PlocMpsocDummy::PlocMpsocDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie) + : DeviceHandlerBase(objectId, comif, comCookie) {} + +PlocMpsocDummy::~PlocMpsocDummy() {} + +void PlocMpsocDummy::doStartUp() {} + +void PlocMpsocDummy::doShutDown() {} + +ReturnValue_t PlocMpsocDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { + return NOTHING_TO_SEND; +} + +ReturnValue_t PlocMpsocDummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) { + return NOTHING_TO_SEND; +} + +ReturnValue_t PlocMpsocDummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand, + const uint8_t *commandData, + size_t commandDataLen) { + return returnvalue::OK; +} + +ReturnValue_t PlocMpsocDummy::scanForReply(const uint8_t *start, size_t len, + DeviceCommandId_t *foundId, size_t *foundLen) { + return returnvalue::OK; +} + +ReturnValue_t PlocMpsocDummy::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) { + return returnvalue::OK; +} + +void PlocMpsocDummy::fillCommandAndReplyMap() {} + +uint32_t PlocMpsocDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 500; } + +ReturnValue_t PlocMpsocDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, + LocalDataPoolManager &poolManager) { + return returnvalue::OK; +} diff --git a/dummies/PlocMpsocDummy.h b/dummies/PlocMpsocDummy.h new file mode 100644 index 00000000..7beaa76b --- /dev/null +++ b/dummies/PlocMpsocDummy.h @@ -0,0 +1,30 @@ +#pragma once + +#include + +class PlocMpsocDummy : public DeviceHandlerBase { + public: + static const DeviceCommandId_t SIMPLE_COMMAND = 1; + static const DeviceCommandId_t PERIODIC_REPLY = 2; + + static const uint8_t SIMPLE_COMMAND_DATA = 1; + static const uint8_t PERIODIC_REPLY_DATA = 2; + + PlocMpsocDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie); + virtual ~PlocMpsocDummy(); + + protected: + void doStartUp() override; + void doShutDown() override; + ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t *id) override; + ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t *id) override; + ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t *commandData, + size_t commandDataLen) override; + ReturnValue_t scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId, + size_t *foundLen) override; + ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) override; + void fillCommandAndReplyMap() override; + uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override; + ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap, + LocalDataPoolManager &poolManager) override; +}; diff --git a/dummies/PlocSupervisorDummy.cpp b/dummies/PlocSupervisorDummy.cpp new file mode 100644 index 00000000..d4730fe9 --- /dev/null +++ b/dummies/PlocSupervisorDummy.cpp @@ -0,0 +1,44 @@ +#include "PlocSupervisorDummy.h" + +PlocSupervisorDummy::PlocSupervisorDummy(object_id_t objectId, object_id_t comif, + CookieIF *comCookie) + : DeviceHandlerBase(objectId, comif, comCookie) {} + +PlocSupervisorDummy::~PlocSupervisorDummy() {} + +void PlocSupervisorDummy::doStartUp() {} + +void PlocSupervisorDummy::doShutDown() {} + +ReturnValue_t PlocSupervisorDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { + return NOTHING_TO_SEND; +} + +ReturnValue_t PlocSupervisorDummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) { + return NOTHING_TO_SEND; +} + +ReturnValue_t PlocSupervisorDummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand, + const uint8_t *commandData, + size_t commandDataLen) { + return returnvalue::OK; +} + +ReturnValue_t PlocSupervisorDummy::scanForReply(const uint8_t *start, size_t len, + DeviceCommandId_t *foundId, size_t *foundLen) { + return returnvalue::OK; +} + +ReturnValue_t PlocSupervisorDummy::interpretDeviceReply(DeviceCommandId_t id, + const uint8_t *packet) { + return returnvalue::OK; +} + +void PlocSupervisorDummy::fillCommandAndReplyMap() {} + +uint32_t PlocSupervisorDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 500; } + +ReturnValue_t PlocSupervisorDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, + LocalDataPoolManager &poolManager) { + return returnvalue::OK; +} diff --git a/dummies/PlocSupervisorDummy.h b/dummies/PlocSupervisorDummy.h new file mode 100644 index 00000000..4118c893 --- /dev/null +++ b/dummies/PlocSupervisorDummy.h @@ -0,0 +1,30 @@ +#pragma once + +#include + +class PlocSupervisorDummy : public DeviceHandlerBase { + public: + static const DeviceCommandId_t SIMPLE_COMMAND = 1; + static const DeviceCommandId_t PERIODIC_REPLY = 2; + + static const uint8_t SIMPLE_COMMAND_DATA = 1; + static const uint8_t PERIODIC_REPLY_DATA = 2; + + PlocSupervisorDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie); + virtual ~PlocSupervisorDummy(); + + protected: + void doStartUp() override; + void doShutDown() override; + ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t *id) override; + ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t *id) override; + ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t *commandData, + size_t commandDataLen) override; + ReturnValue_t scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId, + size_t *foundLen) override; + ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) override; + void fillCommandAndReplyMap() override; + uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override; + ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap, + LocalDataPoolManager &poolManager) override; +}; diff --git a/dummies/ScexDummy.h b/dummies/ScexDummy.h index dc0cc73a..98762db3 100644 --- a/dummies/ScexDummy.h +++ b/dummies/ScexDummy.h @@ -1,5 +1,4 @@ -#ifndef DUMMIES_SCEXDUMMY_H_ -#define DUMMIES_SCEXDUMMY_H_ +#pragma once #include @@ -29,6 +28,3 @@ class ScexDummy : public DeviceHandlerBase { ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) override; }; - - -#endif /* DUMMIES_SCEXDUMMY_H_ */ diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index ee509788..a5b84451 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -15,12 +15,15 @@ #include #include #include +#include +#include #include #include #include #include #include #include +#include #include #include @@ -30,9 +33,9 @@ #include "mission/core/GenericFactory.h" #include "mission/devices/devicedefinitions/GomspaceDefinitions.h" #include "mission/system/tree/acsModeTree.h" +#include "mission/system/tree/comModeTree.h" #include "mission/system/tree/payloadModeTree.h" - -using namespace dummy; +#include "mission/system/tree/tcsModeTree.h" void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpioIF) { new ComIFDummy(objects::DUMMY_COM_IF); @@ -56,7 +59,9 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio new StarTrackerDummy(objects::STAR_TRACKER, objects::DUMMY_COM_IF, comCookieDummy); strDummy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); if (cfg.addSyrlinksDummies) { - new SyrlinksDummy(objects::SYRLINKS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + auto* syrlinksDummy = + new SyrlinksDummy(objects::SYRLINKS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + syrlinksDummy->connectModeTreeParent(satsystem::com::SUBSYSTEM); } auto* imtqDummy = new ImtqDummy(objects::IMTQ_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); imtqDummy->enableThermalModule(ThermalStateCfg()); @@ -120,83 +125,96 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio } if (cfg.addTempSensorDummies) { - std::map tempSensorDummies; - tempSensorDummies.emplace(objects::RTD_0_IC3_PLOC_HEATSPREADER, - new Max31865Dummy(objects::RTD_0_IC3_PLOC_HEATSPREADER, - objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace(objects::RTD_1_IC4_PLOC_MISSIONBOARD, - new Max31865Dummy(objects::RTD_1_IC4_PLOC_MISSIONBOARD, - objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace( + std::map rtdSensorDummies; + rtdSensorDummies.emplace(objects::RTD_0_IC3_PLOC_HEATSPREADER, + new Max31865Dummy(objects::RTD_0_IC3_PLOC_HEATSPREADER, + objects::DUMMY_COM_IF, comCookieDummy)); + rtdSensorDummies.emplace(objects::RTD_1_IC4_PLOC_MISSIONBOARD, + new Max31865Dummy(objects::RTD_1_IC4_PLOC_MISSIONBOARD, + objects::DUMMY_COM_IF, comCookieDummy)); + rtdSensorDummies.emplace( objects::RTD_2_IC5_4K_CAMERA, new Max31865Dummy(objects::RTD_2_IC5_4K_CAMERA, objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace(objects::RTD_3_IC6_DAC_HEATSPREADER, - new Max31865Dummy(objects::RTD_3_IC6_DAC_HEATSPREADER, - objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace( + rtdSensorDummies.emplace(objects::RTD_3_IC6_DAC_HEATSPREADER, + new Max31865Dummy(objects::RTD_3_IC6_DAC_HEATSPREADER, + objects::DUMMY_COM_IF, comCookieDummy)); + rtdSensorDummies.emplace( objects::RTD_4_IC7_STARTRACKER, new Max31865Dummy(objects::RTD_4_IC7_STARTRACKER, objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace( + rtdSensorDummies.emplace( objects::RTD_5_IC8_RW1_MX_MY, new Max31865Dummy(objects::RTD_5_IC8_RW1_MX_MY, objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace( + rtdSensorDummies.emplace( objects::RTD_6_IC9_DRO, new Max31865Dummy(objects::RTD_6_IC9_DRO, objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace( + rtdSensorDummies.emplace( objects::RTD_7_IC10_SCEX, new Max31865Dummy(objects::RTD_7_IC10_SCEX, objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace( + rtdSensorDummies.emplace( objects::RTD_8_IC11_X8, new Max31865Dummy(objects::RTD_8_IC11_X8, objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace( + rtdSensorDummies.emplace( objects::RTD_9_IC12_HPA, new Max31865Dummy(objects::RTD_9_IC12_HPA, objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace( + rtdSensorDummies.emplace( objects::RTD_10_IC13_PL_TX, new Max31865Dummy(objects::RTD_10_IC13_PL_TX, objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace( + rtdSensorDummies.emplace( objects::RTD_11_IC14_MPA, new Max31865Dummy(objects::RTD_11_IC14_MPA, objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace( + rtdSensorDummies.emplace( objects::RTD_12_IC15_ACU, new Max31865Dummy(objects::RTD_12_IC15_ACU, objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace(objects::RTD_13_IC16_PLPCDU_HEATSPREADER, - new Max31865Dummy(objects::RTD_13_IC16_PLPCDU_HEATSPREADER, - objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace( + rtdSensorDummies.emplace(objects::RTD_13_IC16_PLPCDU_HEATSPREADER, + new Max31865Dummy(objects::RTD_13_IC16_PLPCDU_HEATSPREADER, + objects::DUMMY_COM_IF, comCookieDummy)); + rtdSensorDummies.emplace( objects::RTD_14_IC17_TCS_BOARD, new Max31865Dummy(objects::RTD_14_IC17_TCS_BOARD, objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace( + rtdSensorDummies.emplace( objects::RTD_15_IC18_IMTQ, new Max31865Dummy(objects::RTD_15_IC18_IMTQ, objects::DUMMY_COM_IF, comCookieDummy)); - std::map tempTmpSensorDummies; - tempTmpSensorDummies.emplace( + std::map tmpSensorDummies; + tmpSensorDummies.emplace( objects::TMP1075_HANDLER_TCS_0, new Tmp1075Dummy(objects::TMP1075_HANDLER_TCS_0, objects::DUMMY_COM_IF, comCookieDummy)); - tempTmpSensorDummies.emplace( + tmpSensorDummies.emplace( objects::TMP1075_HANDLER_TCS_1, new Tmp1075Dummy(objects::TMP1075_HANDLER_TCS_1, objects::DUMMY_COM_IF, comCookieDummy)); - tempTmpSensorDummies.emplace( + tmpSensorDummies.emplace( objects::TMP1075_HANDLER_PLPCDU_0, new Tmp1075Dummy(objects::TMP1075_HANDLER_PLPCDU_0, objects::DUMMY_COM_IF, comCookieDummy)); - tempTmpSensorDummies.emplace( + tmpSensorDummies.emplace( objects::TMP1075_HANDLER_PLPCDU_1, new Tmp1075Dummy(objects::TMP1075_HANDLER_PLPCDU_1, objects::DUMMY_COM_IF, comCookieDummy)); - tempTmpSensorDummies.emplace( + tmpSensorDummies.emplace( objects::TMP1075_HANDLER_IF_BOARD, new Tmp1075Dummy(objects::TMP1075_HANDLER_IF_BOARD, objects::DUMMY_COM_IF, comCookieDummy)); - new TemperatureSensorInserter(objects::THERMAL_TEMP_INSERTER, tempSensorDummies, - tempTmpSensorDummies); + new TemperatureSensorInserter(objects::THERMAL_TEMP_INSERTER, rtdSensorDummies, + tmpSensorDummies); TcsBoardAssembly* tcsBoardAssy = ObjectFactory::createTcsBoardAssy(pwrSwitcher); - for (auto& rtd : tempSensorDummies) { + for (auto& rtd : rtdSensorDummies) { rtd.second->connectModeTreeParent(*tcsBoardAssy); } + for (auto& tmp : tmpSensorDummies) { + tmp.second->connectModeTreeParent(satsystem::tcs::SUBSYSTEM); + } } auto* camSwitcher = new CamSwitcher(objects::CAM_SWITCHER, pwrSwitcher, power::NO_SWITCH); camSwitcher->connectModeTreeParent(satsystem::pl::SUBSYSTEM); auto* scexDummy = new ScexDummy(objects::SCEX, objects::DUMMY_COM_IF, comCookieDummy); scexDummy->connectModeTreeParent(satsystem::pl::SUBSYSTEM); - new PlPcduDummy(objects::PLPCDU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + auto* plPcduDummy = + new PlPcduDummy(objects::PLPCDU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + plPcduDummy->connectModeTreeParent(satsystem::pl::SUBSYSTEM); + if (cfg.addPlocDummies) { + auto* plocMpsocDummy = + new PlocMpsocDummy(objects::PLOC_MPSOC_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + plocMpsocDummy->connectModeTreeParent(satsystem::pl::SUBSYSTEM); + auto* plocSupervisorDummy = new PlocSupervisorDummy(objects::PLOC_SUPERVISOR_HANDLER, + objects::DUMMY_COM_IF, comCookieDummy); + plocSupervisorDummy->connectModeTreeParent(satsystem::pl::SUBSYSTEM); + } } diff --git a/dummies/helpers.h b/dummies/helpers.h index 878702e3..2181c79c 100644 --- a/dummies/helpers.h +++ b/dummies/helpers.h @@ -14,6 +14,7 @@ struct DummyCfg { bool addSusDummies = true; bool addTempSensorDummies = true; bool addRtdComIFDummy = true; + bool addPlocDummies = true; }; void createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch, GpioIF* gpioIF); From 6a1d4bd52fb922e7e1877625ad47a4631b60f1bb Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 13 Feb 2023 18:01:16 +0100 Subject: [PATCH 307/330] continue --- bsp_q7s/core/scheduling.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index cc3108e8..b23a0e98 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -233,12 +233,10 @@ void scheduling::initTasks() { if (result != returnvalue::OK) { scheduling::printAddObjectError("TCS_SUBSYSTEM", objects::TCS_SUBSYSTEM); } -#if OBSW_ADD_RTD_DEVICES == 1 result = tcsSystemTask->addComponent(objects::TCS_BOARD_ASS); if (result != returnvalue::OK) { scheduling::printAddObjectError("TCS_BOARD_ASS", objects::TCS_BOARD_ASS); } -#endif /* OBSW_ADD_RTD_DEVICES */ #if OBSW_ADD_TCS_CTRL == 1 result = tcsSystemTask->addComponent(objects::THERMAL_CONTROLLER); if (result != returnvalue::OK) { From 131fff68474bbe4d165e37624f832c21eba4f535 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Feb 2023 10:02:12 +0100 Subject: [PATCH 308/330] update create dummeis --- bsp_hosted/ObjectFactory.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bsp_hosted/ObjectFactory.cpp b/bsp_hosted/ObjectFactory.cpp index f0308ee5..d2c3c3da 100644 --- a/bsp_hosted/ObjectFactory.cpp +++ b/bsp_hosted/ObjectFactory.cpp @@ -62,7 +62,6 @@ void ObjectFactory::produce(void* args) { auto* dummyGpioIF = new DummyGpioIF(); auto* dummySwitcher = new DummyPowerSwitcher(objects::PCDU_HANDLER, 18, 0); - static_cast(dummyGpioIF); #ifdef PLATFORM_UNIX new SerialComIF(objects::UART_COM_IF); #if OBSW_ADD_PLOC_MPSOC == 1 @@ -89,7 +88,7 @@ void ObjectFactory::produce(void* args) { #endif dummy::DummyCfg cfg; - dummy::createDummies(cfg, *dummySwitcher); + dummy::createDummies(cfg, *dummySwitcher, dummyGpioIF); HeaterHandler* heaterHandler = nullptr; // new ThermalController(objects::THERMAL_CONTROLLER); From 3c5a2568ef0d41bf70367e4e9b753d13e448dc58 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Feb 2023 10:24:43 +0100 Subject: [PATCH 309/330] updatr lwgps dependency --- thirdparty/lwgps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thirdparty/lwgps b/thirdparty/lwgps index 52999ddf..18ce34fa 160000 --- a/thirdparty/lwgps +++ b/thirdparty/lwgps @@ -1 +1 @@ -Subproject commit 52999ddfe5177493b96b55871961a8a97131596d +Subproject commit 18ce34faf729ed63c94517b2ae6a3d3741e0a054 From a75e035cc5c2eb34f00567a020f9b820d713622f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Feb 2023 10:36:53 +0100 Subject: [PATCH 310/330] fix cppcheck lints --- fsfw | 2 +- linux/ipcore/PdecConfig.cpp | 2 +- linux/ipcore/PdecHandler.cpp | 1 + linux/ipcore/pdec.h | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fsfw b/fsfw index f0b8457b..d256ede8 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit f0b8457ba2d9a34a42b10314c3cdccfd46ebf168 +Subproject commit d256ede8c1d8e7a746d3a56d45313d2b863e0b28 diff --git a/linux/ipcore/PdecConfig.cpp b/linux/ipcore/PdecConfig.cpp index 21de4610..a476e8cd 100644 --- a/linux/ipcore/PdecConfig.cpp +++ b/linux/ipcore/PdecConfig.cpp @@ -22,7 +22,7 @@ void PdecConfig::initialize() { word |= POSITIVE_WINDOW; configWords[0] = word; word = 0; - word |= (NEGATIVE_WINDOW << 24); + word |= (static_cast(NEGATIVE_WINDOW) << 24); word |= (HIGH_AU_MAP_ID << 16); word |= (ENABLE_DERANDOMIZER << 8); configWords[1] = word; diff --git a/linux/ipcore/PdecHandler.cpp b/linux/ipcore/PdecHandler.cpp index 0598cc95..b6b684e9 100644 --- a/linux/ipcore/PdecHandler.cpp +++ b/linux/ipcore/PdecHandler.cpp @@ -99,6 +99,7 @@ ReturnValue_t PdecHandler::performOperation(uint8_t operationCode) { } else if (OP_MODE == Modes::IRQ) { return irqOperation(); } + return returnvalue::FAILED; } ReturnValue_t PdecHandler::polledOperation() { diff --git a/linux/ipcore/pdec.h b/linux/ipcore/pdec.h index 16b0c2e6..7485f744 100644 --- a/linux/ipcore/pdec.h +++ b/linux/ipcore/pdec.h @@ -15,7 +15,7 @@ static constexpr uint32_t NEW_FAR_MASK = 1 << 2; static constexpr uint32_t TC_ABORT_MASK = 1 << 1; static constexpr uint32_t TC_NEW_MASK = 1 << 0; -static constexpr uint32_t FAR_STAT_MASK = 1 << 31; +static constexpr uint32_t FAR_STAT_MASK = 1UL << 31; static const uint32_t FRAME_ANA_MASK = 0x70000000; static const uint32_t IREASON_MASK = 0x0E000000; From 66d20dc11873acca86b5c004b04703ccc8c52c0b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Feb 2023 10:59:35 +0100 Subject: [PATCH 311/330] add tracing for first tasks --- bsp_q7s/OBSWConfig.h.in | 1 + bsp_q7s/core/CoreController.cpp | 4 ++++ bsp_q7s/core/CoreController.h | 3 +++ bsp_q7s/core/scheduling.cpp | 8 ++++---- mission/CMakeLists.txt | 2 +- mission/controller/AcsController.cpp | 4 ++++ mission/controller/AcsController.h | 5 +++++ mission/devices/BpxBatteryHandler.cpp | 8 +++++++- mission/devices/BpxBatteryHandler.h | 6 ++++++ mission/devices/SolarArrayDeploymentHandler.cpp | 6 ++++++ mission/devices/SolarArrayDeploymentHandler.h | 3 +++ mission/trace.cpp | 10 ++++++++++ mission/trace.h | 12 ++++++++++++ 13 files changed, 66 insertions(+), 6 deletions(-) create mode 100644 mission/trace.cpp create mode 100644 mission/trace.h diff --git a/bsp_q7s/OBSWConfig.h.in b/bsp_q7s/OBSWConfig.h.in index 687d9363..a86dd8c7 100644 --- a/bsp_q7s/OBSWConfig.h.in +++ b/bsp_q7s/OBSWConfig.h.in @@ -77,6 +77,7 @@ // If this is enabled, all other I2C code should be disabled #define OBSW_ADD_I2C_TEST_CODE 0 #define OBSW_ADD_UART_TEST_CODE 0 +#define OBSW_THREAD_TRACING 1 #define OBSW_TEST_ACS 0 #define OBSW_DEBUG_ACS 0 diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index 116b4fc9..79dc68f5 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -9,6 +9,7 @@ #include "fsfw/serviceinterface/ServiceInterface.h" #include "fsfw/timemanager/Stopwatch.h" #include "fsfw/version.h" +#include "mission/trace.h" #include "watchdog/definitions.h" #if OBSW_ADD_TMTC_UDP_SERVER == 1 #include "fsfw/osal/common/UdpTmTcBridge.h" @@ -63,6 +64,9 @@ ReturnValue_t CoreController::handleCommandMessage(CommandMessage *message) { } void CoreController::performControlOperation() { +#if OBSW_THREAD_TRACING == 1 + trace::threadTrace(opCounter, "CORE CTRL"); +#endif EventMessage event; for (ReturnValue_t result = eventQueue->receiveMessage(&event); result == returnvalue::OK; result = eventQueue->receiveMessage(&event)) { diff --git a/bsp_q7s/core/CoreController.h b/bsp_q7s/core/CoreController.h index 9cbc6340..36cf5d27 100644 --- a/bsp_q7s/core/CoreController.h +++ b/bsp_q7s/core/CoreController.h @@ -222,6 +222,9 @@ class CoreController : public ExtendedControllerBase { std::string currMntPrefix; bool performOneShotSdCardOpsSwitch = false; uint8_t shortSdCardCdCounter = 0; +#if OBSW_THREAD_TRACING == 1 + uint32_t opCounter; +#endif Countdown sdCardCheckCd = Countdown(INIT_SD_CARD_CHECK_TIMEOUT); /** diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index ad76d308..5abe3fd5 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -374,9 +374,9 @@ void scheduling::createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction #else static constexpr float acsPstPeriod = 0.8; #endif - FixedTimeslotTaskIF* acsPst = factory.createFixedTimeslotTask( - "ACS_PST", 85, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, acsPstPeriod, missedDeadlineFunc); - result = pst::pstTcsAndAcs(acsPst, cfg); + FixedTimeslotTaskIF* acsTcsPst = factory.createFixedTimeslotTask( + "ACS_TCS_PST", 85, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, acsPstPeriod, missedDeadlineFunc); + result = pst::pstTcsAndAcs(acsTcsPst, cfg); if (result != returnvalue::OK) { if (result == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) { sif::warning << "scheduling::initTasks: ACS PST is empty" << std::endl; @@ -384,7 +384,7 @@ void scheduling::createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction sif::error << "scheduling::initTasks: Creating ACS PST failed!" << std::endl; } } else { - taskVec.push_back(acsPst); + taskVec.push_back(acsTcsPst); } /* Polling Sequence Table Default */ diff --git a/mission/CMakeLists.txt b/mission/CMakeLists.txt index f284a675..37c4a2e2 100644 --- a/mission/CMakeLists.txt +++ b/mission/CMakeLists.txt @@ -9,4 +9,4 @@ add_subdirectory(csp) add_subdirectory(cfdp) add_subdirectory(config) -target_sources(${LIB_EIVE_MISSION} PRIVATE acsDefs.cpp) +target_sources(${LIB_EIVE_MISSION} PRIVATE acsDefs.cpp trace.cpp) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index ef590b8c..72589fcc 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -4,6 +4,7 @@ #include "mission/acsDefs.h" #include "mission/config/torquer.h" +#include "mission/trace.h" AcsController::AcsController(object_id_t objectId) : ExtendedControllerBase(objectId), @@ -50,6 +51,9 @@ ReturnValue_t AcsController::getParameter(uint8_t domainId, uint8_t parameterId, } void AcsController::performControlOperation() { +#if OBSW_THREAD_TRACING == 1 + trace::threadTrace(opCounter, "ACS & TCS PST"); +#endif switch (internalState) { case InternalState::STARTUP: { initialCountdown.resetTimer(); diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index 1e017099..14972b3e 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -6,6 +6,7 @@ #include #include +#include "OBSWConfig.h" #include "acs/ActuatorCmd.h" #include "acs/Guidance.h" #include "acs/Navigation.h" @@ -51,6 +52,10 @@ class AcsController : public ExtendedControllerBase, public ReceivesParameterMes ParameterHelper parameterHelper; +#if OBSW_THREAD_TRACING == 1 + uint32_t opCounter = 0; +#endif + enum class InternalState { STARTUP, INITIAL_DELAY, READY }; InternalState internalState = InternalState::STARTUP; diff --git a/mission/devices/BpxBatteryHandler.cpp b/mission/devices/BpxBatteryHandler.cpp index 4e49bebe..efda26f8 100644 --- a/mission/devices/BpxBatteryHandler.cpp +++ b/mission/devices/BpxBatteryHandler.cpp @@ -2,7 +2,7 @@ #include -#include "OBSWConfig.h" +#include "mission/trace.h" BpxBatteryHandler::BpxBatteryHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie) : DeviceHandlerBase(objectId, comIF, comCookie), hkSet(this), cfgSet(this) {} @@ -280,3 +280,9 @@ void BpxBatteryHandler::setToGoToNormalMode(bool enable) { } void BpxBatteryHandler::setDebugMode(bool enable) { this->debugMode = enable; } + +void BpxBatteryHandler::performOperationHook() { +#if OBSW_THREAD_TRACING == 1 + trace::threadTrace(opCounter, "BPX BATT"); +#endif +} diff --git a/mission/devices/BpxBatteryHandler.h b/mission/devices/BpxBatteryHandler.h index ceb0ff8d..31448799 100644 --- a/mission/devices/BpxBatteryHandler.h +++ b/mission/devices/BpxBatteryHandler.h @@ -3,6 +3,7 @@ #include +#include "OBSWConfig.h" #include "devicedefinitions/BpxBatteryDefinitions.h" class BpxBatteryHandler : public DeviceHandlerBase { @@ -24,6 +25,10 @@ class BpxBatteryHandler : public DeviceHandlerBase { bool debugMode = false; bool goToNormalModeImmediately = false; uint8_t sentPingByte = BpxBattery::DEFAULT_PING_SENT_BYTE; +#if OBSW_THREAD_TRACING == 1 + uint32_t opCounter = 0; +#endif + BpxBatteryHk hkSet; DeviceCommandId_t lastCmd = DeviceHandlerIF::NO_COMMAND_ID; BpxBatteryCfg cfgSet; @@ -47,6 +52,7 @@ class BpxBatteryHandler : public DeviceHandlerBase { ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t* id) override; ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t* id) override; void fillCommandAndReplyMap() override; + void performOperationHook() override; ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t* commandData, size_t commandDataLen) override; ReturnValue_t scanForReply(const uint8_t* start, size_t remainingSize, DeviceCommandId_t* foundId, diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index 2b4e22ac..2eacdea4 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -37,6 +37,12 @@ SolarArrayDeploymentHandler::~SolarArrayDeploymentHandler() = default; ReturnValue_t SolarArrayDeploymentHandler::performOperation(uint8_t operationCode) { using namespace std::filesystem; +#if OBSW_THREAD_TRACING == 1 + opCounter++; + if (opCounter % 5 == 0) { + sif::debug << "SA DEPL task running" << std::endl; + } +#endif if (opDivider.checkAndIncrement()) { auto activeSdc = sdcMan.getActiveSdCard(); if (activeSdc and activeSdc.value() == sd::SdCard::SLOT_0 and diff --git a/mission/devices/SolarArrayDeploymentHandler.h b/mission/devices/SolarArrayDeploymentHandler.h index 63f1d3de..27c466f1 100644 --- a/mission/devices/SolarArrayDeploymentHandler.h +++ b/mission/devices/SolarArrayDeploymentHandler.h @@ -172,6 +172,9 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, bool firstAutonomousCycle = true; ActionId_t activeCmd = HasActionsIF::INVALID_ACTION_ID; std::optional initUptime; +#if OBSW_THREAD_TRACING == 1 + uint32_t opCounter; +#endif PeriodicOperationDivider opDivider = PeriodicOperationDivider(5); uint8_t retryCounter = 3; diff --git a/mission/trace.cpp b/mission/trace.cpp new file mode 100644 index 00000000..f12e5902 --- /dev/null +++ b/mission/trace.cpp @@ -0,0 +1,10 @@ +#include "trace.h" + +#include "fsfw/serviceinterface.h" + +void trace::threadTrace(uint32_t& counter, const char* name) { + counter++; + if (counter % 5 == 0) { + sif::debug << name << " running" << std::endl; + } +} diff --git a/mission/trace.h b/mission/trace.h new file mode 100644 index 00000000..a3fabbd9 --- /dev/null +++ b/mission/trace.h @@ -0,0 +1,12 @@ +#ifndef MISSION_TRACE_H_ +#define MISSION_TRACE_H_ + +#include + +namespace trace { + +void threadTrace(uint32_t& counter, const char* name); + +} + +#endif /* MISSION_TRACE_H_ */ From 2aac3c67ee7402a8a004f5231df830ccd52b3404 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Feb 2023 11:10:18 +0100 Subject: [PATCH 312/330] instrumented some more tasks --- bsp_q7s/OBSWConfig.h.in | 1 - bsp_q7s/core/CoreController.cpp | 1 - bsp_q7s/core/CoreController.h | 1 + linux/devices/ploc/PlocMPSoCHelper.cpp | 4 +++- linux/devices/ploc/PlocMPSoCHelper.h | 5 +++++ linux/devices/ploc/PlocSupvUartMan.cpp | 3 +++ linux/devices/ploc/PlocSupvUartMan.h | 5 +++++ mission/controller/AcsController.cpp | 1 - mission/controller/AcsController.h | 2 +- mission/devices/BpxBatteryHandler.cpp | 2 -- mission/devices/BpxBatteryHandler.h | 2 +- mission/devices/SolarArrayDeploymentHandler.cpp | 1 + mission/devices/SolarArrayDeploymentHandler.h | 3 ++- mission/trace.h | 2 ++ 14 files changed, 24 insertions(+), 9 deletions(-) diff --git a/bsp_q7s/OBSWConfig.h.in b/bsp_q7s/OBSWConfig.h.in index a86dd8c7..687d9363 100644 --- a/bsp_q7s/OBSWConfig.h.in +++ b/bsp_q7s/OBSWConfig.h.in @@ -77,7 +77,6 @@ // If this is enabled, all other I2C code should be disabled #define OBSW_ADD_I2C_TEST_CODE 0 #define OBSW_ADD_UART_TEST_CODE 0 -#define OBSW_THREAD_TRACING 1 #define OBSW_TEST_ACS 0 #define OBSW_DEBUG_ACS 0 diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index 79dc68f5..4ff4965f 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -9,7 +9,6 @@ #include "fsfw/serviceinterface/ServiceInterface.h" #include "fsfw/timemanager/Stopwatch.h" #include "fsfw/version.h" -#include "mission/trace.h" #include "watchdog/definitions.h" #if OBSW_ADD_TMTC_UDP_SERVER == 1 #include "fsfw/osal/common/UdpTmTcBridge.h" diff --git a/bsp_q7s/core/CoreController.h b/bsp_q7s/core/CoreController.h index 36cf5d27..65ee20ef 100644 --- a/bsp_q7s/core/CoreController.h +++ b/bsp_q7s/core/CoreController.h @@ -12,6 +12,7 @@ #include "events/subsystemIdRanges.h" #include "fsfw/controller/ExtendedControllerBase.h" #include "mission/devices/devicedefinitions/GPSDefinitions.h" +#include "mission/trace.h" class Timer; class SdCardManager; diff --git a/linux/devices/ploc/PlocMPSoCHelper.cpp b/linux/devices/ploc/PlocMPSoCHelper.cpp index fcd5178b..fca2e51c 100644 --- a/linux/devices/ploc/PlocMPSoCHelper.cpp +++ b/linux/devices/ploc/PlocMPSoCHelper.cpp @@ -3,7 +3,6 @@ #include #include -#include "OBSWConfig.h" #ifdef XIPHOS_Q7S #include "bsp_q7s/fs/FilesystemHelper.h" #endif @@ -34,6 +33,9 @@ ReturnValue_t PlocMPSoCHelper::performOperation(uint8_t operationCode) { ReturnValue_t result = returnvalue::OK; semaphore.acquire(); while (true) { +#if OBSW_THREAD_TRACING == 1 + trace::threadTrace(opCounter, "PLOC MPSOC Helper"); +#endif switch (internalState) { case InternalState::IDLE: { semaphore.acquire(); diff --git a/linux/devices/ploc/PlocMPSoCHelper.h b/linux/devices/ploc/PlocMPSoCHelper.h index c39cc758..dea35a82 100644 --- a/linux/devices/ploc/PlocMPSoCHelper.h +++ b/linux/devices/ploc/PlocMPSoCHelper.h @@ -11,6 +11,7 @@ #include "fsfw/tmtcservices/SourceSequenceCounter.h" #include "fsfw_hal/linux/serial/SerialComIF.h" #include "linux/devices/devicedefinitions/PlocMPSoCDefinitions.h" +#include "mission/trace.h" #ifdef XIPHOS_Q7S #include "bsp_q7s/fs/SdCardManager.h" #endif @@ -116,6 +117,10 @@ class PlocMPSoCHelper : public SystemObject, public ExecutableObjectIF { struct FlashWrite flashWrite; +#if OBSW_THREAD_TRACING == 1 + uint32_t opCounter = 0; +#endif + enum class InternalState { IDLE, FLASH_WRITE, FLASH_READ }; InternalState internalState = InternalState::IDLE; diff --git a/linux/devices/ploc/PlocSupvUartMan.cpp b/linux/devices/ploc/PlocSupvUartMan.cpp index 1fd2b841..5113de40 100644 --- a/linux/devices/ploc/PlocSupvUartMan.cpp +++ b/linux/devices/ploc/PlocSupvUartMan.cpp @@ -101,6 +101,9 @@ ReturnValue_t PlocSupvUartManager::performOperation(uint8_t operationCode) { lock->unlockMutex(); semaphore->acquire(); putTaskToSleep = false; +#if OBSW_THREAD_TRACING == 1 + trace::threadTrace(opCounter, "PLOC SUPV Helper PST"); +#endif while (true) { if (putTaskToSleep) { performUartShutdown(); diff --git a/linux/devices/ploc/PlocSupvUartMan.h b/linux/devices/ploc/PlocSupvUartMan.h index e1539c97..b787815f 100644 --- a/linux/devices/ploc/PlocSupvUartMan.h +++ b/linux/devices/ploc/PlocSupvUartMan.h @@ -7,6 +7,7 @@ #include #include "OBSWConfig.h" +#include "mission/trace.h" #include "fsfw/container/FIFO.h" #include "fsfw/devicehandlers/CookieIF.h" #include "fsfw/objectmanager/SystemObject.h" @@ -15,6 +16,7 @@ #include "fsfw/tasks/ExecutableObjectIF.h" #include "fsfw_hal/linux/serial/SerialComIF.h" #include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h" +#include "mission/trace.h" #include "tas/crc.h" #ifdef XIPHOS_Q7S @@ -211,6 +213,9 @@ class PlocSupvUartManager : public DeviceCommunicationIF, supv::TmBase tmReader; int serialPort = 0; struct termios tty = {}; +#if OBSW_THREAD_TRACING == 1 + uint32_t opCounter = 0; +#endif struct EventBufferRequest { std::string path = ""; diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index 72589fcc..051fa8f0 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -4,7 +4,6 @@ #include "mission/acsDefs.h" #include "mission/config/torquer.h" -#include "mission/trace.h" AcsController::AcsController(object_id_t objectId) : ExtendedControllerBase(objectId), diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h index 14972b3e..f5240b74 100644 --- a/mission/controller/AcsController.h +++ b/mission/controller/AcsController.h @@ -6,7 +6,6 @@ #include #include -#include "OBSWConfig.h" #include "acs/ActuatorCmd.h" #include "acs/Guidance.h" #include "acs/Navigation.h" @@ -20,6 +19,7 @@ #include "fsfw_hal/devicehandlers/MgmRM3100Handler.h" #include "mission/devices/devicedefinitions/SusDefinitions.h" #include "mission/devices/devicedefinitions/imtqHandlerDefinitions.h" +#include "mission/trace.h" class AcsController : public ExtendedControllerBase, public ReceivesParameterMessagesIF { public: diff --git a/mission/devices/BpxBatteryHandler.cpp b/mission/devices/BpxBatteryHandler.cpp index efda26f8..922bcd3b 100644 --- a/mission/devices/BpxBatteryHandler.cpp +++ b/mission/devices/BpxBatteryHandler.cpp @@ -2,8 +2,6 @@ #include -#include "mission/trace.h" - BpxBatteryHandler::BpxBatteryHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie) : DeviceHandlerBase(objectId, comIF, comCookie), hkSet(this), cfgSet(this) {} diff --git a/mission/devices/BpxBatteryHandler.h b/mission/devices/BpxBatteryHandler.h index 31448799..c42ed7fd 100644 --- a/mission/devices/BpxBatteryHandler.h +++ b/mission/devices/BpxBatteryHandler.h @@ -3,8 +3,8 @@ #include -#include "OBSWConfig.h" #include "devicedefinitions/BpxBatteryDefinitions.h" +#include "mission/trace.h" class BpxBatteryHandler : public DeviceHandlerBase { public: diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index 2eacdea4..cb8658bc 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -11,6 +11,7 @@ #include "fsfw/ipc/QueueFactory.h" #include "fsfw/objectmanager/ObjectManager.h" #include "fsfw_hal/common/gpio/GpioCookie.h" +#include "mission/trace.h" static constexpr bool DEBUG_MODE = true; diff --git a/mission/devices/SolarArrayDeploymentHandler.h b/mission/devices/SolarArrayDeploymentHandler.h index 27c466f1..61211ca3 100644 --- a/mission/devices/SolarArrayDeploymentHandler.h +++ b/mission/devices/SolarArrayDeploymentHandler.h @@ -19,6 +19,7 @@ #include "fsfw/timemanager/Countdown.h" #include "fsfw_hal/common/gpio/GpioIF.h" #include "mission/memory/SdCardMountedIF.h" +#include "mission/trace.h" #include "returnvalues/classIds.h" enum DeploymentChannels : uint8_t { SA_1 = 1, SA_2 = 2 }; @@ -173,7 +174,7 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, ActionId_t activeCmd = HasActionsIF::INVALID_ACTION_ID; std::optional initUptime; #if OBSW_THREAD_TRACING == 1 - uint32_t opCounter; + uint32_t opCounter = 0; #endif PeriodicOperationDivider opDivider = PeriodicOperationDivider(5); uint8_t retryCounter = 3; diff --git a/mission/trace.h b/mission/trace.h index a3fabbd9..6f20a698 100644 --- a/mission/trace.h +++ b/mission/trace.h @@ -3,6 +3,8 @@ #include +#define OBSW_THREAD_TRACING 1 + namespace trace { void threadTrace(uint32_t& counter, const char* name); From a57384f6c43a20281884cde5cd984af71ed89b0f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Feb 2023 11:11:06 +0100 Subject: [PATCH 313/330] trace has settable div --- mission/trace.cpp | 4 ++-- mission/trace.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mission/trace.cpp b/mission/trace.cpp index f12e5902..6c9af0af 100644 --- a/mission/trace.cpp +++ b/mission/trace.cpp @@ -2,9 +2,9 @@ #include "fsfw/serviceinterface.h" -void trace::threadTrace(uint32_t& counter, const char* name) { +void trace::threadTrace(uint32_t& counter, const char* name, unsigned div) { counter++; - if (counter % 5 == 0) { + if (counter % div == 0) { sif::debug << name << " running" << std::endl; } } diff --git a/mission/trace.h b/mission/trace.h index 6f20a698..59fdd99e 100644 --- a/mission/trace.h +++ b/mission/trace.h @@ -7,7 +7,7 @@ namespace trace { -void threadTrace(uint32_t& counter, const char* name); +void threadTrace(uint32_t& counter, const char* name, unsigned div = 5); } From 9b2398888dfd11a8e4e5093492067b7bbca81d5b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Feb 2023 11:18:51 +0100 Subject: [PATCH 314/330] add some more traces --- linux/devices/GpsHyperionLinuxController.cpp | 3 +++ linux/devices/GpsHyperionLinuxController.h | 4 ++++ linux/devices/ploc/PlocSupvUartMan.h | 1 - mission/controller/ThermalController.cpp | 3 +++ mission/controller/ThermalController.h | 7 ++++++- 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/linux/devices/GpsHyperionLinuxController.cpp b/linux/devices/GpsHyperionLinuxController.cpp index afc76fcf..a6e0a1a3 100644 --- a/linux/devices/GpsHyperionLinuxController.cpp +++ b/linux/devices/GpsHyperionLinuxController.cpp @@ -102,6 +102,9 @@ ReturnValue_t GpsHyperionLinuxController::performOperation(uint8_t opCode) { handleQueue(); poolManager.performHkOperation(); while (true) { +#if OBSW_THREAD_TRACING == 1 + trace::threadTrace(opCounter, "GPS CTRL"); +#endif bool callAgainImmediately = readGpsDataFromGpsd(); if (not callAgainImmediately) { handleQueue(); diff --git a/linux/devices/GpsHyperionLinuxController.h b/linux/devices/GpsHyperionLinuxController.h index 5d4a35ff..1e97bc29 100644 --- a/linux/devices/GpsHyperionLinuxController.h +++ b/linux/devices/GpsHyperionLinuxController.h @@ -6,6 +6,7 @@ #include "fsfw/controller/ExtendedControllerBase.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h" #include "mission/devices/devicedefinitions/GPSDefinitions.h" +#include "mission/trace.h" #ifdef FSFW_OSAL_LINUX #include @@ -60,6 +61,9 @@ class GpsHyperionLinuxController : public ExtendedControllerBase { Countdown maxTimeToReachFix = Countdown(MAX_SECONDS_TO_REACH_FIX * 1000); bool modeCommanded = false; bool timeInit = false; +#if OBSW_THREAD_TRACING == 1 + uint32_t opCounter = 0; +#endif struct OneShotSwitches { void reset() { diff --git a/linux/devices/ploc/PlocSupvUartMan.h b/linux/devices/ploc/PlocSupvUartMan.h index b787815f..02bfb6c7 100644 --- a/linux/devices/ploc/PlocSupvUartMan.h +++ b/linux/devices/ploc/PlocSupvUartMan.h @@ -7,7 +7,6 @@ #include #include "OBSWConfig.h" -#include "mission/trace.h" #include "fsfw/container/FIFO.h" #include "fsfw/devicehandlers/CookieIF.h" #include "fsfw/objectmanager/SystemObject.h" diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 0521d9aa..53b7f13d 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -72,6 +72,9 @@ ReturnValue_t ThermalController::handleCommandMessage(CommandMessage* message) { } void ThermalController::performControlOperation() { +#if OBSW_THREAD_TRACING == 1 + trace::threadTrace(opCounter, "TCS Task"); +#endif switch (internalState) { case InternalState::STARTUP: { initialCountdown.resetTimer(); diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 03c7954c..6297b175 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -11,7 +11,8 @@ #include -#include "../devices/HeaterHandler.h" +#include "mission/devices/HeaterHandler.h" +#include "mission/trace.h" /** * NOP Limit: Hard limit for device, usually from datasheet. Device damage is possible lif NOP limit @@ -152,6 +153,10 @@ class ThermalController : public ExtendedControllerBase { // Initial delay to make sure all pool variables have been initialized their owners Countdown initialCountdown = Countdown(DELAY); +#if OBSW_THREAD_TRACING == 1 + uint32_t opCounter = 0; +#endif + std::array, 5> sensors; uint8_t numSensors = 0; From ecb22bdd85655d93e673646fe108a666daaee690 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Feb 2023 11:32:03 +0100 Subject: [PATCH 315/330] further cut down the number of threads --- bsp_q7s/core/scheduling.cpp | 56 ++++++++++++------------------- linux/scheduling.cpp | 66 ++++++++++++++++++------------------- linux/scheduling.h | 4 +-- 3 files changed, 56 insertions(+), 70 deletions(-) diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index 5abe3fd5..2fa8f015 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -154,6 +154,14 @@ void scheduling::initTasks() { if (result != returnvalue::OK) { scheduling::printAddObjectError("PL_SUBSYSTEM", objects::PL_SUBSYSTEM); } + result = genericSysTask->addComponent(objects::INTERNAL_ERROR_REPORTER); + if (result != returnvalue::OK) { + scheduling::printAddObjectError("ERROR_REPORTER", objects::INTERNAL_ERROR_REPORTER); + } + result = genericSysTask->addComponent(objects::PUS_SERVICE_17_TEST); + if (result != returnvalue::OK) { + scheduling::printAddObjectError("PUS_17", objects::PUS_SERVICE_17_TEST); + } #if OBSW_ADD_CCSDS_IP_CORES == 1 result = genericSysTask->addComponent(objects::CCSDS_HANDLER); @@ -266,14 +274,16 @@ void scheduling::initTasks() { #endif /* OBSW_ADD_PLOC_SUPERVISOR */ PeriodicTaskIF* plTask = factory->createPeriodicTask( - "PL_TASK", 25, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, missedDeadlineFunc); - scheduling::addMpsocSupvHandlers(plTask); + "PL_TASK", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc); plTask->addComponent(objects::CAM_SWITCHER); + scheduling::addMpsocSupvHandlers(plTask); +#if OBSW_ADD_SCEX_DEVICE == 1 + scheduling::scheduleScexDev(plTask); +#endif #if OBSW_ADD_SCEX_DEVICE == 1 - PeriodicTaskIF* scexDevHandler; PeriodicTaskIF* scexReaderTask; - scheduling::schedulingScex(*factory, scexDevHandler, scexReaderTask); + scheduling::scheduleScexReader(*factory, scexReaderTask); #endif std::vector pusTasks; @@ -330,7 +340,6 @@ void scheduling::initTasks() { taskStarter(pstTasks, "PST task vector"); taskStarter(pusTasks, "PUS task vector"); #if OBSW_ADD_SCEX_DEVICE == 1 - scexDevHandler->startTask(); scexReaderTask->startTask(); #endif @@ -435,42 +444,28 @@ void scheduling::createPusTasks(TaskFactory& factory, TaskDeadlineMissedFunction std::vector& taskVec) { ReturnValue_t result = returnvalue::OK; /* PUS Services */ - PeriodicTaskIF* pusVerification = factory.createPeriodicTask( - "PUS_VERIF", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc); - result = pusVerification->addComponent(objects::PUS_SERVICE_1_VERIFICATION); + PeriodicTaskIF* pusHighPrio = factory.createPeriodicTask( + "PUS_HIGH_PRIO", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc); + result = pusHighPrio->addComponent(objects::PUS_SERVICE_1_VERIFICATION); if (result != returnvalue::OK) { scheduling::printAddObjectError("PUS_VERIF", objects::PUS_SERVICE_1_VERIFICATION); } - taskVec.push_back(pusVerification); - - PeriodicTaskIF* pusEvents = factory.createPeriodicTask( - "PUS_EVENTS", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc); - result = pusEvents->addComponent(objects::PUS_SERVICE_5_EVENT_REPORTING); + result = pusHighPrio->addComponent(objects::PUS_SERVICE_5_EVENT_REPORTING); if (result != returnvalue::OK) { scheduling::printAddObjectError("PUS_EVENTS", objects::PUS_SERVICE_5_EVENT_REPORTING); } - result = pusEvents->addComponent(objects::EVENT_MANAGER); + result = pusHighPrio->addComponent(objects::EVENT_MANAGER); if (result != returnvalue::OK) { scheduling::printAddObjectError("PUS_MGMT", objects::EVENT_MANAGER); } - taskVec.push_back(pusEvents); - - PeriodicTaskIF* pusHighPrio = factory.createPeriodicTask( - "PUS_HIGH_PRIO", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc); - result = pusHighPrio->addComponent(objects::PUS_SERVICE_2_DEVICE_ACCESS); - if (result != returnvalue::OK) { - scheduling::printAddObjectError("PUS_2", objects::PUS_SERVICE_2_DEVICE_ACCESS); - } result = pusHighPrio->addComponent(objects::PUS_SERVICE_9_TIME_MGMT); if (result != returnvalue::OK) { scheduling::printAddObjectError("PUS_9", objects::PUS_SERVICE_9_TIME_MGMT); } - taskVec.push_back(pusHighPrio); PeriodicTaskIF* pusMedPrio = factory.createPeriodicTask( "PUS_MED_PRIO", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc); - result = pusMedPrio->addComponent(objects::PUS_SERVICE_3_HOUSEKEEPING); if (result != returnvalue::OK) { scheduling::printAddObjectError("PUS_3", objects::PUS_SERVICE_3_HOUSEKEEPING); @@ -495,20 +490,11 @@ void scheduling::createPusTasks(TaskFactory& factory, TaskDeadlineMissedFunction if (result != returnvalue::OK) { scheduling::printAddObjectError("PUS_201", objects::PUS_SERVICE_201_HEALTH); } - // Used for connection tests, therefore use higher priority - result = pusMedPrio->addComponent(objects::PUS_SERVICE_17_TEST); + result = pusMedPrio->addComponent(objects::PUS_SERVICE_2_DEVICE_ACCESS); if (result != returnvalue::OK) { - scheduling::printAddObjectError("PUS_17", objects::PUS_SERVICE_17_TEST); + scheduling::printAddObjectError("PUS_2", objects::PUS_SERVICE_2_DEVICE_ACCESS); } taskVec.push_back(pusMedPrio); - - PeriodicTaskIF* pusLowPrio = factory.createPeriodicTask( - "PUS_LOW_PRIO", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.6, missedDeadlineFunc); - result = pusLowPrio->addComponent(objects::INTERNAL_ERROR_REPORTER); - if (result != returnvalue::OK) { - scheduling::printAddObjectError("ERROR_REPORTER", objects::INTERNAL_ERROR_REPORTER); - } - taskVec.push_back(pusLowPrio); } void scheduling::createTestTasks(TaskFactory& factory, diff --git a/linux/scheduling.cpp b/linux/scheduling.cpp index f2e6ddec..85394dea 100644 --- a/linux/scheduling.cpp +++ b/linux/scheduling.cpp @@ -8,8 +8,7 @@ #include "ObjectFactory.h" #include "eive/objects.h" -void scheduling::schedulingScex(TaskFactory& factory, PeriodicTaskIF*& scexDevHandler, - PeriodicTaskIF*& scexReaderTask) { +void scheduling::scheduleScexReader(TaskFactory& factory, PeriodicTaskIF*& scexReaderTask) { using namespace scheduling; ReturnValue_t result = returnvalue::OK; #if OBSW_PRINT_MISSED_DEADLINES == 1 @@ -17,37 +16,6 @@ void scheduling::schedulingScex(TaskFactory& factory, PeriodicTaskIF*& scexDevHa #else void (*missedDeadlineFunc)(void) = nullptr; #endif - scexDevHandler = factory.createPeriodicTask( - "SCEX_DEV", 35, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.5, missedDeadlineFunc); - - result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::PERFORM_OPERATION); - if (result != returnvalue::OK) { - printAddObjectError("SCEX_DEV", objects::SCEX); - } - result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::SEND_WRITE); - if (result != returnvalue::OK) { - printAddObjectError("SCEX_DEV", objects::SCEX); - } - result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::GET_WRITE); - if (result != returnvalue::OK) { - printAddObjectError("SCEX_DEV", objects::SCEX); - } - result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::SEND_READ); - if (result != returnvalue::OK) { - printAddObjectError("SCEX_DEV", objects::SCEX); - } - result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::GET_READ); - if (result != returnvalue::OK) { - printAddObjectError("SCEX_DEV", objects::SCEX); - } - result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::SEND_READ); - if (result != returnvalue::OK) { - printAddObjectError("SCEX_DEV", objects::SCEX); - } - result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::GET_READ); - if (result != returnvalue::OK) { - printAddObjectError("SCEX_DEV", objects::SCEX); - } result = returnvalue::OK; scexReaderTask = factory.createPeriodicTask( @@ -79,3 +47,35 @@ void scheduling::addMpsocSupvHandlers(PeriodicTaskIF* plTask) { plTask->addComponent(objects::PLOC_MPSOC_HANDLER, DeviceHandlerIF::GET_READ); #endif } + +void scheduling::scheduleScexDev(PeriodicTaskIF*& scexDevHandler) { + ReturnValue_t result = + scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::PERFORM_OPERATION); + if (result != returnvalue::OK) { + printAddObjectError("SCEX_DEV", objects::SCEX); + } + result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::SEND_WRITE); + if (result != returnvalue::OK) { + printAddObjectError("SCEX_DEV", objects::SCEX); + } + result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::GET_WRITE); + if (result != returnvalue::OK) { + printAddObjectError("SCEX_DEV", objects::SCEX); + } + result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::SEND_READ); + if (result != returnvalue::OK) { + printAddObjectError("SCEX_DEV", objects::SCEX); + } + result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::GET_READ); + if (result != returnvalue::OK) { + printAddObjectError("SCEX_DEV", objects::SCEX); + } + result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::SEND_READ); + if (result != returnvalue::OK) { + printAddObjectError("SCEX_DEV", objects::SCEX); + } + result = scexDevHandler->addComponent(objects::SCEX, DeviceHandlerIF::GET_READ); + if (result != returnvalue::OK) { + printAddObjectError("SCEX_DEV", objects::SCEX); + } +} diff --git a/linux/scheduling.h b/linux/scheduling.h index d33e9d1f..b5ec8ef2 100644 --- a/linux/scheduling.h +++ b/linux/scheduling.h @@ -3,7 +3,7 @@ #include namespace scheduling { -void schedulingScex(TaskFactory& factory, PeriodicTaskIF*& scexDevHandler, - PeriodicTaskIF*& scexReaderTask); +void scheduleScexDev(PeriodicTaskIF*& scexDevHandler); +void scheduleScexReader(TaskFactory& factory, PeriodicTaskIF*& scexReaderTask); void addMpsocSupvHandlers(PeriodicTaskIF* task); } // namespace scheduling From 2d4c881d3ab84914603494f6ad4d6df71e7713b9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Feb 2023 11:56:40 +0100 Subject: [PATCH 316/330] add missing include --- linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 63b40df2..062bf7e7 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -1,5 +1,7 @@ #include "pollingSequenceFactory.h" +#include "OBSWConfig.h" + #include #include #include From e0c33b21e92b201116f10d3243056da86acb24d0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Feb 2023 13:11:52 +0100 Subject: [PATCH 317/330] remove lwgps dependency --- CHANGELOG.md | 4 ++++ CMakeLists.txt | 2 +- linux/boardtest/UartTestClass.h | 4 ++-- test/TestTask.cpp | 15 +++++++++++---- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f94066d3..f49f4ed4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,10 @@ change warranting a new major release: - Remove 2 TCS threads. - Move low level polling into ACS PST, move high level device handlers into TCS system task. +## Removed + +- lwgps dependency not compiled anymore, is not used + # [v1.27.1] 2023-02-13 ## Fixed diff --git a/CMakeLists.txt b/CMakeLists.txt index 782993be..6d730eab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -204,7 +204,7 @@ set(LIB_FSFW_NAME fsfw) set(LIB_EIVE_MISSION eive-mission) set(LIB_ETL_TARGET etl::etl) set(LIB_CSP_NAME libcsp) -set(LIB_LWGPS_NAME lwgps) +# set(LIB_LWGPS_NAME lwgps) set(LIB_ARCSEC wire) set(LIB_GOMSPACE_CLIENTS gs_clients) set(LIB_GOMSPACE_CSP gs_csp) diff --git a/linux/boardtest/UartTestClass.h b/linux/boardtest/UartTestClass.h index b206de53..6cb0d31c 100644 --- a/linux/boardtest/UartTestClass.h +++ b/linux/boardtest/UartTestClass.h @@ -10,7 +10,7 @@ #include -#include "lwgps/lwgps.h" +//#include "lwgps/lwgps.h" #include "mission/devices/devicedefinitions/ScexDefinitions.h" #include "test/TestTask.h" @@ -59,7 +59,7 @@ class UartTestClass : public TestTask { DleEncoder dleEncoder = DleEncoder(); SerialCookie* uartCookie = nullptr; size_t encodedLen = 0; - lwgps_t gpsData = {}; + //lwgps_t gpsData = {}; struct termios tty = {}; int serialPort = 0; bool startFound = false; diff --git a/test/TestTask.cpp b/test/TestTask.cpp index 634fdd0d..33af5494 100644 --- a/test/TestTask.cpp +++ b/test/TestTask.cpp @@ -41,11 +41,15 @@ ReturnValue_t EiveTestTask::performOperation(uint8_t operationCode) { } #include -#include + + +// #include + /** * @brief Dummy data from GPS receiver. Will be replaced witgh hyperion data later. */ + const char gps_rx_data[] = "" "$GPRMC,183729,A,3907.356,N,12102.482,W,000.0,360.0,080301,015.5,E*6F\r\n" @@ -72,6 +76,7 @@ const char hyperion_gps_data[] = "$GNVTG,040.7,T,,M,000.0,N,000.0,K,A*10\r\n" "$GNZDA,173225.998892,27,02,2021,00,00*75\r\n"; + ReturnValue_t EiveTestTask::performOneShotAction() { #if OBSW_ADD_TEST_CODE == 1 // performLwgpsTest(); @@ -96,20 +101,22 @@ ReturnValue_t EiveTestTask::performActionB() { return result; } +/* void EiveTestTask::performLwgpsTest() { - /* Everything here will only be performed once. */ + // Everything here will only be performed once. sif::info << "Processing sample GPS output.." << std::endl; lwgps_t gpsStruct; sif::info << "Size of GPS struct: " << sizeof(gpsStruct) << std::endl; lwgps_init(&gpsStruct); - /* Process all input data */ + // Process all input data lwgps_process(&gpsStruct, hyperion_gps_data, strlen(hyperion_gps_data)); - /* Print messages */ + // Print messages printf("Valid status: %d\n", gpsStruct.is_valid); printf("Latitude: %f degrees\n", gpsStruct.latitude); printf("Longitude: %f degrees\n", gpsStruct.longitude); printf("Altitude: %f meters\n", gpsStruct.altitude); } +*/ From 3da5f1d6cc9b8240fe456c2abadf725193552a12 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Feb 2023 13:13:16 +0100 Subject: [PATCH 318/330] update .cproject file --- misc/eclipse/.cproject | 90 ++++++++++++++++++++++++++---------------- 1 file changed, 57 insertions(+), 33 deletions(-) diff --git a/misc/eclipse/.cproject b/misc/eclipse/.cproject index aaecb53e..0dfd812a 100644 --- a/misc/eclipse/.cproject +++ b/misc/eclipse/.cproject @@ -57,7 +57,7 @@ - + @@ -119,7 +119,7 @@ - + @@ -187,7 +187,7 @@ - + @@ -255,7 +255,7 @@ - + @@ -418,7 +418,7 @@ - + @@ -580,7 +580,7 @@ - + @@ -750,7 +750,7 @@ - + @@ -917,7 +917,7 @@ - + @@ -1084,7 +1084,7 @@ - + @@ -1149,7 +1149,7 @@ - + @@ -1317,7 +1317,7 @@ - + @@ -1386,7 +1386,7 @@ - + @@ -1451,18 +1451,9 @@ - - - - - - - - - @@ -1478,6 +1469,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1490,25 +1523,16 @@ - - - - + - + - - - - - - - + From ef09cdabc27bdcb9dbe73a4374359aae6c03c025 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Feb 2023 13:15:12 +0100 Subject: [PATCH 319/330] remove lwgps properly --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d730eab..a1f0b37d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -204,7 +204,7 @@ set(LIB_FSFW_NAME fsfw) set(LIB_EIVE_MISSION eive-mission) set(LIB_ETL_TARGET etl::etl) set(LIB_CSP_NAME libcsp) -# set(LIB_LWGPS_NAME lwgps) +set(LIB_LWGPS_NAME lwgps) set(LIB_ARCSEC wire) set(LIB_GOMSPACE_CLIENTS gs_clients) set(LIB_GOMSPACE_CSP gs_csp) @@ -424,7 +424,6 @@ add_subdirectory(${BSP_PATH}) add_subdirectory(${COMMON_PATH}) add_subdirectory(${DUMMY_PATH}) -add_subdirectory(${LIB_LWGPS_PATH}) add_subdirectory(${FSFW_PATH}) add_subdirectory(${LIB_EIVE_MISSION_PATH}) add_subdirectory(${TEST_PATH}) From 1de832509a7d6383abe509145d2107346dbcf4dd Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Feb 2023 13:40:07 +0100 Subject: [PATCH 320/330] do a commit --- mission/devices/ImtqHandler.cpp | 4 ++++ mission/devices/RwHandler.cpp | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/mission/devices/ImtqHandler.cpp b/mission/devices/ImtqHandler.cpp index 0e75c06d..b370b7d9 100644 --- a/mission/devices/ImtqHandler.cpp +++ b/mission/devices/ImtqHandler.cpp @@ -192,6 +192,10 @@ ReturnValue_t ImtqHandler::buildCommandFromCommand(DeviceCommandId_t deviceComma if (result != returnvalue::OK) { return result; } + result = dipoleSet.commit(); + if (result != returnvalue::OK) { + sif::error << "ImtqHandler::buildCommandFromCommand: commit failed" << std::endl; + } } else { // Read set dipole values from local pool PoolReadGuard pg(&dipoleSet); diff --git a/mission/devices/RwHandler.cpp b/mission/devices/RwHandler.cpp index 88857b68..5c6914be 100644 --- a/mission/devices/RwHandler.cpp +++ b/mission/devices/RwHandler.cpp @@ -102,7 +102,6 @@ ReturnValue_t RwHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand return returnvalue::OK; } case (RwDefinitions::SET_SPEED): { - sif::debug << "hello" << std::endl; if (commandData != nullptr && commandDataLen != 6) { sif::error << "RwHandler::buildCommandFromCommand: Received set speed command with" << " invalid length" << std::endl; @@ -117,6 +116,10 @@ ReturnValue_t RwHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand if (result != returnvalue::OK) { return result; } + result = rwSpeedActuationSet.commit(); + if (result != returnvalue::OK) { + sif::error << "RwHandler::buildCommandFromCommand: commit failed" << std::endl; + } } else { // Read set rw speed value from local pool PoolReadGuard pg(&rwSpeedActuationSet); From 16eab6b26680c44df7d4ab493296ffe6eb8ea58d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Feb 2023 14:01:16 +0100 Subject: [PATCH 321/330] update forwarding scripts for UDP --- scripts/q7s-em-udp-forwarding.sh | 8 ++++++++ scripts/q7s-fm-udp-forwarding.sh | 8 ++++++++ scripts/q7s-ssh-udp-forwarding.sh | 8 -------- 3 files changed, 16 insertions(+), 8 deletions(-) create mode 100755 scripts/q7s-em-udp-forwarding.sh create mode 100755 scripts/q7s-fm-udp-forwarding.sh delete mode 100755 scripts/q7s-ssh-udp-forwarding.sh diff --git a/scripts/q7s-em-udp-forwarding.sh b/scripts/q7s-em-udp-forwarding.sh new file mode 100755 index 00000000..22830efe --- /dev/null +++ b/scripts/q7s-em-udp-forwarding.sh @@ -0,0 +1,8 @@ +#!/bin/bash +echo "Q7S UDP connection from local port 18000 -> TCP ssh tunnel -> EM port 7301" + + +socat udp4-listen:18000,reuseaddr,fork tcp:localhost:18002 & +ssh -L 18002:localhost:18123 eive@flatsat.eive.absatvirt.lw \ + 'CONSOLE_PREFIX="[Q7S EM UDP Tunnel]" \ + /bin/bash && socat tcp4-listen:18123,reuseaddr udp:192.168.133.10:7301' diff --git a/scripts/q7s-fm-udp-forwarding.sh b/scripts/q7s-fm-udp-forwarding.sh new file mode 100755 index 00000000..6bb2b3f2 --- /dev/null +++ b/scripts/q7s-fm-udp-forwarding.sh @@ -0,0 +1,8 @@ +#!/bin/bash +echo "Q7S UDP connection from local port 18000 -> TCP ssh tunnel -> FM port 7301" + + +socat udp4-listen:18000,reuseaddr,fork tcp:localhost:18002 & +ssh -L 18002:localhost:18123 eive@flatsat.eive.absatvirt.lw \ + 'CONSOLE_PREFIX="[Q7S FM UDP Tunnel]" \ + /bin/bash && socat tcp4-listen:18123,reuseaddr udp:192.168.155.55:7301' diff --git a/scripts/q7s-ssh-udp-forwarding.sh b/scripts/q7s-ssh-udp-forwarding.sh deleted file mode 100755 index 35303246..00000000 --- a/scripts/q7s-ssh-udp-forwarding.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -echo "Setting up all Q7S ports" -echo "upd connection from local port 18000 -> tcp ssh tunnel -> EM port 7301" - - -socat udp4-listen:18000,reuseaddr,fork tcp:localhost:18002 & -ssh -L 18002:localhost:18123 eive@flatsat.eive.absatvirt.lw 'socat tcp4-listen:18123,reuseaddr udp:192.168.133.10:7301' - From e07492c85515126257dbeccdf6a7eaf230a301cf Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Feb 2023 14:10:37 +0100 Subject: [PATCH 322/330] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 9b7471e9..20e107c7 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 9b7471e9097edd410995ba0c76125b626440d9be +Subproject commit 20e107c7ae373e7f36fca68957dbc36f4dd76f3b From a0d09e7f2352a940810084e9c4aaf4d49879a82f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Feb 2023 14:15:30 +0100 Subject: [PATCH 323/330] go away --- CMakeLists.txt | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a1f0b37d..5ce19479 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -491,7 +491,7 @@ endif() # Add libraries target_link_libraries(${LIB_EIVE_MISSION} - PUBLIC ${LIB_FSFW_NAME} ${LIB_LWGPS_NAME} ${LIB_OS_NAME}) + PUBLIC ${LIB_FSFW_NAME} ${LIB_OS_NAME}) target_link_libraries(${LIB_DUMMIES} PUBLIC ${LIB_FSFW_NAME} ${LIB_JSON_NAME}) diff --git a/tmtc b/tmtc index 9b7471e9..20e107c7 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 9b7471e9097edd410995ba0c76125b626440d9be +Subproject commit 20e107c7ae373e7f36fca68957dbc36f4dd76f3b From 35b9c7a4df590f28e8ed05c18378c74dd120c475 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Feb 2023 14:27:25 +0100 Subject: [PATCH 324/330] bump changelog --- CHANGELOG.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f49f4ed4..d01f4290 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,8 +19,17 @@ change warranting a new major release: ## Changed -- Remove 2 TCS threads. -- Move low level polling into ACS PST, move high level device handlers into TCS system task. +- Remove 2 TCS threads. Move low level polling into ACS PST, move high level device handlers into + TCS system task. +- Further reduce number of threads: + 1. Remove PUS low priority task, move assigned threads to the generic system task + 2. Group events and verification tasks into PUS high priority task + 3. Group all other components into PUS medium priority task + 4. Add SCEX device handler to PL task, remove dedicated thread + +## Added + +- Tracing supports which allows checking whether threads are running as usual. ## Removed From 024e06a3d33cf85303a62083fb027effef155ff7 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Feb 2023 14:28:26 +0100 Subject: [PATCH 325/330] set define to 0 for PR --- mission/trace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/trace.h b/mission/trace.h index 59fdd99e..fbc99d37 100644 --- a/mission/trace.h +++ b/mission/trace.h @@ -3,7 +3,7 @@ #include -#define OBSW_THREAD_TRACING 1 +#define OBSW_THREAD_TRACING 0 namespace trace { From 6f84099c5e5e537a312d6221101f892fc8ef83aa Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Feb 2023 14:29:47 +0100 Subject: [PATCH 326/330] small update and afmt --- CMakeLists.txt | 4 ++-- linux/boardtest/UartTestClass.h | 2 +- linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp | 3 +-- mission/devices/SolarArrayDeploymentHandler.cpp | 5 +---- test/TestTask.cpp | 3 --- 5 files changed, 5 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ce19479..8a8055bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -490,8 +490,8 @@ endif() # ############################################################################## # Add libraries -target_link_libraries(${LIB_EIVE_MISSION} - PUBLIC ${LIB_FSFW_NAME} ${LIB_OS_NAME}) +target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_FSFW_NAME} + ${LIB_OS_NAME}) target_link_libraries(${LIB_DUMMIES} PUBLIC ${LIB_FSFW_NAME} ${LIB_JSON_NAME}) diff --git a/linux/boardtest/UartTestClass.h b/linux/boardtest/UartTestClass.h index 6cb0d31c..fd20e621 100644 --- a/linux/boardtest/UartTestClass.h +++ b/linux/boardtest/UartTestClass.h @@ -59,7 +59,7 @@ class UartTestClass : public TestTask { DleEncoder dleEncoder = DleEncoder(); SerialCookie* uartCookie = nullptr; size_t encodedLen = 0; - //lwgps_t gpsData = {}; + // lwgps_t gpsData = {}; struct termios tty = {}; int serialPort = 0; bool startFound = false; diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 062bf7e7..d8df8e9a 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -1,12 +1,11 @@ #include "pollingSequenceFactory.h" -#include "OBSWConfig.h" - #include #include #include #include +#include "OBSWConfig.h" #include "eive/definitions.h" #include "mission/devices/devicedefinitions/Max31865Definitions.h" diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index cb8658bc..77c826fd 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -39,10 +39,7 @@ SolarArrayDeploymentHandler::~SolarArrayDeploymentHandler() = default; ReturnValue_t SolarArrayDeploymentHandler::performOperation(uint8_t operationCode) { using namespace std::filesystem; #if OBSW_THREAD_TRACING == 1 - opCounter++; - if (opCounter % 5 == 0) { - sif::debug << "SA DEPL task running" << std::endl; - } + trace::threadTrace(opCounter, "SA DEPL"); #endif if (opDivider.checkAndIncrement()) { auto activeSdc = sdcMan.getActiveSdCard(); diff --git a/test/TestTask.cpp b/test/TestTask.cpp index 33af5494..2c6cb015 100644 --- a/test/TestTask.cpp +++ b/test/TestTask.cpp @@ -42,10 +42,8 @@ ReturnValue_t EiveTestTask::performOperation(uint8_t operationCode) { #include - // #include - /** * @brief Dummy data from GPS receiver. Will be replaced witgh hyperion data later. */ @@ -76,7 +74,6 @@ const char hyperion_gps_data[] = "$GNVTG,040.7,T,,M,000.0,N,000.0,K,A*10\r\n" "$GNZDA,173225.998892,27,02,2021,00,00*75\r\n"; - ReturnValue_t EiveTestTask::performOneShotAction() { #if OBSW_ADD_TEST_CODE == 1 // performLwgpsTest(); From d506b515fc63476304e2d7934096549ecce2fa13 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Feb 2023 14:33:12 +0100 Subject: [PATCH 327/330] bump fsfw --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index d256ede8..9de6c4b3 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit d256ede8c1d8e7a746d3a56d45313d2b863e0b28 +Subproject commit 9de6c4b3aa20ee63c28051d486be8a12df147f22 From 918cd7b237be07ca6ca3a3568eac58cb2eb6377d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Feb 2023 14:38:33 +0100 Subject: [PATCH 328/330] small tweak for scripts, bump fsfw --- fsfw | 2 +- scripts/q7s-em-udp-forwarding.sh | 3 +-- scripts/q7s-fm-udp-forwarding.sh | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/fsfw b/fsfw index d256ede8..9de6c4b3 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit d256ede8c1d8e7a746d3a56d45313d2b863e0b28 +Subproject commit 9de6c4b3aa20ee63c28051d486be8a12df147f22 diff --git a/scripts/q7s-em-udp-forwarding.sh b/scripts/q7s-em-udp-forwarding.sh index 22830efe..284e7889 100755 --- a/scripts/q7s-em-udp-forwarding.sh +++ b/scripts/q7s-em-udp-forwarding.sh @@ -4,5 +4,4 @@ echo "Q7S UDP connection from local port 18000 -> TCP ssh tunnel -> EM port 7301 socat udp4-listen:18000,reuseaddr,fork tcp:localhost:18002 & ssh -L 18002:localhost:18123 eive@flatsat.eive.absatvirt.lw \ - 'CONSOLE_PREFIX="[Q7S EM UDP Tunnel]" \ - /bin/bash && socat tcp4-listen:18123,reuseaddr udp:192.168.133.10:7301' + 'socat tcp4-listen:18123,reuseaddr udp:192.168.133.10:7301' diff --git a/scripts/q7s-fm-udp-forwarding.sh b/scripts/q7s-fm-udp-forwarding.sh index 6bb2b3f2..34c8421f 100755 --- a/scripts/q7s-fm-udp-forwarding.sh +++ b/scripts/q7s-fm-udp-forwarding.sh @@ -4,5 +4,4 @@ echo "Q7S UDP connection from local port 18000 -> TCP ssh tunnel -> FM port 7301 socat udp4-listen:18000,reuseaddr,fork tcp:localhost:18002 & ssh -L 18002:localhost:18123 eive@flatsat.eive.absatvirt.lw \ - 'CONSOLE_PREFIX="[Q7S FM UDP Tunnel]" \ - /bin/bash && socat tcp4-listen:18123,reuseaddr udp:192.168.155.55:7301' + 'socat tcp4-listen:18123,reuseaddr udp:192.168.155.55:7301' From 166fd77f7b6a17486d9fc43813183ab63e76cb88 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Feb 2023 18:41:43 +0100 Subject: [PATCH 329/330] stupid RW --- bsp_q7s/core/ObjectFactory.cpp | 4 +- .../pollingSequenceFactory.cpp | 148 +++++++++--------- mission/devices/ImtqHandler.cpp | 26 ++- mission/devices/RwHandler.cpp | 48 +++--- mission/devices/RwHandler.h | 9 +- 5 files changed, 116 insertions(+), 119 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 2bf36743..2631a628 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -683,8 +683,8 @@ void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF, RwDefinitions::MAX_REPLY_SIZE, spi::RW_MODE, spi::RW_SPEED, &rwSpiCallback::spiCallback, nullptr); auto* rwHandler = new RwHandler(rwIds[idx], objects::SPI_RW_COM_IF, rwCookies[idx], gpioComIF, - rwGpioIds[idx]); - rwCookies[idx]->setCallbackArgs(rws[idx]); + rwGpioIds[idx], idx); + rwCookies[idx]->setCallbackArgs(rwHandler); #if OBSW_TEST_RW == 1 rws[idx]->setStartUpImmediately(); #endif diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index e404cdf7..7e4cafeb 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -633,80 +633,80 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg } if (cfg.scheduleRws) { - thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - - thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::SEND_WRITE); - - thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::GET_WRITE); - - thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::SEND_READ); - - thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - - thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::SEND_WRITE); - - thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::GET_WRITE); - - thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::SEND_READ); - - thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - - thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::SEND_WRITE); - - thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::GET_WRITE); - - thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::SEND_READ); - - thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::GET_READ); + // thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + // thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + // thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + // thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + // + // thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::SEND_WRITE); + // thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::SEND_WRITE); + // thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::SEND_WRITE); + // thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::SEND_WRITE); + // + // thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::GET_WRITE); + // thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::GET_WRITE); + // thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::GET_WRITE); + // thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::GET_WRITE); + // + // thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::SEND_READ); + // thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::SEND_READ); + // thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::SEND_READ); + // thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::SEND_READ); + // + // thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::GET_READ); + // thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::GET_READ); + // thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::GET_READ); + // thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::GET_READ); + // + // thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + // thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + // thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + // thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + // + // thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::SEND_WRITE); + // thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::SEND_WRITE); + // thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::SEND_WRITE); + // thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::SEND_WRITE); + // + // thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::GET_WRITE); + // thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::GET_WRITE); + // thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::GET_WRITE); + // thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::GET_WRITE); + // + // thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::SEND_READ); + // thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::SEND_READ); + // thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::SEND_READ); + // thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::SEND_READ); + // + // thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::GET_READ); + // thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::GET_READ); + // thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::GET_READ); + // thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::GET_READ); + // + // thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + // thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + // thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + // thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + // + // thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::SEND_WRITE); + // thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::SEND_WRITE); + // thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::SEND_WRITE); + // thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::SEND_WRITE); + // + // thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::GET_WRITE); + // thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::GET_WRITE); + // thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::GET_WRITE); + // thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::GET_WRITE); + // + // thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::SEND_READ); + // thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::SEND_READ); + // thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::SEND_READ); + // thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::SEND_READ); + // + // thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::GET_READ); + // thisSequence->addSlot(objects::RW2, length * 0, DeviceHandlerIF::GET_READ); + // thisSequence->addSlot(objects::RW3, length * 0, DeviceHandlerIF::GET_READ); + // thisSequence->addSlot(objects::RW4, length * 0, DeviceHandlerIF::GET_READ); } if (cfg.scheduleRws) { diff --git a/mission/devices/ImtqHandler.cpp b/mission/devices/ImtqHandler.cpp index b370b7d9..93e9dae8 100644 --- a/mission/devices/ImtqHandler.cpp +++ b/mission/devices/ImtqHandler.cpp @@ -183,22 +183,20 @@ ReturnValue_t ImtqHandler::buildCommandFromCommand(DeviceCommandId_t deviceComma return DeviceHandlerIF::INVALID_COMMAND_PARAMETER; } ReturnValue_t result; - // Commands override anything which was set in the software - if (commandData != nullptr) { - dipoleSet.setValidityBufferGeneration(false); - result = - dipoleSet.deSerialize(&commandData, &commandDataLen, SerializeIF::Endianness::NETWORK); - dipoleSet.setValidityBufferGeneration(true); - if (result != returnvalue::OK) { - return result; - } - result = dipoleSet.commit(); - if (result != returnvalue::OK) { - sif::error << "ImtqHandler::buildCommandFromCommand: commit failed" << std::endl; - } - } else { + { // Read set dipole values from local pool PoolReadGuard pg(&dipoleSet); + + // Commands override anything which was set in the software + if (commandData != nullptr) { + dipoleSet.setValidityBufferGeneration(false); + result = dipoleSet.deSerialize(&commandData, &commandDataLen, + SerializeIF::Endianness::NETWORK); + dipoleSet.setValidityBufferGeneration(true); + if (result != returnvalue::OK) { + return result; + } + } } if (ACTUATION_WIRETAPPING) { sif::debug << "Actuating IMTQ with parameters x = " << dipoleSet.xDipole.value diff --git a/mission/devices/RwHandler.cpp b/mission/devices/RwHandler.cpp index 5c6914be..9d4a7255 100644 --- a/mission/devices/RwHandler.cpp +++ b/mission/devices/RwHandler.cpp @@ -7,14 +7,15 @@ #include "OBSWConfig.h" RwHandler::RwHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, - GpioIF* gpioComIF, gpioId_t enableGpio) + GpioIF* gpioComIF, gpioId_t enableGpio, uint8_t rwIdx) : DeviceHandlerBase(objectId, comIF, comCookie), gpioComIF(gpioComIF), enableGpio(enableGpio), statusSet(this), lastResetStatusSet(this), tmDataset(this), - rwSpeedActuationSet(*this) { + rwSpeedActuationSet(*this), + rwIdx(rwIdx) { if (comCookie == nullptr) { sif::error << "RwHandler: Invalid com cookie" << std::endl; } @@ -43,6 +44,10 @@ void RwHandler::doShutDown() { ReturnValue_t RwHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { switch (internalState) { + case InternalState::SET_SPEED: + *id = RwDefinitions::SET_SPEED; + internalState = InternalState::GET_RESET_STATUS; + break; case InternalState::GET_RESET_STATUS: *id = RwDefinitions::GET_LAST_RESET_STATUS; internalState = InternalState::READ_TEMPERATURE; @@ -53,10 +58,6 @@ ReturnValue_t RwHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { break; case InternalState::GET_RW_SATUS: *id = RwDefinitions::GET_RW_STATUS; - internalState = InternalState::SET_SPEED; - break; - case InternalState::SET_SPEED: - *id = RwDefinitions::SET_SPEED; internalState = InternalState::CLEAR_RESET_STATUS; break; case InternalState::CLEAR_RESET_STATUS: @@ -107,29 +108,26 @@ ReturnValue_t RwHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand << " invalid length" << std::endl; return SET_SPEED_COMMAND_INVALID_LENGTH; } - // Commands override anything which was set in the software - if (commandData != nullptr) { - rwSpeedActuationSet.setValidityBufferGeneration(false); - result = rwSpeedActuationSet.deSerialize(&commandData, &commandDataLen, - SerializeIF::Endianness::NETWORK); - rwSpeedActuationSet.setValidityBufferGeneration(true); - if (result != returnvalue::OK) { - return result; - } - result = rwSpeedActuationSet.commit(); - if (result != returnvalue::OK) { - sif::error << "RwHandler::buildCommandFromCommand: commit failed" << std::endl; - } - } else { - // Read set rw speed value from local pool + + { PoolReadGuard pg(&rwSpeedActuationSet); + // Commands override anything which was set in the software + if (commandData != nullptr) { + rwSpeedActuationSet.setValidityBufferGeneration(false); + result = rwSpeedActuationSet.deSerialize(&commandData, &commandDataLen, + SerializeIF::Endianness::NETWORK); + rwSpeedActuationSet.setValidityBufferGeneration(true); + if (result != returnvalue::OK) { + return result; + } + } } if (ACTUATION_WIRETAPPING) { - int32_t speed; - uint16_t rampTime; + int32_t speed = 0; + uint16_t rampTime = 0; rwSpeedActuationSet.getRwSpeed(speed, rampTime); - sif::debug << "Actuating RW with speed = " << speed << " and rampTime = " << rampTime - << std::endl; + sif::debug << "Actuating RW " << static_cast(rwIdx) << " with speed = " << speed + << " and rampTime = " << rampTime << std::endl; } result = checkSpeedAndRampTime(); if (result != returnvalue::OK) { diff --git a/mission/devices/RwHandler.h b/mission/devices/RwHandler.h index 148a6359..ee18960d 100644 --- a/mission/devices/RwHandler.h +++ b/mission/devices/RwHandler.h @@ -9,7 +9,7 @@ #include "events/subsystemIdRanges.h" #include "returnvalues/classIds.h" -static constexpr bool ACTUATION_WIRETAPPING = true; +static constexpr bool ACTUATION_WIRETAPPING = false; class GpioIF; @@ -36,7 +36,7 @@ class RwHandler : public DeviceHandlerBase { * to high to enable the device. */ RwHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, GpioIF* gpioComIF, - gpioId_t enableGpio); + gpioId_t enableGpio, uint8_t rwIdx); void setDebugMode(bool enable); @@ -98,9 +98,10 @@ class RwHandler : public DeviceHandlerBase { RwDefinitions::RwSpeedActuationSet rwSpeedActuationSet; uint8_t commandBuffer[RwDefinitions::MAX_CMD_SIZE]; + uint8_t rwIdx; - PoolEntry rwSpeed = PoolEntry(0, false); - PoolEntry rampTime = PoolEntry(10, false); + PoolEntry rwSpeed = PoolEntry({0}); + PoolEntry rampTime = PoolEntry({10}); enum class InternalState { GET_RESET_STATUS, From 177b573cd4ae4c47724167607f8df472834b9746 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 14 Feb 2023 18:54:43 +0100 Subject: [PATCH 330/330] prep v1.27.2 --- CHANGELOG.md | 7 +++++++ CMakeLists.txt | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 417f6522..a8b2ef0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,13 @@ change warranting a new major release: # [unreleased] +# [v1.27.2] 2023-02-14 + +Reaction Wheel handling was determined to be (quasi) broken and needs to be fixed in future release +to be usable by ACS controller. + +eive-tmtc: v2.15.6 + ## Added - Function for the ACS controller to command MTQ and RWs called by all subroutines diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a8055bd..4f62c199 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ cmake_minimum_required(VERSION 3.13) set(OBSW_VERSION_MAJOR 1) set(OBSW_VERSION_MINOR 27) -set(OBSW_VERSION_REVISION 1) +set(OBSW_VERSION_REVISION 2) # set(CMAKE_VERBOSE TRUE)