meier/startracker #155

Merged
muellerr merged 51 commits from meier/startracker into develop 2022-02-28 13:25:39 +01:00
13 changed files with 595 additions and 630 deletions
Showing only changes of commit f88674ed59 - Show all commits

View File

@ -54,16 +54,13 @@
#include "linux/boardtest/SpiTestClass.h"
#include "linux/csp/CspComIF.h"
#include "linux/csp/CspCookie.h"
#include "linux/devices/GPSHyperionLinuxController.h"
#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h"
#include "linux/devices/startracker/StarTrackerHandler.h"
#include "linux/devices/startracker/StrHelper.h"
#include "mission/devices/SolarArrayDeploymentHandler.h"
#include "mission/devices/SusHandler.h"
#include "mission/devices/devicedefinitions/SusDefinitions.h"
#include "mission/core/GenericFactory.h"
#include "mission/devices/ACUHandler.h"
#include "mission/devices/BpxBatteryHandler.h"
#include "linux/devices/GPSHyperionLinuxController.h"
#include "mission/devices/GyroADIS1650XHandler.h"
#include "mission/devices/HeaterHandler.h"
#include "mission/devices/IMTQHandler.h"
@ -75,6 +72,7 @@
#include "mission/devices/PlocMPSoCHandler.h"
#include "mission/devices/RadiationSensorHandler.h"
#include "mission/devices/RwHandler.h"
#include "mission/devices/SolarArrayDeploymentHandler.h"
#include "mission/devices/SusHandler.h"
#include "mission/devices/SyrlinksHkHandler.h"
#include "mission/devices/Tmp1075Handler.h"

View File

@ -2,9 +2,9 @@
#define MISSION_DEVICES_GPSHYPERIONHANDLER_H_
#include "fsfw/FSFW.h"
#include "mission/devices/devicedefinitions/GPSDefinitions.h"
#include "fsfw/controller/ExtendedControllerBase.h"
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
#include "mission/devices/devicedefinitions/GPSDefinitions.h"
#ifdef FSFW_OSAL_LINUX
#include <gps.h>

View File

