QUEST Fix II #834

Merged
muellerr merged 3 commits from quest-fix2 into main 2023-12-13 11:24:22 +01:00
Showing only changes of commit be2c4379a7 - Show all commits

View File

@ -8,14 +8,14 @@ AttitudeEstimation::~AttitudeEstimation() {}
void AttitudeEstimation::quest(acsctrl::SusDataProcessed *susData, void AttitudeEstimation::quest(acsctrl::SusDataProcessed *susData,
acsctrl::MgmDataProcessed *mgmData, acsctrl::MgmDataProcessed *mgmData,
acsctrl::AttitudeEstimationData *attitudeEstimation) { acsctrl::AttitudeEstimationData *attitudeEstimationData) {
if (not(susData->susVecTot.isValid() and susData->sunIjkModel.isValid() and if (not(susData->susVecTot.isValid() and susData->sunIjkModel.isValid() and
mgmData->mgmVecTot.isValid() and mgmData->magIgrfModel.isValid())) { mgmData->mgmVecTot.isValid() and mgmData->magIgrfModel.isValid())) {
{ {
PoolReadGuard pg{attitudeEstimation}; PoolReadGuard pg{attitudeEstimationData};
if (pg.getReadResult() == returnvalue::OK) { if (pg.getReadResult() == returnvalue::OK) {
std::memcpy(attitudeEstimation->quatQuest.value, ZERO_VEC4, 4 * sizeof(double)); std::memcpy(attitudeEstimationData->quatQuest.value, ZERO_VEC4, 4 * sizeof(double));
attitudeEstimation->quatQuest.setValid(false); attitudeEstimationData->quatQuest.setValid(false);
} }
} }
return; return;
@ -102,10 +102,10 @@ void AttitudeEstimation::quest(acsctrl::SusDataProcessed *susData,
QuaternionOperations::slerp(qBI, qOld, acsParameters->onBoardParams.questFilterWeight, qBI); QuaternionOperations::slerp(qBI, qOld, acsParameters->onBoardParams.questFilterWeight, qBI);
} }
{ {
PoolReadGuard pg{attitudeEstimation}; PoolReadGuard pg{attitudeEstimationData};
if (pg.getReadResult() == returnvalue::OK) { if (pg.getReadResult() == returnvalue::OK) {
std::memcpy(attitudeEstimation->quatQuest.value, qBI, 4 * sizeof(double)); std::memcpy(attitudeEstimationData->quatQuest.value, qBI, 4 * sizeof(double));
attitudeEstimation->quatQuest.setValid(true); attitudeEstimationData->quatQuest.setValid(true);
} }
} }
} }