Merge branch 'eggert/acs' into marquardt/ptgCtrl
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
# Conflicts: # mission/controller/AcsController.cpp # mission/controller/AcsController.h # mission/controller/acs/AcsParameters.h # mission/controller/acs/ActuatorCmd.h # mission/controller/acs/Guidance.cpp # mission/controller/acs/Guidance.h # mission/controller/acs/MultiplicativeKalmanFilter.cpp # mission/controller/acs/OutputValues.h # mission/controller/acs/SensorProcessing.cpp # mission/controller/acs/SensorProcessing.h # mission/controller/acs/control/Detumble.cpp # mission/controller/acs/control/Detumble.h # mission/controller/acs/control/PtgCtrl.cpp # mission/controller/acs/util/MathOperations.h
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#ifndef MISSION_CONTROLLER_ACSCONTROLLER_H_
|
||||
#define MISSION_CONTROLLER_ACSCONTROLLER_H_
|
||||
|
||||
#include <commonObjects.h>
|
||||
#include <fsfw/controller/ExtendedControllerBase.h>
|
||||
#include <fsfw/globalfunctions/math/VectorOperations.h>
|
||||
|
||||
@@ -9,14 +8,15 @@
|
||||
#include "acs/Guidance.h"
|
||||
#include "acs/Navigation.h"
|
||||
#include "acs/SensorProcessing.h"
|
||||
#include "acs/control/SafeCtrl.h"
|
||||
#include "acs/control/Detumble.h"
|
||||
#include "acs/control/PtgCtrl.h"
|
||||
#include "acs/control/SafeCtrl.h"
|
||||
#include "controllerdefinitions/AcsCtrlDefinitions.h"
|
||||
#include "eive/objects.h"
|
||||
#include "fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h"
|
||||
#include "fsfw_hal/devicehandlers/MgmRM3100Handler.h"
|
||||
#include "mission/devices/devicedefinitions/IMTQHandlerDefinitions.h"
|
||||
#include "mission/devices/devicedefinitions/SusDefinitions.h"
|
||||
#include "mission/devices/devicedefinitions/imtqHandlerDefinitions.h"
|
||||
|
||||
class AcsController : public ExtendedControllerBase {
|
||||
public:
|
||||
@@ -31,8 +31,11 @@ class AcsController : public ExtendedControllerBase {
|
||||
static const Submode_t SUBMODE_PTG_SUN = 6;
|
||||
static const Submode_t SUBMODE_PTG_INERTIAL = 7;
|
||||
|
||||
protected:
|
||||
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::ACS_SUBSYSTEM;
|
||||
static const Event SAFE_RATE_VIOLATION =
|
||||
MAKE_EVENT(0, severity::MEDIUM); //!< The limits for the rotation in safe mode were violated.
|
||||
|
||||
protected:
|
||||
void performSafe();
|
||||
void performDetumble();
|
||||
void performPointingCtrl();
|
||||
@@ -67,62 +70,98 @@ class AcsController : public ExtendedControllerBase {
|
||||
void modeChanged(Mode_t mode, Submode_t submode);
|
||||
void announceMode(bool recursive);
|
||||
|
||||
/* ACS Datasets */
|
||||
IMTQ::DipoleActuationSet dipoleSet = IMTQ::DipoleActuationSet(objects::IMTQ_HANDLER);
|
||||
// MGMs
|
||||
acsctrl::MgmDataRaw mgmData;
|
||||
|
||||
MGMLIS3MDL::MgmPrimaryDataset mgm0Lis3Set =
|
||||
MGMLIS3MDL::MgmPrimaryDataset(objects::MGM_0_LIS3_HANDLER);
|
||||
RM3100::Rm3100PrimaryDataset mgm1Rm3100Set =
|
||||
RM3100::Rm3100PrimaryDataset(objects::MGM_1_RM3100_HANDLER);
|
||||
MGMLIS3MDL::MgmPrimaryDataset mgm2Lis3Set =
|
||||
MGMLIS3MDL::MgmPrimaryDataset(objects::MGM_2_LIS3_HANDLER);
|
||||
RM3100::Rm3100PrimaryDataset mgm3Rm3100Set =
|
||||
RM3100::Rm3100PrimaryDataset(objects::MGM_3_RM3100_HANDLER);
|
||||
IMTQ::RawMtmMeasurementSet imtqMgmSet = IMTQ::RawMtmMeasurementSet(objects::IMTQ_HANDLER);
|
||||
|
||||
PoolEntry<float> mgm0PoolVec = PoolEntry<float>(3);
|
||||
PoolEntry<float> mgm1PoolVec = PoolEntry<float>(3);
|
||||
PoolEntry<float> mgm2PoolVec = PoolEntry<float>(3);
|
||||
PoolEntry<float> mgm3PoolVec = PoolEntry<float>(3);
|
||||
PoolEntry<float> imtqMgmPoolVec = PoolEntry<float>(3);
|
||||
acsctrl::MgmDataRaw mgmDataRaw;
|
||||
PoolEntry<float> mgm0VecRaw = PoolEntry<float>(3);
|
||||
PoolEntry<float> mgm1VecRaw = PoolEntry<float>(3);
|
||||
PoolEntry<float> mgm2VecRaw = PoolEntry<float>(3);
|
||||
PoolEntry<float> mgm3VecRaw = PoolEntry<float>(3);
|
||||
PoolEntry<float> imtqMgmVecRaw = PoolEntry<float>(3);
|
||||
PoolEntry<uint8_t> imtqCalActStatus = PoolEntry<uint8_t>();
|
||||
|
||||
void copyMgmData();
|
||||
|
||||
// Sun Sensors
|
||||
|
||||
acsctrl::SusDataRaw susData;
|
||||
|
||||
std::array<SUS::SusDataset, 12> susSets{
|
||||
SUS::SusDataset(objects::SUS_0_N_LOC_XFYFZM_PT_XF),
|
||||
SUS::SusDataset(objects::SUS_1_N_LOC_XBYFZM_PT_XB),
|
||||
SUS::SusDataset(objects::SUS_2_N_LOC_XFYBZB_PT_YB),
|
||||
SUS::SusDataset(objects::SUS_3_N_LOC_XFYBZF_PT_YF),
|
||||
SUS::SusDataset(objects::SUS_4_N_LOC_XMYFZF_PT_ZF),
|
||||
SUS::SusDataset(objects::SUS_5_N_LOC_XFYMZB_PT_ZB),
|
||||
SUS::SusDataset(objects::SUS_6_R_LOC_XFYBZM_PT_XF),
|
||||
SUS::SusDataset(objects::SUS_7_R_LOC_XBYBZM_PT_XB),
|
||||
SUS::SusDataset(objects::SUS_8_R_LOC_XBYBZB_PT_YB),
|
||||
SUS::SusDataset(objects::SUS_9_R_LOC_XBYBZB_PT_YF),
|
||||
SUS::SusDataset(objects::SUS_10_N_LOC_XMYBZF_PT_ZF),
|
||||
SUS::SusDataset(objects::SUS_11_R_LOC_XBYMZB_PT_ZB),
|
||||
};
|
||||
|
||||
PoolEntry<uint16_t> sus0PoolVec = PoolEntry<uint16_t>(6);
|
||||
PoolEntry<uint16_t> sus1PoolVec = PoolEntry<uint16_t>(6);
|
||||
PoolEntry<uint16_t> sus2PoolVec = PoolEntry<uint16_t>(6);
|
||||
PoolEntry<uint16_t> sus3PoolVec = PoolEntry<uint16_t>(6);
|
||||
PoolEntry<uint16_t> sus4PoolVec = PoolEntry<uint16_t>(6);
|
||||
PoolEntry<uint16_t> sus5PoolVec = PoolEntry<uint16_t>(6);
|
||||
PoolEntry<uint16_t> sus6PoolVec = PoolEntry<uint16_t>(6);
|
||||
PoolEntry<uint16_t> sus7PoolVec = PoolEntry<uint16_t>(6);
|
||||
PoolEntry<uint16_t> sus8PoolVec = PoolEntry<uint16_t>(6);
|
||||
PoolEntry<uint16_t> sus9PoolVec = PoolEntry<uint16_t>(6);
|
||||
PoolEntry<uint16_t> sus10PoolVec = PoolEntry<uint16_t>(6);
|
||||
PoolEntry<uint16_t> sus11PoolVec = PoolEntry<uint16_t>(6);
|
||||
acsctrl::MgmDataProcessed mgmDataProcessed;
|
||||
PoolEntry<float> mgm0VecProc = PoolEntry<float>(3);
|
||||
PoolEntry<float> mgm1VecProc = PoolEntry<float>(3);
|
||||
PoolEntry<float> mgm2VecProc = PoolEntry<float>(3);
|
||||
PoolEntry<float> mgm3VecProc = PoolEntry<float>(3);
|
||||
PoolEntry<float> mgm4VecProc = PoolEntry<float>(3);
|
||||
PoolEntry<double> mgmVecTot = PoolEntry<double>(3);
|
||||
PoolEntry<double> mgmVecTotDer = PoolEntry<double>(3);
|
||||
PoolEntry<double> magIgrf = PoolEntry<double>(3);
|
||||
|
||||
// SUSs
|
||||
acsctrl::SusDataRaw susDataRaw;
|
||||
PoolEntry<uint16_t> sus0ValRaw = PoolEntry<uint16_t>(6);
|
||||
PoolEntry<uint16_t> sus1ValRaw = PoolEntry<uint16_t>(6);
|
||||
PoolEntry<uint16_t> sus2ValRaw = PoolEntry<uint16_t>(6);
|
||||
PoolEntry<uint16_t> sus3ValRaw = PoolEntry<uint16_t>(6);
|
||||
PoolEntry<uint16_t> sus4ValRaw = PoolEntry<uint16_t>(6);
|
||||
PoolEntry<uint16_t> sus5ValRaw = PoolEntry<uint16_t>(6);
|
||||
PoolEntry<uint16_t> sus6ValRaw = PoolEntry<uint16_t>(6);
|
||||
PoolEntry<uint16_t> sus7ValRaw = PoolEntry<uint16_t>(6);
|
||||
PoolEntry<uint16_t> sus8ValRaw = PoolEntry<uint16_t>(6);
|
||||
PoolEntry<uint16_t> sus9ValRaw = PoolEntry<uint16_t>(6);
|
||||
PoolEntry<uint16_t> sus10ValRaw = PoolEntry<uint16_t>(6);
|
||||
PoolEntry<uint16_t> sus11ValRaw = PoolEntry<uint16_t>(6);
|
||||
void copySusData();
|
||||
|
||||
acsctrl::SusDataProcessed susDataProcessed;
|
||||
PoolEntry<float> sus0VecProc = PoolEntry<float>(3);
|
||||
PoolEntry<float> sus1VecProc = PoolEntry<float>(3);
|
||||
PoolEntry<float> sus2VecProc = PoolEntry<float>(3);
|
||||
PoolEntry<float> sus3VecProc = PoolEntry<float>(3);
|
||||
PoolEntry<float> sus4VecProc = PoolEntry<float>(3);
|
||||
PoolEntry<float> sus5VecProc = PoolEntry<float>(3);
|
||||
PoolEntry<float> sus6VecProc = PoolEntry<float>(3);
|
||||
PoolEntry<float> sus7VecProc = PoolEntry<float>(3);
|
||||
PoolEntry<float> sus8VecProc = PoolEntry<float>(3);
|
||||
PoolEntry<float> sus9VecProc = PoolEntry<float>(3);
|
||||
PoolEntry<float> sus10VecProc = PoolEntry<float>(3);
|
||||
PoolEntry<float> sus11VecProc = PoolEntry<float>(3);
|
||||
PoolEntry<double> susVecTot = PoolEntry<double>(3);
|
||||
PoolEntry<double> susVecTotDer = PoolEntry<double>(3);
|
||||
PoolEntry<double> sunIjk = PoolEntry<double>(3);
|
||||
|
||||
// GYRs
|
||||
acsctrl::GyrDataRaw gyrDataRaw;
|
||||
PoolEntry<double> gyr0VecRaw = PoolEntry<double>(3);
|
||||
PoolEntry<float> gyr1VecRaw = PoolEntry<float>(3);
|
||||
PoolEntry<double> gyr2VecRaw = PoolEntry<double>(3);
|
||||
PoolEntry<float> gyr3VecRaw = PoolEntry<float>(3);
|
||||
void copyGyrData();
|
||||
|
||||
acsctrl::GyrDataProcessed gyrDataProcessed;
|
||||
PoolEntry<double> gyr0VecProc = PoolEntry<double>(3);
|
||||
PoolEntry<double> gyr1VecProc = PoolEntry<double>(3);
|
||||
PoolEntry<double> gyr2VecProc = PoolEntry<double>(3);
|
||||
PoolEntry<double> gyr3VecProc = PoolEntry<double>(3);
|
||||
PoolEntry<double> gyrVecTot = PoolEntry<double>(3);
|
||||
|
||||
// GPS
|
||||
acsctrl::GpsDataProcessed gpsDataProcessed;
|
||||
PoolEntry<double> gcLatitude = PoolEntry<double>();
|
||||
PoolEntry<double> gdLongitude = PoolEntry<double>();
|
||||
|
||||
// MEKF
|
||||
acsctrl::MekfData mekfData;
|
||||
PoolEntry<double> quatMekf = PoolEntry<double>(4);
|
||||
PoolEntry<double> satRotRateMekf = PoolEntry<double>(3);
|
||||
|
||||
// Ctrl Values
|
||||
acsctrl::CtrlValData ctrlValData;
|
||||
PoolEntry<double> tgtQuat = PoolEntry<double>(4);
|
||||
PoolEntry<double> errQuat = PoolEntry<double>(4);
|
||||
PoolEntry<double> errAng = PoolEntry<double>();
|
||||
|
||||
// Actuator CMD
|
||||
acsctrl::ActuatorCmdData actuatorCmdData;
|
||||
PoolEntry<double> rwTargetTorque = PoolEntry<double>(4);
|
||||
PoolEntry<int32_t> rwTargetSpeed = PoolEntry<int32_t>(4);
|
||||
PoolEntry<int16_t> mtqTargetDipole = PoolEntry<int16_t>(3);
|
||||
|
||||
// Initial delay to make sure all pool variables have been initialized their owners
|
||||
Countdown initialCountdown = Countdown(INIT_DELAY);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user