From c3e20d6a117135aeae6eb566d36bc2f89ddddd9d Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Tue, 8 Feb 2022 11:59:22 +0100 Subject: [PATCH 01/13] debugging --- linux/devices/startracker/StarTrackerHandler.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/linux/devices/startracker/StarTrackerHandler.h b/linux/devices/startracker/StarTrackerHandler.h index 475c1441..172094fe 100644 --- a/linux/devices/startracker/StarTrackerHandler.h +++ b/linux/devices/startracker/StarTrackerHandler.h @@ -1,6 +1,7 @@ #ifndef MISSION_DEVICES_STARTRACKERHANDLER_H_ #define MISSION_DEVICES_STARTRACKERHANDLER_H_ +#include "OBSWConfig.h" #include #include "ArcsecDatalinkLayer.h" @@ -268,10 +269,10 @@ class StarTrackerHandler : public DeviceHandlerBase { // Countdown to insert delay for star tracker to switch from bootloader to firmware program Countdown bootCountdown; -#ifdef EGSE +#ifndef EGSE std::string paramJsonFile = "/mnt/sd0/startracker/full.json"; #else - std::string paramJsonFile = "/home/pi/arcsec/flight-config.json"; + std::string paramJsonFile = "/home/pi/arcsec/ground-config.json"; #endif enum class InternalState { TEMPERATURE_REQUEST }; From 92eb403e35cca5e60ab2cc31a633866e7d268c0d Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Tue, 8 Feb 2022 13:09:50 +0100 Subject: [PATCH 02/13] egse define fiX --- linux/fsfwconfig/OBSWConfig.h.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/fsfwconfig/OBSWConfig.h.in b/linux/fsfwconfig/OBSWConfig.h.in index 8da487cf..043ce97b 100644 --- a/linux/fsfwconfig/OBSWConfig.h.in +++ b/linux/fsfwconfig/OBSWConfig.h.in @@ -106,7 +106,7 @@ debugging. */ #define OBSW_DEBUG_PLOC_SUPERVISOR 0 #define OBSW_DEBUG_PDEC_HANDLER 0 -#if defined EGSE +#ifdef EGSE #define OBSW_DEBUG_STARTRACKER 1 #else #define OBSW_DEBUG_STARTRACKER 0 From 328a3b2d0285a8e15d1b82ed902fc59702d16517 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Tue, 8 Feb 2022 13:11:54 +0100 Subject: [PATCH 03/13] define fix --- linux/fsfwconfig/OBSWConfig.h.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/fsfwconfig/OBSWConfig.h.in b/linux/fsfwconfig/OBSWConfig.h.in index 043ce97b..4643543f 100644 --- a/linux/fsfwconfig/OBSWConfig.h.in +++ b/linux/fsfwconfig/OBSWConfig.h.in @@ -59,7 +59,7 @@ debugging. */ #endif -#if defined EGSE +#ifdef EGSE #define OBSW_ADD_STAR_TRACKER 1 #endif From cfce44ca3ab639ef5b5ea8613b9a482816ff85e7 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Tue, 8 Feb 2022 16:01:06 +0100 Subject: [PATCH 04/13] change default name of json file --- linux/devices/startracker/StarTrackerHandler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/devices/startracker/StarTrackerHandler.h b/linux/devices/startracker/StarTrackerHandler.h index 172094fe..3d7ed28a 100644 --- a/linux/devices/startracker/StarTrackerHandler.h +++ b/linux/devices/startracker/StarTrackerHandler.h @@ -270,7 +270,7 @@ class StarTrackerHandler : public DeviceHandlerBase { // Countdown to insert delay for star tracker to switch from bootloader to firmware program Countdown bootCountdown; #ifndef EGSE - std::string paramJsonFile = "/mnt/sd0/startracker/full.json"; + std::string paramJsonFile = "/mnt/sd0/startracker/flight-config.json"; #else std::string paramJsonFile = "/home/pi/arcsec/ground-config.json"; #endif From a3092e57e43b05bf62e06cda9604296a0069f7a9 Mon Sep 17 00:00:00 2001 From: "Jakob.Meier" Date: Tue, 8 Feb 2022 16:36:33 +0100 Subject: [PATCH 05/13] readme running obsw on egse --- README.md | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 34f31da7..78656e51 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,10 @@ 12. [Static Code Analysis](#static-code-analysis) 13. [Eclipse](#eclipse) 14. [Running the OBSW on a Raspberry Pi](#rpi) -15. [Manually preparing sysroots to compile gpsd](#gpsd) -16. [FSFW](#fsfw) -17. [Coding Style](#coding-style) +15. [Running OBSW on EGSE](#egse) +16. [Manually preparing sysroots to compile gpsd](#gpsd) +17. [FSFW](#fsfw) +18. [Coding Style](#coding-style) # General information @@ -1134,6 +1135,32 @@ sudo apt-get install gpiod libgpiod-dev to install the required GPIO libraries before cloning the system root folder. +# Running OBSW on EGSE +The EGSE is a test system from arcsec build arround a raspberry pi 4 to test the star tracker. The IP address of the EGSE (raspberry pi) is 192.168.18.31. An ssh session can be opened with +```` +ssh pi@192.168.18.31 +```` +Password: raspberry + +To run the obsw perform the following steps: +1. Build the cmake EGSE configuration +2. Disable the ser2net systemd service on the EGSE +````sh +$ sudo systemctl stop ser2net.service +```` +3. Power on the star tracker by running +````sh +$ ~/powerctrl/enable0.sh` +```` +4. Run portforwarding script for tmtc tcp connection and tcf agent on host PC +````sh +$ ./scripts/egse-port.sh +```` +5. The star tracker can be powered off by running +````sh +$ ~/powerctrl/disable0.sh +```` + # Manually preparing sysroots to compile gpsd Copy all header files from [here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/gpsd&fileid=1189985) to the /usr/include directory and all static libraries to /usr/lib. From 60d43246d422dcffb5255a6412c5880050e3fbda Mon Sep 17 00:00:00 2001 From: "Jakob.Meier" Date: Wed, 9 Feb 2022 13:34:24 +0100 Subject: [PATCH 06/13] link to egse sysroots --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 78656e51..7acc6342 100644 --- a/README.md +++ b/README.md @@ -1143,7 +1143,8 @@ ssh pi@192.168.18.31 Password: raspberry To run the obsw perform the following steps: -1. Build the cmake EGSE configuration +1. Build the cmake EGSE Configuration + * the sysroots for the EGSE can be found [here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/egse&fileid=1190471) 2. Disable the ser2net systemd service on the EGSE ````sh $ sudo systemctl stop ser2net.service From 3035aea88585d854973c25a2ee9b6bbea6468db8 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Wed, 9 Feb 2022 19:20:19 +0100 Subject: [PATCH 07/13] wip parameter requests --- .../StarTrackerDefinitions.h | 677 +++++++++++++++++- .../startracker/StarTrackerHandler.cpp | 209 +++++- .../devices/startracker/StarTrackerHandler.h | 19 +- tmtc | 2 +- 4 files changed, 885 insertions(+), 22 deletions(-) diff --git a/linux/devices/devicedefinitions/StarTrackerDefinitions.h b/linux/devices/devicedefinitions/StarTrackerDefinitions.h index adfcf9b6..5f669fc9 100644 --- a/linux/devices/devicedefinitions/StarTrackerDefinitions.h +++ b/linux/devices/devicedefinitions/StarTrackerDefinitions.h @@ -214,6 +214,15 @@ enum PoolIds : lp_id_t { CAM_VAL3, CAM_REG4, CAM_VAL4, + CAM_REG5, + CAM_VAL5, + CAM_REG6, + CAM_VAL6, + CAM_REG7, + CAM_VAL7, + CAM_REG8, + CAM_VAL8, + CAM_FREQ_1, LIMITS_ACTION, LIMITS_FPGA18CURRENT, LIMITS_FPGA25CURRENT, @@ -239,7 +248,96 @@ enum PoolIds : lp_id_t { BLOB_DARK_THRESHOLD, BLOB_ENABLE_HISTOGRAM, BLOB_ENABLE_CONTRAST, - BLOB_BIN_MODE + BLOB_BIN_MODE, + LOGLEVEL1, + LOGLEVEL2, + LOGLEVEL3, + LOGLEVEL4, + LOGLEVEL5, + LOGLEVEL6, + LOGLEVEL7, + LOGLEVEL8, + LOGLEVEL9, + LOGLEVEL10, + LOGLEVEL11, + LOGLEVEL12, + LOGLEVEL13, + LOGLEVEL14, + LOGLEVEL15, + LOGLEVEL16, + MOUNTING_QW, + MOUNTING_QX, + MOUNTING_QY, + MOUNTING_QZ, + IMAGE_PROCESSOR_MODE, + IMAGE_PROCESSOR_STORE, + IMAGE_PROCESSOR_SIGNALTHRESHOLD, + IMAGE_PROCESSOR_DARKTHRESHOLD, + IMAGE_PROCESSOR_BACKGROUNDCOMPENSATION, + CENTROIDING_ENABLE_FILTER, + CENTROIDING_MAX_QUALITY, + CENTROIDING_DARK_THRESHOLD, + CENTROIDING_MIN_QUALITY, + CENTROIDING_MAX_INTENSITY, + CENTROIDING_MIN_INTENSITY, + CENTROIDING_MAX_MAGNITUDE, + CENTROIDING_GAUSSIAN_CMAX, + CENTROIDING_GAUSSIAN_CMIN, + CENTROIDING_TRANSMATRIX00, + CENTROIDING_TRANSMATRIX01, + CENTROIDING_TRANSMATRIX10, + CENTROIDING_TRANSMATRIX11, + LISA_MODE, + LISA_PREFILTER_DIST_THRESHOLD, + LISA_PREFILTER_ANGLE_THRESHOLD, + LISA_FOV_WIDTH, + LISA_FOV_HEIGHT, + LISA_FLOAT_STAR_LIMIT, + LISA_CLOSE_STAR_LIMIT, + LISA_RATING_WEIGHT_CLOSE_STAR_COUNT, + LISA_RATING_WEIGHT_FRACTION_CLOSE, + LISA_RATING_WEIGHT_MEAN_SUM, + LISA_RATING_WEIGHT_DB_STAR_COUNT, + LISA_MAX_COMBINATIONS, + LISA_NR_STARS_STOP, + LISA_FRACTION_CLOSE_STOP, + MATCHING_SQUARED_DISTANCE_LIMIT, + MATCHING_SQUARED_SHIFT_LIMIT, + TRACKING_THIN_LIMIT, + TRACKING_OUTLIER_THRESHOLD, + TRACKING_OUTLIER_THRESHOLD_QUEST, + TRACKING_TRACKER_CHOICE, + VALIDATION_STABLE_COUNT, + VALIDATION_MAX_DIFFERENCE, + VALIDATION_MIN_TRACKER_CONFIDENCE, + VALIDATION_MIN_MATCHED_STARS, + ALGO_MODE, + ALGO_I2T_MIN_CONFIDENCE, + ALGO_I2T_MIN_MATCHED, + ALGO_I2L_MIN_CONFIDENCE, + ALGO_I2L_MIN_MATCHED, + SUBSCRIPTION_TM1, + SUBSCRIPTION_TM2, + SUBSCRIPTION_TM3, + SUBSCRIPTION_TM4, + SUBSCRIPTION_TM5, + SUBSCRIPTION_TM6, + SUBSCRIPTION_TM7, + SUBSCRIPTION_TM8, + SUBSCRIPTION_TM9, + SUBSCRIPTION_TM10, + SUBSCRIPTION_TM11, + SUBSCRIPTION_TM12, + SUBSCRIPTION_TM13, + SUBSCRIPTION_TM14, + SUBSCRIPTION_TM15, + SUBSCRIPTION_TM16, + LOG_SUBSCRIPTION_LEVEL1, + LOG_SUBSCRIPTION_MODULE1, + LOG_SUBSCRIPTION_LEVEL2, + LOG_SUBSCRIPTION_MODULE2, + DEBUG_CAMERA_TIMING, + DEBUG_CAMERA_TEST }; static const DeviceCommandId_t PING_REQUEST = 0; @@ -290,6 +388,18 @@ static const DeviceCommandId_t UPLOAD_FPGA_IMAGE = 65; static const DeviceCommandId_t FPGA_ACTION = 66; static const DeviceCommandId_t REQ_CAMERA = 67; static const DeviceCommandId_t REQ_LIMITS = 68; +static const DeviceCommandId_t REQ_LOG_LEVEL = 69; +static const DeviceCommandId_t REQ_MOUNTING = 70; +static const DeviceCommandId_t REQ_IMAGE_PROCESSOR = 71; +static const DeviceCommandId_t REQ_CENTROIDING = 72; +static const DeviceCommandId_t REQ_LISA = 73; +static const DeviceCommandId_t REQ_MATCHING = 74; +static const DeviceCommandId_t REQ_TRACKING = 75; +static const DeviceCommandId_t REQ_VALIDATION = 76; +static const DeviceCommandId_t REQ_ALGO = 77; +static const DeviceCommandId_t REQ_SUBSCRIPTION = 78; +static const DeviceCommandId_t REQ_LOG_SUBSCRIPTION = 79; +static const DeviceCommandId_t REQ_DEBUG_CAMERA = 80; static const DeviceCommandId_t NONE = 0xFFFFFFFF; static const uint32_t VERSION_SET_ID = REQ_VERSION; @@ -307,6 +417,17 @@ static const uint32_t DOWNLOAD_DBIMAGE_SET_ID = DOWNLOAD_DBIMAGE; static const uint32_t DOWNLOAD_BLOBPIXEL_SET_ID = DOWNLOAD_BLOBPIXEL; static const uint32_t CAMERA_SET_ID = REQ_CAMERA; static const uint32_t LIMITS_SET_ID = REQ_LIMITS; +static const uint32_t LOG_LEVEL_SET_ID = REQ_LOG_LEVEL; +static const uint32_t MOUNTING_SET_ID = REQ_MOUNTING; +static const uint32_t IMAGE_PROCESSOR_SET_ID = REQ_IMAGE_PROCESSOR; +static const uint32_t CENTROIDING_SET_ID = REQ_CENTROIDING; +static const uint32_t LISA_SET_ID = REQ_LISA; +static const uint32_t MATCHING_SET_ID = REQ_MATCHING; +static const uint32_t TRACKING_SET_ID = REQ_TRACKING; +static const uint32_t VALIDATION_SET_ID = REQ_VALIDATION; +static const uint32_t ALGO_SET_ID = REQ_ALGO; +static const uint32_t SUBSCRIPTION_SET_ID = REQ_SUBSCRIPTION; +static const uint32_t LOG_SUBSCRIPTION_SET_ID = REQ_LOG_SUBSCRIPTION; /** Max size of unencoded frame */ static const size_t MAX_FRAME_SIZE = 1200; @@ -324,8 +445,20 @@ static const uint8_t DOWNLOAD_CENTROID_SET_ENTRIES = 11; static const uint8_t DOWNLOAD_MATCHED_STAR_SET_ENTRIES = 14; static const uint8_t DOWNLOAD_DBIMAGE_SET_ENTRIES = 6; static const uint8_t DOWNLOAD_BLOBPIXEL_SET_ENTRIES = 7; -static const uint8_t CAMERA_SET_ENTRIES = 15; +static const uint8_t CAMERA_SET_ENTRIES = 24; static const uint8_t LIMITS_SET_ENTRIES = 11; +static const uint8_t LOG_LEVEL_SET_ENTRIES = 16; +static const uint8_t MOUNTING_SET_ENTRIES = 4; +static const uint8_t IMAGE_PROCESSOR_SET_ENTRIES = 5; +static const uint8_t CENTROIDING_PARAMS_SET_ENTRIES = 13; +static const uint8_t LISA_SET_ENTRIES = 14; +static const uint8_t MATCHING_SET_ENTRIES = 2; +static const uint8_t TRACKING_SET_ENTRIES = 4; +static const uint8_t VALIDATION_SET_ENTRIES = 4; +static const uint8_t ALGO_SET_ENTRIES = 5; +static const uint8_t SUBSCRIPTION_SET_ENTRIES = 16; +static const uint8_t LOG_SUBSCRIPTION_SET_ENTRIES = 4; +static const uint8_t DEBUG_CAMERA_SET_ENTRIES = 2; // Action, parameter and telemetry IDs namespace ID { @@ -347,7 +480,7 @@ static const uint8_t REBOOT = 7; static const uint8_t UPLOAD_IMAGE = 10; static const uint8_t POWER = 11; static const uint8_t SET_TIME = 14; -static const uint8_t SUBSCRIBE = 18; +static const uint8_t SUBSCRIPTION = 18; static const uint8_t SOLUTION = 24; static const uint8_t TEMPERATURE = 27; static const uint8_t HISTOGRAM = 28; @@ -366,6 +499,9 @@ static const uint8_t DOWNLOAD_MATCHED_STAR = 18; static const uint8_t DOWNLOAD_DBIMAGE = 19; static const uint8_t DOWNLOAD_BLOBPIXEL = 24; static const uint8_t FPGA_ACTION = 22; +static const uint8_t LOG_LEVEL = 3; +static const uint8_t LOG_SUBSCRIPTION = 19; +static const uint8_t DEBUG_CAMERA = 20; } // namespace ID namespace Program { @@ -1103,7 +1239,7 @@ class DownloadBlobPixel : public StaticLocalDataSet { public: // Size of dataset - static const size_t SIZE = 25; + static const size_t SIZE = 34; CameraSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, CAMERA_SET_ID) {} @@ -1124,6 +1260,15 @@ class CameraSet : public StaticLocalDataSet { lp_var_t val3 = lp_var_t(sid.objectId, PoolIds::CAM_VAL3, this); lp_var_t reg4 = lp_var_t(sid.objectId, PoolIds::CAM_REG4, this); lp_var_t val4 = lp_var_t(sid.objectId, PoolIds::CAM_VAL4, this); + lp_var_t reg5 = lp_var_t(sid.objectId, PoolIds::CAM_REG5, this); + lp_var_t val5 = lp_var_t(sid.objectId, PoolIds::CAM_VAL5, this); + lp_var_t reg6 = lp_var_t(sid.objectId, PoolIds::CAM_REG6, this); + lp_var_t val6 = lp_var_t(sid.objectId, PoolIds::CAM_VAL6, this); + lp_var_t reg7 = lp_var_t(sid.objectId, PoolIds::CAM_REG7, this); + lp_var_t val7 = lp_var_t(sid.objectId, PoolIds::CAM_VAL7, this); + lp_var_t reg8 = lp_var_t(sid.objectId, PoolIds::CAM_REG8, this); + lp_var_t val8 = lp_var_t(sid.objectId, PoolIds::CAM_VAL8, this); + lp_var_t freq1 = lp_var_t(sid.objectId, PoolIds::CAM_FREQ_1, this); void printSet() { PoolReadGuard rg(this); @@ -1153,6 +1298,24 @@ class CameraSet : public StaticLocalDataSet { << std::endl; sif::info << "CameraSet::printSet: Val 4: " << static_cast(this->val4.value) << std::endl; + sif::info << "CameraSet::printSet: Reg 5: " << static_cast(this->reg5.value) + << std::endl; + sif::info << "CameraSet::printSet: Val 5: " << static_cast(this->val5.value) + << std::endl; + sif::info << "CameraSet::printSet: Reg 6: " << static_cast(this->reg6.value) + << std::endl; + sif::info << "CameraSet::printSet: Val 6: " << static_cast(this->val6.value) + << std::endl; + sif::info << "CameraSet::printSet: Reg 7: " << static_cast(this->reg7.value) + << std::endl; + sif::info << "CameraSet::printSet: Val 7: " << static_cast(this->val7.value) + << std::endl; + sif::info << "CameraSet::printSet: Reg 8: " << static_cast(this->reg8.value) + << std::endl; + sif::info << "CameraSet::printSet: Val 8: " << static_cast(this->val8.value) + << std::endl; + sif::info << "CameraSet::printSet: Freq 1: " << static_cast(this->freq1.value) + << std::endl; } }; @@ -1189,17 +1352,503 @@ class LimitsSet : public StaticLocalDataSet { void printSet() { PoolReadGuard rg(this); - sif::info << "CameraSet::printSet: action: " << static_cast(this->action.value) + sif::info << "LimitsSet::printSet: action: " << static_cast(this->action.value) << std::endl; - sif::info << "CameraSet::printSet: FPGA18Current: " << this->fpga18current << std::endl; - sif::info << "CameraSet::printSet: FPGA25Current: " << this->fpga25current << std::endl; - sif::info << "CameraSet::printSet: FPGA10Current: " << this->fpga10current << std::endl; - sif::info << "CameraSet::printSet: MCUCurrent: " << this->mcuCurrent << std::endl; - sif::info << "CameraSet::printSet: CMOS21Current: " << this->cmos21current << std::endl; - sif::info << "CameraSet::printSet: CMOSPixCurrent: " << this->cmosPixCurrent << std::endl; - sif::info << "CameraSet::printSet: CMOS33Current: " << this->cmos33current << std::endl; - sif::info << "CameraSet::printSet: CMOSVResCurrent: " << this->cmosVresCurrent << std::endl; - sif::info << "CameraSet::printSet: CMOSTemperature: " << this->cmosTemperature << std::endl; + sif::info << "LimitsSet::printSet: FPGA18Current: " << this->fpga18current << std::endl; + sif::info << "LimitsSet::printSet: FPGA25Current: " << this->fpga25current << std::endl; + sif::info << "LimitsSet::printSet: FPGA10Current: " << this->fpga10current << std::endl; + sif::info << "LimitsSet::printSet: MCUCurrent: " << this->mcuCurrent << std::endl; + sif::info << "LimitsSet::printSet: CMOS21Current: " << this->cmos21current << std::endl; + sif::info << "LimitsSet::printSet: CMOSPixCurrent: " << this->cmosPixCurrent << std::endl; + sif::info << "LimitsSet::printSet: CMOS33Current: " << this->cmos33current << std::endl; + sif::info << "LimitsSet::printSet: CMOSVResCurrent: " << this->cmosVresCurrent << std::endl; + sif::info << "LimitsSet::printSet: CMOSTemperature: " << this->cmosTemperature << std::endl; + } +}; + +/** + * @brief Will store the requested log level parameters + */ +class LogLevelSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 16; + + LogLevelSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, LOG_LEVEL_SET_ENTRIES) {} + + LogLevelSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, LOG_LEVEL_SET_ENTRIES)) {} + + lp_var_t loglevel1 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL1, this); + lp_var_t loglevel2 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL2, this); + lp_var_t loglevel3 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL3, this); + lp_var_t loglevel4 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL4, this); + lp_var_t loglevel5 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL5, this); + lp_var_t loglevel6 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL6, this); + lp_var_t loglevel7 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL7, this); + lp_var_t loglevel8 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL8, this); + lp_var_t loglevel9 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL9, this); + lp_var_t loglevel10 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL10, this); + lp_var_t loglevel11 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL11, this); + lp_var_t loglevel12 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL12, this); + lp_var_t loglevel13 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL13, this); + lp_var_t loglevel14 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL14, this); + lp_var_t loglevel15 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL15, this); + lp_var_t loglevel16 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL16, this); + + void printSet() { + PoolReadGuard rg(this); + sif::info << "LogLevelSet::printSet: loglevel1: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel2: " + << static_cast(this->loglevel2.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel3: " + << static_cast(this->loglevel3.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel4: " + << static_cast(this->loglevel4.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel5: " + << static_cast(this->loglevel5.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel6: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel7: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel8: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel9: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel10: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel11: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel12: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel13: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel14: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel15: " + << static_cast(this->loglevel1.value) << std::endl; + sif::info << "LogLevelSet::printSet: loglevel16: " + << static_cast(this->loglevel1.value) << std::endl; + } +}; + +/** + * @brief Will store the requested mounting parameters + */ +class MountingSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 16; + + MountingSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, MOUNTING_SET_ID) {} + + MountingSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, MOUNTING_SET_ID)) {} + + lp_var_t qw = lp_var_t(sid.objectId, PoolIds::MOUNTING_QW, this); + lp_var_t qx = lp_var_t(sid.objectId, PoolIds::MOUNTING_QX, this); + lp_var_t qy = lp_var_t(sid.objectId, PoolIds::MOUNTING_QY, this); + lp_var_t qz = lp_var_t(sid.objectId, PoolIds::MOUNTING_QZ, this); + + void printSet() { + sif::info << "MountingSet::printSet: qw: " << this->qw << std::endl; + sif::info << "MountingSet::printSet: qx: " << this->qx << std::endl; + sif::info << "MountingSet::printSet: qy: " << this->qy << std::endl; + sif::info << "MountingSet::printSet: qz: " << this->qz << std::endl; + } +}; + +/** + * @brief Will store the requested image processor parameters + */ +class ImageProcessorSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 7; + + ImageProcessorSet(HasLocalDataPoolIF* owner) + : StaticLocalDataSet(owner, IMAGE_PROCESSOR_SET_ID) {} + + ImageProcessorSet(object_id_t objectId) + : StaticLocalDataSet(sid_t(objectId, IMAGE_PROCESSOR_SET_ID)) {} + + lp_var_t mode = lp_var_t(sid.objectId, PoolIds::IMAGE_PROCESSOR_MODE, this); + lp_var_t store = lp_var_t(sid.objectId, PoolIds::IMAGE_PROCESSOR_STORE, this); + lp_var_t signalThreshold = + lp_var_t(sid.objectId, PoolIds::IMAGE_PROCESSOR_SIGNALTHRESHOLD, this); + lp_var_t darkThreshold = + lp_var_t(sid.objectId, PoolIds::IMAGE_PROCESSOR_DARKTHRESHOLD, this); + lp_var_t backgroundCompensation = + lp_var_t(sid.objectId, PoolIds::IMAGE_PROCESSOR_BACKGROUNDCOMPENSATION, this); + + void printSet() { + sif::info << "ImageProcessorSet::printSet: mode: " << this->mode << std::endl; + sif::info << "ImageProcessorSet::printSet: store: " << this->store << std::endl; + sif::info << "ImageProcessorSet::printSet: signal threshold: " << this->signalThreshold + << std::endl; + sif::info << "ImageProcessorSet::printSet: dark threshold: " << this->darkThreshold + << std::endl; + sif::info << "ImageProcessorSet::printSet: background compensation: " + << this->backgroundCompensation << std::endl; + } +}; + +/** + * @brief Will store the requested centroiding parameters + */ +class CentroidingSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 49; + + CentroidingSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, CENTROIDING_SET_ID) {} + + CentroidingSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, CENTROIDING_SET_ID)) {} + + lp_var_t enableFilter = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_ENABLE_FILTER, this); + lp_var_t maxQuality = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_MAX_QUALITY, this); + lp_var_t darkThreshold = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_DARK_THRESHOLD, this); + lp_var_t minQuality = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_MIN_QUALITY, this); + lp_var_t maxIntensity = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_MAX_INTENSITY, this); + lp_var_t minIntensity = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_MIN_INTENSITY, this); + lp_var_t maxMagnitude = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_MAX_MAGNITUDE, this); + lp_var_t gaussianCmax = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_GAUSSIAN_CMAX, this); + lp_var_t gaussianCmin = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_GAUSSIAN_CMIN, this); + lp_var_t transmatrix00 = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_TRANSMATRIX00, this); + lp_var_t transmatrix01 = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_TRANSMATRIX01, this); + lp_var_t transmatrix10 = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_TRANSMATRIX10, this); + lp_var_t transmatrix11 = + lp_var_t(sid.objectId, PoolIds::CENTROIDING_TRANSMATRIX11, this); + + void printSet() { + sif::info << "CentroidingSet::printSet: enable filter: " << this->enableFilter << std::endl; + sif::info << "CentroidingSet::printSet: max quality: " << this->maxQuality << std::endl; + sif::info << "CentroidingSet::printSet: dark threshold: " << this->darkThreshold << std::endl; + sif::info << "CentroidingSet::printSet: min quality: " << this->minQuality << std::endl; + sif::info << "CentroidingSet::printSet: max intensity: " << this->maxIntensity << std::endl; + sif::info << "CentroidingSet::printSet: min intensity: " << this->minIntensity << std::endl; + sif::info << "CentroidingSet::printSet: max magnitude: " << this->maxMagnitude << std::endl; + sif::info << "CentroidingSet::printSet: gaussian cmax: " << this->gaussianCmax << std::endl; + sif::info << "CentroidingSet::printSet: gaussian cmin: " << this->gaussianCmin << std::endl; + sif::info << "CentroidingSet::printSet: transmatrix 00 : " << this->transmatrix00 << std::endl; + sif::info << "CentroidingSet::printSet: transmatrix 01 : " << this->transmatrix01 << std::endl; + sif::info << "CentroidingSet::printSet: transmatrix 10 : " << this->transmatrix10 << std::endl; + sif::info << "CentroidingSet::printSet: transmatrix 11 : " << this->transmatrix11 << std::endl; + } +}; + +/** + * @brief Will store the requested centroiding parameters + */ +class LisaSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 50; + + LisaSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, LISA_SET_ID) {} + + LisaSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, LISA_SET_ID)) {} + + lp_var_t mode = lp_var_t(sid.objectId, PoolIds::LISA_MODE, this); + lp_var_t prefilterDistThreshold = + lp_var_t(sid.objectId, PoolIds::LISA_PREFILTER_DIST_THRESHOLD, this); + lp_var_t prefilterAngleThreshold = + lp_var_t(sid.objectId, PoolIds::LISA_PREFILTER_ANGLE_THRESHOLD, this); + lp_var_t fovWidth = lp_var_t(sid.objectId, PoolIds::LISA_FOV_WIDTH, this); + lp_var_t fovHeight = lp_var_t(sid.objectId, PoolIds::LISA_FOV_HEIGHT, this); + lp_var_t floatStarLimit = + lp_var_t(sid.objectId, PoolIds::LISA_FLOAT_STAR_LIMIT, this); + lp_var_t closeStarLimit = + lp_var_t(sid.objectId, PoolIds::LISA_CLOSE_STAR_LIMIT, this); + lp_var_t ratingWeightCloseStarCount = + lp_var_t(sid.objectId, PoolIds::LISA_RATING_WEIGHT_CLOSE_STAR_COUNT, this); + lp_var_t ratingWeightFractionClose = + lp_var_t(sid.objectId, PoolIds::LISA_RATING_WEIGHT_FRACTION_CLOSE, this); + lp_var_t ratingWeightMeanSum = + lp_var_t(sid.objectId, PoolIds::LISA_RATING_WEIGHT_MEAN_SUM, this); + lp_var_t ratingWeightDbStarCount = + lp_var_t(sid.objectId, PoolIds::LISA_RATING_WEIGHT_DB_STAR_COUNT, this); + lp_var_t maxCombinations = + lp_var_t(sid.objectId, PoolIds::LISA_MAX_COMBINATIONS, this); + lp_var_t nrStarsStop = + lp_var_t(sid.objectId, PoolIds::LISA_NR_STARS_STOP, this); + lp_var_t fractionCloseStop = + lp_var_t(sid.objectId, PoolIds::LISA_FRACTION_CLOSE_STOP, this); + + void printSet() { + sif::info << "LisaSet::printSet: mode: " << this->mode << std::endl; + sif::info << "LisaSet::printSet: prefilter dist threshold: " << this->prefilterDistThreshold + << std::endl; + sif::info << "LisaSet::printSet: prefilter angle threshold: " << this->prefilterAngleThreshold + << std::endl; + sif::info << "LisaSet::printSet: fov width: " << this->fovWidth << std::endl; + sif::info << "LisaSet::printSet: fov height: " << this->fovHeight << std::endl; + sif::info << "LisaSet::printSet: float star limit: " << this->floatStarLimit << std::endl; + sif::info << "LisaSet::printSet: close star limit: " << this->closeStarLimit << std::endl; + sif::info << "LisaSet::printSet: rating weight close star count: " + << this->ratingWeightCloseStarCount << std::endl; + sif::info << "LisaSet::printSet: rating weight fraction close: " + << this->ratingWeightFractionClose << std::endl; + sif::info << "LisaSet::printSet: rating weight mean sum: " << this->ratingWeightMeanSum + << std::endl; + sif::info << "LisaSet::printSet: rating weight db star count: " << this->ratingWeightDbStarCount + << std::endl; + sif::info << "LisaSet::printSet: max combinations: " << this->maxCombinations << std::endl; + sif::info << "LisaSet::printSet: nr stars stop: " << this->nrStarsStop << std::endl; + sif::info << "LisaSet::printSet: fraction close stop: " << this->fractionCloseStop << std::endl; + } +}; + +/** + * @brief Will store the requested matching parameters + */ +class MatchingSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 8; + + MatchingSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, MATCHING_SET_ID) {} + + MatchingSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, MATCHING_SET_ID)) {} + + lp_var_t squaredDistanceLimit = lp_var_t(sid.objectId, PoolIds::MATCHING_SQUARED_DISTANCE_LIMIT, this); + lp_var_t squaredShiftLimit = lp_var_t(sid.objectId, PoolIds::MATCHING_SQUARED_SHIFT_LIMIT, this); + + void printSet() { + sif::info << "MatchingSet::printSet: squared distance limit: " << this->squaredDistanceLimit + << std::endl; + sif::info << "MatchingSet::printSet: squared distance limit: " << this->squaredShiftLimit + << std::endl; + } +}; + +/** + * @brief Will store the requested tracking parameters + */ +class TrackingSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 16; + + TrackingSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, TRACKING_SET_ID) {} + + TrackingSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, TRACKING_SET_ID)) {} + + lp_var_t thinLimit = lp_var_t(sid.objectId, PoolIds::TRACKING_THIN_LIMIT, this); + lp_var_t outlierThreshold = lp_var_t(sid.objectId, PoolIds::TRACKING_OUTLIER_THRESHOLD, this); + lp_var_t outlierThresholdQuest = lp_var_t(sid.objectId, PoolIds::TRACKING_OUTLIER_THRESHOLD_QUEST, this); + lp_var_t trackerChoice = lp_var_t(sid.objectId, PoolIds::TRACKING_TRACKER_CHOICE, this); + + void printSet() { + sif::info << "MatchingSet::printSet: squared distance limit: " << this->squaredDistanceLimit + << std::endl; + sif::info << "MatchingSet::printSet: squared distance limit: " << this->squaredShiftLimit + << std::endl; + } +}; + +/** + * @brief Will store the requested validation parameters + */ +class ValidationSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 10; + + ValidationSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, VALIDATION_SET_ID) {} + + ValidationSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, VALIDATION_SET_ID)) {} + + lp_var_t stableCount = + lp_var_t(sid.objectId, PoolIds::VALIDATION_STABLE_COUNT, this); + lp_var_t maxDifference = + lp_var_t(sid.objectId, PoolIds::VALIDATION_MAX_DIFFERENCE, this); + lp_var_t minTrackerConfidence = + lp_var_t(sid.objectId, PoolIds::VALIDATION_MIN_TRACKER_CONFIDENCE, this); + lp_var_t minMatchedStars = + lp_var_t(sid.objectId, PoolIds::VALIDATION_MIN_MATCHED_STARS, this); + + void printSet() { + sif::info << "ValidationSet::printSet: stable count: " + << static_cast(this->stableCount) << std::endl; + sif::info << "ValidationSet::printSet: max difference: " << this->maxDifference << std::endl; + sif::info << "ValidationSet::printSet: min tracker confidence: " << this->minTrackerConfidence + << std::endl; + sif::info << "ValidationSet::printSet: min matched stars: " << this->minMatchedStars + << std::endl; + } +}; + +/** + * @brief Will store the requested algo parameters + */ +class AlgoSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 11; + + AlgoSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, ALGO_SET_ID) {} + + AlgoSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, ALGO_SET_ID)) {} + + lp_var_t mode = + lp_var_t(sid.objectId, PoolIds::ALGO_MODE, this); + lp_var_t i2tMinConfidence = + lp_var_t(sid.objectId, PoolIds::ALGO_I2T_MIN_CONFIDENCE, this); + lp_var_t i2tMinMatched = + lp_var_t(sid.objectId, PoolIds::ALGO_I2T_MIN_MATCHED, this); + lp_var_t i2lMinConfidence = + lp_var_t(sid.objectId, PoolIds::ALGO_I2L_MIN_CONFIDENCE, this); + lp_var_t i2lMinMatched = + lp_var_t(sid.objectId, PoolIds::ALGO_I2L_MIN_MATCHED, this); + + void printSet() { + sif::info << "AlgoSet::printSet: mode: " << static_cast(this->mode) << std::endl; + sif::info << "AlgoSet::printSet: i2t min confidence: " << this->i2tMinConfidence << std::endl; + sif::info << "AlgoSet::printSet: i2t min matched: " + << static_cast(this->i2tMinMatched) << std::endl; + sif::info << "AlgoSet::printSet: i2l min confidence: " << this->i2lMinConfidence << std::endl; + sif::info << "AlgoSet::printSet: i2l min matched: " + << static_cast(this->i2lMinMatched) << std::endl; + } +}; + +/** + * @brief Will store the requested subscription parameters + */ +class SubscriptionSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 16; + + SubscriptionSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, SUBSCRIPTION_SET_ID) {} + + SubscriptionSet(object_id_t objectId) + : StaticLocalDataSet(sid_t(objectId, SUBSCRIPTION_SET_ID)) {} + + lp_var_t tm1 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM1, this); + lp_var_t tm2 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM2, this); + lp_var_t tm3 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM3, this); + lp_var_t tm4 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM4, this); + lp_var_t tm5 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM5, this); + lp_var_t tm6 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM6, this); + lp_var_t tm7 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM7, this); + lp_var_t tm8 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM8, this); + lp_var_t tm9 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM9, this); + lp_var_t tm10 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM10, this); + lp_var_t tm11 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM11, this); + lp_var_t tm12 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM12, this); + lp_var_t tm13 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM13, this); + lp_var_t tm14 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM14, this); + lp_var_t tm15 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM15, this); + lp_var_t tm16 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM16, this); + + void printSet() { + sif::info << "SubscriptionSet::printSet: telemetry 1: " << static_cast(this->tm1) + << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 2: " << static_cast(this->tm2) + << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 3: " << static_cast(this->tm3) + << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 4: " << static_cast(this->tm4) + << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 5: " << static_cast(this->tm5) + << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 6: " << static_cast(this->tm6) + << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 7: " << static_cast(this->tm7) + << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 8: " << static_cast(this->tm8) + << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 9: " << static_cast(this->tm9) + << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 10: " + << static_cast(this->tm10) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 11: " + << static_cast(this->tm11) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 12: " + << static_cast(this->tm12) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 13: " + << static_cast(this->tm13) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 14: " + << static_cast(this->tm14) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 15: " + << static_cast(this->tm15) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 16: " + << static_cast(this->tm16) << std::endl; + } +}; + +/** + * @brief Will store the requested log subscription parameters + */ +class LogSubscriptionSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 4; + + LogSubscriptionSet(HasLocalDataPoolIF* owner) + : StaticLocalDataSet(owner, LOG_SUBSCRIPTION_SET_ID) {} + + LogSubscriptionSet(object_id_t objectId) + : StaticLocalDataSet(sid_t(objectId, LOG_SUBSCRIPTION_SET_ID)) {} + + lp_var_t level1 = + lp_var_t(sid.objectId, PoolIds::LOG_SUBSCRIPTION_LEVEL1, this); + lp_var_t module1 = + lp_var_t(sid.objectId, PoolIds::LOG_SUBSCRIPTION_MODULE1, this); + lp_var_t level2 = + lp_var_t(sid.objectId, PoolIds::LOG_SUBSCRIPTION_LEVEL2, this); + lp_var_t module2 = + lp_var_t(sid.objectId, PoolIds::LOG_SUBSCRIPTION_MODULE2, this); + + void printSet() { + sif::info << "LogSubscriptionSet::printSet: level 1: " + << static_cast(this->level1) << std::endl; + sif::info << "LogSubscriptionSet::printSet: module 1: " + << static_cast(this->module1) << std::endl; + sif::info << "LogSubscriptionSet::printSet: level 2: " + << static_cast(this->level2) << std::endl; + sif::info << "LogSubscriptionSet::printSet: module 2: " + << static_cast(this->module2) << std::endl; + } +}; + +/** + * @brief Will store the requested debug camera parameters + */ +class DebugCameraSet : public StaticLocalDataSet { + public: + // Size of dataset + static const size_t SIZE = 8; + + DebugCameraSet(HasLocalDataPoolIF* owner) + : StaticLocalDataSet(owner, DEBUG_CAMERA_SET_ID) {} + + lp_var_t timing = + lp_var_t(sid.objectId, PoolIds::DEBUG_CAMERA_TIMING, this); + lp_var_t test = + lp_var_t(sid.objectId, PoolIds::DEBUG_CAMERA_TEST, this); + + DebugCameraSet(object_id_t objectId) + : StaticLocalDataSet(sid_t(objectId, DEBUG_CAMERA_SET_ID)) {} + + void printSet() { + sif::info << "DebugCameraSet::printSet: level 1: " + << static_cast(this->level1) << std::endl; + sif::info << "DebugCameraSet::printSet: module 1: " + << static_cast(this->module1) << std::endl; } }; } // namespace StarTracker diff --git a/linux/devices/startracker/StarTrackerHandler.cpp b/linux/devices/startracker/StarTrackerHandler.cpp index e2857f79..044dd0d7 100644 --- a/linux/devices/startracker/StarTrackerHandler.cpp +++ b/linux/devices/startracker/StarTrackerHandler.cpp @@ -515,6 +515,50 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi result = prepareRequestLimitsParams(); return result; } + case (StarTracker::REQ_LOG_LEVEL): { + result = prepareRequestLogLevelParams(); + return result; + } + case (StarTracker::REQ_MOUNTING): { + result = prepareRequestMountingParams(); + return result; + } + case (StarTracker::REQ_IMAGE_PROCESSOR): { + result = prepareRequestMountignParams(); + return result; + } + case (StarTracker::REQ_CENTROIDING): { + result = prepareRequestCentroidingParams(); + return result; + } + case (StarTracker::REQ_LISA): { + result = prepareRequestLisaParams(); + return result; + } + case (StarTracker::REQ_MATCHING): { + result = prepareRequetMatchingParams(); + return result; + } + case (StarTracker::REQ_TRACKING): { + result = prepareRequestTrackingParams(); + return result; + } + case (StarTracker::REQ_VALIDATION): { + result = prepareRequestValidationParams(); + return result; + } + case (StarTracker::REQ_ALGO): { + result = prepareRequestAlgoParams(); + return result; + } + case (StarTracker::REQ_SUBSCRIPTION): { + result = prepareRequestSubscriptionParams(); + return result; + } + case (StarTracker::REQ_LOG_SUBSCRIPTION): { + result = prepareRequestLogSubscriptionParams(); + return result; + } default: return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED; } @@ -599,6 +643,30 @@ void StarTrackerHandler::fillCommandAndReplyMap() { StarTracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(StarTracker::REQ_LIMITS, 3, nullptr, StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::REQ_LOG_LEVEL, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::REQ_MOUNTING, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::REQ_IMAGE_PROCESSOR, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::REQ_CENTROIDING, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::REQ_LISA, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::REQ_MATCHING, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::REQ_TRACKING, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::REQ_VALIDATION, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::REQ_ALGO, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::REQ_SUBSCRIPTION, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::REQ_LOG_SUBSCRIPTION, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::REQ_DEBUG_CAMERA, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); } ReturnValue_t StarTrackerHandler::scanForReply(const uint8_t* start, size_t remainingSize, @@ -983,6 +1051,15 @@ ReturnValue_t StarTrackerHandler::initializeLocalDataPool(localpool::DataPool& l localDataPoolMap.emplace(StarTracker::CAM_VAL3, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::CAM_REG4, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::CAM_VAL4, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CAM_REG5, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CAM_VAL5, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CAM_REG6, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CAM_VAL6, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CAM_REG7, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CAM_VAL7, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CAM_REG8, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CAM_VAL8, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CAM_FREQ_1, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::LIMITS_ACTION, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::LIMITS_FPGA18CURRENT, new PoolEntry({0})); @@ -994,6 +1071,77 @@ ReturnValue_t StarTrackerHandler::initializeLocalDataPool(localpool::DataPool& l localDataPoolMap.emplace(StarTracker::LIMITS_CMOS33CURRENT, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::LIMITS_CMOSVRESCURRENT, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::LIMITS_CMOSTEMPERATURE, new PoolEntry({0})); + + localDataPoolMap.emplace(StarTracker::LOGLEVEL1, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL2, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL3, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL4, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL5, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL6, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL7, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL8, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL9, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL10, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL11, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL12, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL13, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL14, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL15, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOGLEVEL16, new PoolEntry({0})); + + localDataPoolMap.emplace(StarTracker::MOUNTING_QW, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::MOUNTING_QX, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::MOUNTING_QY, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::MOUNTING_QZ, new PoolEntry({0})); + + localDataPoolMap.emplace(StarTracker::IMAGE_PROCESSOR_MODE, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::IMAGE_PROCESSOR_STORE, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::IMAGE_PROCESSOR_SIGNALTHRESHOLD, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::IMAGE_PROCESSOR_DARKTHRESHOLD, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::IMAGE_PROCESSOR_BACKGROUNDCOMPENSATION, new PoolEntry({0})); + + localDataPoolMap.emplace(StarTracker::CENTROIDING_ENABLE_FILTER, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CENTROIDING_MAX_QUALITY, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CENTROIDING_DARK_THRESHOLD, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CENTROIDING_MIN_QUALITY, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CENTROIDING_MAX_INTENSITY, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CENTROIDING_MIN_INTENSITY, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CENTROIDING_MAX_MAGNITUDE, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CENTROIDING_GAUSSIAN_CMAX, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CENTROIDING_GAUSSIAN_CMIN, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CENTROIDING_TRANSMATRIX00, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CENTROIDING_TRANSMATRIX01, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CENTROIDING_TRANSMATRIX10, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::CENTROIDING_TRANSMATRIX11, new PoolEntry({0})); + + localDataPoolMap.emplace(StarTracker::LISA_MODE, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LISA_PREFILTER_DIST_THRESHOLD, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LISA_PREFILTER_ANGLE_THRESHOLD, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LISA_FOV_WIDTH, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LISA_FOV_HEIGHT, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LISA_FLOAT_STAR_LIMIT, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LISA_CLOSE_STAR_LIMIT, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LISA_RATING_WEIGHT_CLOSE_STAR_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LISA_RATING_WEIGHT_FRACTION_CLOSE, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LISA_RATING_WEIGHT_MEAN_SUM, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LISA_RATING_WEIGHT_DB_STAR_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LISA_MAX_COMBINATIONS, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LISA_NR_STARS_STOP, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LISA_FRACTION_CLOSE_STOP, new PoolEntry({0})); + + localDataPoolMap.emplace(StarTracker::MATCHING_SQUARED_DISTANCE_LIMIT, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::MATCHING_SQUARED_SHIFT_LIMIT, new PoolEntry({0})); + + localDataPoolMap.emplace(StarTracker::TRACKING_THIN_LIMIT, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::TRACKING_OUTLIER_THRESHOLD, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::TRACKING_OUTLIER_THRESHOLD_QUEST, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::TRACKING_TRACKER_CHOICE, new PoolEntry({0})); + + localDataPoolMap.emplace(StarTracker::VALIDATION_STABLE_COUNT, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::VALIDATION_MAX_DIFFERENCE, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::VALIDATION_MIN_TRACKER_CONFIDENCE, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::VALIDATION_MIN_MATCHED_STARS, new PoolEntry({0})); + return RETURN_OK; } @@ -1099,7 +1247,7 @@ ReturnValue_t StarTrackerHandler::scanForActionReply(DeviceCommandId_t* foundId) ReturnValue_t StarTrackerHandler::scanForSetParameterReply(DeviceCommandId_t* foundId) { const uint8_t* reply = dataLinkLayer.getReply(); switch (*reply) { - case (StarTracker::ID::SUBSCRIBE): { + case (StarTracker::ID::SUBSCRIPTION): { *foundId = StarTracker::SUBSCRIBE_TO_TM; break; } @@ -1162,6 +1310,54 @@ ReturnValue_t StarTrackerHandler::scanForGetParameterReply(DeviceCommandId_t* fo *foundId = StarTracker::REQ_LIMITS; break; } + case (StarTracker::ID::LOG_LEVEL): { + *foundId = StarTracker::REQ_LOG_LEVEL; + break; + } + case (StarTracker::ID::MOUNTING): { + *foundId = StarTracker::REQ_MOUNTING; + break; + } + case (StarTracker::ID::IMAGE_PROCESSOR): { + *foundId = StarTracker::REQ_IMAGE_PROCESSOR; + break; + } + case (StarTracker::ID::CENTROIDING): { + *foundId = StarTracker::REQ_CENTROIDING; + break; + } + case (StarTracker::ID::LISA): { + *foundId = StarTracker::REQ_LISA; + break; + } + case (StarTracker::ID::MATCHING): { + *foundId = StarTracker::REQ_MATCHING; + break; + } + case (StarTracker::ID::TRACKING): { + *foundId = StarTracker::REQ_TRACKING; + break; + } + case (StarTracker::ID::VALIDATION): { + *foundId = StarTracker::REQ_VALIDATION; + break; + } + case (StarTracker::ID::ALGO): { + *foundId = StarTracker::REQ_ALGO; + break; + } + case (StarTracker::ID::SUBSCRIPTION): { + *foundId = StarTracker::SUBSCRIPTION; + break; + } + case (StarTracker::ID::LOG_SUBSCRIPTION): { + *foundId = StarTracker::REQ_LOG_SUBSCRIPTION; + break; + } + case (StarTracker::ID::DEBUG_CAMERA): { + *foundId = StarTracker::REQ_DEBUG_CAMERA; + break; + } default: { sif::warning << "tarTrackerHandler::scanForGetParameterReply: UnkNown ID" << std::endl; return RETURN_FAILED; @@ -1626,7 +1822,7 @@ void StarTrackerHandler::prepareTakeImageCommand(const uint8_t* commandData) { void StarTrackerHandler::prepareSubscriptionCommand(const uint8_t* tmId) { uint32_t length = 18; commandBuffer[0] = TMTC_SETPARAMREQ; - commandBuffer[1] = StarTracker::ID::SUBSCRIBE; + commandBuffer[1] = StarTracker::ID::SUBSCRIPTION; // Fill all other fields with invalid tm id commandBuffer[2] = *tmId; commandBuffer[3] = 0; @@ -1794,6 +1990,15 @@ ReturnValue_t StarTrackerHandler::prepareRequestLimitsParams() { return RETURN_OK; } +ReturnValue_t StarTrackerHandler::prepareRequestPropertyParams() { + uint32_t length = 0; + arc_pack_loglevel_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + ReturnValue_t StarTrackerHandler::handleSetParamReply() { const uint8_t* reply = dataLinkLayer.getReply(); uint8_t status = *(reply + STATUS_OFFSET); diff --git a/linux/devices/startracker/StarTrackerHandler.h b/linux/devices/startracker/StarTrackerHandler.h index 3d7ed28a..a6ead8e8 100644 --- a/linux/devices/startracker/StarTrackerHandler.h +++ b/linux/devices/startracker/StarTrackerHandler.h @@ -495,14 +495,23 @@ class StarTrackerHandler : public DeviceHandlerBase { ReturnValue_t prepareFpgaActionCommand(const uint8_t* commandData, size_t commandDataLen); /** - * @brief Will fill the command buffer with the command to request the set camera parameters. + * @brief The following function will fill the command buffer with the command to request + * a parameter set. */ ReturnValue_t prepareRequestCameraParams(); - - /** - * @brief Will fill the command buffer with the command to request the set limits. - */ ReturnValue_t prepareRequestLimitsParams(); + ReturnValue_t prepareRequestLogLevelParams(); + ReturnValue_t prepareRequestMountingParams(); + ReturnValue_t prepareRequestImageProcessorParams(); + ReturnValue_t prepareRequestCentroidingParams(); + ReturnValue_t prepareRequestLisaParams(); + ReturnValue_t prepareRequestMatchingParams(); + ReturnValue_t prepareRequestTrackingParams(); + ReturnValue_t prepareRequestValidationParams(); + ReturnValue_t prepareRequestAlgoParams(); + ReturnValue_t prepareRequestSubscriptionParams(); + ReturnValue_t prepareRequestLogSubscriptionParams(); + ReturnValue_t prepareRequestDebugCameraParams(); /** * @brief Handles action replies with datasets. diff --git a/tmtc b/tmtc index 199ffe1a..cf7d25c2 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 199ffe1a321c09ba9726c87413045f8b32f40e90 +Subproject commit cf7d25c206e8ae8480367e1fc2b1151a0ded2683 From a65072b743637d502af096638ab2c47b4656ab4c Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Wed, 9 Feb 2022 19:27:08 +0100 Subject: [PATCH 08/13] changed egse default config to ground --- linux/devices/startracker/StarTrackerHandler.h | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/linux/devices/startracker/StarTrackerHandler.h b/linux/devices/startracker/StarTrackerHandler.h index 3d7ed28a..65aefa93 100644 --- a/linux/devices/startracker/StarTrackerHandler.h +++ b/linux/devices/startracker/StarTrackerHandler.h @@ -272,7 +272,7 @@ class StarTrackerHandler : public DeviceHandlerBase { #ifndef EGSE std::string paramJsonFile = "/mnt/sd0/startracker/flight-config.json"; #else - std::string paramJsonFile = "/home/pi/arcsec/ground-config.json"; + std::string paramJsonFile = "/home/pi/arcsec/flight-config.json"; #endif enum class InternalState { TEMPERATURE_REQUEST }; diff --git a/tmtc b/tmtc index 199ffe1a..cf7d25c2 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 199ffe1a321c09ba9726c87413045f8b32f40e90 +Subproject commit cf7d25c206e8ae8480367e1fc2b1151a0ded2683 From 07e68bd05b444261860d8fe651bc1deef0e5f16b Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Wed, 9 Feb 2022 19:46:12 +0100 Subject: [PATCH 09/13] param request wip --- .../StarTrackerDefinitions.h | 6 +- .../startracker/StarTrackerHandler.cpp | 71 +++++++++++++++---- .../devices/startracker/StarTrackerHandler.h | 12 ++++ 3 files changed, 71 insertions(+), 18 deletions(-) diff --git a/linux/devices/devicedefinitions/StarTrackerDefinitions.h b/linux/devices/devicedefinitions/StarTrackerDefinitions.h index 5f669fc9..4e80bf42 100644 --- a/linux/devices/devicedefinitions/StarTrackerDefinitions.h +++ b/linux/devices/devicedefinitions/StarTrackerDefinitions.h @@ -1845,10 +1845,8 @@ class DebugCameraSet : public StaticLocalDataSet { : StaticLocalDataSet(sid_t(objectId, DEBUG_CAMERA_SET_ID)) {} void printSet() { - sif::info << "DebugCameraSet::printSet: level 1: " - << static_cast(this->level1) << std::endl; - sif::info << "DebugCameraSet::printSet: module 1: " - << static_cast(this->module1) << std::endl; + sif::info << "DebugCameraSet::printSet: level 1: " << this->timing << std::endl; + sif::info << "DebugCameraSet::printSet: module 1: " << this->test << std::endl; } }; } // namespace StarTracker diff --git a/linux/devices/startracker/StarTrackerHandler.cpp b/linux/devices/startracker/StarTrackerHandler.cpp index 044dd0d7..a24284bf 100644 --- a/linux/devices/startracker/StarTrackerHandler.cpp +++ b/linux/devices/startracker/StarTrackerHandler.cpp @@ -36,6 +36,18 @@ StarTrackerHandler::StarTrackerHandler(object_id_t objectId, object_id_t comIF, downloadBlobPixel(this), cameraSet(this), limitsSet(this), + loglevelSet(this), + mountingSet(this), + imageProcessorSet(this), + centroidingSet(this), + lisaSet(this), + matchingSet(this), + trackingSet(this), + validationSet(this), + algoSet(this), + subscriptionSet(this), + logSubscriptionSet(this), + debugCameraSet(this), strHelper(strHelper) { if (comCookie == nullptr) { sif::error << "StarTrackerHandler: Invalid com cookie" << std::endl; @@ -639,33 +651,33 @@ void StarTrackerHandler::fillCommandAndReplyMap() { StarTracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(StarTracker::FPGA_ACTION, 3, nullptr, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_CAMERA, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::REQ_CAMERA, 3, &cameraSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_LIMITS, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::REQ_LIMITS, 3, &limitsSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_LOG_LEVEL, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::REQ_LOG_LEVEL, 3, &loglevelSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_MOUNTING, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::REQ_MOUNTING, 3, &mountingSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_IMAGE_PROCESSOR, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::REQ_IMAGE_PROCESSOR, 3, &imageProcessorSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_CENTROIDING, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::REQ_CENTROIDING, 3, ¢roidingSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_LISA, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::REQ_LISA, 3, &lisaSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_MATCHING, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::REQ_MATCHING, 3, &matchingSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_TRACKING, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::REQ_TRACKING, 3, &trackingSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_VALIDATION, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::REQ_VALIDATION, 3, &validationSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_ALGO, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::REQ_ALGO, 3, &algoSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_SUBSCRIPTION, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::REQ_SUBSCRIPTION, 3, &subscriptionSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_LOG_SUBSCRIPTION, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::REQ_LOG_SUBSCRIPTION, 3, &logSubscriptionSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); - this->insertInCommandAndReplyMap(StarTracker::REQ_DEBUG_CAMERA, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::REQ_DEBUG_CAMERA, 3, &debugCameraSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); } @@ -1142,6 +1154,37 @@ ReturnValue_t StarTrackerHandler::initializeLocalDataPool(localpool::DataPool& l localDataPoolMap.emplace(StarTracker::VALIDATION_MIN_TRACKER_CONFIDENCE, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::VALIDATION_MIN_MATCHED_STARS, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::ALGO_MODE, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::ALGO_I2T_MIN_CONFIDENCE, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::ALGO_I2T_MIN_MATCHED, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::ALGO_I2L_MIN_CONFIDENCE, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::ALGO_I2L_MIN_MATCHED, new PoolEntry({0})); + + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM1, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM2, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM3, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM4, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM5, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM6, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM7, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM8, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM9, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM10, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM11, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM12, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM13, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM14, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM15, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::SUBSCRIPTION_TM16, new PoolEntry({0})); + + localDataPoolMap.emplace(StarTracker::LOG_SUBSCRIPTION_LEVEL1, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOG_SUBSCRIPTION_MODULE1, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOG_SUBSCRIPTION_LEVEL2, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::LOG_SUBSCRIPTION_MODULE2, new PoolEntry({0})); + + localDataPoolMap.emplace(StarTracker::DEBUG_CAMERA_TIMING, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::DEBUG_CAMERA_TEST, new PoolEntry({0})); + return RETURN_OK; } diff --git a/linux/devices/startracker/StarTrackerHandler.h b/linux/devices/startracker/StarTrackerHandler.h index a6ead8e8..aa600ff6 100644 --- a/linux/devices/startracker/StarTrackerHandler.h +++ b/linux/devices/startracker/StarTrackerHandler.h @@ -261,6 +261,18 @@ class StarTrackerHandler : public DeviceHandlerBase { StarTracker::DownloadBlobPixel downloadBlobPixel; StarTracker::CameraSet cameraSet; StarTracker::LimitsSet limitsSet; + StarTracker::LogLevelSet loglevelSet; + StarTracker::MountingSet mountingSet; + StarTracker::ImageProcessorSet imageProcessorSet; + StarTracker::CentroidingSet centroidingSet; + StarTracker::LisaSet lisaSet; + StarTracker::MatchingSet matchingSet; + StarTracker::TrackingSet trackingSet; + StarTracker::ValidationSet validationSet; + StarTracker::AlgoSet algoSet; + StarTracker::SubscriptionSet subscriptionSet; + StarTracker::LogSubscriptionSet logSubscriptionSet; + StarTracker::DebugCameraSet debugCameraSet; // Pointer to object responsible for uploading and downloading images to/from the star tracker StrHelper* strHelper = nullptr; From c9e5fbc36130c808b0ae78715c66ef929c8c3842 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Thu, 10 Feb 2022 18:39:37 +0100 Subject: [PATCH 10/13] all parameter requests implemented --- bsp_egse/InitMission.cpp | 4 + .../StarTrackerDefinitions.h | 114 +++---- linux/devices/startracker/ArcsecJsonKeys.h | 49 ++- .../startracker/StarTrackerHandler.cpp | 245 ++++++++++++--- .../startracker/StarTrackerJsonCommands.cpp | 283 ++++++++++++++++++ .../startracker/StarTrackerJsonCommands.h | 64 ++++ 6 files changed, 664 insertions(+), 95 deletions(-) diff --git a/bsp_egse/InitMission.cpp b/bsp_egse/InitMission.cpp index 920c066d..222c8ec8 100644 --- a/bsp_egse/InitMission.cpp +++ b/bsp_egse/InitMission.cpp @@ -24,6 +24,10 @@ ServiceInterfaceStream sif::error("ERROR"); ObjectManagerIF* objectManager = nullptr; void initmission::initMission() { + sif::info << "Make sure the systemd service ser2net on the egse has been stopped " + << "(alias stop-ser2net)" << std::endl; + sif::info << "Make sure the power lines of the star tracker have been enabled " + << "(alias enable-startracker)" << std::endl; sif::info << "Building global objects.." << std::endl; /* Instantiate global object manager and also create all objects */ ObjectManager::instance()->setObjectFactoryFunction(ObjectFactory::produce, nullptr); diff --git a/linux/devices/devicedefinitions/StarTrackerDefinitions.h b/linux/devices/devicedefinitions/StarTrackerDefinitions.h index 4e80bf42..215ef472 100644 --- a/linux/devices/devicedefinitions/StarTrackerDefinitions.h +++ b/linux/devices/devicedefinitions/StarTrackerDefinitions.h @@ -355,7 +355,7 @@ static const DeviceCommandId_t REQ_POWER = 11; static const DeviceCommandId_t TAKE_IMAGE = 15; static const DeviceCommandId_t DOWNLOAD_CENTROID = 16; static const DeviceCommandId_t UPLOAD_CENTROID = 17; -static const DeviceCommandId_t SUBSCRIBE_TO_TM = 18; +static const DeviceCommandId_t SUBSCRIPTION = 18; static const DeviceCommandId_t IMAGE_PROCESSOR = 19; static const DeviceCommandId_t REQ_SOLUTION = 24; static const DeviceCommandId_t REQ_TEMPERATURE = 25; @@ -400,6 +400,9 @@ static const DeviceCommandId_t REQ_ALGO = 77; static const DeviceCommandId_t REQ_SUBSCRIPTION = 78; static const DeviceCommandId_t REQ_LOG_SUBSCRIPTION = 79; static const DeviceCommandId_t REQ_DEBUG_CAMERA = 80; +static const DeviceCommandId_t LOGLEVEL = 81; +static const DeviceCommandId_t LOGSUBSCRIPTION = 82; +static const DeviceCommandId_t DEBUG_CAMERA = 83; static const DeviceCommandId_t NONE = 0xFFFFFFFF; static const uint32_t VERSION_SET_ID = REQ_VERSION; @@ -428,6 +431,7 @@ static const uint32_t VALIDATION_SET_ID = REQ_VALIDATION; static const uint32_t ALGO_SET_ID = REQ_ALGO; static const uint32_t SUBSCRIPTION_SET_ID = REQ_SUBSCRIPTION; static const uint32_t LOG_SUBSCRIPTION_SET_ID = REQ_LOG_SUBSCRIPTION; +static const uint32_t DEBUG_CAMERA_SET_ID = REQ_DEBUG_CAMERA; /** Max size of unencoded frame */ static const size_t MAX_FRAME_SIZE = 1200; @@ -1369,14 +1373,14 @@ class LimitsSet : public StaticLocalDataSet { /** * @brief Will store the requested log level parameters */ -class LogLevelSet : public StaticLocalDataSet { +class LogLevelSet : public StaticLocalDataSet { public: // Size of dataset static const size_t SIZE = 16; - LogLevelSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, LOG_LEVEL_SET_ENTRIES) {} + LogLevelSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, LOG_LEVEL_SET_ID) {} - LogLevelSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, LOG_LEVEL_SET_ENTRIES)) {} + LogLevelSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, LOG_LEVEL_SET_ID)) {} lp_var_t loglevel1 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL1, this); lp_var_t loglevel2 = lp_var_t(sid.objectId, PoolIds::LOGLEVEL2, this); @@ -1481,14 +1485,16 @@ class ImageProcessorSet : public StaticLocalDataSet lp_var_t(sid.objectId, PoolIds::IMAGE_PROCESSOR_BACKGROUNDCOMPENSATION, this); void printSet() { - sif::info << "ImageProcessorSet::printSet: mode: " << this->mode << std::endl; - sif::info << "ImageProcessorSet::printSet: store: " << this->store << std::endl; + sif::info << "ImageProcessorSet::printSet: mode: " + << static_cast(this->mode.value) << std::endl; + sif::info << "ImageProcessorSet::printSet: store: " + << static_cast(this->store.value) << std::endl; sif::info << "ImageProcessorSet::printSet: signal threshold: " << this->signalThreshold << std::endl; sif::info << "ImageProcessorSet::printSet: dark threshold: " << this->darkThreshold << std::endl; sif::info << "ImageProcessorSet::printSet: background compensation: " - << this->backgroundCompensation << std::endl; + << static_cast(this->backgroundCompensation.value) << std::endl; } }; @@ -1532,7 +1538,8 @@ class CentroidingSet : public StaticLocalDataSet lp_var_t(sid.objectId, PoolIds::CENTROIDING_TRANSMATRIX11, this); void printSet() { - sif::info << "CentroidingSet::printSet: enable filter: " << this->enableFilter << std::endl; + sif::info << "CentroidingSet::printSet: enable filter: " + << static_cast(this->enableFilter.value) << std::endl; sif::info << "CentroidingSet::printSet: max quality: " << this->maxQuality << std::endl; sif::info << "CentroidingSet::printSet: dark threshold: " << this->darkThreshold << std::endl; sif::info << "CentroidingSet::printSet: min quality: " << this->minQuality << std::endl; @@ -1604,8 +1611,10 @@ class LisaSet : public StaticLocalDataSet { << std::endl; sif::info << "LisaSet::printSet: rating weight db star count: " << this->ratingWeightDbStarCount << std::endl; - sif::info << "LisaSet::printSet: max combinations: " << this->maxCombinations << std::endl; - sif::info << "LisaSet::printSet: nr stars stop: " << this->nrStarsStop << std::endl; + sif::info << "LisaSet::printSet: max combinations: " + << static_cast(this->maxCombinations.value) << std::endl; + sif::info << "LisaSet::printSet: nr stars stop: " + << static_cast(this->nrStarsStop.value) << std::endl; sif::info << "LisaSet::printSet: fraction close stop: " << this->fractionCloseStop << std::endl; } }; @@ -1639,7 +1648,7 @@ class MatchingSet : public StaticLocalDataSet { class TrackingSet : public StaticLocalDataSet { public: // Size of dataset - static const size_t SIZE = 16; + static const size_t SIZE = 13; TrackingSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, TRACKING_SET_ID) {} @@ -1648,13 +1657,16 @@ class TrackingSet : public StaticLocalDataSet { lp_var_t thinLimit = lp_var_t(sid.objectId, PoolIds::TRACKING_THIN_LIMIT, this); lp_var_t outlierThreshold = lp_var_t(sid.objectId, PoolIds::TRACKING_OUTLIER_THRESHOLD, this); lp_var_t outlierThresholdQuest = lp_var_t(sid.objectId, PoolIds::TRACKING_OUTLIER_THRESHOLD_QUEST, this); - lp_var_t trackerChoice = lp_var_t(sid.objectId, PoolIds::TRACKING_TRACKER_CHOICE, this); + lp_var_t trackerChoice = lp_var_t(sid.objectId, PoolIds::TRACKING_TRACKER_CHOICE, this); void printSet() { - sif::info << "MatchingSet::printSet: squared distance limit: " << this->squaredDistanceLimit + sif::info << "TrackingSet::printSet: thin limit: " << this->thinLimit << std::endl; + sif::info << "TrackingSet::printSet: outlier threshold: " << this->outlierThreshold << std::endl; - sif::info << "MatchingSet::printSet: squared distance limit: " << this->squaredShiftLimit + sif::info << "TrackingSet::printSet: outlier threshold quest: " << this->outlierThresholdQuest << std::endl; + sif::info << "TrackingSet::printSet: tracker choice: " + << static_cast(this->trackerChoice.value) << std::endl; } }; @@ -1681,12 +1693,12 @@ class ValidationSet : public StaticLocalDataSet { void printSet() { sif::info << "ValidationSet::printSet: stable count: " - << static_cast(this->stableCount) << std::endl; + << static_cast(this->stableCount.value) << std::endl; sif::info << "ValidationSet::printSet: max difference: " << this->maxDifference << std::endl; sif::info << "ValidationSet::printSet: min tracker confidence: " << this->minTrackerConfidence << std::endl; - sif::info << "ValidationSet::printSet: min matched stars: " << this->minMatchedStars - << std::endl; + sif::info << "ValidationSet::printSet: min matched stars: " + << static_cast(this->minMatchedStars.value) << std::endl; } }; @@ -1714,13 +1726,13 @@ class AlgoSet : public StaticLocalDataSet { lp_var_t(sid.objectId, PoolIds::ALGO_I2L_MIN_MATCHED, this); void printSet() { - sif::info << "AlgoSet::printSet: mode: " << static_cast(this->mode) << std::endl; + sif::info << "AlgoSet::printSet: mode: " << static_cast(this->mode.value) << std::endl; sif::info << "AlgoSet::printSet: i2t min confidence: " << this->i2tMinConfidence << std::endl; sif::info << "AlgoSet::printSet: i2t min matched: " - << static_cast(this->i2tMinMatched) << std::endl; + << static_cast(this->i2tMinMatched.value) << std::endl; sif::info << "AlgoSet::printSet: i2l min confidence: " << this->i2lMinConfidence << std::endl; sif::info << "AlgoSet::printSet: i2l min matched: " - << static_cast(this->i2lMinMatched) << std::endl; + << static_cast(this->i2lMinMatched.value) << std::endl; } }; @@ -1755,38 +1767,38 @@ class SubscriptionSet : public StaticLocalDataSet { lp_var_t tm16 = lp_var_t(sid.objectId, PoolIds::SUBSCRIPTION_TM16, this); void printSet() { - sif::info << "SubscriptionSet::printSet: telemetry 1: " << static_cast(this->tm1) - << std::endl; - sif::info << "SubscriptionSet::printSet: telemetry 2: " << static_cast(this->tm2) - << std::endl; - sif::info << "SubscriptionSet::printSet: telemetry 3: " << static_cast(this->tm3) - << std::endl; - sif::info << "SubscriptionSet::printSet: telemetry 4: " << static_cast(this->tm4) - << std::endl; - sif::info << "SubscriptionSet::printSet: telemetry 5: " << static_cast(this->tm5) - << std::endl; - sif::info << "SubscriptionSet::printSet: telemetry 6: " << static_cast(this->tm6) - << std::endl; - sif::info << "SubscriptionSet::printSet: telemetry 7: " << static_cast(this->tm7) - << std::endl; - sif::info << "SubscriptionSet::printSet: telemetry 8: " << static_cast(this->tm8) - << std::endl; - sif::info << "SubscriptionSet::printSet: telemetry 9: " << static_cast(this->tm9) - << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 1: " + << static_cast(this->tm1.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 2: " + << static_cast(this->tm2.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 3: " + << static_cast(this->tm3.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 4: " + << static_cast(this->tm4.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 5: " + << static_cast(this->tm5.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 6: " + << static_cast(this->tm6.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 7: " + << static_cast(this->tm7.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 8: " + << static_cast(this->tm8.value) << std::endl; + sif::info << "SubscriptionSet::printSet: telemetry 9: " + << static_cast(this->tm9.value) << std::endl; sif::info << "SubscriptionSet::printSet: telemetry 10: " - << static_cast(this->tm10) << std::endl; + << static_cast(this->tm10.value) << std::endl; sif::info << "SubscriptionSet::printSet: telemetry 11: " - << static_cast(this->tm11) << std::endl; + << static_cast(this->tm11.value) << std::endl; sif::info << "SubscriptionSet::printSet: telemetry 12: " - << static_cast(this->tm12) << std::endl; + << static_cast(this->tm12.value) << std::endl; sif::info << "SubscriptionSet::printSet: telemetry 13: " - << static_cast(this->tm13) << std::endl; + << static_cast(this->tm13.value) << std::endl; sif::info << "SubscriptionSet::printSet: telemetry 14: " - << static_cast(this->tm14) << std::endl; + << static_cast(this->tm14.value) << std::endl; sif::info << "SubscriptionSet::printSet: telemetry 15: " - << static_cast(this->tm15) << std::endl; + << static_cast(this->tm15.value) << std::endl; sif::info << "SubscriptionSet::printSet: telemetry 16: " - << static_cast(this->tm16) << std::endl; + << static_cast(this->tm16.value) << std::endl; } }; @@ -1815,13 +1827,13 @@ class LogSubscriptionSet : public StaticLocalDataSet(this->level1) << std::endl; + << static_cast(this->level1.value) << std::endl; sif::info << "LogSubscriptionSet::printSet: module 1: " - << static_cast(this->module1) << std::endl; + << static_cast(this->module1.value) << std::endl; sif::info << "LogSubscriptionSet::printSet: level 2: " - << static_cast(this->level2) << std::endl; + << static_cast(this->level2.value) << std::endl; sif::info << "LogSubscriptionSet::printSet: module 2: " - << static_cast(this->module2) << std::endl; + << static_cast(this->module2.value) << std::endl; } }; @@ -1845,8 +1857,8 @@ class DebugCameraSet : public StaticLocalDataSet { : StaticLocalDataSet(sid_t(objectId, DEBUG_CAMERA_SET_ID)) {} void printSet() { - sif::info << "DebugCameraSet::printSet: level 1: " << this->timing << std::endl; - sif::info << "DebugCameraSet::printSet: module 1: " << this->test << std::endl; + sif::info << "DebugCameraSet::printSet: timing: " << this->timing << std::endl; + sif::info << "DebugCameraSet::printSet: test: " << this->test << std::endl; } }; } // namespace StarTracker diff --git a/linux/devices/startracker/ArcsecJsonKeys.h b/linux/devices/startracker/ArcsecJsonKeys.h index 28d4ad3f..34989b1f 100644 --- a/linux/devices/startracker/ArcsecJsonKeys.h +++ b/linux/devices/startracker/ArcsecJsonKeys.h @@ -126,9 +126,56 @@ static const char TRACKER_CHOICE[] = "trackerChoice"; static const char ALGO[] = "algo"; static const char L2T_MIN_CONFIDENCE[] = "l2t_minConfidence"; -static const char L2T_MIN_MATCHED[] = "l2t_minConfidence"; +static const char L2T_MIN_MATCHED[] = "l2t_minMatched"; static const char T2L_MIN_CONFIDENCE[] = "t2l_minConfidence"; static const char T2L_MIN_MATCHED[] = "t2l_minMatched"; + +static const char LOGLEVEL[] = "loglevel"; +static const char LOGLEVEL1[] = "loglevel1"; +static const char LOGLEVEL2[] = "loglevel2"; +static const char LOGLEVEL3[] = "loglevel3"; +static const char LOGLEVEL4[] = "loglevel4"; +static const char LOGLEVEL5[] = "loglevel5"; +static const char LOGLEVEL6[] = "loglevel6"; +static const char LOGLEVEL7[] = "loglevel7"; +static const char LOGLEVEL8[] = "loglevel8"; +static const char LOGLEVEL9[] = "loglevel9"; +static const char LOGLEVEL10[] = "loglevel10"; +static const char LOGLEVEL11[] = "loglevel11"; +static const char LOGLEVEL12[] = "loglevel12"; +static const char LOGLEVEL13[] = "loglevel13"; +static const char LOGLEVEL14[] = "loglevel14"; +static const char LOGLEVEL15[] = "loglevel15"; +static const char LOGLEVEL16[] = "loglevel16"; + +static const char SUBSCRIPTION[] = "subscription"; +static const char TELEMETRY_1[] = "telemetry1"; +static const char TELEMETRY_2[] = "telemetry2"; +static const char TELEMETRY_3[] = "telemetry3"; +static const char TELEMETRY_4[] = "telemetry4"; +static const char TELEMETRY_5[] = "telemetry5"; +static const char TELEMETRY_6[] = "telemetry6"; +static const char TELEMETRY_7[] = "telemetry7"; +static const char TELEMETRY_8[] = "telemetry8"; +static const char TELEMETRY_9[] = "telemetry9"; +static const char TELEMETRY_10[] = "telemetry10"; +static const char TELEMETRY_11[] = "telemetry11"; +static const char TELEMETRY_12[] = "telemetry12"; +static const char TELEMETRY_13[] = "telemetry13"; +static const char TELEMETRY_14[] = "telemetry14"; +static const char TELEMETRY_15[] = "telemetry15"; +static const char TELEMETRY_16[] = "telemetry16"; + +static const char LOG_SUBSCRIPTION[] = "logsubscription"; +static const char LEVEL1[] = "level1"; +static const char MODULE1[] = "module1"; +static const char LEVEL2[] = "level2"; +static const char MODULE2[] = "module2"; + +static const char DEBUG_CAMERA[] = "debugcamera"; +static const char TIMING[] = "timing"; +static const char TEST[] = "test"; + } // namespace arcseckeys #endif /* BSP_Q7S_DEVICES_DEVICEDEFINITIONS_ARCSECJSONKEYS_H_ */ diff --git a/linux/devices/startracker/StarTrackerHandler.cpp b/linux/devices/startracker/StarTrackerHandler.cpp index a24284bf..9324458c 100644 --- a/linux/devices/startracker/StarTrackerHandler.cpp +++ b/linux/devices/startracker/StarTrackerHandler.cpp @@ -270,6 +270,7 @@ void StarTrackerHandler::doStartUp() { } return; case StartupState::DONE: + startupState = StartupState::IDLE; break; default: return; @@ -405,8 +406,9 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi prepareTakeImageCommand(commandData); return RETURN_OK; } - case (StarTracker::SUBSCRIBE_TO_TM): { - prepareSubscriptionCommand(commandData); + case (StarTracker::SUBSCRIPTION): { + Subscription subscription; + result = prepareParamCommand(commandData, commandDataLen, subscription); return RETURN_OK; } case (StarTracker::REQ_SOLUTION): { @@ -479,6 +481,21 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi result = prepareParamCommand(commandData, commandDataLen, tracking); return result; } + case (StarTracker::LOGLEVEL): { + LogLevel logLevel; + result = prepareParamCommand(commandData, commandDataLen, logLevel); + return result; + } + case (StarTracker::LOGSUBSCRIPTION): { + LogSubscription logSubscription; + result = prepareParamCommand(commandData, commandDataLen, logSubscription); + return result; + } + case (StarTracker::DEBUG_CAMERA): { + DebugCamera debugCamera; + result = prepareParamCommand(commandData, commandDataLen, debugCamera); + return result; + } case (StarTracker::ERASE): { result = prepareEraseCommand(commandData, commandDataLen); return result; @@ -536,7 +553,7 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi return result; } case (StarTracker::REQ_IMAGE_PROCESSOR): { - result = prepareRequestMountignParams(); + result = prepareRequestImageProcessorParams(); return result; } case (StarTracker::REQ_CENTROIDING): { @@ -548,7 +565,7 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi return result; } case (StarTracker::REQ_MATCHING): { - result = prepareRequetMatchingParams(); + result = prepareRequestMatchingParams(); return result; } case (StarTracker::REQ_TRACKING): { @@ -571,6 +588,10 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi result = prepareRequestLogSubscriptionParams(); return result; } + case (StarTracker::REQ_DEBUG_CAMERA): { + result = prepareRequestDebugCameraParams(); + return result; + } default: return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED; } @@ -595,7 +616,7 @@ void StarTrackerHandler::fillCommandAndReplyMap() { StarTracker::MAX_FRAME_SIZE * 2 + 2); // Reboot has no reply. Star tracker reboots immediately this->insertInCommandMap(StarTracker::SWITCH_TO_BOOTLOADER_PROGRAM); - this->insertInCommandAndReplyMap(StarTracker::SUBSCRIBE_TO_TM, 3, nullptr, + this->insertInCommandAndReplyMap(StarTracker::SUBSCRIPTION, 3, nullptr, StarTracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(StarTracker::REQ_SOLUTION, 3, &solutionSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); @@ -605,6 +626,12 @@ void StarTrackerHandler::fillCommandAndReplyMap() { StarTracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(StarTracker::REQ_CONTRAST, 3, &contrastSet, StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::LOGLEVEL, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::LOGSUBSCRIPTION, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); + this->insertInCommandAndReplyMap(StarTracker::DEBUG_CAMERA, 3, nullptr, + StarTracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(StarTracker::LIMITS, 3, nullptr, StarTracker::MAX_FRAME_SIZE * 2 + 2); this->insertInCommandAndReplyMap(StarTracker::MOUNTING, 3, nullptr, @@ -739,10 +766,6 @@ ReturnValue_t StarTrackerHandler::interpretDeviceReply(DeviceCommandId_t id, ReturnValue_t result = RETURN_OK; switch (id) { - case (StarTracker::SUBSCRIBE_TO_TM): { - result = handleSetParamReply(); - break; - } case (StarTracker::REQ_TIME): { result = handleTm(timeSet, StarTracker::TimeSet::SIZE); break; @@ -823,6 +846,10 @@ ReturnValue_t StarTrackerHandler::interpretDeviceReply(DeviceCommandId_t id, result = handleTm(contrastSet, StarTracker::ContrastSet::SIZE); break; } + case (StarTracker::SUBSCRIPTION): + case (StarTracker::LOGLEVEL): + case (StarTracker::LOGSUBSCRIPTION): + case (StarTracker::DEBUG_CAMERA): case (StarTracker::LIMITS): case (StarTracker::MOUNTING): case (StarTracker::CAMERA): @@ -844,13 +871,60 @@ ReturnValue_t StarTrackerHandler::interpretDeviceReply(DeviceCommandId_t id, handleParamRequest(limitsSet, StarTracker::LimitsSet::SIZE); break; } + case (StarTracker::REQ_LOG_LEVEL): { + handleParamRequest(loglevelSet, StarTracker::LogLevelSet::SIZE); + break; + } + case (StarTracker::REQ_MOUNTING): { + handleParamRequest(mountingSet, StarTracker::MountingSet::SIZE); + break; + } + case (StarTracker::REQ_IMAGE_PROCESSOR): { + handleParamRequest(imageProcessorSet, StarTracker::ImageProcessorSet::SIZE); + break; + } + case (StarTracker::REQ_CENTROIDING): { + handleParamRequest(centroidingSet, StarTracker::CentroidingSet::SIZE); + break; + } + case (StarTracker::REQ_LISA): { + handleParamRequest(lisaSet, StarTracker::LisaSet::SIZE); + break; + } + case (StarTracker::REQ_MATCHING): { + handleParamRequest(matchingSet, StarTracker::MatchingSet::SIZE); + break; + } + case (StarTracker::REQ_TRACKING): { + handleParamRequest(trackingSet, StarTracker::TrackingSet::SIZE); + break; + } + case (StarTracker::REQ_VALIDATION): { + handleParamRequest(validationSet, StarTracker::ValidationSet::SIZE); + break; + } + case (StarTracker::REQ_ALGO): { + handleParamRequest(algoSet, StarTracker::AlgoSet::SIZE); + break; + } + case (StarTracker::REQ_SUBSCRIPTION): { + handleParamRequest(subscriptionSet, StarTracker::SubscriptionSet::SIZE); + break; + } + case (StarTracker::REQ_LOG_SUBSCRIPTION): { + handleParamRequest(logSubscriptionSet, StarTracker::LogSubscriptionSet::SIZE); + break; + } + case (StarTracker::REQ_DEBUG_CAMERA): { + handleParamRequest(debugCameraSet, StarTracker::DebugCameraSet::SIZE); + break; + } default: { sif::debug << "StarTrackerHandler::interpretDeviceReply: Unknown device reply id:" << id << std::endl; result = DeviceHandlerIF::UNKNOWN_DEVICE_REPLY; } } - return result; } @@ -1147,7 +1221,7 @@ ReturnValue_t StarTrackerHandler::initializeLocalDataPool(localpool::DataPool& l localDataPoolMap.emplace(StarTracker::TRACKING_THIN_LIMIT, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::TRACKING_OUTLIER_THRESHOLD, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::TRACKING_OUTLIER_THRESHOLD_QUEST, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::TRACKING_TRACKER_CHOICE, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::TRACKING_TRACKER_CHOICE, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::VALIDATION_STABLE_COUNT, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::VALIDATION_MAX_DIFFERENCE, new PoolEntry({0})); @@ -1182,8 +1256,8 @@ ReturnValue_t StarTrackerHandler::initializeLocalDataPool(localpool::DataPool& l localDataPoolMap.emplace(StarTracker::LOG_SUBSCRIPTION_LEVEL2, new PoolEntry({0})); localDataPoolMap.emplace(StarTracker::LOG_SUBSCRIPTION_MODULE2, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::DEBUG_CAMERA_TIMING, new PoolEntry({0})); - localDataPoolMap.emplace(StarTracker::DEBUG_CAMERA_TEST, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::DEBUG_CAMERA_TIMING, new PoolEntry({0})); + localDataPoolMap.emplace(StarTracker::DEBUG_CAMERA_TEST, new PoolEntry({0})); return RETURN_OK; } @@ -1280,7 +1354,7 @@ ReturnValue_t StarTrackerHandler::scanForActionReply(DeviceCommandId_t* foundId) break; } default: - sif::warning << "StarTrackerHandler::scanForParameterReply: Unknown parameter reply id" + sif::warning << "StarTrackerHandler::scanForActionReply: Unknown parameter reply id" << std::endl; return RETURN_FAILED; } @@ -1291,7 +1365,7 @@ ReturnValue_t StarTrackerHandler::scanForSetParameterReply(DeviceCommandId_t* fo const uint8_t* reply = dataLinkLayer.getReply(); switch (*reply) { case (StarTracker::ID::SUBSCRIPTION): { - *foundId = StarTracker::SUBSCRIBE_TO_TM; + *foundId = StarTracker::SUBSCRIPTION; break; } case (StarTracker::ID::LIMITS): { @@ -1334,6 +1408,18 @@ ReturnValue_t StarTrackerHandler::scanForSetParameterReply(DeviceCommandId_t* fo *foundId = StarTracker::ALGO; break; } + case (StarTracker::ID::LOG_LEVEL): { + *foundId = StarTracker::LOGLEVEL; + break; + } + case (StarTracker::ID::DEBUG_CAMERA): { + *foundId = StarTracker::DEBUG_CAMERA; + break; + } + case (StarTracker::ID::LOG_SUBSCRIPTION): { + *foundId = StarTracker::LOGSUBSCRIPTION; + break; + } default: sif::debug << "StarTrackerHandler::scanForParameterReply: Unknown parameter reply id" << std::endl; @@ -1390,7 +1476,7 @@ ReturnValue_t StarTrackerHandler::scanForGetParameterReply(DeviceCommandId_t* fo break; } case (StarTracker::ID::SUBSCRIPTION): { - *foundId = StarTracker::SUBSCRIPTION; + *foundId = StarTracker::REQ_SUBSCRIPTION; break; } case (StarTracker::ID::LOG_SUBSCRIPTION): { @@ -1862,32 +1948,6 @@ void StarTrackerHandler::prepareTakeImageCommand(const uint8_t* commandData) { rawPacketLen = dataLinkLayer.getEncodedLength(); } -void StarTrackerHandler::prepareSubscriptionCommand(const uint8_t* tmId) { - uint32_t length = 18; - commandBuffer[0] = TMTC_SETPARAMREQ; - commandBuffer[1] = StarTracker::ID::SUBSCRIPTION; - // Fill all other fields with invalid tm id - commandBuffer[2] = *tmId; - commandBuffer[3] = 0; - commandBuffer[4] = 0; - commandBuffer[5] = 0; - commandBuffer[6] = 0; - commandBuffer[7] = 0; - commandBuffer[8] = 0; - commandBuffer[9] = 0; - commandBuffer[10] = 0; - commandBuffer[11] = 0; - commandBuffer[12] = 0; - commandBuffer[13] = 0; - commandBuffer[14] = 0; - commandBuffer[15] = 0; - commandBuffer[16] = 0; - commandBuffer[17] = 0; - dataLinkLayer.encodeFrame(commandBuffer, length); - rawPacket = dataLinkLayer.getEncodedFrame(); - rawPacketLen = dataLinkLayer.getEncodedLength(); -} - void StarTrackerHandler::prepareSolutionRequest() { uint32_t length = 0; arc_tm_pack_solution_req(commandBuffer, &length); @@ -2033,7 +2093,7 @@ ReturnValue_t StarTrackerHandler::prepareRequestLimitsParams() { return RETURN_OK; } -ReturnValue_t StarTrackerHandler::prepareRequestPropertyParams() { +ReturnValue_t StarTrackerHandler::prepareRequestLogLevelParams() { uint32_t length = 0; arc_pack_loglevel_parameter_req(commandBuffer, &length); dataLinkLayer.encodeFrame(commandBuffer, length); @@ -2042,6 +2102,105 @@ ReturnValue_t StarTrackerHandler::prepareRequestPropertyParams() { return RETURN_OK; } +ReturnValue_t StarTrackerHandler::prepareRequestMountingParams() { + uint32_t length = 0; + arc_pack_mounting_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestImageProcessorParams() { + uint32_t length = 0; + arc_pack_imageprocessor_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestCentroidingParams() { + uint32_t length = 0; + arc_pack_centroiding_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestLisaParams() { + uint32_t length = 0; + arc_pack_lisa_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestMatchingParams() { + uint32_t length = 0; + arc_pack_matching_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestTrackingParams() { + uint32_t length = 0; + arc_pack_tracking_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestValidationParams() { + uint32_t length = 0; + arc_pack_validation_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestAlgoParams() { + uint32_t length = 0; + arc_pack_algo_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestSubscriptionParams() { + uint32_t length = 0; + arc_pack_subscription_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestLogSubscriptionParams() { + uint32_t length = 0; + arc_pack_logsubscription_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + +ReturnValue_t StarTrackerHandler::prepareRequestDebugCameraParams() { + uint32_t length = 0; + arc_pack_debugcamera_parameter_req(commandBuffer, &length); + dataLinkLayer.encodeFrame(commandBuffer, length); + rawPacket = dataLinkLayer.getEncodedFrame(); + rawPacketLen = dataLinkLayer.getEncodedLength(); + return RETURN_OK; +} + ReturnValue_t StarTrackerHandler::handleSetParamReply() { const uint8_t* reply = dataLinkLayer.getReply(); uint8_t status = *(reply + STATUS_OFFSET); diff --git a/linux/devices/startracker/StarTrackerJsonCommands.cpp b/linux/devices/startracker/StarTrackerJsonCommands.cpp index c9d09a96..d8ddb7ca 100644 --- a/linux/devices/startracker/StarTrackerJsonCommands.cpp +++ b/linux/devices/startracker/StarTrackerJsonCommands.cpp @@ -504,6 +504,12 @@ ReturnValue_t Lisa::createCommand(uint8_t* buffer) { } addfloat(param, buffer + offset); offset += sizeof(float); + result = getParam(arcseckeys::RATING_WEIGHT_MEAN_SUM, param); + if (result != RETURN_OK) { + return result; + } + addfloat(param, buffer + offset); + offset += sizeof(float); result = getParam(arcseckeys::RATING_WEIGHT_DB_STAR_COUNT, param); if (result != RETURN_OK) { return result; @@ -632,3 +638,280 @@ ReturnValue_t Algo::createCommand(uint8_t* buffer) { adduint8(param, buffer + offset); return RETURN_OK; } + +LogLevel::LogLevel() : ArcsecJsonParamBase(arcseckeys::LOGLEVEL) {} + +size_t LogLevel::getSize() { return COMMAND_SIZE; } + +ReturnValue_t LogLevel::createCommand(uint8_t* buffer) { + ReturnValue_t result = RETURN_OK; + uint8_t offset = 0; + std::string param; + addSetParamHeader(buffer, StarTracker::ID::LOG_LEVEL); + offset = 2; + result = getParam(arcseckeys::LOGLEVEL1, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL2, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL3, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL4, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL5, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL6, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL7, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL8, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL9, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL10, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL11, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL12, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL13, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL14, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL15, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LOGLEVEL16, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + + return RETURN_OK; +} + +Subscription::Subscription() : ArcsecJsonParamBase(arcseckeys::SUBSCRIPTION) {} + +size_t Subscription::getSize() { return COMMAND_SIZE; } + +ReturnValue_t Subscription::createCommand(uint8_t* buffer) { + ReturnValue_t result = RETURN_OK; + uint8_t offset = 0; + std::string param; + addSetParamHeader(buffer, StarTracker::ID::SUBSCRIPTION); + offset = 2; + result = getParam(arcseckeys::TELEMETRY_1, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_2, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_3, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_4, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_5, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_6, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_7, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_8, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_9, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_10, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_11, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_12, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_13, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_14, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_15, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::TELEMETRY_16, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + return RETURN_OK; +} + +LogSubscription::LogSubscription() : ArcsecJsonParamBase(arcseckeys::LOG_SUBSCRIPTION) {} + +size_t LogSubscription::getSize() { return COMMAND_SIZE; } + +ReturnValue_t LogSubscription::createCommand(uint8_t* buffer) { + ReturnValue_t result = RETURN_OK; + uint8_t offset = 0; + std::string param; + addSetParamHeader(buffer, StarTracker::ID::LOG_SUBSCRIPTION); + offset = 2; + result = getParam(arcseckeys::LEVEL1, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::MODULE1, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::LEVEL2, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + offset += sizeof(uint8_t); + result = getParam(arcseckeys::MODULE2, param); + if (result != RETURN_OK) { + return result; + } + adduint8(param, buffer + offset); + return RETURN_OK; +} + +DebugCamera::DebugCamera() : ArcsecJsonParamBase(arcseckeys::DEBUG_CAMERA) {} + +size_t DebugCamera::getSize() { return COMMAND_SIZE; } + +ReturnValue_t DebugCamera::createCommand(uint8_t* buffer) { + ReturnValue_t result = RETURN_OK; + uint8_t offset = 0; + std::string param; + addSetParamHeader(buffer, StarTracker::ID::DEBUG_CAMERA); + offset = 2; + result = getParam(arcseckeys::TIMING, param); + if (result != RETURN_OK) { + return result; + } + adduint32(param, buffer + offset); + offset += sizeof(uint32_t); + result = getParam(arcseckeys::TEST, param); + if (result != RETURN_OK) { + return result; + } + adduint32(param, buffer + offset); + return RETURN_OK; +} diff --git a/linux/devices/startracker/StarTrackerJsonCommands.h b/linux/devices/startracker/StarTrackerJsonCommands.h index 2c816056..a827d829 100644 --- a/linux/devices/startracker/StarTrackerJsonCommands.h +++ b/linux/devices/startracker/StarTrackerJsonCommands.h @@ -173,4 +173,68 @@ class Algo : public ArcsecJsonParamBase { ReturnValue_t createCommand(uint8_t* buffer) override; }; +/** + * @brief Generates command to configure the log level parameters. + * + */ +class LogLevel : public ArcsecJsonParamBase { + public: + LogLevel(); + + size_t getSize(); + + private: + static const size_t COMMAND_SIZE = 18; + + ReturnValue_t createCommand(uint8_t* buffer) override; +}; + +/** + * @brief Generates command to set subscription parameters. + * + */ +class Subscription : public ArcsecJsonParamBase { + public: + Subscription(); + + size_t getSize(); + + private: + static const size_t COMMAND_SIZE = 18; + + ReturnValue_t createCommand(uint8_t* buffer) override; +}; + +/** + * @brief Generates command to set log subscription parameters. + * + */ +class LogSubscription : public ArcsecJsonParamBase { + public: + LogSubscription(); + + size_t getSize(); + + private: + static const size_t COMMAND_SIZE = 6; + + ReturnValue_t createCommand(uint8_t* buffer) override; +}; + +/** + * @brief Generates command to set debug camera parameters + * + */ +class DebugCamera : public ArcsecJsonParamBase { + public: + DebugCamera(); + + size_t getSize(); + + private: + static const size_t COMMAND_SIZE = 10; + + ReturnValue_t createCommand(uint8_t* buffer) override; +}; + #endif /* BSP_Q7S_DEVICES_DEVICEDEFINITIONS_STARTRACKERJSONCOMMANDS_H_ */ From 1e4001321006de0eb137dcc1a166c27d340840f3 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Fri, 11 Feb 2022 07:34:55 +0100 Subject: [PATCH 11/13] arcsec lib update --- thirdparty/arcsec_star_tracker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thirdparty/arcsec_star_tracker b/thirdparty/arcsec_star_tracker index aa1ebfc1..7cb426a6 160000 --- a/thirdparty/arcsec_star_tracker +++ b/thirdparty/arcsec_star_tracker @@ -1 +1 @@ -Subproject commit aa1ebfc154558dad746a175d2efee52470fddefe +Subproject commit 7cb426a6a1f1b25ac02d7bfd0792c412451c70af From b1973f77f7f10fefe52fc4bf11bdbd048c4320bf Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Fri, 11 Feb 2022 08:24:35 +0100 Subject: [PATCH 12/13] integrated log level, log suscription and debug camera parameter setting in startup routine --- .../startracker/StarTrackerHandler.cpp | 29 ++++++++++++++++++- .../devices/startracker/StarTrackerHandler.h | 3 ++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/linux/devices/startracker/StarTrackerHandler.cpp b/linux/devices/startracker/StarTrackerHandler.cpp index 9324458c..83776d2d 100644 --- a/linux/devices/startracker/StarTrackerHandler.cpp +++ b/linux/devices/startracker/StarTrackerHandler.cpp @@ -266,7 +266,7 @@ void StarTrackerHandler::doStartUp() { return; case StartupState::BOOT_DELAY: if (bootCountdown.hasTimedOut()) { - startupState = StartupState::LIMITS; + startupState = StartupState::LOGLEVEL; } return; case StartupState::DONE: @@ -313,6 +313,11 @@ ReturnValue_t StarTrackerHandler::buildTransitionDeviceCommand(DeviceCommandId_t bootCountdown.setTimeout(BOOT_TIMEOUT); startupState = StartupState::BOOT_DELAY; return buildCommandFromCommand(*id, nullptr, 0); + case StartupState::LOGLEVEL: + startupState = StartupState::WAIT_FOR_EXECUTION; + *id = StarTracker::LOGLEVEL; + return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), + paramJsonFile.size()); case StartupState::LIMITS: startupState = StartupState::WAIT_FOR_EXECUTION; *id = StarTracker::LIMITS; @@ -363,6 +368,16 @@ ReturnValue_t StarTrackerHandler::buildTransitionDeviceCommand(DeviceCommandId_t *id = StarTracker::ALGO; return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), paramJsonFile.size()); + case StartupState::LOG_SUBSCRIPTION: + startupState = StartupState::WAIT_FOR_EXECUTION; + *id = StarTracker::LOGSUBSCRIPTION; + return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), + paramJsonFile.size()); + case StartupState::DEBUG_CAMERA: + startupState = StartupState::WAIT_FOR_EXECUTION; + *id = StarTracker::DEBUG_CAMERA; + return buildCommandFromCommand(*id, reinterpret_cast(paramJsonFile.c_str()), + paramJsonFile.size()); default: break; } @@ -2422,6 +2437,10 @@ ReturnValue_t StarTrackerHandler::handleActionReplySet(LocalPoolDataSetBase& dat void StarTrackerHandler::handleStartup(const uint8_t* parameterId) { switch (*parameterId) { + case (StarTracker::ID::LOG_LEVEL): { + startupState = StartupState::LIMITS; + break; + } case (StarTracker::ID::LIMITS): { startupState = StartupState::TRACKING; break; @@ -2459,6 +2478,14 @@ void StarTrackerHandler::handleStartup(const uint8_t* parameterId) { break; } case (StarTracker::ID::ALGO): { + startupState = StartupState::LOG_SUBSCRIPTION; + break; + } + case (StarTracker::ID::LOG_SUBSCRIPTION): { + startupState = StartupState::DEBUG_CAMERA; + break; + } + case (StarTracker::ID::DEBUG_CAMERA): { startupState = StartupState::DONE; break; } diff --git a/linux/devices/startracker/StarTrackerHandler.h b/linux/devices/startracker/StarTrackerHandler.h index 736ae7e0..8fb49b63 100644 --- a/linux/devices/startracker/StarTrackerHandler.h +++ b/linux/devices/startracker/StarTrackerHandler.h @@ -296,6 +296,7 @@ class StarTrackerHandler : public DeviceHandlerBase { CHECK_BOOT_STATE, BOOT, BOOT_DELAY, + LOGLEVEL, LIMITS, TRACKING, MOUNTING, @@ -307,6 +308,8 @@ class StarTrackerHandler : public DeviceHandlerBase { MATCHING, VALIDATION, ALGO, + LOG_SUBSCRIPTION, + DEBUG_CAMERA, WAIT_FOR_EXECUTION, DONE }; From e3f36ddcfb9bb7d6abd4152276e6f42836e17e53 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Fri, 11 Feb 2022 08:47:06 +0100 Subject: [PATCH 13/13] tmtc update --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index cf7d25c2..5d8b9aac 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit cf7d25c206e8ae8480367e1fc2b1151a0ded2683 +Subproject commit 5d8b9aac1fea707015bd991b865da7f3405859e8