From a71be232acaf2e9ce2ebc893f5d5113b9be17242 Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 27 Apr 2023 11:21:02 +0200 Subject: [PATCH] make Robin even happier --- mission/controller/acs/control/PtgCtrl.cpp | 8 ++++---- mission/controller/acs/control/PtgCtrl.h | 10 ++++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/mission/controller/acs/control/PtgCtrl.cpp b/mission/controller/acs/control/PtgCtrl.cpp index 98d3a0fa..21d86e28 100644 --- a/mission/controller/acs/control/PtgCtrl.cpp +++ b/mission/controller/acs/control/PtgCtrl.cpp @@ -5,9 +5,7 @@ #include #include #include -#include - -#include "../util/MathOperations.h" +#include PtgCtrl::PtgCtrl(AcsParameters *acsParameters_) { acsParameters = acsParameters_; } @@ -135,7 +133,9 @@ void PtgCtrl::ptgDesaturation(AcsParameters::PointingLawParameters *pointingLawP void PtgCtrl::ptgNullspace(AcsParameters::PointingLawParameters *pointingLawParameters, const int32_t *speedRw0, const int32_t *speedRw1, const int32_t *speedRw2, const int32_t *speedRw3, double *rwTrqNs) { - double speedRws[4] = {(double)*speedRw0, (double)*speedRw1, (double)*speedRw2, (double)*speedRw3}; + // concentrate RW speeds as vector and convert to double + double speedRws[4] = {static_cast(*speedRw0), static_cast(*speedRw1), + static_cast(*speedRw2), static_cast(*speedRw3)}; double wheelMomentum[4] = {0, 0, 0, 0}; double rpmOffset[4] = {1, 1, 1, -1}, factor = 350 * 2 * Math::PI / 60; // conversion to [rad/s] for further calculations diff --git a/mission/controller/acs/control/PtgCtrl.h b/mission/controller/acs/control/PtgCtrl.h index fad72e6b..870732c7 100644 --- a/mission/controller/acs/control/PtgCtrl.h +++ b/mission/controller/acs/control/PtgCtrl.h @@ -1,13 +1,10 @@ #ifndef PTGCTRL_H_ #define PTGCTRL_H_ +#include +#include +#include #include -#include -#include - -#include "../AcsParameters.h" -#include "../SensorValues.h" -#include "eive/resultClassIds.h" class PtgCtrl { /* @@ -45,6 +42,7 @@ class PtgCtrl { private: const AcsParameters *acsParameters; + static constexpr double RAD_PER_SEC_TO_RPM = 60 / (2 * M_PI); }; #endif /* ACS_CONTROL_PTGCTRL_H_ */