@ -424,24 +424,11 @@ namespace region_secrets {
static const uint32_t REGION_14_SECRET = 0xe862b70b;
static const uint32_t REGION_15_SECRET = 0x79b537ca;
static const uint32_t secret[16]{
REGION_0_SECRET,
REGION_1_SECRET,
REGION_2_SECRET,
REGION_3_SECRET,
REGION_4_SECRET,
REGION_5_SECRET,
REGION_6_SECRET,
REGION_7_SECRET,
REGION_8_SECRET,
REGION_9_SECRET,
REGION_10_SECRET,
REGION_11_SECRET,
REGION_12_SECRET,
REGION_13_SECRET,
REGION_14_SECRET,
REGION_15_SECRET
};
}
REGION_0_SECRET, REGION_1_SECRET, REGION_2_SECRET, REGION_3_SECRET,
REGION_4_SECRET, REGION_5_SECRET, REGION_6_SECRET, REGION_7_SECRET,
REGION_8_SECRET, REGION_9_SECRET, REGION_10_SECRET, REGION_11_SECRET,
REGION_12_SECRET, REGION_13_SECRET, REGION_14_SECRET, REGION_15_SECRET};
} // namespace region_secrets
enum class FlashSections : uint8_t {
BOOTLOADER_SECTION = 0,
@ -450,10 +437,7 @@ enum class FlashSections: uint8_t {
};
// Flash region IDs of firmware partition
enum class FirmwareRegions: uint32_t {
FIRST = 1,
LAST = 8
};
enum class FirmwareRegions : uint32_t { FIRST = 1, LAST = 8 };
static const uint32_t FLASH_REGION_SIZE = 0x20000;
@ -1292,8 +1276,10 @@ class MatchingSet : public StaticLocalDataSet<MATCHING_SET_ENTRIES> {
MatchingSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, MATCHING_SET_ID)) {}
lp_var_t<float> squaredDistanceLimit = lp_var_t<float>(sid.objectId, PoolIds::MATCHING_SQUARED_DISTANCE_LIMIT, this);
lp_var_t<float> squaredShiftLimit = lp_var_t<float>(sid.objectId, PoolIds::MATCHING_SQUARED_SHIFT_LIMIT, this);
lp_var_t<float> squaredDistanceLimit =
lp_var_t<float>(sid.objectId, PoolIds::MATCHING_SQUARED_DISTANCE_LIMIT, this);
lp_var_t<float> squaredShiftLimit =
lp_var_t<float>(sid.objectId, PoolIds::MATCHING_SQUARED_SHIFT_LIMIT, this);
void printSet() {
sif::info << "MatchingSet::printSet: squared distance limit: " << this->squaredDistanceLimit
@ -1316,9 +1302,12 @@ class TrackingSet : public StaticLocalDataSet<TRACKING_SET_ENTRIES> {
TrackingSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, TRACKING_SET_ID)) {}
lp_var_t<float> thinLimit = lp_var_t<float>(sid.objectId, PoolIds::TRACKING_THIN_LIMIT, this);
lp_var_t<float> outlierThreshold = lp_var_t<float>(sid.objectId, PoolIds::TRACKING_OUTLIER_THRESHOLD, this);
lp_var_t<float> outlierThresholdQuest = lp_var_t<float>(sid.objectId, PoolIds::TRACKING_OUTLIER_THRESHOLD_QUEST, this);
lp_var_t<uint8_t> trackerChoice = lp_var_t<uint8_t>(sid.objectId, PoolIds::TRACKING_TRACKER_CHOICE, this);
lp_var_t<float> outlierThreshold =
lp_var_t<float>(sid.objectId, PoolIds::TRACKING_OUTLIER_THRESHOLD, this);
lp_var_t<float> outlierThresholdQuest =
lp_var_t<float>(sid.objectId, PoolIds::TRACKING_OUTLIER_THRESHOLD_QUEST, this);
lp_var_t<uint8_t> trackerChoice =
lp_var_t<uint8_t>(sid.objectId, PoolIds::TRACKING_TRACKER_CHOICE, this);
void printSet() {
sif::info << "TrackingSet::printSet: thin limit: " << this->thinLimit << std::endl;
@ -1375,8 +1364,7 @@ class AlgoSet : public StaticLocalDataSet<ALGO_SET_ENTRIES> {
AlgoSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, ALGO_SET_ID)) {}
lp_var_t<uint8_t> mode =
lp_var_t<uint8_t>(sid.objectId, PoolIds::ALGO_MODE, this);
lp_var_t<uint8_t> mode = lp_var_t<uint8_t>(sid.objectId, PoolIds::ALGO_MODE, this);
lp_var_t<float> i2tMinConfidence =
lp_var_t<float>(sid.objectId, PoolIds::ALGO_I2T_MIN_CONFIDENCE, this);
lp_var_t<uint8_t> i2tMinMatched =
@ -1387,7 +1375,8 @@ class AlgoSet : public StaticLocalDataSet<ALGO_SET_ENTRIES> {
lp_var_t<uint8_t>(sid.objectId, PoolIds::ALGO_I2L_MIN_MATCHED, this);
void printSet() {
sif::info << "AlgoSet::printSet: mode: " << static_cast<unsigned int>(this->mode.value) << std::endl;
sif::info << "AlgoSet::printSet: mode: " << static_cast<unsigned int>(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<unsigned int>(this->i2tMinMatched.value) << std::endl;
@ -1506,16 +1495,12 @@ class DebugCameraSet : public StaticLocalDataSet<DEBUG_CAMERA_SET_ENTRIES> {
// Size of dataset
static const size_t SIZE = 8;
DebugCameraSet(HasLocalDataPoolIF* owner)
: StaticLocalDataSet(owner, DEBUG_CAMERA_SET_ID) {}
DebugCameraSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, DEBUG_CAMERA_SET_ID) {}
lp_var_t<uint32_t> timing =
lp_var_t<uint32_t>(sid.objectId, PoolIds::DEBUG_CAMERA_TIMING, this);
lp_var_t<uint32_t> test =
lp_var_t<uint32_t>(sid.objectId, PoolIds::DEBUG_CAMERA_TEST, this);
lp_var_t<uint32_t> timing = lp_var_t<uint32_t>(sid.objectId, PoolIds::DEBUG_CAMERA_TIMING, this);
lp_var_t<uint32_t> test = lp_var_t<uint32_t>(sid.objectId, PoolIds::DEBUG_CAMERA_TEST, this);
DebugCameraSet(object_id_t objectId)
: StaticLocalDataSet(sid_t(objectId, DEBUG_CAMERA_SET_ID)) {}
DebugCameraSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, DEBUG_CAMERA_SET_ID)) {}
void printSet() {
sif::info << "DebugCameraSet::printSet: timing: " << this->timing << std::endl;

View File

@ -10,6 +10,7 @@ extern "C" {
#include <thirdparty/arcsec_star_tracker/client/generated/actionreq.h>
#include <thirdparty/arcsec_star_tracker/client/generated/parameter.h>
#include <thirdparty/arcsec_star_tracker/client/generated/telemetry.h>
#include "common/misc.h"
}

View File

@ -1,11 +1,11 @@
#ifndef MISSION_DEVICES_STARTRACKERHANDLER_H_
#define MISSION_DEVICES_STARTRACKERHANDLER_H_
#include "OBSWConfig.h"
#include <fsfw/datapool/PoolReadGuard.h>
#include "ArcsecDatalinkLayer.h"
#include "ArcsecJsonParamBase.h"
#include "OBSWConfig.h"
#include "StrHelper.h"
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
#include "fsfw/src/fsfw/serialize/SerializeAdapter.h"
@ -128,9 +128,11 @@ class StarTrackerHandler : public DeviceHandlerBase {
static const ReturnValue_t STR_HELPER_EXECUTING = MAKE_RETURN_CODE(0xB5);
//! [EXPORT] : [COMMENT] Star tracker is already in firmware mode
static const ReturnValue_t STARTRACKER_ALREADY_BOOTED = MAKE_RETURN_CODE(0xB6);
//! [EXPORT] : [COMMENT] Star tracker is in firmware mode but must be in bootloader mode to execute this command
//! [EXPORT] : [COMMENT] Star tracker is in firmware mode but must be in bootloader mode to
//! execute this command
static const ReturnValue_t STARTRACKER_RUNNING_FIRMWARE = MAKE_RETURN_CODE(0xB7);
//! [EXPORT] : [COMMENT] Star tracker is in bootloader mode but must be in firmware mode to execute this command
//! [EXPORT] : [COMMENT] Star tracker is in bootloader mode but must be in firmware mode to
//! execute this command
static const ReturnValue_t STARTRACKER_RUNNING_BOOTLOADER = MAKE_RETURN_CODE(0xB8);
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::STR_HANDLER;
@ -224,10 +226,7 @@ class StarTrackerHandler : public DeviceHandlerBase {
#endif
#endif
enum class NormalState {
TEMPERATURE_REQUEST,
SOLUTION_REQUEST
};
enum class NormalState { TEMPERATURE_REQUEST, SOLUTION_REQUEST };
NormalState normalState = NormalState::TEMPERATURE_REQUEST;
@ -263,13 +262,7 @@ class StarTrackerHandler : public DeviceHandlerBase {
InternalState internalState = InternalState::IDLE;
enum class StartupState {
IDLE,
CHECK_PROGRAM,
WAIT_CHECK_PROGRAM,
BOOT_BOOTLOADER,
DONE
};
enum class StartupState { IDLE, CHECK_PROGRAM, WAIT_CHECK_PROGRAM, BOOT_BOOTLOADER, DONE };
StartupState startupState = StartupState::IDLE;

View File

@ -168,13 +168,9 @@ ReturnValue_t StrHelper::startFlashRead(std::string path, uint8_t startRegion, u
return RETURN_OK;
}
void StrHelper::disableTimestamping() {
timestamping = false;
}
void StrHelper::disableTimestamping() { timestamping = false; }
void StrHelper::enableTimestamping() {
timestamping = true;
}
void StrHelper::enableTimestamping() { timestamping = true; }
ReturnValue_t StrHelper::performImageDownload() {
ReturnValue_t result;
@ -584,8 +580,7 @@ std::string StrHelper::makeFullFilename(std::string path, std::string filename)
Timestamp timestamp;
if (timestamping) {
image = path + "/" + timestamp.str() + filename;
}
else {
} else {
image = path + "/" + filename;
}
return image;

View File

@ -28,7 +28,6 @@ extern "C" {
* @author J. Meier
*/
class StrHelper : public SystemObject, public ExecutableObjectIF, public HasReturnvaluesIF {
public:
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::STR_HELPER;
@ -193,13 +192,7 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu
static const size_t CONFIG_MAX_DOWNLOAD_RETRIES = 3;
static const uint32_t FLASH_ERASE_DELAY = 500;
enum class InternalState {
IDLE,
UPLOAD_IMAGE,
DOWNLOAD_IMAGE,
FLASH_READ,
FIRMWARE_UPDATE
};
enum class InternalState { IDLE, UPLOAD_IMAGE, DOWNLOAD_IMAGE, FLASH_READ, FIRMWARE_UPDATE };
InternalState internalState = InternalState::IDLE;

2
tmtc

@ -1 +1 @@
Subproject commit fd43ef0c8a8241e7c50eea16ac86d9b121736ac1
Subproject commit 14c6d7a5251d400f12b71a4444a374ca49802df8