fixed usage of sunMagAngleMin

This commit is contained in:
Marius Eggert 2022-12-19 14:24:03 +01:00
parent e4936b1bed
commit c338c4fb58

View File

@ -129,10 +129,8 @@ void SafeCtrl::safeNoMekf(timeval now, double *susDirB, bool susDirBValid, doubl
/* 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 sinAngle = 0; double angleSunMag = acos(cosAngleSunMag);
sinAngle = sin(acos(cos(cosAngleSunMag))); if (angleSunMag < safeModeControllerParameters->sunMagAngleMin) {
if (!(sinAngle > sin(safeModeControllerParameters->sunMagAngleMin * M_PI / 180))) {
return; return;
} }