This commit is contained in:
parent
c79e17514c
commit
ac83e66016
@ -146,10 +146,10 @@ void AcsController::performControlOperation() {
|
|||||||
{
|
{
|
||||||
PoolReadGuard pg(&ctrlValData);
|
PoolReadGuard pg(&ctrlValData);
|
||||||
if (pg.getReadResult() == returnvalue::OK) {
|
if (pg.getReadResult() == returnvalue::OK) {
|
||||||
double zeroQuat[4] = {0, 0, 0, 0};
|
double unitQuat[4] = {0, 0, 0, 1};
|
||||||
std::memcpy(ctrlValData.tgtQuat.value, zeroQuat, 4 * sizeof(double));
|
std::memcpy(ctrlValData.tgtQuat.value, unitQuat, 4 * sizeof(double));
|
||||||
ctrlValData.tgtQuat.setValid(false);
|
ctrlValData.tgtQuat.setValid(false);
|
||||||
std::memcpy(ctrlValData.errQuat.value, zeroQuat, 4 * sizeof(double));
|
std::memcpy(ctrlValData.errQuat.value, unitQuat, 4 * sizeof(double));
|
||||||
ctrlValData.errQuat.setValid(false);
|
ctrlValData.errQuat.setValid(false);
|
||||||
ctrlValData.errAng.value = errAng;
|
ctrlValData.errAng.value = errAng;
|
||||||
ctrlValData.errAng.setValid(true);
|
ctrlValData.errAng.setValid(true);
|
||||||
@ -178,10 +178,9 @@ void AcsController::performControlOperation() {
|
|||||||
{
|
{
|
||||||
PoolReadGuard pg(&actuatorCmdData);
|
PoolReadGuard pg(&actuatorCmdData);
|
||||||
if (pg.getReadResult() == returnvalue::OK) {
|
if (pg.getReadResult() == returnvalue::OK) {
|
||||||
int32_t zeroVec[4] = {0, 0, 0, 0};
|
std::memset(actuatorCmdData.rwTargetTorque.value, 0, 4 * sizeof(int32_t));
|
||||||
std::memcpy(actuatorCmdData.rwTargetTorque.value, zeroVec, 4 * sizeof(int32_t));
|
|
||||||
actuatorCmdData.rwTargetTorque.setValid(false);
|
actuatorCmdData.rwTargetTorque.setValid(false);
|
||||||
std::memcpy(actuatorCmdData.rwTargetSpeed.value, zeroVec, 4 * sizeof(int32_t));
|
std::memset(actuatorCmdData.rwTargetSpeed.value, 0, 4 * sizeof(int32_t));
|
||||||
actuatorCmdData.rwTargetSpeed.setValid(false);
|
actuatorCmdData.rwTargetSpeed.setValid(false);
|
||||||
std::memcpy(actuatorCmdData.mtqTargetDipole.value, dipolCmdUnits, 3 * sizeof(int16_t));
|
std::memcpy(actuatorCmdData.mtqTargetDipole.value, dipolCmdUnits, 3 * sizeof(int16_t));
|
||||||
actuatorCmdData.mtqTargetDipole.setValid(true);
|
actuatorCmdData.mtqTargetDipole.setValid(true);
|
||||||
|
@ -87,7 +87,7 @@ ReturnValue_t SafeCtrl::safeMekf(timeval now, double *quatBJ, bool quatBJValid,
|
|||||||
return returnvalue::OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Will be the version in worst case scenario in event of no working MEKF (nor RMUs)
|
// Will be the version in worst case scenario in event of no working MEKF (nor GYRs)
|
||||||
void SafeCtrl::safeNoMekf(timeval now, double *susDirB, bool susDirBValid, double *sunRateB,
|
void SafeCtrl::safeNoMekf(timeval now, double *susDirB, bool susDirBValid, double *sunRateB,
|
||||||
bool sunRateBValid, double *magFieldB, bool magFieldBValid,
|
bool sunRateBValid, double *magFieldB, bool magFieldBValid,
|
||||||
double *magRateB, bool magRateBValid, double *sunDirRef,
|
double *magRateB, bool magRateBValid, double *sunDirRef,
|
||||||
@ -127,8 +127,7 @@ void SafeCtrl::safeNoMekf(timeval now, double *susDirB, bool susDirBValid, doubl
|
|||||||
VectorOperations<double>::mulScalar(estSatRate, 0.5, estSatRate, 3);
|
VectorOperations<double>::mulScalar(estSatRate, 0.5, estSatRate, 3);
|
||||||
|
|
||||||
/* Only valid if angle between sun direction and magnetic field direction
|
/* Only valid if angle between sun direction and magnetic field direction
|
||||||
is sufficiently large */
|
* is sufficiently large */
|
||||||
|
|
||||||
double angleSunMag = acos(cosAngleSunMag);
|
double angleSunMag = acos(cosAngleSunMag);
|
||||||
if (angleSunMag < safeModeControllerParameters->sunMagAngleMin) {
|
if (angleSunMag < safeModeControllerParameters->sunMagAngleMin) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user