eive-obsw/mission/controller/acs/SusConverter.h
Marius Eggert 3079dabc20
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
combined SensorProcessing and SusConverter
2022-10-06 15:38:23 +02:00

62 lines
2.3 KiB
C++

/*
* SusConverter.h
*
* Created on: Sep 22, 2022
* Author: marius
*/
#ifndef MISSION_CONTROLLER_ACS_SUSCONVERTER_H_
#define MISSION_CONTROLLER_ACS_SUSCONVERTER_H_
#include <fsfw/datapoollocal/LocalPoolVector.h>
#include <stdint.h>
#include "AcsParameters.h"
class SusConverter {
public:
SusConverter() {}
bool checkSunSensorData(lp_vec_t<uint16_t, 6> susChannel);
void calcAngle(lp_vec_t<uint16_t, 6> susChannel);
void calibration(const float coeffAlpha[9][10], const float coeffBeta[9][10]);
float* calculateSunVector();
bool getValidFlag(uint8_t susNumber);
float* getSunVectorSensorFrame(lp_vec_t<uint16_t, 6> susChannel, const float coeffAlpha[9][10],
const float coeffBeta[9][10]);
float* TransferSunVector();
private:
float alphaBetaRaw[2]; //[°]
// float coeffAlpha[9][10];
// float coeffBeta[9][10];
float alphaBetaCalibrated[2]; //[°]
float sunVectorBodyFrame[3]; //[-]
bool validFlag[12] = {returnvalue::OK, returnvalue::OK, returnvalue::OK, returnvalue::OK,
returnvalue::OK, returnvalue::OK, returnvalue::OK, returnvalue::OK,
returnvalue::OK, returnvalue::OK, returnvalue::OK, returnvalue::OK};
static const uint8_t GNDREF = 4;
uint16_t susChannelValueCheckHigh =
4096; //=2^12[Bit]high borderline for the channel values of one sun sensor for validity Check
uint8_t susChannelValueCheckLow =
0; //[Bit]low borderline for the channel values of one sun sensor for validity Check
uint16_t susChannelValueSumHigh =
100; // 4096[Bit]high borderline for check if the sun sensor is illuminated by the sun or by
// the reflection of sunlight from the moon/earth
uint8_t susChannelValueSumLow =
0; //[Bit]low borderline for check if the sun sensor is illuminated
// by the sun or by the reflection of sunlight from the moon/earth
uint8_t completeCellWidth = 140,
halfCellWidth = 70; //[°] Width of the calibration cells --> necessary for checking in
// which cell a data point should be
uint16_t susChannelValueSum = 0;
AcsParameters acsParameters;
};
#endif /* MISSION_CONTROLLER_ACS_SUSCONVERTER_H_ */