Compare commits

..

2 Commits

Author SHA1 Message Date
3ba05d46f3 changelog
Some checks are pending
EIVE/eive-obsw/pipeline/head Build queued...
EIVE/eive-obsw/pipeline/pr-main This commit looks good
2024-07-19 09:10:13 +02:00
6820fb729a mekf for detumble state machine 2024-07-19 09:10:05 +02:00
27 changed files with 64 additions and 188 deletions

View File

@ -16,17 +16,9 @@ will consitute of a breaking change warranting a new major release:
# [unreleased]
# [v8.2.1] 2025-02-07
Patch release with EM changes only.
## Changed
- BPX battery is not added anymore for EM build, dummy is used by default now.
## Fixed
- Small fix for `q7s-cp.py` script: Add `-O` argument.
- Readded rotation rate from the `MEKF` to the detumble state machine.
# [v8.2.0] 2024-06-26

View File

@ -11,7 +11,7 @@ cmake_minimum_required(VERSION 3.13)
set(OBSW_VERSION_MAJOR 8)
set(OBSW_VERSION_MINOR 2)
set(OBSW_VERSION_REVISION 1)
set(OBSW_VERSION_REVISION 0)
# set(CMAKE_VERBOSE TRUE)
@ -70,13 +70,13 @@ if(EIVE_Q7S_EM)
set(OBSW_Q7S_EM
1
CACHE STRING "Q7S EM configuration")
set(OBSW_Q7S_FM 0)
set(INIT_VAL 0)
set(OBSW_STAR_TRACKER_GROUND_CONFIG 1)
else()
set(OBSW_Q7S_EM
0
CACHE STRING "Q7S EM configuration")
set(OBSW_Q7S_FM 1)
set(INIT_VAL 1)
set(OBSW_STAR_TRACKER_GROUND_CONFIG 0)
endif()
@ -87,19 +87,19 @@ set(OBSW_ADD_TMTC_UDP_SERVER
0
CACHE STRING "Add UDP TMTC Server")
set(OBSW_ADD_MGT
${OBSW_Q7S_FM}
${INIT_VAL}
CACHE STRING "Add MGT module")
set(OBSW_ADD_BPX_BATTERY_HANDLER
${OBSW_Q7S_FM}
1
CACHE STRING "Add BPX battery module")
set(OBSW_ADD_STAR_TRACKER
1
CACHE STRING "Add Startracker module")
set(OBSW_ADD_SUN_SENSORS
${OBSW_Q7S_FM}
${INIT_VAL}
CACHE STRING "Add sun sensor module")
set(OBSW_ADD_SUS_BOARD_ASS
${OBSW_Q7S_FM}
${INIT_VAL}
CACHE STRING "Add sun sensor board assembly")
set(OBSW_ADD_THERMAL_TEMP_INSERTER
${OBSW_Q7S_EM}
@ -108,7 +108,7 @@ set(OBSW_ADD_ACS_BOARD
1
CACHE STRING "Add ACS board module")
set(OBSW_ADD_GPS_CTRL
${OBSW_Q7S_FM}
${INIT_VAL}
CACHE STRING "Add GPS controllers")
set(OBSW_ADD_CCSDS_IP_CORES
1
@ -129,19 +129,19 @@ set(OBSW_ADD_PLOC_SUPERVISOR
1
CACHE STRING "Add PLOC supervisor handler")
set(OBSW_ADD_SA_DEPL
${OBSW_Q7S_FM}
${INIT_VAL}
CACHE STRING "Add SA deployment handler")
set(OBSW_ADD_PLOC_MPSOC
1
CACHE STRING "Add MPSoC handler")
set(OBSW_ADD_ACS_CTRL
${OBSW_Q7S_FM}
${INIT_VAL}
CACHE STRING "Add ACS controller")
set(OBSW_ADD_RTD_DEVICES
${OBSW_Q7S_FM}
${INIT_VAL}
CACHE STRING "Add RTD devices")
set(OBSW_ADD_RAD_SENSORS
${OBSW_Q7S_FM}
${INIT_VAL}
CACHE STRING "Add Rad Sensor module")
set(OBSW_ADD_PL_PCDU
1
@ -156,10 +156,10 @@ set(OBSW_ADD_GOMSPACE_PCDU
1
CACHE STRING "Add GomSpace PCDU modules")
set(OBSW_ADD_GOMSPACE_ACU
${OBSW_Q7S_FM}
${INIT_VAL}
CACHE STRING "Add GomSpace ACU submodule")
set(OBSW_ADD_RW
${OBSW_Q7S_FM}
${INIT_VAL}
CACHE STRING "Add RW modules")
set(OBSW_ADD_SCEX_DEVICE
1

View File

@ -117,11 +117,10 @@ void ObjectFactory::produce(void* args) {
#if OBSW_ADD_BPX_BATTERY_HANDLER == 1
createBpxBatteryComponent(enableHkSets, battAndImtqI2cDev);
#endif
createPowerController(true, enableHkSets);
dummy::createDummies(dummyCfg, *pwrSwitcher, gpioComIF, enableHkSets);
createPowerController(true, enableHkSets);
new CoreController(objects::CORE_CONTROLLER, enableHkSets);
auto* stackHandler = new Stack5VHandler(*pwrSwitcher);
@ -144,6 +143,10 @@ void ObjectFactory::produce(void* args) {
createImtqComponents(pwrSwitcher, enableHkSets, battAndImtqI2cDev);
#endif
#if OBSW_ADD_SYRLINKS == 1
createSyrlinksComponents(pwrSwitcher);
#endif /* OBSW_ADD_SYRLINKS == 1 */
#if OBSW_ADD_RW == 1
createReactionWheelComponents(gpioComIF, pwrSwitcher);
#endif
@ -152,10 +155,6 @@ void ObjectFactory::produce(void* args) {
createStrComponents(pwrSwitcher, *SdCardManager::instance());
#endif /* OBSW_ADD_STAR_TRACKER == 1 */
#if OBSW_ADD_SYRLINKS == 1
createSyrlinksComponents(pwrSwitcher);
#endif
#if OBSW_ADD_PL_PCDU == 1
createPlPcduComponents(gpioComIF, spiMainComIF, pwrSwitcher, *stackHandler);
#endif

View File

@ -598,13 +598,14 @@ void ObjectFactory::createSolarArrayDeploymentComponents(PowerSwitchIF& pwrSwitc
}
void ObjectFactory::createSyrlinksComponents(PowerSwitchIF* pwrSwitcher) {
new SyrlinksComHandler(objects::SYRLINKS_COM_HANDLER);
auto* syrlinksAssy = new SyrlinksAssembly(objects::SYRLINKS_ASSY);
syrlinksAssy->connectModeTreeParent(satsystem::com::SUBSYSTEM);
auto* syrlinksUartCookie =
new SerialCookie(objects::SYRLINKS_HANDLER, q7s::UART_SYRLINKS_DEV, serial::SYRLINKS_BAUD,
syrlinks::MAX_REPLY_SIZE, UartModes::NON_CANONICAL);
syrlinksUartCookie->setParityEven();
new SyrlinksComHandler(objects::SYRLINKS_COM_HANDLER);
auto* syrlinksAssy = new SyrlinksAssembly(objects::SYRLINKS_ASSY);
syrlinksAssy->connectModeTreeParent(satsystem::com::SUBSYSTEM);
auto syrlinksFdir = new SyrlinksFdir(objects::SYRLINKS_HANDLER);
auto syrlinksHandler =
new SyrlinksHandler(objects::SYRLINKS_HANDLER, objects::SYRLINKS_COM_HANDLER,

View File

@ -10,9 +10,7 @@
int simple::simple() {
std::cout << "-- Q7S Simple Application --" << std::endl;
#if Q7S_SIMPLE_ADD_FILE_SYSTEM_TEST == 1
{
FileSystemTest fileSystemTest;
}
{ FileSystemTest fileSystemTest; }
#endif
#if TE0720_GPIO_TEST

View File

@ -1,54 +0,0 @@
#include "BatteryDummy.h"
BatteryDummy::BatteryDummy(DhbConfig cfg)
: FreshDeviceHandlerBase(cfg), cfgSet(this), hkSet(this) {}
void BatteryDummy::performDeviceOperation(uint8_t opCode) {}
LocalPoolDataSetBase* BatteryDummy::getDataSetHandle(sid_t sid) {
if (sid == hkSet.getSid()) {
return &hkSet;
}
if (sid == cfgSet.getSid()) {
return &cfgSet;
}
return nullptr;
}
ReturnValue_t BatteryDummy::initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) {
localDataPoolMap.emplace(bpxBat::BATT_TEMP_1, &battTemp1);
localDataPoolMap.emplace(bpxBat::BATT_TEMP_2, &battTemp2);
localDataPoolMap.emplace(bpxBat::BATT_TEMP_3, &battTemp3);
localDataPoolMap.emplace(bpxBat::BATT_TEMP_4, &battTemp4);
localDataPoolMap.emplace(bpxBat::CHARGE_CURRENT, &chargeCurrent);
localDataPoolMap.emplace(bpxBat::DISCHARGE_CURRENT, &dischargeCurrent);
localDataPoolMap.emplace(bpxBat::HEATER_CURRENT, &heaterCurrent);
localDataPoolMap.emplace(bpxBat::BATT_VOLTAGE, &battVolt);
localDataPoolMap.emplace(bpxBat::REBOOT_COUNTER, &rebootCounter);
localDataPoolMap.emplace(bpxBat::BOOTCAUSE, &bootCause);
localDataPoolMap.emplace(bpxBat::BATTERY_HEATER_MODE, &battheatMode);
localDataPoolMap.emplace(bpxBat::BATTHEAT_LOW_LIMIT, &battheatLow);
localDataPoolMap.emplace(bpxBat::BATTHEAT_HIGH_LIMIT, &battheatHigh);
poolManager.subscribeForRegularPeriodicPacket(
subdp::RegularHkPeriodicParams(hkSet.getSid(), true, 20.0));
poolManager.subscribeForRegularPeriodicPacket(
subdp::RegularHkPeriodicParams(cfgSet.getSid(), false, 30.0));
return returnvalue::OK;
}
ReturnValue_t BatteryDummy::checkModeCommand(Mode_t mode, Submode_t submode,
uint32_t* msToReachTheMode) {
return returnvalue::OK;
}
ReturnValue_t BatteryDummy::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
const uint8_t* data, size_t size) {
return returnvalue::OK;
}
ReturnValue_t BatteryDummy::handleCommandMessage(CommandMessage* message) {
return returnvalue::FAILED;
}

View File

@ -1,52 +0,0 @@
#pragma once
#include "fsfw/devicehandlers/FreshDeviceHandlerBase.h"
#include "mission/power/bpxBattDefs.h"
/// @brief
class BatteryDummy : public FreshDeviceHandlerBase {
public:
BatteryDummy(DhbConfig cfg);
private:
/**
* Periodic helper executed function, implemented by child class.
*/
void performDeviceOperation(uint8_t opCode) override;
/**
* Implemented by child class. Handle all command messages which are
* not health, mode, action or housekeeping messages.
* @param message
* @return
*/
ReturnValue_t handleCommandMessage(CommandMessage* message) override;
// HK manager abstract functions.
LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override;
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) override;
// Mode abstract functions
ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode,
uint32_t* msToReachTheMode) override;
// Action override. Forward to user.
ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
const uint8_t* data, size_t size) override;
BpxBatteryCfg cfgSet;
BpxBatteryHk hkSet;
PoolEntry<uint16_t> chargeCurrent = PoolEntry<uint16_t>({0});
PoolEntry<uint16_t> dischargeCurrent = PoolEntry<uint16_t>({0});
PoolEntry<uint16_t> heaterCurrent = PoolEntry<uint16_t>({0});
PoolEntry<uint16_t> battVolt = PoolEntry<uint16_t>({16'000});
PoolEntry<int16_t> battTemp1 = PoolEntry<int16_t>({10}, true);
PoolEntry<int16_t> battTemp2 = PoolEntry<int16_t>({10}, true);
PoolEntry<int16_t> battTemp3 = PoolEntry<int16_t>({10}, true);
PoolEntry<int16_t> battTemp4 = PoolEntry<int16_t>({10}, true);
PoolEntry<uint32_t> rebootCounter = PoolEntry<uint32_t>({0});
PoolEntry<uint8_t> bootCause = PoolEntry<uint8_t>({0});
PoolEntry<uint8_t> battheatMode = PoolEntry<uint8_t>({0});
PoolEntry<int8_t> battheatLow = PoolEntry<int8_t>({0});
PoolEntry<int8_t> battheatHigh = PoolEntry<int8_t>({0});
};

View File

@ -29,5 +29,4 @@ target_sources(
PlocSupervisorDummy.cpp
helperFactory.cpp
MgmRm3100Dummy.cpp
BatteryDummy.cpp
Tmp1075Dummy.cpp)

View File

@ -2,15 +2,14 @@
#include <mission/com/syrlinksDefs.h>
SyrlinksDummy::SyrlinksDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie,
DeviceHandlerFailureIsolation *fdir)
: DeviceHandlerBase(objectId, comif, comCookie, fdir) {}
SyrlinksDummy::SyrlinksDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
: DeviceHandlerBase(objectId, comif, comCookie) {}
SyrlinksDummy::~SyrlinksDummy() {}
void SyrlinksDummy::doStartUp() { setMode(MODE_ON); }
void SyrlinksDummy::doStartUp() {}
void SyrlinksDummy::doShutDown() { setMode(MODE_OFF); }
void SyrlinksDummy::doShutDown() {}
ReturnValue_t SyrlinksDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) {
return NOTHING_TO_SEND;
@ -37,7 +36,7 @@ ReturnValue_t SyrlinksDummy::interpretDeviceReply(DeviceCommandId_t id, const ui
void SyrlinksDummy::fillCommandAndReplyMap() {}
uint32_t SyrlinksDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 1000; }
uint32_t SyrlinksDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 500; }
ReturnValue_t SyrlinksDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) {

View File

@ -11,8 +11,7 @@ class SyrlinksDummy : public DeviceHandlerBase {
static const uint8_t SIMPLE_COMMAND_DATA = 1;
static const uint8_t PERIODIC_REPLY_DATA = 2;
SyrlinksDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie,
DeviceHandlerFailureIsolation *fdir);
SyrlinksDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie);
virtual ~SyrlinksDummy();
protected:

View File

@ -1,7 +1,6 @@
#include "helperFactory.h"
#include <dummies/AcuDummy.h>
#include <dummies/BatteryDummy.h>
#include <dummies/BpxDummy.h>
#include <dummies/ComCookieDummy.h>
#include <dummies/ComIFDummy.h>
@ -31,8 +30,6 @@
#include <mission/power/gsDefs.h>
#include <mission/system/acs/ImtqAssembly.h>
#include <mission/system/acs/StrAssembly.h>
#include <mission/system/com/SyrlinksAssembly.h>
#include <mission/system/com/SyrlinksFdir.h>
#include <mission/system/objects/CamSwitcher.h>
#include <mission/system/tcs/TcsBoardAssembly.h>
@ -52,7 +49,7 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio
new ComIFDummy(objects::DUMMY_COM_IF);
auto* comCookieDummy = new ComCookieDummy();
if (cfg.addBpxBattDummy) {
new BatteryDummy(DhbConfig(objects::BPX_BATT_HANDLER));
new BpxDummy(objects::BPX_BATT_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
}
if (cfg.addCoreCtrlCfg) {
new CoreControllerDummy(objects::CORE_CONTROLLER);
@ -77,13 +74,9 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio
strDummy->connectModeTreeParent(*strAssy);
}
if (cfg.addSyrlinksDummies) {
auto* syrlinksAssy = new SyrlinksAssembly(objects::SYRLINKS_ASSY);
syrlinksAssy->connectModeTreeParent(satsystem::com::SUBSYSTEM);
auto syrlinksFdir = new SyrlinksFdir(objects::SYRLINKS_HANDLER);
auto* syrlinksDummy = new SyrlinksDummy(objects::SYRLINKS_HANDLER, objects::DUMMY_COM_IF,
comCookieDummy, syrlinksFdir);
syrlinksDummy->connectModeTreeParent(*syrlinksAssy);
auto* syrlinksDummy =
new SyrlinksDummy(objects::SYRLINKS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy);
syrlinksDummy->connectModeTreeParent(satsystem::com::SUBSYSTEM);
}
auto* imtqAssy = new ImtqAssembly(objects::IMTQ_ASSY);
imtqAssy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM);

View File

@ -557,9 +557,12 @@ void AcsController::performPointingCtrl() {
void AcsController::handleDetumbling() {
switch (detumbleState) {
case DetumbleState::NO_DETUMBLE:
if (fusedRotRateData.rotRateTotalSusMgm.isValid() and
if ((fusedRotRateData.rotRateTotalSusMgm.isValid() and
VectorOperations<double>::norm(fusedRotRateData.rotRateTotalSusMgm.value, 3) >
acsParameters.detumbleParameter.omegaDetumbleStart) {
acsParameters.detumbleParameter.omegaDetumbleStart) and
(attitudeEstimationData.satRotRateMekf.isValid() and
VectorOperations<double>::norm(attitudeEstimationData.satRotRateMekf.value, 3) >
acsParameters.detumbleParameter.omegaDetumbleStart)) {
detumbleCounter++;
} else if (detumbleCounter > 0) {
detumbleCounter -= 1;
@ -601,9 +604,12 @@ void AcsController::handleDetumbling() {
detumbleState = DetumbleState::NO_DETUMBLE;
break;
case DetumbleState::IN_DETUMBLE:
if (fusedRotRateData.rotRateTotalSusMgm.isValid() and
if ((fusedRotRateData.rotRateTotalSusMgm.isValid() and
VectorOperations<double>::norm(fusedRotRateData.rotRateTotalSusMgm.value, 3) <
acsParameters.detumbleParameter.omegaDetumbleEnd) {
acsParameters.detumbleParameter.omegaDetumbleEnd) and
(attitudeEstimationData.satRotRateMekf.isValid() and
VectorOperations<double>::norm(attitudeEstimationData.satRotRateMekf.value, 3) <
acsParameters.detumbleParameter.omegaDetumbleEnd)) {
detumbleCounter++;
} else if (detumbleCounter > 0) {
detumbleCounter -= 1;

View File

@ -32,8 +32,8 @@ class BpxBatteryHandler : public DeviceHandlerBase {
BpxBatteryHk hkSet;
DeviceCommandId_t lastCmd = DeviceHandlerIF::NO_COMMAND_ID;
std::array<uint8_t, 8> cmdBuf = {};
BpxBatteryCfg cfgSet;
std::array<uint8_t, 8> cmdBuf = {};
PoolEntry<uint16_t> chargeCurrent = PoolEntry<uint16_t>({0});
PoolEntry<uint16_t> dischargeCurrent = PoolEntry<uint16_t>({0});
PoolEntry<uint16_t> heaterCurrent = PoolEntry<uint16_t>({0});

View File

@ -199,7 +199,6 @@ class BpxBatteryHk : public StaticLocalDataSet<bpxBat::HK_ENTRIES> {
private:
friend class BpxBatteryHandler;
friend class BatteryDummy;
/**
* Constructor for data creator
* @param hkOwner
@ -239,7 +238,6 @@ class BpxBatteryCfg : public StaticLocalDataSet<bpxBat::CFG_ENTRIES> {
private:
friend class BpxBatteryHandler;
friend class BatteryDummy;
/**
* Constructor for data creator
* @param hkOwner

View File

@ -29,7 +29,7 @@ else
echo "No ${cmake_fmt} tool found, not formatting CMake files"
fi
cpp_format="clang-format-19"
cpp_format="clang-format"
file_selectors="( -iname *.h -o -iname *.cpp -o -iname *.c -o -iname *.tpp )"
file_excludes="( -not -iname translateObjects.cpp -not -iname translateEvents.cpp )"
if command -v ${cpp_format} &> /dev/null; then

View File

@ -84,8 +84,6 @@ def build_cmd(args):
cmd = "scp "
if args.recursive:
cmd += "-r "
# Necessary to avoid some errors related to SFTP server of OBSW.
cmd += "-O "
address = ""
port_args = ""
target = args.target
@ -101,7 +99,7 @@ def build_cmd(args):
target = args.target
else:
if target == "":
target = "/tmp"
target = f"/tmp"
else:
target = args.target
# accepted_key_rsa_args = "-o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa"

2
tmtc

@ -1 +1 @@
Subproject commit 82b388e23e8745c8671b8dfb1a55e443f59bf274
Subproject commit 9a06c64dfac3f4283c2d5af72a9c095f4726480b