2021-07-07 12:12:01 +02:00
|
|
|
#ifndef MISSION_STARTRACKER_DEFINITIONS_H_
|
|
|
|
#define MISSION_STARTRACKER_DEFINITIONS_H_
|
|
|
|
|
|
|
|
#include <fsfw/datapoollocal/StaticLocalDataSet.h>
|
|
|
|
#include <fsfw/datapoollocal/LocalPoolVariable.h>
|
|
|
|
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
|
|
|
|
#include "objects/systemObjectList.h"
|
2021-11-27 19:40:52 +01:00
|
|
|
#include <fsfw/datapool/PoolReadGuard.h>
|
2021-07-07 12:12:01 +02:00
|
|
|
|
|
|
|
namespace StarTracker {
|
|
|
|
|
|
|
|
/** This is the address of the star tracker */
|
|
|
|
static const uint8_t ADDRESS = 33;
|
|
|
|
|
2021-11-26 13:16:05 +01:00
|
|
|
static const uint8_t STATUS_OK = 0;
|
|
|
|
|
2021-07-07 12:12:01 +02:00
|
|
|
enum PoolIds: lp_id_t {
|
2021-11-27 19:40:52 +01:00
|
|
|
TICKS_TIME_SET,
|
|
|
|
TIME_TIME_SET,
|
|
|
|
RUN_TIME,
|
|
|
|
UNIX_TIME,
|
2021-11-26 15:24:52 +01:00
|
|
|
TICKS_VERSION_SET,
|
|
|
|
TIME_VERSION_SET,
|
2021-11-27 19:40:52 +01:00
|
|
|
PROGRAM,
|
|
|
|
MAJOR,
|
|
|
|
MINOR,
|
|
|
|
TICKS_INTERFACE_SET,
|
|
|
|
TIME_INTERFACE_SET,
|
|
|
|
FRAME_COUNT,
|
|
|
|
CHECKSUM_ERROR_COUNT,
|
|
|
|
SET_PARAM_COUNT,
|
|
|
|
SET_PARAM_REPLY_COUNT,
|
|
|
|
PARAM_REQUEST_COUNT,
|
|
|
|
PARAM_REPLY_COUNT,
|
|
|
|
REQ_TM_COUNT,
|
|
|
|
TM_REPLY_COUNT,
|
|
|
|
ACTION_REQ_COUNT,
|
|
|
|
ACTION_REPLY_COUNT,
|
|
|
|
TICKS_POWER_SET,
|
|
|
|
TIME_POWER_SET,
|
|
|
|
MCU_CURRENT,
|
|
|
|
MCU_VOLTAGE,
|
|
|
|
FPGA_CORE_CURRENT,
|
|
|
|
FPGA_CORE_VOLTAGE,
|
|
|
|
FPGA_18_CURRENT,
|
|
|
|
FPGA_18_VOLTAGE,
|
|
|
|
FPGA_25_CURRENT,
|
|
|
|
FPGA_25_VOLTAGE,
|
|
|
|
CMV_21_CURRENT,
|
|
|
|
CMV_21_VOLTAGE,
|
|
|
|
CMV_PIX_CURRENT,
|
|
|
|
CMV_PIX_VOLTAGE,
|
|
|
|
CMV_33_CURRENT,
|
|
|
|
CMV_33_VOLTAGE,
|
|
|
|
CMV_RES_CURRENT,
|
|
|
|
CMV_RES_VOLTAGE,
|
2021-11-26 15:24:52 +01:00
|
|
|
TICKS_TEMPERATURE_SET,
|
|
|
|
TIME_TEMPERATURE_SET,
|
2021-07-07 12:12:01 +02:00
|
|
|
MCU_TEMPERATURE,
|
2021-11-26 15:24:52 +01:00
|
|
|
CMOS_TEMPERATURE,
|
2021-07-07 12:12:01 +02:00
|
|
|
|
2021-11-27 19:40:52 +01:00
|
|
|
TICKS_SOLUTION_SET,
|
|
|
|
TIME_SOLUTION_SET,
|
|
|
|
CALI_QW,
|
|
|
|
CALI_QX,
|
|
|
|
CALI_QY,
|
|
|
|
CALI_QZ,
|
|
|
|
TRACK_CONFIDENCE,
|
|
|
|
TRACK_QW,
|
|
|
|
TRACK_QX,
|
|
|
|
TRACK_QY,
|
|
|
|
TRACK_QZ,
|
|
|
|
TRACK_REMOVED,
|
|
|
|
STARS_CENTROIDED,
|
|
|
|
STARS_MATCHED_DATABASE,
|
|
|
|
LISA_QW,
|
|
|
|
LISA_QX,
|
|
|
|
LISA_QY,
|
|
|
|
LISA_QZ,
|
|
|
|
LISA_PERC_CLOSE,
|
|
|
|
LISA_NR_CLOSE,
|
|
|
|
TRUST_WORTHY,
|
|
|
|
STABLE_COUNT,
|
|
|
|
SOLUTION_STRATEGY
|
|
|
|
};
|
2021-07-07 12:12:01 +02:00
|
|
|
|
2021-11-26 09:14:41 +01:00
|
|
|
static const DeviceCommandId_t PING_REQUEST = 0;
|
2021-11-27 19:40:52 +01:00
|
|
|
// Boots image (works only in bootloader mode)
|
|
|
|
static const DeviceCommandId_t BOOT = 1;
|
2021-11-26 15:24:52 +01:00
|
|
|
static const DeviceCommandId_t REQ_VERSION = 2;
|
2021-11-27 19:40:52 +01:00
|
|
|
static const DeviceCommandId_t REQ_INTERFACE = 3;
|
|
|
|
static const DeviceCommandId_t REQ_TIME = 4;
|
2021-11-26 13:16:05 +01:00
|
|
|
static const DeviceCommandId_t REBOOT = 7;
|
2021-12-02 08:05:33 +01:00
|
|
|
static const DeviceCommandId_t DOWNLOAD_IMAGE = 9;
|
2021-11-29 11:04:56 +01:00
|
|
|
static const DeviceCommandId_t UPLOAD_IMAGE = 10;
|
2021-11-27 19:40:52 +01:00
|
|
|
static const DeviceCommandId_t REQ_POWER = 11;
|
|
|
|
static const DeviceCommandId_t SUBSCRIBE_TO_TM = 18;
|
|
|
|
static const DeviceCommandId_t REQ_SOLUTION = 24;
|
2021-07-07 12:12:01 +02:00
|
|
|
static const DeviceCommandId_t REQ_TEMPERATURE = 25;
|
2021-12-06 19:36:21 +01:00
|
|
|
static const DeviceCommandId_t LIMITS = 40;
|
2021-12-07 16:30:17 +01:00
|
|
|
static const DeviceCommandId_t MOUNTING = 41;
|
2021-12-06 19:36:21 +01:00
|
|
|
static const DeviceCommandId_t CAMERA = 42;
|
|
|
|
static const DeviceCommandId_t BLOB = 43;
|
|
|
|
static const DeviceCommandId_t CENTROIDING = 44;
|
|
|
|
static const DeviceCommandId_t LISA = 45;
|
2021-12-07 16:30:17 +01:00
|
|
|
static const DeviceCommandId_t MATCHING = 46;
|
2021-12-06 19:36:21 +01:00
|
|
|
static const DeviceCommandId_t TRACKING = 47;
|
|
|
|
static const DeviceCommandId_t VALIDATION = 48;
|
|
|
|
static const DeviceCommandId_t ALGO = 49;
|
2021-11-29 11:04:56 +01:00
|
|
|
static const DeviceCommandId_t NONE = 0xFFFFFFFF;
|
2021-07-07 12:12:01 +02:00
|
|
|
|
2021-11-26 15:24:52 +01:00
|
|
|
static const uint32_t VERSION_SET_ID = REQ_VERSION;
|
2021-11-27 19:40:52 +01:00
|
|
|
static const uint32_t INTERFACE_SET_ID = REQ_INTERFACE;
|
|
|
|
static const uint32_t POWER_SET_ID = REQ_POWER;
|
2021-07-07 12:12:01 +02:00
|
|
|
static const uint32_t TEMPERATURE_SET_ID = REQ_TEMPERATURE;
|
2021-11-27 19:40:52 +01:00
|
|
|
static const uint32_t TIME_SET_ID = REQ_TIME;
|
|
|
|
static const uint32_t SOLUTION_SET_ID = REQ_SOLUTION;
|
2021-07-07 12:12:01 +02:00
|
|
|
|
|
|
|
/** Max size of unencoded frame */
|
|
|
|
static const size_t MAX_FRAME_SIZE = 1200;
|
|
|
|
|
2021-11-26 15:24:52 +01:00
|
|
|
static const uint8_t TEMPERATURE_SET_ENTRIES = 4;
|
2021-11-27 19:40:52 +01:00
|
|
|
static const uint8_t VERSION_SET_ENTRIES = 5;
|
2021-11-29 11:04:56 +01:00
|
|
|
static const uint8_t INTERFACE_SET_ENTRIES = 4;
|
2021-11-27 19:40:52 +01:00
|
|
|
static const uint8_t POWER_SET_ENTRIES = 18;
|
|
|
|
static const uint8_t TIME_SET_ENTRIES = 4;
|
|
|
|
static const uint8_t SOLUTION_SET_ENTRIES = 23;
|
|
|
|
|
|
|
|
// Action, parameter and telemetry IDs
|
|
|
|
namespace ID {
|
|
|
|
static const uint8_t PING = 0;
|
|
|
|
static const uint8_t BOOT = 1;
|
|
|
|
static const uint8_t VERSION = 2;
|
|
|
|
static const uint8_t INTERFACE = 3;
|
2021-12-06 19:36:21 +01:00
|
|
|
static const uint8_t LIMITS = 5;
|
|
|
|
static const uint8_t MOUNTING = 6;
|
|
|
|
static const uint8_t CAMERA = 9;
|
|
|
|
static const uint8_t BLOB = 10;
|
|
|
|
static const uint8_t CENTROIDING = 11;
|
|
|
|
static const uint8_t LISA = 12;
|
|
|
|
static const uint8_t MATCHING = 13;
|
|
|
|
static const uint8_t TRACKING = 14;
|
|
|
|
static const uint8_t VALIDATION = 15;
|
|
|
|
static const uint8_t ALGO = 16;
|
2021-11-27 19:40:52 +01:00
|
|
|
static const uint8_t REBOOT = 7;
|
2021-11-29 11:04:56 +01:00
|
|
|
static const uint8_t UPLOAD_IMAGE = 10;
|
2021-11-27 19:40:52 +01:00
|
|
|
static const uint8_t POWER = 11;
|
|
|
|
static const uint8_t SUBSCRIBE = 18;
|
|
|
|
static const uint8_t SOLUTION = 24;
|
|
|
|
static const uint8_t TEMPERATURE = 25;
|
|
|
|
static const uint8_t TIME = 1;
|
|
|
|
}
|
2021-07-07 12:12:01 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief This dataset can be used to store the temperature of a reaction wheel.
|
|
|
|
*/
|
|
|
|
class TemperatureSet:
|
|
|
|
public StaticLocalDataSet<TEMPERATURE_SET_ENTRIES> {
|
|
|
|
public:
|
|
|
|
|
|
|
|
TemperatureSet(HasLocalDataPoolIF* owner):
|
|
|
|
StaticLocalDataSet(owner, TEMPERATURE_SET_ID) {
|
|
|
|
}
|
|
|
|
|
|
|
|
TemperatureSet(object_id_t objectId):
|
|
|
|
StaticLocalDataSet(sid_t(objectId, TEMPERATURE_SET_ID)) {
|
|
|
|
}
|
|
|
|
|
2021-11-26 13:16:05 +01:00
|
|
|
// Ticks is time reference generated by interanl counter of the star tracker
|
2021-07-07 12:12:01 +02:00
|
|
|
lp_var_t<uint32_t> ticks = lp_var_t<uint32_t>(sid.objectId,
|
2021-11-26 15:24:52 +01:00
|
|
|
PoolIds::TICKS_TEMPERATURE_SET, this);
|
2021-07-07 12:12:01 +02:00
|
|
|
/** Unix time in microseconds */
|
2021-07-08 11:20:19 +02:00
|
|
|
lp_var_t<uint64_t> time = lp_var_t<uint64_t>(sid.objectId,
|
2021-11-26 15:24:52 +01:00
|
|
|
PoolIds::TIME_TEMPERATURE_SET, this);
|
2021-07-07 12:12:01 +02:00
|
|
|
lp_var_t<float> mcuTemperature = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::MCU_TEMPERATURE, this);
|
|
|
|
lp_var_t<float> cmosTemperature = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::CMOS_TEMPERATURE, this);
|
2021-11-28 09:57:14 +01:00
|
|
|
|
|
|
|
void printSet() {
|
|
|
|
sif::info << "TemperatureSet::printSet: Ticks: "
|
|
|
|
<< this->ticks << std::endl;
|
|
|
|
sif::info << "TemperatureSet::printSet: Time: "
|
|
|
|
<< this->time << " us" << std::endl;
|
|
|
|
sif::info << "TemperatureSet::printSet: MCU Temperature: "
|
|
|
|
<< this->mcuTemperature << " °C" << std::endl;
|
|
|
|
sif::info << "TemperatureSet::printSet: CMOS Temperature: "
|
2021-11-29 11:04:56 +01:00
|
|
|
<< this->cmosTemperature << " °C" << std::endl;
|
2021-11-28 09:57:14 +01:00
|
|
|
}
|
2021-07-07 12:12:01 +02:00
|
|
|
};
|
|
|
|
|
2021-11-26 15:24:52 +01:00
|
|
|
/**
|
|
|
|
* @brief Package to store version parameters
|
|
|
|
*/
|
|
|
|
class VersionSet:
|
|
|
|
public StaticLocalDataSet<VERSION_SET_ENTRIES> {
|
|
|
|
public:
|
|
|
|
|
|
|
|
VersionSet(HasLocalDataPoolIF* owner):
|
|
|
|
StaticLocalDataSet(owner, VERSION_SET_ID) {
|
|
|
|
}
|
|
|
|
|
|
|
|
VersionSet(object_id_t objectId):
|
|
|
|
StaticLocalDataSet(sid_t(objectId, VERSION_SET_ID)) {
|
|
|
|
}
|
|
|
|
|
|
|
|
// Ticks is time reference generated by interanl counter of the star tracker
|
|
|
|
lp_var_t<uint32_t> ticks = lp_var_t<uint32_t>(sid.objectId,
|
|
|
|
PoolIds::TICKS_VERSION_SET, this);
|
|
|
|
/** Unix time in microseconds */
|
|
|
|
lp_var_t<uint64_t> time = lp_var_t<uint64_t>(sid.objectId,
|
|
|
|
PoolIds::TIME_VERSION_SET, this);
|
|
|
|
lp_var_t<uint8_t> program = lp_var_t<uint8_t>(sid.objectId,
|
|
|
|
PoolIds::PROGRAM, this);
|
|
|
|
lp_var_t<uint8_t> major = lp_var_t<uint8_t>(sid.objectId,
|
|
|
|
PoolIds::MAJOR, this);
|
|
|
|
lp_var_t<uint8_t> minor = lp_var_t<uint8_t>(sid.objectId,
|
|
|
|
PoolIds::MINOR, this);
|
2021-11-29 11:04:56 +01:00
|
|
|
|
|
|
|
void printSet() {
|
|
|
|
PoolReadGuard rg(this);
|
|
|
|
sif::info << "VersionSet::printSet: Ticks: "
|
|
|
|
<< this->ticks << std::endl;
|
|
|
|
sif::info << "VersionSet::printSet: Unix Time: "
|
|
|
|
<< this->time << " us" << std::endl;
|
|
|
|
sif::info << "VersionSet::printSet: Program: "
|
|
|
|
<< static_cast<unsigned int>(this->program.value) << std::endl;
|
|
|
|
sif::info << "VersionSet::printSet: Major: "
|
|
|
|
<< static_cast<unsigned int>(this->major.value) << std::endl;
|
|
|
|
sif::info << "VersionSet::printSet: Minor: "
|
|
|
|
<< static_cast<unsigned int>(this->minor.value) << std::endl;
|
|
|
|
}
|
2021-11-26 15:24:52 +01:00
|
|
|
};
|
|
|
|
|
2021-11-27 19:40:52 +01:00
|
|
|
/**
|
|
|
|
* @brief Dataset to store the interface telemtry data.
|
|
|
|
*/
|
|
|
|
class InterfaceSet:
|
|
|
|
public StaticLocalDataSet<INTERFACE_SET_ENTRIES> {
|
|
|
|
public:
|
|
|
|
|
|
|
|
InterfaceSet(HasLocalDataPoolIF* owner):
|
|
|
|
StaticLocalDataSet(owner, REQ_INTERFACE) {
|
|
|
|
}
|
|
|
|
|
|
|
|
InterfaceSet(object_id_t objectId):
|
|
|
|
StaticLocalDataSet(sid_t(objectId, REQ_INTERFACE)) {
|
|
|
|
}
|
|
|
|
|
|
|
|
// Ticks is time reference generated by interanl counter of the star tracker
|
|
|
|
lp_var_t<uint32_t> ticks = lp_var_t<uint32_t>(sid.objectId,
|
|
|
|
PoolIds::TICKS_INTERFACE_SET, this);
|
|
|
|
/** Unix time in microseconds */
|
|
|
|
lp_var_t<uint64_t> time = lp_var_t<uint64_t>(sid.objectId,
|
|
|
|
PoolIds::TIME_INTERFACE_SET, this);
|
|
|
|
lp_var_t<uint32_t> frameCount = lp_var_t<uint32_t>(sid.objectId,
|
|
|
|
PoolIds::FRAME_COUNT, this);
|
|
|
|
lp_var_t<uint32_t> checksumerrorCount = lp_var_t<uint32_t>(sid.objectId,
|
|
|
|
PoolIds::CHECKSUM_ERROR_COUNT, this);
|
2021-11-29 11:04:56 +01:00
|
|
|
|
|
|
|
void printSet() {
|
|
|
|
PoolReadGuard rg(this);
|
|
|
|
sif::info << "InterfaceSet::printSet: Ticks: "
|
|
|
|
<< this->ticks << std::endl;
|
|
|
|
sif::info << "InterfaceSet::printSet: Time: "
|
|
|
|
<< this->time << " us" << std::endl;
|
|
|
|
sif::info << "InterfaceSet::printSet: Frame Count: "
|
|
|
|
<< this->frameCount << std::endl;
|
|
|
|
sif::info << "InterfaceSet::printSet: Checksum Error Count: "
|
|
|
|
<< this->checksumerrorCount << std::endl;
|
|
|
|
}
|
2021-11-27 19:40:52 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Dataset to store the data of the power telemetry reply.
|
|
|
|
*/
|
|
|
|
class PowerSet:
|
|
|
|
public StaticLocalDataSet<POWER_SET_ENTRIES> {
|
|
|
|
public:
|
|
|
|
|
|
|
|
PowerSet(HasLocalDataPoolIF* owner):
|
|
|
|
StaticLocalDataSet(owner, REQ_INTERFACE) {
|
|
|
|
}
|
|
|
|
|
|
|
|
PowerSet(object_id_t objectId):
|
|
|
|
StaticLocalDataSet(sid_t(objectId, REQ_INTERFACE)) {
|
|
|
|
}
|
|
|
|
|
|
|
|
// Ticks is time reference generated by interanl counter of the star tracker
|
|
|
|
lp_var_t<uint32_t> ticks = lp_var_t<uint32_t>(sid.objectId,
|
|
|
|
PoolIds::TICKS_POWER_SET, this);
|
|
|
|
/** Unix time in microseconds */
|
|
|
|
lp_var_t<uint64_t> time = lp_var_t<uint64_t>(sid.objectId,
|
|
|
|
PoolIds::TIME_POWER_SET, this);
|
|
|
|
lp_var_t<float> mcuCurrent = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::MCU_CURRENT, this);
|
|
|
|
lp_var_t<float> mcuVoltage = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::MCU_VOLTAGE, this);
|
|
|
|
lp_var_t<float> fpgaCoreCurrent = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::FPGA_CORE_CURRENT, this);
|
|
|
|
lp_var_t<float> fpgaCoreVoltage = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::FPGA_CORE_VOLTAGE, this);
|
|
|
|
lp_var_t<float> fpga18Current = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::FPGA_18_CURRENT, this);
|
|
|
|
lp_var_t<float> fpga18Voltage = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::FPGA_18_VOLTAGE, this);
|
|
|
|
lp_var_t<float> fpga25Current = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::FPGA_25_CURRENT, this);
|
|
|
|
lp_var_t<float> fpga25Voltage = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::FPGA_25_VOLTAGE, this);
|
|
|
|
lp_var_t<float> cmv21Current = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::CMV_21_CURRENT, this);
|
|
|
|
lp_var_t<float> cmv21Voltage = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::CMV_21_VOLTAGE, this);
|
|
|
|
lp_var_t<float> cmvPixCurrent = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::CMV_PIX_CURRENT, this);
|
|
|
|
lp_var_t<float> cmvPixVoltage = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::CMV_PIX_VOLTAGE, this);
|
|
|
|
lp_var_t<float> cmv33Current = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::CMV_33_CURRENT, this);
|
|
|
|
lp_var_t<float> cmv33Voltage = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::CMV_33_VOLTAGE, this);
|
|
|
|
lp_var_t<float> cmvResCurrent = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::CMV_RES_CURRENT, this);
|
|
|
|
lp_var_t<float> cmvResVoltage = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::CMV_RES_VOLTAGE, this);
|
2021-11-29 11:04:56 +01:00
|
|
|
|
|
|
|
void printSet() {
|
|
|
|
PoolReadGuard rg(this);
|
|
|
|
sif::info << "PowerSet::printSet: Ticks: "
|
|
|
|
<< this->ticks << std::endl;
|
|
|
|
sif::info << "PowerSet::printSet: Time: "
|
|
|
|
<< this->time << " us" << std::endl;
|
|
|
|
sif::info << "PowerSet::printSet: MCU Current: "
|
|
|
|
<< this->mcuCurrent << " A" << std::endl;
|
|
|
|
sif::info << "PowerSet::printSet: MCU Voltage: "
|
|
|
|
<< this->mcuVoltage << " V" << std::endl;
|
|
|
|
sif::info << "PowerSet::printSet: FPGA Core current: "
|
|
|
|
<< this->fpgaCoreCurrent << " A" << std::endl;
|
|
|
|
sif::info << "PowerSet::printSet: FPGA Core voltage: "
|
|
|
|
<< this->fpgaCoreVoltage << " V" << std::endl;
|
|
|
|
sif::info << "PowerSet::printSet: FPGA 18 current: "
|
|
|
|
<< this->fpga18Current << " A" << std::endl;
|
|
|
|
sif::info << "PowerSet::printSet: FPGA 18 voltage: "
|
|
|
|
<< this->fpga18Voltage << " V" << std::endl;
|
|
|
|
sif::info << "PowerSet::printSet: FPGA 25 current: "
|
|
|
|
<< this->fpga25Current << " A" << std::endl;
|
|
|
|
sif::info << "PowerSet::printSet: FPGA 25 voltage: "
|
|
|
|
<< this->fpga25Voltage << " V" << std::endl;
|
|
|
|
sif::info << "PowerSet::printSet: CMV 21 current: "
|
|
|
|
<< this->cmv21Current << " A" << std::endl;
|
|
|
|
sif::info << "PowerSet::printSet: CMV 21 voltage: "
|
|
|
|
<< this->cmv21Voltage << " V" << std::endl;
|
|
|
|
sif::info << "PowerSet::printSet: CMV Pix current: "
|
|
|
|
<< this->cmvPixCurrent << " A" << std::endl;
|
|
|
|
sif::info << "PowerSet::printSet: CMV Pix voltage: "
|
|
|
|
<< this->cmvPixVoltage << " V" << std::endl;
|
|
|
|
sif::info << "PowerSet::printSet: CMV 33 current: "
|
|
|
|
<< this->cmv33Current << " A" << std::endl;
|
|
|
|
sif::info << "PowerSet::printSet: CMV 33 voltage: "
|
|
|
|
<< this->cmv33Voltage << " V" << std::endl;
|
|
|
|
sif::info << "PowerSet::printSet: CMV Res current: "
|
|
|
|
<< this->cmvResCurrent << " A" << std::endl;
|
|
|
|
sif::info << "PowerSet::printSet: CMV Res voltage: "
|
|
|
|
<< this->cmvResVoltage << " V" << std::endl;
|
|
|
|
}
|
2021-11-27 19:40:52 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Data set to store the time telemetry packet.
|
|
|
|
*/
|
|
|
|
class TimeSet:
|
|
|
|
public StaticLocalDataSet<TIME_SET_ENTRIES> {
|
|
|
|
public:
|
|
|
|
|
|
|
|
TimeSet(HasLocalDataPoolIF* owner):
|
|
|
|
StaticLocalDataSet(owner, TIME_SET_ID) {
|
|
|
|
}
|
|
|
|
|
|
|
|
TimeSet(object_id_t objectId):
|
|
|
|
StaticLocalDataSet(sid_t(objectId, TIME_SET_ID)) {
|
|
|
|
}
|
|
|
|
|
|
|
|
lp_var_t<uint32_t> ticks = lp_var_t<uint32_t>(sid.objectId,
|
|
|
|
PoolIds::TICKS_TIME_SET, this);
|
|
|
|
/** Unix time in microseconds */
|
|
|
|
lp_var_t<uint64_t> time = lp_var_t<uint64_t>(sid.objectId,
|
|
|
|
PoolIds::TIME_TIME_SET, this);
|
|
|
|
// Number of milliseconds since processor start-up
|
|
|
|
lp_var_t<uint32_t> runTime = lp_var_t<uint32_t>(sid.objectId,
|
|
|
|
PoolIds::RUN_TIME, this);
|
|
|
|
// Unix time in seconds?? --> maybe typo in datasheet. Seems to be microseconds
|
|
|
|
lp_var_t<uint64_t> unixTime = lp_var_t<uint64_t>(sid.objectId,
|
|
|
|
PoolIds::UNIX_TIME, this);
|
2021-11-28 09:57:14 +01:00
|
|
|
void printSet() {
|
|
|
|
PoolReadGuard rg(this);
|
|
|
|
sif::info << "TimeSet::printSet: Ticks: "
|
|
|
|
<< this->ticks << std::endl;
|
|
|
|
sif::info << "TimeSet::printSet: Time (time stamp): "
|
|
|
|
<< this->time << " us" << std::endl;
|
|
|
|
sif::info << "TimeSet::printSet: Run Time: "
|
|
|
|
<< this->runTime << " ms" << std::endl;
|
|
|
|
sif::info << "TimeSet::printSet: Unix Time: "
|
|
|
|
<< this->unixTime << " s" << std::endl;
|
|
|
|
}
|
2021-11-27 19:40:52 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief The solution dataset is the main dataset of the star tracker and contains the
|
|
|
|
* attitude information.
|
|
|
|
*/
|
|
|
|
class SolutionSet:
|
|
|
|
public StaticLocalDataSet<SOLUTION_SET_ENTRIES> {
|
|
|
|
public:
|
|
|
|
|
|
|
|
SolutionSet(HasLocalDataPoolIF* owner):
|
|
|
|
StaticLocalDataSet(owner, SOLUTION_SET_ID) {
|
|
|
|
}
|
|
|
|
|
|
|
|
SolutionSet(object_id_t objectId):
|
|
|
|
StaticLocalDataSet(sid_t(objectId, SOLUTION_SET_ID)) {
|
|
|
|
}
|
|
|
|
|
|
|
|
// Ticks timestamp
|
|
|
|
lp_var_t<uint32_t> ticks = lp_var_t<uint32_t>(sid.objectId,
|
|
|
|
PoolIds::TICKS_SOLUTION_SET, this);
|
|
|
|
/// Unix time stamp
|
|
|
|
lp_var_t<uint64_t> time = lp_var_t<uint64_t>(sid.objectId,
|
|
|
|
PoolIds::TIME_SOLUTION_SET, this);
|
|
|
|
// Calibrated quaternion (takes into account the mounting quaternion), typically same as
|
|
|
|
// track q values
|
|
|
|
lp_var_t<float> caliQw = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::CALI_QW, this);
|
|
|
|
lp_var_t<float> caliQx = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::CALI_QX, this);
|
|
|
|
lp_var_t<float> caliQy = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::CALI_QY, this);
|
|
|
|
lp_var_t<float> caliQz = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::CALI_QZ, this);
|
|
|
|
// The lower this value the more confidence that the star tracker solution is correct
|
|
|
|
lp_var_t<float> trackConfidence = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::TRACK_CONFIDENCE, this);
|
|
|
|
// Estimated attitude of spacecraft
|
|
|
|
lp_var_t<float> trackQw = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::TRACK_QW, this);
|
|
|
|
lp_var_t<float> trackQx = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::TRACK_QX, this);
|
|
|
|
lp_var_t<float> trackQy = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::TRACK_QY, this);
|
|
|
|
lp_var_t<float> trackQz = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::TRACK_QZ, this);
|
|
|
|
// Number of stars removed from tracking solution
|
|
|
|
lp_var_t<uint8_t> trackRemoved = lp_var_t<uint8_t>(sid.objectId,
|
|
|
|
PoolIds::TRACK_REMOVED, this);
|
|
|
|
// Number of stars for which a valid centroid was found
|
|
|
|
lp_var_t<uint8_t> starsCentroided = lp_var_t<uint8_t>(sid.objectId,
|
|
|
|
PoolIds::STARS_CENTROIDED, this);
|
|
|
|
// Number of stars that matched to a database star
|
|
|
|
lp_var_t<uint8_t> starsMatchedDatabase = lp_var_t<uint8_t>(sid.objectId,
|
|
|
|
PoolIds::STARS_MATCHED_DATABASE, this);
|
|
|
|
// Result of LISA (lost in space algorithm), searches for stars without prior knowledge of
|
|
|
|
// attitude
|
|
|
|
lp_var_t<float> lisaQw = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::LISA_QW, this);
|
|
|
|
lp_var_t<float> lisaQx = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::LISA_QX, this);
|
|
|
|
lp_var_t<float> lisaQy = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::LISA_QY, this);
|
|
|
|
lp_var_t<float> lisaQz = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::LISA_QZ, this);
|
|
|
|
// Percentage of close stars in LISA solution
|
|
|
|
lp_var_t<float> lisaPercentageClose = lp_var_t<float>(sid.objectId,
|
|
|
|
PoolIds::LISA_PERC_CLOSE, this);
|
|
|
|
// Number of close stars in LISA solution
|
|
|
|
lp_var_t<uint8_t> lisaNrClose = lp_var_t<uint8_t>(sid.objectId,
|
|
|
|
PoolIds::LISA_NR_CLOSE, this);
|
|
|
|
// Gives a combined overview of the validation parameters (1 for valid solution, otherwise 0)
|
|
|
|
lp_var_t<uint8_t> isTrustWorthy = lp_var_t<uint8_t>(sid.objectId,
|
|
|
|
PoolIds::TRUST_WORTHY, this);
|
|
|
|
// Number of times the validation criteria was met
|
|
|
|
lp_var_t<uint32_t> stableCount = lp_var_t<uint32_t>(sid.objectId,
|
|
|
|
PoolIds::STABLE_COUNT, this);
|
|
|
|
// Shows the autonomous mode used to obtain the star tracker attitude
|
|
|
|
lp_var_t<uint8_t> solutionStrategy = lp_var_t<uint8_t>(sid.objectId,
|
|
|
|
PoolIds::SOLUTION_STRATEGY, this);
|
|
|
|
|
|
|
|
void printSet() {
|
|
|
|
PoolReadGuard rg(this);
|
|
|
|
sif::info << "SolutionSet::printSet: Ticks: "
|
|
|
|
<< this->ticks << std::endl;
|
|
|
|
sif::info << "SolutionSet::printSet: Time: "
|
|
|
|
<< this->time << std::endl;
|
|
|
|
sif::info << "SolutionSet::printSet: Calibrated quaternion Qw: "
|
|
|
|
<< this->caliQw << std::endl;
|
|
|
|
sif::info << "SolutionSet::printSet: Calibrated quaternion Qx: "
|
|
|
|
<< this->caliQx << std::endl;
|
|
|
|
sif::info << "SolutionSet::printSet: Calibrated quaternion Qy: "
|
|
|
|
<< this->caliQy << std::endl;
|
|
|
|
sif::info << "SolutionSet::printSet: Calibrated quaternion Qz: "
|
|
|
|
<< this->caliQz << std::endl;
|
|
|
|
sif::info << "SolutionSet::printSet: Track confidence: "
|
|
|
|
<< this->trackConfidence << std::endl;
|
|
|
|
sif::info << "SolutionSet::printSet: Track Qw: "
|
|
|
|
<< this->trackQw << std::endl;
|
|
|
|
sif::info << "SolutionSet::printSet: Track Qx: "
|
|
|
|
<< this->trackQx << std::endl;
|
|
|
|
sif::info << "SolutionSet::printSet: Track Qy: "
|
|
|
|
<< this->trackQy << std::endl;
|
|
|
|
sif::info << "SolutionSet::printSet: Track Qz: "
|
|
|
|
<< this->trackQz << std::endl;
|
|
|
|
sif::info << "SolutionSet::printSet: Track removed: "
|
2021-12-06 19:36:21 +01:00
|
|
|
<< static_cast<unsigned int>(this->trackRemoved.value) << std::endl;
|
2021-11-27 19:40:52 +01:00
|
|
|
sif::info << "SolutionSet::printSet: Number of stars centroided: "
|
2021-12-06 19:36:21 +01:00
|
|
|
<< static_cast<unsigned int>(this->starsCentroided.value) << std::endl;
|
2021-11-27 19:40:52 +01:00
|
|
|
sif::info << "SolutionSet::printSet: Number of stars matched database: "
|
2021-12-06 19:36:21 +01:00
|
|
|
<< static_cast<unsigned int>(this->starsMatchedDatabase.value) << std::endl;
|
2021-11-27 19:40:52 +01:00
|
|
|
sif::info << "SolutionSet::printSet: LISA Qw: "
|
|
|
|
<< this->lisaQw << std::endl;
|
|
|
|
sif::info << "SolutionSet::printSet: LISA Qx: "
|
|
|
|
<< this->lisaQx << std::endl;
|
|
|
|
sif::info << "SolutionSet::printSet: LISA Qy: "
|
|
|
|
<< this->lisaQy << std::endl;
|
|
|
|
sif::info << "SolutionSet::printSet: LISA Qz: "
|
|
|
|
<< this->lisaQz << std::endl;
|
|
|
|
sif::info << "SolutionSet::printSet: LISA Percentage close: "
|
|
|
|
<< this->lisaPercentageClose << std::endl;
|
|
|
|
sif::info << "SolutionSet::printSet: LISA number of close stars: "
|
2021-12-06 19:36:21 +01:00
|
|
|
<< static_cast<unsigned int>(this->lisaNrClose.value) << std::endl;
|
2021-11-27 19:40:52 +01:00
|
|
|
sif::info << "SolutionSet::printSet: Is trust worthy: "
|
2021-12-06 19:36:21 +01:00
|
|
|
<< static_cast<unsigned int>(this->isTrustWorthy.value) << std::endl;
|
2021-11-27 19:40:52 +01:00
|
|
|
sif::info << "SolutionSet::printSet: Stable count: "
|
|
|
|
<< this->stableCount << std::endl;
|
|
|
|
sif::info << "SolutionSet::printSet: Solution strategy: "
|
2021-12-06 19:36:21 +01:00
|
|
|
<< static_cast<unsigned int>(this->solutionStrategy.value) << std::endl;
|
2021-11-27 19:40:52 +01:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2021-07-07 12:12:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* MISSION_STARTRACKER_DEFINITIONS_H_ */
|