only one guidance function to calculate error quaternion

This commit is contained in:
2023-02-20 11:52:53 +01:00
parent 0dae3b04be
commit 700d7ced64
3 changed files with 53 additions and 58 deletions

View File

@ -16,37 +16,34 @@ class Guidance {
// 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 targetQuatPtgSingleAxis(timeval now, double targetQuat[4], double targetSatRotRate[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]);
double targetSatRotRate[3]);
void targetQuatPtgGs(timeval now, double targetQuat[4], double targetSatRotRate[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]);
void targetQuatPtgSun(timeval now, double targetQuat[4], double targetSatRotRate[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]);
void targetQuatPtgNadirSingleAxis(timeval now, double targetQuat[4], double targetSatRotRate[3]);
void targetQuatPtgNadirThreeAxes(timeval now, double targetQuat[4], double targetSatRotRate[3]);
// Function to get the target quaternion and refence rotation rate from parameters for inertial
// pointing
void targetQuatPtgInertial(double targetQuat[4], double refSatRate[3]);
void targetQuatPtgInertial(double targetQuat[4], double targetSatRotRate[3]);
// @note: compares the target Quaternion in the ECI to the current orientation in ECI to compute
// the error quaternion and error angle
void calculateErrorQuat(double targetQuat[4], double currentQuat[4], double errorQuat[4],
double errorAngle);
// @note: Calculates the error quaternion between the current orientation and the target
// quaternion, considering a reference quaternion. Additionally the difference between the actual
// and a desired satellite rotational rate is calculated, again considering a reference rotational
// rate. Lastly gives back the error angle of the error quaternion.
void comparePtg(double currentQuat[4], double currentSatRotRate[3], double targetQuat[4],
double targetSatRotRate[3], double refQuat[4], double refSatRotRate[3],
double errorQuat[4], double errorSatRotRate[3], double errorAngle);
// @note: compares target Quaternion and reference quaternion, also actual and desired satellite
// rate
void comparePtg(double oldErrorQuat[4], double quatRef[4], double newErrorQuatComplete[4],
double satRotRate[3], double satRotRateGuidance[3], double satRotRateRef[3],
double satRotRateError[3]);
void refRotationRate(int8_t timeElapsedMax, timeval now, double quatInertialTarget[4],
double *refSatRate);
void targetRotationRate(int8_t timeElapsedMax, timeval now, double quatInertialTarget[4],
double *targetSatRotRate);
// @note: will give back the pseudoinverse matrix for the reaction wheel depending on the valid
// reation wheel maybe can be done in "commanding.h"