diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index f1bef501..c402fe9e 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -250,8 +250,8 @@ void AcsController::performPointingCtrl() { switch (submode) { case acs::PTG_IDLE: - guidance.sunQuatPtg(&sensorValues, &mekfData, &susDataProcessed, &gpsDataProcessed, now, - targetQuat, refSatRate); + guidance.targetQuatPtgSun(&sensorValues, &mekfData, &susDataProcessed, &gpsDataProcessed, now, + targetQuat, refSatRate); std::memcpy(quatRef, acsParameters.targetModeControllerParameters.quatRef, 4 * sizeof(double)); enableAntiStiction = acsParameters.targetModeControllerParameters.enableAntiStiction; @@ -319,8 +319,8 @@ void AcsController::performPointingCtrl() { break; case acs::PTG_NADIR: - guidance.quatNadirPtgThreeAxes(&sensorValues, &gpsDataProcessed, &mekfData, now, targetQuat, - refSatRate); + guidance.targetQuatPtgNadirThreeAxes(&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, @@ -341,7 +341,7 @@ void AcsController::performPointingCtrl() { break; case acs::PTG_INERTIAL: - guidance.inertialQuatPtg(targetQuat, refSatRate); + guidance.targetQuatPtgInertial(targetQuat, refSatRate); std::memcpy(quatRef, acsParameters.inertialModeControllerParameters.quatRef, 4 * sizeof(double)); enableAntiStiction = acsParameters.inertialModeControllerParameters.enableAntiStiction; diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index 506f6dfc..fc5e839e 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -1,10 +1,3 @@ -/* - * Guidance.cpp - * - * Created on: 6 Jun 2022 - * Author: Robin Marquardt - */ - #include "Guidance.h" #include @@ -355,7 +348,7 @@ void Guidance::targetQuatPtgGs(timeval now, double targetQuat[4], double refSatR QuaternionOperations::multiply(quatBJ, quatInertialTarget, targetQuat); } -void Guidance::sunQuatPtg(timeval now, double targetQuat[4], double refSatRate[3]) { +void Guidance::targetQuatPtgSun(timeval now, double targetQuat[4], double refSatRate[3]) { //------------------------------------------------------------------------------------- // Calculation of target quaternion to sun //------------------------------------------------------------------------------------- @@ -421,7 +414,7 @@ void Guidance::sunQuatPtg(timeval now, double targetQuat[4], double refSatRate[3 refSatRate[2] = 0; } -void Guidance::quatNadirPtgSingleAxis(timeval now, double targetQuat[4], +void Guidance::targetQuatPtgNadirSingleAxis(timeval now, double targetQuat[4], double refSatRate[3]) { // old version of Nadir Pointing //------------------------------------------------------------------------------------- // Calculation of target quaternion for Nadir pointing @@ -535,7 +528,7 @@ void Guidance::quatNadirPtgThreeAxes(double posSateE[3], double velSateE[3], tim QuaternionOperations::multiply(quatBJ, quatInertialTarget, targetQuat); } -void Guidance::inertialQuatPtg(double targetQuat[4], double refSatRate[3]) { +void Guidance::targetQuatPtgInertial(double targetQuat[4], double refSatRate[3]) { std::memcpy(targetQuat, acsParameters.inertialModeControllerParameters.tgtQuat, 4 * sizeof(double)); std::memcpy(refSatRate, acsParameters.inertialModeControllerParameters.refRotRate, diff --git a/mission/controller/acs/Guidance.h b/mission/controller/acs/Guidance.h index 32c013fc..1b3ee607 100644 --- a/mission/controller/acs/Guidance.h +++ b/mission/controller/acs/Guidance.h @@ -1,10 +1,3 @@ -/* - * Guidance.h - * - * Created on: 6 Jun 2022 - * Author: Robin Marquardt - */ - #ifndef GUIDANCE_H_ #define GUIDANCE_H_ @@ -23,44 +16,27 @@ class Guidance { // 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], - 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, - double targetQuat[4], double refSatRate[3]); + void targetQuatPtgThreeAxes(timeval now, double targetQuat[4], double refSatRate[3]); + void targetQuatPtgGs(timeval now, double targetQuat[4], double refSatRate[3]); + void targetQuatPtgSingleAxis(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, acsctrl::MekfData *mekfData, - acsctrl::SusDataProcessed *susDataProcessed, - acsctrl::GpsDataProcessed *gpsDataProcessed, timeval now, double targetQuat[4], - double refSatRate[3]); + 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 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 targetQuatPtgNadirThreeAxes(timeval now, double targetQuat[4], double refSatRate[3]); + void targetQuatPtgNadirSingleAxis(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]); + void targetQuatPtgInertial(double targetQuat[4], double refSatRate[3]); // @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], 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);