#ifndef GUIDANCE_H_ #define GUIDANCE_H_ #include #include "../controllerdefinitions/AcsCtrlDefinitions.h" #include "AcsParameters.h" #include "SensorValues.h" class Guidance { public: Guidance(AcsParameters *acsParameters_); virtual ~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 targetQuatPtgSingleAxis(timeval now, double targetQuat[4], double refSatRate[3]); void targetQuatPtgThreeAxes(timeval now, double posSatE[3], double velSatE[3], double quatIX[4], double refSatRate[3]); void targetQuatPtgGs(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 targetQuatPtgSun(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 targetQuatPtgNadirSingleAxis(timeval now, double targetQuat[4], double refSatRate[3]); void targetQuatPtgNadirThreeAxes(timeval now, double targetQuat[4], double refSatRate[3]); // Function to get the target quaternion and refence rotation rate from parameters for inertial // pointing void targetQuatPtgInertial(double targetQuat[4], double refSatRate[3]); // @note: compares target Quaternion and reference quaternion, also actual and desired satellite // rate void comparePtg(double targetQuat[4], 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); // @note: will give back the pseudoinverse matrix for the reaction wheel depending on the valid // reation wheel maybe can be done in "commanding.h" ReturnValue_t getDistributionMatrixRw(ACS::SensorValues *sensorValues, double *rwPseudoInv); private: AcsParameters acsParameters; bool strBlindAvoidFlag = false; timeval timeSavedQuaternion; double savedQuaternion[4] = {0, 0, 0, 0}; double omegaRefSaved[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_ */