Prevent STR Blinding #859

Merged
meggert merged 35 commits from prevent-str-blinding into main 2024-02-27 13:48:20 +01:00
2 changed files with 6 additions and 15 deletions
Showing only changes of commit 2f43f58792 - Show all commits

2
fsfw

@ -1 +1 @@
Subproject commit 90f3f8ef1f67dc6d07c242b68bc59c805bb407dd
Subproject commit 7d4e77843b64e812e537e2abd1213c632b6eeb48

View File

@ -102,12 +102,9 @@ void Guidance::targetQuatPtgGs(timeval timeAbsolute, const double timeDelta,
acsParameters->gsTargetModeControllerParameters.altitudeTgt, posGroundStationF);
// target direction in the ECI frame
double posSatI[3] = {3808618.68633079, -1163140.41530084, 5612341.3560814},
posGroundStationI[3] = {3737093.20736689, -1967773.50625331, 4763980.76688758},
groundStationDirI[3] = {0, 0, 0};
// CoordinateTransformations::positionEcfToEci(posSatF, posSatI, &timeAbsolute);
// CoordinateTransformations::positionEcfToEci(posGroundStationF, posGroundStationI,
// &timeAbsolute);
double posSatI[3] = {0, 0, 0}, posGroundStationI[3] = {0, 0, 0}, groundStationDirI[3] = {0, 0, 0};
CoordinateTransformations::positionEcfToEci(posSatF, posSatI, &timeAbsolute);
CoordinateTransformations::positionEcfToEci(posGroundStationF, posGroundStationI, &timeAbsolute);
VectorOperations<double>::subtract(posGroundStationI, posSatI, groundStationDirI, 3);
// negative x-axis aligned with target direction
@ -241,10 +238,6 @@ void Guidance::targetRotationRate(const double timeDelta, double quatIX[4], doub
}
void Guidance::limitReferenceRotation(const double xAxisIX[3], double quatIX[4]) {
sif::debug << "xAxisIX = [" << xAxisIX[0] << " " << xAxisIX[1] << " " << xAxisIX[2] << "]"
<< std::endl;
sif::debug << "quatIX = [" << quatIX[3] << " " << quatIX[0] << " " << quatIX[1] << " "
<< quatIX[2] << "]" << std::endl;
if ((VectorOperations<double>::norm(quatIXprev, 4) == 0) or
(VectorOperations<double>::norm(xAxisIXprev, 3) == 0)) {
return;
@ -255,14 +248,12 @@ void Guidance::limitReferenceRotation(const double xAxisIX[3], double quatIX[4])
QuaternionOperations::inverse(quatIXprev, quatXprevI);
QuaternionOperations::multiply(quatIX, quatXprevI, quatXprevX);
QuaternionOperations::normalize(quatXprevX);
double phiMax = acsParameters->gsTargetModeControllerParameters.omMax * 1;
// acsParameters->onBoardParams.sampleTime;
double phiMax = acsParameters->gsTargetModeControllerParameters.omMax *
acsParameters->onBoardParams.sampleTime;
if (2 * std::acos(quatXprevX[3]) < phiMax) {
return;
}
sif::debug << "Reduced Quaternion Rotation Required" << std::endl;
// x-axis always needs full rotation
double phiX = 0, phiXvec[3] = {0, 0, 0};
phiX = std::acos(VectorOperations<double>::dot(xAxisIXprev, xAxisIX));