2022-09-19 15:44:14 +02:00
|
|
|
/*******************************
|
|
|
|
* EIVE Flight Software Framework (FSFW)
|
|
|
|
* (c) 2022 IRS, Uni Stuttgart
|
|
|
|
*******************************/
|
|
|
|
#ifndef SENSORPROCESSING_H_
|
|
|
|
#define SENSORPROCESSING_H_
|
|
|
|
|
2022-10-06 15:38:23 +02:00
|
|
|
#include <fsfw/returnvalues/returnvalue.h>
|
|
|
|
#include <stdint.h> //uint8_t
|
|
|
|
#include <time.h> /*purpose, timeval ?*/
|
|
|
|
|
|
|
|
#include "../controllerdefinitions/AcsCtrlDefinitions.h"
|
2022-09-27 11:06:11 +02:00
|
|
|
#include "AcsParameters.h"
|
|
|
|
#include "OutputValues.h"
|
2022-10-06 15:38:23 +02:00
|
|
|
#include "SensorValues.h"
|
2022-10-10 09:54:06 +02:00
|
|
|
#include "SusConverter.h"
|
2022-09-27 11:06:11 +02:00
|
|
|
#include "config/classIds.h"
|
2022-09-19 15:44:14 +02:00
|
|
|
|
2022-10-06 15:38:23 +02:00
|
|
|
class SensorProcessing {
|
|
|
|
public:
|
|
|
|
void reset();
|
|
|
|
|
|
|
|
SensorProcessing(AcsParameters *acsParameters_);
|
|
|
|
virtual ~SensorProcessing();
|
|
|
|
|
2022-10-12 10:27:28 +02:00
|
|
|
void process(timeval now, ACS::SensorValues *sensorValues, ACS::OutputValues *outputValues,
|
2022-10-06 15:38:23 +02:00
|
|
|
const AcsParameters *acsParameters); // Will call protected functions
|
|
|
|
private:
|
|
|
|
protected:
|
|
|
|
// short description needed for every function
|
|
|
|
bool processMgm(const float *mgm0Value, bool mgm0valid, const float *mgm1Value, bool mgm1valid,
|
|
|
|
const float *mgm2Value, bool mgm2valid, const float *mgm3Value, bool mgm3valid,
|
|
|
|
const float *mgm4Value, bool mgm4valid, timeval timeOfMgmMeasurement,
|
|
|
|
const AcsParameters::MgmHandlingParameters *mgmParameters,
|
|
|
|
const double gpsLatitude, const double gpsLongitude, const double gpsAltitude,
|
|
|
|
bool gpsValid, double *magFieldEst, bool *outputValid, double *magFieldModel,
|
|
|
|
bool *magFieldModelValid, double *magneticFieldVectorDerivative,
|
|
|
|
bool *magneticFieldVectorDerivativeValid); // Output
|
|
|
|
|
2022-10-10 16:02:57 +02:00
|
|
|
void processSus(const uint16_t *sus0Value, bool sus0valid, const uint16_t *sus1Value,
|
|
|
|
bool sus1valid, const uint16_t *sus2Value, bool sus2valid,
|
|
|
|
const uint16_t *sus3Value, bool sus3valid, const uint16_t *sus4Value,
|
|
|
|
bool sus4valid, const uint16_t *sus5Value, bool sus5valid,
|
|
|
|
const uint16_t *sus6Value, bool sus6valid, const uint16_t *sus7Value,
|
|
|
|
bool sus7valid, const uint16_t *sus8Value, bool sus8valid,
|
|
|
|
const uint16_t *sus9Value, bool sus9valid, const uint16_t *sus10Value,
|
|
|
|
bool sus10valid, const uint16_t *sus11Value, bool sus11valid,
|
|
|
|
timeval timeOfSusMeasurement,
|
2022-10-06 15:38:23 +02:00
|
|
|
const AcsParameters::SusHandlingParameters *susParameters,
|
|
|
|
const AcsParameters::SunModelParameters *sunModelParameters, double *sunDirEst,
|
|
|
|
bool *sunDirEstValid, double *sunVectorInertial, bool *sunVectorInertialValid,
|
|
|
|
double *sunVectorDerivative, bool *sunVectorDerivativeValid);
|
|
|
|
|
2022-10-11 15:01:32 +02:00
|
|
|
void processGyr(const double gyr0axXvalue, bool gyr0axXvalid, const double gyr0axYvalue,
|
|
|
|
bool gyr0axYvalid, const double gyr0axZvalue, bool gyr0axZvalid,
|
|
|
|
const double gyr1axXvalue, bool gyr1axXvalid, const double gyr1axYvalue,
|
|
|
|
bool gyr1axYvalid, const double gyr1axZvalue, bool gyr1axZvalid,
|
|
|
|
const double gyr2axXvalue, bool gyr2axXvalid, const double gyr2axYvalue,
|
|
|
|
bool gyr2axYvalid, const double gyr2axZvalue, bool gyr2axZvalid,
|
|
|
|
const double gyr3axXvalue, bool gyr3axXvalid, const double gyr3axYvalue,
|
|
|
|
bool gyr3axYvalid, const double gyr3axZvalue, bool gyr3axZvalid,
|
|
|
|
timeval timeOfGyrMeasurement,
|
|
|
|
const AcsParameters::GyrHandlingParameters *gyrParameters, double *satRatEst,
|
2022-10-06 15:38:23 +02:00
|
|
|
bool *satRateEstValid);
|
|
|
|
|
|
|
|
void processStr();
|
|
|
|
|
|
|
|
void processGps(const double gps0latitude, const double gps0longitude, const bool validGps,
|
|
|
|
double *gcLatitude, double *gdLongitude);
|
|
|
|
|
|
|
|
double savedMagFieldEst[3];
|
|
|
|
timeval timeOfSavedMagFieldEst;
|
|
|
|
double savedSunVector[3];
|
|
|
|
timeval timeOfSavedSusDirEst;
|
|
|
|
bool validMagField;
|
|
|
|
bool validGcLatitude;
|
|
|
|
|
|
|
|
SusConverter susConverter;
|
|
|
|
AcsParameters acsParameters;
|
2022-09-19 15:44:14 +02:00
|
|
|
};
|
|
|
|
|
2022-09-27 11:57:15 +02:00
|
|
|
#endif /*SENSORPROCESSING_H_*/
|