still broken
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
This commit is contained in:
parent
f0d77125e1
commit
f12fa77644
@ -250,8 +250,8 @@ void AcsController::performPointingCtrl() {
|
|||||||
|
|
||||||
switch (submode) {
|
switch (submode) {
|
||||||
case acs::PTG_IDLE:
|
case acs::PTG_IDLE:
|
||||||
guidance.sunQuatPtg(&sensorValues, &mekfData, &susDataProcessed, &gpsDataProcessed, now,
|
guidance.targetQuatPtgSun(&sensorValues, &mekfData, &susDataProcessed, &gpsDataProcessed, now,
|
||||||
targetQuat, refSatRate);
|
targetQuat, refSatRate);
|
||||||
std::memcpy(quatRef, acsParameters.targetModeControllerParameters.quatRef,
|
std::memcpy(quatRef, acsParameters.targetModeControllerParameters.quatRef,
|
||||||
4 * sizeof(double));
|
4 * sizeof(double));
|
||||||
enableAntiStiction = acsParameters.targetModeControllerParameters.enableAntiStiction;
|
enableAntiStiction = acsParameters.targetModeControllerParameters.enableAntiStiction;
|
||||||
@ -319,8 +319,8 @@ void AcsController::performPointingCtrl() {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case acs::PTG_NADIR:
|
case acs::PTG_NADIR:
|
||||||
guidance.quatNadirPtgThreeAxes(&sensorValues, &gpsDataProcessed, &mekfData, now, targetQuat,
|
guidance.targetQuatPtgNadirThreeAxes(&sensorValues, &gpsDataProcessed, &mekfData, now,
|
||||||
refSatRate);
|
targetQuat, refSatRate);
|
||||||
std::memcpy(quatRef, acsParameters.nadirModeControllerParameters.quatRef, 4 * sizeof(double));
|
std::memcpy(quatRef, acsParameters.nadirModeControllerParameters.quatRef, 4 * sizeof(double));
|
||||||
enableAntiStiction = acsParameters.nadirModeControllerParameters.enableAntiStiction;
|
enableAntiStiction = acsParameters.nadirModeControllerParameters.enableAntiStiction;
|
||||||
guidance.comparePtg(targetQuat, &mekfData, quatRef, refSatRate, quatErrorComplete, quatError,
|
guidance.comparePtg(targetQuat, &mekfData, quatRef, refSatRate, quatErrorComplete, quatError,
|
||||||
@ -341,7 +341,7 @@ void AcsController::performPointingCtrl() {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case acs::PTG_INERTIAL:
|
case acs::PTG_INERTIAL:
|
||||||
guidance.inertialQuatPtg(targetQuat, refSatRate);
|
guidance.targetQuatPtgInertial(targetQuat, refSatRate);
|
||||||
std::memcpy(quatRef, acsParameters.inertialModeControllerParameters.quatRef,
|
std::memcpy(quatRef, acsParameters.inertialModeControllerParameters.quatRef,
|
||||||
4 * sizeof(double));
|
4 * sizeof(double));
|
||||||
enableAntiStiction = acsParameters.inertialModeControllerParameters.enableAntiStiction;
|
enableAntiStiction = acsParameters.inertialModeControllerParameters.enableAntiStiction;
|
||||||
|
@ -1,10 +1,3 @@
|
|||||||
/*
|
|
||||||
* Guidance.cpp
|
|
||||||
*
|
|
||||||
* Created on: 6 Jun 2022
|
|
||||||
* Author: Robin Marquardt
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "Guidance.h"
|
#include "Guidance.h"
|
||||||
|
|
||||||
#include <fsfw/datapool/PoolReadGuard.h>
|
#include <fsfw/datapool/PoolReadGuard.h>
|
||||||
@ -355,7 +348,7 @@ void Guidance::targetQuatPtgGs(timeval now, double targetQuat[4], double refSatR
|
|||||||
QuaternionOperations::multiply(quatBJ, quatInertialTarget, targetQuat);
|
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
|
// Calculation of target quaternion to sun
|
||||||
//-------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------
|
||||||
@ -421,7 +414,7 @@ void Guidance::sunQuatPtg(timeval now, double targetQuat[4], double refSatRate[3
|
|||||||
refSatRate[2] = 0;
|
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
|
double refSatRate[3]) { // old version of Nadir Pointing
|
||||||
//-------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------
|
||||||
// Calculation of target quaternion for 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);
|
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,
|
std::memcpy(targetQuat, acsParameters.inertialModeControllerParameters.tgtQuat,
|
||||||
4 * sizeof(double));
|
4 * sizeof(double));
|
||||||
std::memcpy(refSatRate, acsParameters.inertialModeControllerParameters.refRotRate,
|
std::memcpy(refSatRate, acsParameters.inertialModeControllerParameters.refRotRate,
|
||||||
|
@ -1,10 +1,3 @@
|
|||||||
/*
|
|
||||||
* Guidance.h
|
|
||||||
*
|
|
||||||
* Created on: 6 Jun 2022
|
|
||||||
* Author: Robin Marquardt
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef GUIDANCE_H_
|
#ifndef GUIDANCE_H_
|
||||||
#define 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
|
// Function to get the target quaternion and refence rotation rate from gps position and
|
||||||
// position of the ground station
|
// position of the ground station
|
||||||
void targetQuatPtgThreeAxes(ACS::SensorValues *sensorValues,
|
void targetQuatPtgThreeAxes(timeval now, double targetQuat[4], double refSatRate[3]);
|
||||||
acsctrl::GpsDataProcessed *gpsDataProcessed,
|
void targetQuatPtgGs(timeval now, double targetQuat[4], double refSatRate[3]);
|
||||||
acsctrl::MekfData *mekfData, timeval now, double targetQuat[4],
|
void targetQuatPtgSingleAxis(timeval now, double targetQuat[4], double refSatRate[3]);
|
||||||
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]);
|
|
||||||
|
|
||||||
// Function to get the target quaternion and refence rotation rate for sun pointing after ground
|
// Function to get the target quaternion and refence rotation rate for sun pointing after ground
|
||||||
// station
|
// station
|
||||||
void sunQuatPtg(ACS::SensorValues *sensorValues, acsctrl::MekfData *mekfData,
|
void targetQuatPtgSun(timeval now, double targetQuat[4], double refSatRate[3]);
|
||||||
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
|
// Function to get the target quaternion and refence rotation rate from gps position for Nadir
|
||||||
// pointing
|
// pointing
|
||||||
void quatNadirPtgThreeAxes(ACS::SensorValues *sensorValues,
|
void targetQuatPtgNadirThreeAxes(timeval now, double targetQuat[4], double refSatRate[3]);
|
||||||
acsctrl::GpsDataProcessed *gpsDataProcessed,
|
void targetQuatPtgNadirSingleAxis(timeval now, double targetQuat[4], double refSatRate[3]);
|
||||||
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]);
|
|
||||||
|
|
||||||
// Function to get the target quaternion and refence rotation rate from parameters for inertial
|
// Function to get the target quaternion and refence rotation rate from parameters for inertial
|
||||||
// pointing
|
// 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
|
// @note: compares target Quaternion and reference quaternion, also actual satellite rate and
|
||||||
// desired
|
// desired
|
||||||
void comparePtg(double targetQuat[4], acsctrl::MekfData *mekfData, double quatRef[4],
|
void comparePtg(double targetQuat[4], double quatRef[4], double refSatRate[3],
|
||||||
double refSatRate[3], double quatErrorComplete[4], double quatError[3],
|
double quatErrorComplete[4], double quatError[3], double deltaRate[3]);
|
||||||
double deltaRate[3]);
|
|
||||||
|
|
||||||
void refRotationRate(int8_t timeElapsedMax, timeval now, double quatInertialTarget[4],
|
void refRotationRate(int8_t timeElapsedMax, timeval now, double quatInertialTarget[4],
|
||||||
double *refSatRate);
|
double *refSatRate);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user