acs hotfix v2 #425
@ -99,7 +99,7 @@ ReturnValue_t SafeCtrl::safeNoMekf(timeval now, double *susDirB, bool susDirBVal
|
|||||||
|
|
||||||
// normalize sunDir and magDir
|
// normalize sunDir and magDir
|
||||||
double magDirB[3] = {0, 0, 0};
|
double magDirB[3] = {0, 0, 0};
|
||||||
VectorOperations<double>::normalize(magFieldB, magDirB, 3);
|
VectorOperations<double>::normalize(magFieldBT, magDirB, 3);
|
||||||
VectorOperations<double>::normalize(susDirB, susDirB, 3);
|
VectorOperations<double>::normalize(susDirB, susDirB, 3);
|
||||||
|
|
||||||
// Cosinus angle between sunDir and magDir
|
// Cosinus angle between sunDir and magDir
|
||||||
@ -160,8 +160,8 @@ ReturnValue_t SafeCtrl::safeNoMekf(timeval now, double *susDirB, bool susDirBVal
|
|||||||
// Magnetic moment
|
// Magnetic moment
|
||||||
double magMomB[3] = {0, 0, 0};
|
double magMomB[3] = {0, 0, 0};
|
||||||
double crossMagFieldTorque[3] = {0, 0, 0};
|
double crossMagFieldTorque[3] = {0, 0, 0};
|
||||||
VectorOperations<double>::cross(magFieldB, torqueB, crossMagFieldTorque);
|
VectorOperations<double>::cross(magFieldBT, torqueB, crossMagFieldTorque);
|
||||||
double magMomFactor = pow(VectorOperations<double>::norm(magFieldB, 3), 2);
|
double magMomFactor = pow(VectorOperations<double>::norm(magFieldBT, 3), 2);
|
||||||
VectorOperations<double>::mulScalar(crossMagFieldTorque, 1 / magMomFactor, magMomB, 3);
|
VectorOperations<double>::mulScalar(crossMagFieldTorque, 1 / magMomFactor, magMomB, 3);
|
||||||
|
|
||||||
std::memcpy(outputMagMomB, magMomB, 3 * sizeof(double));
|
std::memcpy(outputMagMomB, magMomB, 3 * sizeof(double));
|
||||||
|
Loading…
Reference in New Issue
Block a user