|
|
|
@@ -97,7 +97,7 @@ void AcsController::performSafe() {
|
|
|
|
|
|
|
|
|
|
sensorProcessing.process(now, &sensorValues, &outputValues, &acsParameters);
|
|
|
|
|
ReturnValue_t validMekf;
|
|
|
|
|
navigation.useMekf(&sensorValues, &outputValues, &validMekf); // DOES THIS WORK WITH VALID?
|
|
|
|
|
navigation.useMekf(&sensorValues, &outputValues, &validMekf);
|
|
|
|
|
|
|
|
|
|
// Give desired satellite rate and sun direction to align
|
|
|
|
|
double satRateSafe[3] = {0, 0, 0}, sunTargetDir[3] = {0, 0, 0};
|
|
|
|
@@ -127,25 +127,18 @@ void AcsController::performSafe() {
|
|
|
|
|
if (outputValues.satRateMekfValid && VectorOperations<double>::norm(outputValues.satRateMekf, 3) >
|
|
|
|
|
acsParameters.detumbleParameter.omegaDetumbleStart) {
|
|
|
|
|
detumbleCounter++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else if (outputValues.satRateEstValid &&
|
|
|
|
|
VectorOperations<double>::norm(outputValues.satRateEst, 3) >
|
|
|
|
|
acsParameters.detumbleParameter.omegaDetumbleStart) {
|
|
|
|
|
} else if (outputValues.satRateEstValid &&
|
|
|
|
|
VectorOperations<double>::norm(outputValues.satRateEst, 3) >
|
|
|
|
|
acsParameters.detumbleParameter.omegaDetumbleStart) {
|
|
|
|
|
detumbleCounter++;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
} else {
|
|
|
|
|
detumbleCounter = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) {
|
|
|
|
|
submode = SUBMODE_DETUMBLE;
|
|
|
|
|
detumbleCounter = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// commanding.magnetorquesDipol();
|
|
|
|
|
// commanding.magnetorquesDipol();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AcsController::performDetumble() {
|
|
|
|
@@ -154,7 +147,6 @@ void AcsController::performDetumble() {
|
|
|
|
|
|
|
|
|
|
timeval now;
|
|
|
|
|
Clock::getClock_timeval(&now);
|
|
|
|
|
// Clock::getUptime(&now);
|
|
|
|
|
|
|
|
|
|
sensorProcessing.process(now, &sensorValues, &outputValues, &acsParameters);
|
|
|
|
|
ReturnValue_t validMekf;
|
|
|
|
@@ -170,14 +162,13 @@ void AcsController::performDetumble() {
|
|
|
|
|
if (outputValues.satRateMekfValid && VectorOperations<double>::norm(outputValues.satRateMekf, 3) <
|
|
|
|
|
acsParameters.detumbleParameter.omegaDetumbleEnd) {
|
|
|
|
|
detumbleCounter++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else if (outputValues.satRateEstValid &&
|
|
|
|
|
VectorOperations<double>::norm(outputValues.satRateEst, 3) <
|
|
|
|
|
acsParameters.detumbleParameter.omegaDetumbleEnd) {
|
|
|
|
|
} else if (outputValues.satRateEstValid &&
|
|
|
|
|
VectorOperations<double>::norm(outputValues.satRateEst, 3) <
|
|
|
|
|
acsParameters.detumbleParameter.omegaDetumbleEnd) {
|
|
|
|
|
detumbleCounter++;
|
|
|
|
|
} else {
|
|
|
|
|
detumbleCounter = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) {
|
|
|
|
|
submode = SUBMODE_SAFE;
|
|
|
|
|
detumbleCounter = 0;
|
|
|
|
@@ -235,6 +226,7 @@ ReturnValue_t AcsController::initializeLocalDataPool(localpool::DataPool &localD
|
|
|
|
|
localDataPoolMap.emplace(acsctrl::PoolIds::MGM_1_VEC, &mgm1VecProc);
|
|
|
|
|
localDataPoolMap.emplace(acsctrl::PoolIds::MGM_2_VEC, &mgm2VecProc);
|
|
|
|
|
localDataPoolMap.emplace(acsctrl::PoolIds::MGM_3_VEC, &mgm3VecProc);
|
|
|
|
|
localDataPoolMap.emplace(acsctrl::PoolIds::MGM_4_VEC, &mgm4VecProc);
|
|
|
|
|
localDataPoolMap.emplace(acsctrl::PoolIds::MGM_VEC_TOT, &mgmVecTot);
|
|
|
|
|
localDataPoolMap.emplace(acsctrl::PoolIds::MGM_VEC_TOT_DERIVATIVE, &mgmVecTotDer);
|
|
|
|
|
localDataPoolMap.emplace(acsctrl::PoolIds::MAG_IGRF_MODEL, &magIgrf);
|
|
|
|
@@ -539,3 +531,4 @@ void AcsController::copyGyrData() {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|