Star Tracker : Tweaks and fixes #443

Merged
muellerr merged 7 commits from startracker_try_cfg_time_reduction into develop 2023-03-08 01:26:04 +01:00
2 changed files with 18 additions and 14 deletions
Showing only changes of commit 1b00029202 - Show all commits

View File

@ -1,6 +1,7 @@
#include "StarTrackerHandler.h" #include "StarTrackerHandler.h"
#include <fsfw/ipc/QueueFactory.h> #include <fsfw/ipc/QueueFactory.h>
#include <fsfw/timemanager/Stopwatch.h>
#include <fstream> #include <fstream>
@ -419,7 +420,6 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi
return returnvalue::OK; return returnvalue::OK;
} }
case (startracker::SUBSCRIPTION): { case (startracker::SUBSCRIPTION): {
Subscription subscription;
result = prepareParamCommand(commandData, commandDataLen, subscription); result = prepareParamCommand(commandData, commandDataLen, subscription);
return returnvalue::OK; return returnvalue::OK;
} }
@ -436,67 +436,54 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi
return returnvalue::OK; return returnvalue::OK;
} }
case (startracker::LIMITS): { case (startracker::LIMITS): {
Limits limits;
result = prepareParamCommand(commandData, commandDataLen, limits); result = prepareParamCommand(commandData, commandDataLen, limits);
return result; return result;
} }
case (startracker::MOUNTING): { case (startracker::MOUNTING): {
Mounting mounting;
result = prepareParamCommand(commandData, commandDataLen, mounting); result = prepareParamCommand(commandData, commandDataLen, mounting);
return result; return result;
} }
case (startracker::IMAGE_PROCESSOR): { case (startracker::IMAGE_PROCESSOR): {
ImageProcessor imageProcessor;
result = prepareParamCommand(commandData, commandDataLen, imageProcessor); result = prepareParamCommand(commandData, commandDataLen, imageProcessor);
return result; return result;
} }
case (startracker::CAMERA): { case (startracker::CAMERA): {
Camera camera;
result = prepareParamCommand(commandData, commandDataLen, camera); result = prepareParamCommand(commandData, commandDataLen, camera);
return result; return result;
} }
case (startracker::CENTROIDING): { case (startracker::CENTROIDING): {
Centroiding centroiding;
result = prepareParamCommand(commandData, commandDataLen, centroiding); result = prepareParamCommand(commandData, commandDataLen, centroiding);
return result; return result;
} }
case (startracker::LISA): { case (startracker::LISA): {
Lisa lisa;
result = prepareParamCommand(commandData, commandDataLen, lisa); result = prepareParamCommand(commandData, commandDataLen, lisa);
return result; return result;
} }
case (startracker::MATCHING): { case (startracker::MATCHING): {
Matching matching;
result = prepareParamCommand(commandData, commandDataLen, matching); result = prepareParamCommand(commandData, commandDataLen, matching);
return result; return result;
} }
case (startracker::VALIDATION): { case (startracker::VALIDATION): {
Validation validation;
result = prepareParamCommand(commandData, commandDataLen, validation); result = prepareParamCommand(commandData, commandDataLen, validation);
return result; return result;
} }
case (startracker::ALGO): { case (startracker::ALGO): {
Algo algo;
result = prepareParamCommand(commandData, commandDataLen, algo); result = prepareParamCommand(commandData, commandDataLen, algo);
return result; return result;
} }
case (startracker::TRACKING): { case (startracker::TRACKING): {
Tracking tracking;
result = prepareParamCommand(commandData, commandDataLen, tracking); result = prepareParamCommand(commandData, commandDataLen, tracking);
return result; return result;
} }
case (startracker::LOGLEVEL): { case (startracker::LOGLEVEL): {
LogLevel logLevel;
result = prepareParamCommand(commandData, commandDataLen, logLevel); result = prepareParamCommand(commandData, commandDataLen, logLevel);
return result; return result;
} }
case (startracker::LOGSUBSCRIPTION): { case (startracker::LOGSUBSCRIPTION): {
LogSubscription logSubscription;
result = prepareParamCommand(commandData, commandDataLen, logSubscription); result = prepareParamCommand(commandData, commandDataLen, logSubscription);
return result; return result;
} }
case (startracker::DEBUG_CAMERA): { case (startracker::DEBUG_CAMERA): {
DebugCamera debugCamera;
result = prepareParamCommand(commandData, commandDataLen, debugCamera); result = prepareParamCommand(commandData, commandDataLen, debugCamera);
return result; return result;
} }
@ -1650,6 +1637,7 @@ void StarTrackerHandler::prepareHistogramRequest() {
ReturnValue_t StarTrackerHandler::prepareParamCommand(const uint8_t* commandData, ReturnValue_t StarTrackerHandler::prepareParamCommand(const uint8_t* commandData,
size_t commandDataLen, size_t commandDataLen,
ArcsecJsonParamBase& paramSet) { ArcsecJsonParamBase& paramSet) {
Stopwatch watch;
ReturnValue_t result = returnvalue::OK; ReturnValue_t result = returnvalue::OK;
if (commandDataLen > MAX_PATH_SIZE) { if (commandDataLen > MAX_PATH_SIZE) {
return FILE_PATH_TOO_LONG; return FILE_PATH_TOO_LONG;

View File

@ -2,6 +2,7 @@
#define MISSION_DEVICES_STARTRACKERHANDLER_H_ #define MISSION_DEVICES_STARTRACKERHANDLER_H_
#include <fsfw/datapool/PoolReadGuard.h> #include <fsfw/datapool/PoolReadGuard.h>
#include <linux/devices/startracker/StarTrackerJsonCommands.h>
#include "ArcsecDatalinkLayer.h" #include "ArcsecDatalinkLayer.h"
#include "ArcsecJsonParamBase.h" #include "ArcsecJsonParamBase.h"
@ -216,6 +217,21 @@ class StarTrackerHandler : public DeviceHandlerBase {
// Loading firmware requires some time and the command will not trigger a reply when executed // Loading firmware requires some time and the command will not trigger a reply when executed
Countdown bootCountdown; Countdown bootCountdown;
Tracking tracking;
LogLevel logLevel;
LogSubscription logSubscription;
DebugCamera debugCamera;
Algo algo;
Validation validation;
Matching matching;
Lisa lisa;
Centroiding centroiding;
Camera camera;
ImageProcessor imageProcessor;
Mounting mounting;
Limits limits;
Subscription subscription;
#ifdef EGSE #ifdef EGSE
std::string paramJsonFile = "/home/pi/arcsec/json/flight-config.json"; std::string paramJsonFile = "/home/pi/arcsec/json/flight-config.json";
#else #else