ACS updates #365
@ -21,6 +21,7 @@ change warranting a new major release:
|
||||
|
||||
- Bugfix in FSFW where the sequence flags of the PUS packets were set to continuation segment (0b00)
|
||||
instead of unsegmented (0b11).
|
||||
- Set GPS set entries to invalid on MODE_OFF command.
|
||||
|
||||
# [v1.23.0] 2023-02-01
|
||||
|
||||
|
2
fsfw
2
fsfw
@ -1 +1 @@
|
||||
Subproject commit 01cc619e67b84cef514b045377771ff1e11caf80
|
||||
Subproject commit f2461cd7e9df449e9ea4a842ca820d5002ef6494
|
@ -48,6 +48,9 @@ ReturnValue_t GPSHyperionLinuxController::checkModeCommand(Mode_t mode, Submode_
|
||||
return HasModesIF::INVALID_MODE;
|
||||
}
|
||||
}
|
||||
if (mode == MODE_OFF) {
|
||||
gpsSet.setValidity(false, true);
|
||||
}
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
|
26
mission/acsDefs.h
Normal file
26
mission/acsDefs.h
Normal file
@ -0,0 +1,26 @@
|
||||
#ifndef MISSION_ACSDEFS_H_
|
||||
#define MISSION_ACSDEFS_H_
|
||||
|
||||
#include <fsfw/modes/HasModesIF.h>
|
||||
|
||||
namespace acs {
|
||||
|
||||
enum CtrlSubmode {
|
||||
OFF = HasModesIF::MODE_OFF,
|
||||
SAFE = 2,
|
||||
DETUMBLE = 3,
|
||||
IDLE = 4,
|
||||
PTG_NADIR = 5,
|
||||
PTG_TARGET = 6,
|
||||
PTG_TARGET_GS = 7,
|
||||
PTG_INERTIAL = 8,
|
||||
};
|
||||
|
||||
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::ACS_SUBSYSTEM;
|
||||
static const Event SAFE_RATE_VIOLATION =
|
||||
MAKE_EVENT(0, severity::MEDIUM); //!< The limits for the rotation in safe mode were violated.
|
||||
static constexpr Event SAFE_RATE_RECOVERY = MAKE_EVENT(1, severity::MEDIUM);
|
||||
|
||||
} // namespace acs
|
||||
|
||||
#endif /* MISSION_ACSDEFS_H_ */
|
@ -2,6 +2,7 @@
|
||||
|
||||
#include <fsfw/datapool/PoolReadGuard.h>
|
||||
|
||||
#include "mission/acsDefs.h"
|
||||
#include "mission/config/torquer.h"
|
||||
|
||||
AcsController::AcsController(object_id_t objectId)
|
||||
@ -45,15 +46,15 @@ void AcsController::performControlOperation() {
|
||||
case InternalState::READY: {
|
||||
if (mode != MODE_OFF) {
|
||||
switch (submode) {
|
||||
case SUBMODE_SAFE:
|
||||
case acs::SAFE:
|
||||
performSafe();
|
||||
break;
|
||||
case SUBMODE_DETUMBLE:
|
||||
case acs::DETUMBLE:
|
||||
performDetumble();
|
||||
break;
|
||||
case SUBMODE_PTG_TARGET:
|
||||
case SUBMODE_PTG_NADIR:
|
||||
case SUBMODE_PTG_INERTIAL:
|
||||
case acs::PTG_TARGET:
|
||||
case acs::PTG_NADIR:
|
||||
case acs::PTG_INERTIAL:
|
||||
performPointingCtrl();
|
||||
break;
|
||||
}
|
||||
@ -151,9 +152,10 @@ void AcsController::performSafe() {
|
||||
detumbleCounter = 0;
|
||||
}
|
||||
if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) {
|
||||
submode = SUBMODE_DETUMBLE;
|
||||
// TODO: Trigger mode transition in ACS subsystem?
|
||||
submode = acs::CtrlSubmode::DETUMBLE;
|
||||
detumbleCounter = 0;
|
||||
triggerEvent(SAFE_RATE_VIOLATION);
|
||||
triggerEvent(acs::SAFE_RATE_VIOLATION);
|
||||
}
|
||||
|
||||
{
|
||||
@ -208,7 +210,8 @@ void AcsController::performDetumble() {
|
||||
detumbleCounter = 0;
|
||||
}
|
||||
if (detumbleCounter > acsParameters.detumbleParameter.detumblecounter) {
|
||||
submode = SUBMODE_SAFE;
|
||||
// TODO: Trigger mode transition in subsystem instead
|
||||
submode = acs::CtrlSubmode::DETUMBLE;
|
||||
detumbleCounter = 0;
|
||||
}
|
||||
|
||||
|
@ -24,16 +24,6 @@ class AcsController : public ExtendedControllerBase {
|
||||
|
||||
AcsController(object_id_t objectId);
|
||||
|
||||
static const Submode_t SUBMODE_SAFE = 2;
|
||||
static const Submode_t SUBMODE_DETUMBLE = 3;
|
||||
static const Submode_t SUBMODE_PTG_TARGET = 4;
|
||||
static const Submode_t SUBMODE_PTG_NADIR = 5;
|
||||
static const Submode_t SUBMODE_PTG_INERTIAL = 6;
|
||||
|
||||
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::ACS_SUBSYSTEM;
|
||||
static const Event SAFE_RATE_VIOLATION =
|
||||
MAKE_EVENT(0, severity::MEDIUM); //!< The limits for the rotation in safe mode were violated.
|
||||
|
||||
protected:
|
||||
void performSafe();
|
||||
void performDetumble();
|
||||
|
@ -1,14 +0,0 @@
|
||||
#ifndef MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCONTROLLERDEFINITIONS_H_
|
||||
#define MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCONTROLLERDEFINITIONS_H_
|
||||
|
||||
#include <fsfw/modes/HasModesIF.h>
|
||||
|
||||
namespace acs {
|
||||
|
||||
enum CtrlModes { OFF = HasModesIF::MODE_OFF, SAFE = 1, DETUMBLE = 2, IDLE = 3, TARGET_PT = 4 };
|
||||
|
||||
static constexpr Submode_t IDLE_CHARGE = 1;
|
||||
|
||||
} // namespace acs
|
||||
|
||||
#endif /* MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCONTROLLERDEFINITIONS_H_ */
|
@ -162,7 +162,8 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun
|
||||
pus::PUS_SERVICE_20);
|
||||
new CService200ModeCommanding(objects::PUS_SERVICE_200_MODE_MGMT, config::EIVE_PUS_APID,
|
||||
pus::PUS_SERVICE_200, 8);
|
||||
HealthServiceCfg healthCfg(objects::PUS_SERVICE_201_HEALTH, config::EIVE_PUS_APID, *healthTable, 20);
|
||||
HealthServiceCfg healthCfg(objects::PUS_SERVICE_201_HEALTH, config::EIVE_PUS_APID, *healthTable,
|
||||
20);
|
||||
new CServiceHealthCommanding(healthCfg);
|
||||
|
||||
#if OBSW_ADD_CFDP_COMPONENTS == 1
|
||||
|
@ -1,5 +1,81 @@
|
||||
#include "AcsSubsystem.h"
|
||||
|
||||
#include <fsfw/events/EventManagerIF.h>
|
||||
#include <fsfw/ipc/QueueFactory.h>
|
||||
|
||||
#include "fsfw/modes/ModeMessage.h"
|
||||
#include "mission/acsDefs.h"
|
||||
|
||||
AcsSubsystem::AcsSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences,
|
||||
uint32_t maxNumberOfTables)
|
||||
: Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) {}
|
||||
: Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) {
|
||||
auto mqArgs = MqArgs(getObjectId(), static_cast<void*>(this));
|
||||
eventQueue =
|
||||
QueueFactory::instance()->createMessageQueue(10, EventMessage::EVENT_MESSAGE_SIZE, &mqArgs);
|
||||
}
|
||||
|
||||
ReturnValue_t AcsSubsystem::initialize() {
|
||||
EventManagerIF* manager = ObjectManager::instance()->get<EventManagerIF>(objects::EVENT_MANAGER);
|
||||
if (manager == nullptr) {
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << "AcsSubsystem::initialize: Invalid event manager" << std::endl;
|
||||
#endif
|
||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||
}
|
||||
ReturnValue_t result = manager->registerListener(eventQueue->getId());
|
||||
if (result != returnvalue::OK) {
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::warning << "AcsSubsystem::registerListener: Failed to register as "
|
||||
"listener"
|
||||
<< std::endl;
|
||||
#endif
|
||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||
;
|
||||
}
|
||||
result = manager->subscribeToEvent(eventQueue->getId(), event::getEventId(acs::SAFE_RATE_VIOLATION));
|
||||
if(result != returnvalue::OK) {
|
||||
sif::error << "AcsSubsystem: Subscribing for acs::SAFE_RATE_VIOLATION failed" << std::endl;
|
||||
}
|
||||
result = manager->subscribeToEvent(eventQueue->getId(), event::getEventId(acs::SAFE_RATE_RECOVERY));
|
||||
if(result != returnvalue::OK) {
|
||||
sif::error << "AcsSubsystem: Subscribing for acs::SAFE_RATE_RECOVERY failed" << std::endl;
|
||||
}
|
||||
return Subsystem::initialize();
|
||||
}
|
||||
|
||||
void AcsSubsystem::performChildOperation() {
|
||||
handleEventMessages();
|
||||
return Subsystem::performChildOperation();
|
||||
}
|
||||
|
||||
void AcsSubsystem::handleEventMessages() {
|
||||
EventMessage event;
|
||||
for (ReturnValue_t result = eventQueue->receiveMessage(&event); result == returnvalue::OK;
|
||||
result = eventQueue->receiveMessage(&event)) {
|
||||
switch (event.getMessageId()) {
|
||||
case EventMessage::EVENT_MESSAGE:
|
||||
if (event.getEvent() == acs::SAFE_RATE_VIOLATION) {
|
||||
CommandMessage msg;
|
||||
ModeMessage::setCmdModeModeMessage(msg, acs::CtrlSubmode::DETUMBLE, 0);
|
||||
ReturnValue_t result = commandQueue->sendMessage(commandQueue->getId(), &msg);
|
||||
if (result != returnvalue::OK) {
|
||||
sif::error << "AcsSubsystem: sending DETUMBLE mode cmd to self has failed" << std::endl;
|
||||
}
|
||||
}
|
||||
if (event.getEvent() == acs::SAFE_RATE_RECOVERY) {
|
||||
CommandMessage msg;
|
||||
ModeMessage::setCmdModeModeMessage(msg, acs::CtrlSubmode::SAFE, 0);
|
||||
ReturnValue_t result = commandQueue->sendMessage(commandQueue->getId(), &msg);
|
||||
if (result != returnvalue::OK) {
|
||||
sif::error << "AcsSubsystem: sending IDLE mode cmd to self has failed" << std::endl;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
sif::debug << "AcsSubsystem::performChildOperation: Did not subscribe "
|
||||
"to this event message"
|
||||
<< std::endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,12 @@ class AcsSubsystem : public Subsystem {
|
||||
AcsSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables);
|
||||
|
||||
private:
|
||||
ReturnValue_t initialize() override;
|
||||
void performChildOperation() override;
|
||||
|
||||
void handleEventMessages();
|
||||
|
||||
MessageQueueIF* eventQueue = nullptr;
|
||||
};
|
||||
|
||||
#endif /* MISSION_SYSTEM_ACSSUBSYSTEM_H_ */
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include <fsfw/subsystem/modes/ModeDefinitions.h>
|
||||
|
||||
#include "eive/objects.h"
|
||||
#include "mission/controller/controllerdefinitions/AcsControllerDefinitions.h"
|
||||
#include "mission/acsDefs.h"
|
||||
#include "util.h"
|
||||
|
||||
Subsystem satsystem::acs::ACS_SUBSYSTEM(objects::ACS_SUBSYSTEM, 12, 24);
|
||||
@ -20,64 +20,62 @@ void buildOffSequence(Subsystem& ss, ModeListEntry& eh);
|
||||
void buildDetumbleSequence(Subsystem& ss, ModeListEntry& entryHelper);
|
||||
void buildSafeSequence(Subsystem& ss, ModeListEntry& entryHelper);
|
||||
void buildIdleSequence(Subsystem& ss, ModeListEntry& entryHelper);
|
||||
void buildIdleChargeSequence(Subsystem& ss, ModeListEntry& entryHelper);
|
||||
void buildTargetPtSequence(Subsystem& ss, ModeListEntry& entryHelper);
|
||||
} // namespace
|
||||
|
||||
static const auto OFF = HasModesIF::MODE_OFF;
|
||||
static const auto NML = DeviceHandlerIF::MODE_NORMAL;
|
||||
|
||||
auto ACS_SEQUENCE_OFF =
|
||||
std::make_pair(acs::CtrlModes::OFF << 24, FixedArrayList<ModeListEntry, 2>());
|
||||
auto ACS_SEQUENCE_OFF = std::make_pair(acs::CtrlSubmode::OFF, FixedArrayList<ModeListEntry, 2>());
|
||||
auto ACS_TABLE_OFF_TGT =
|
||||
std::make_pair((acs::CtrlModes::OFF << 24) | 1, FixedArrayList<ModeListEntry, 1>());
|
||||
std::make_pair((acs::CtrlSubmode::OFF << 24) | 1, FixedArrayList<ModeListEntry, 1>());
|
||||
auto ACS_TABLE_OFF_TRANS =
|
||||
std::make_pair((acs::CtrlModes::OFF << 24) | 2, FixedArrayList<ModeListEntry, 6>());
|
||||
std::make_pair((acs::CtrlSubmode::OFF << 24) | 2, FixedArrayList<ModeListEntry, 6>());
|
||||
|
||||
auto ACS_SEQUENCE_DETUMBLE =
|
||||
std::make_pair(acs::CtrlModes::DETUMBLE << 24, FixedArrayList<ModeListEntry, 3>());
|
||||
std::make_pair(acs::CtrlSubmode::DETUMBLE, FixedArrayList<ModeListEntry, 3>());
|
||||
auto ACS_TABLE_DETUMBLE_TGT =
|
||||
std::make_pair((acs::CtrlModes::DETUMBLE << 24) | 1, FixedArrayList<ModeListEntry, 4>());
|
||||
std::make_pair((acs::CtrlSubmode::DETUMBLE << 24) | 1, FixedArrayList<ModeListEntry, 4>());
|
||||
auto ACS_TABLE_DETUMBLE_TRANS_0 =
|
||||
std::make_pair((acs::CtrlModes::DETUMBLE << 24) | 2, FixedArrayList<ModeListEntry, 5>());
|
||||
std::make_pair((acs::CtrlSubmode::DETUMBLE << 24) | 2, FixedArrayList<ModeListEntry, 5>());
|
||||
auto ACS_TABLE_DETUMBLE_TRANS_1 =
|
||||
std::make_pair((acs::CtrlModes::DETUMBLE << 24) | 3, FixedArrayList<ModeListEntry, 1>());
|
||||
std::make_pair((acs::CtrlSubmode::DETUMBLE << 24) | 3, FixedArrayList<ModeListEntry, 1>());
|
||||
|
||||
auto ACS_SEQUENCE_SAFE =
|
||||
std::make_pair(acs::CtrlModes::SAFE << 24, FixedArrayList<ModeListEntry, 3>());
|
||||
auto ACS_SEQUENCE_SAFE = std::make_pair(acs::CtrlSubmode::SAFE, FixedArrayList<ModeListEntry, 3>());
|
||||
auto ACS_TABLE_SAFE_TGT =
|
||||
std::make_pair((acs::CtrlModes::SAFE << 24) | 1, FixedArrayList<ModeListEntry, 4>());
|
||||
std::make_pair((acs::CtrlSubmode::SAFE << 24) | 1, FixedArrayList<ModeListEntry, 4>());
|
||||
auto ACS_TABLE_SAFE_TRANS_0 =
|
||||
std::make_pair((acs::CtrlModes::SAFE << 24) | 2, FixedArrayList<ModeListEntry, 5>());
|
||||
std::make_pair((acs::CtrlSubmode::SAFE << 24) | 2, FixedArrayList<ModeListEntry, 5>());
|
||||
auto ACS_TABLE_SAFE_TRANS_1 =
|
||||
std::make_pair((acs::CtrlModes::SAFE << 24) | 3, FixedArrayList<ModeListEntry, 1>());
|
||||
std::make_pair((acs::CtrlSubmode::SAFE << 24) | 3, FixedArrayList<ModeListEntry, 1>());
|
||||
|
||||
auto ACS_SEQUENCE_IDLE =
|
||||
std::make_pair(acs::CtrlModes::IDLE << 24, FixedArrayList<ModeListEntry, 3>());
|
||||
auto ACS_SEQUENCE_IDLE = std::make_pair(acs::CtrlSubmode::IDLE, FixedArrayList<ModeListEntry, 3>());
|
||||
auto ACS_TABLE_IDLE_TGT =
|
||||
std::make_pair((acs::CtrlModes::IDLE << 24) | 1, FixedArrayList<ModeListEntry, 5>());
|
||||
std::make_pair((acs::CtrlSubmode::IDLE << 24) | 1, FixedArrayList<ModeListEntry, 6>());
|
||||
auto ACS_TABLE_IDLE_TRANS_0 =
|
||||
std::make_pair((acs::CtrlModes::IDLE << 24) | 2, FixedArrayList<ModeListEntry, 5>());
|
||||
std::make_pair((acs::CtrlSubmode::IDLE << 24) | 2, FixedArrayList<ModeListEntry, 6>());
|
||||
auto ACS_TABLE_IDLE_TRANS_1 =
|
||||
std::make_pair((acs::CtrlModes::IDLE << 24) | 3, FixedArrayList<ModeListEntry, 1>());
|
||||
std::make_pair((acs::CtrlSubmode::IDLE << 24) | 3, FixedArrayList<ModeListEntry, 2>());
|
||||
|
||||
auto ACS_SEQUENCE_IDLE_CHRG = std::make_pair(acs::CtrlModes::IDLE << 24 | (acs::IDLE_CHARGE << 8),
|
||||
FixedArrayList<ModeListEntry, 3>());
|
||||
auto ACS_TABLE_IDLE_CHRG_TGT = std::make_pair(
|
||||
(acs::CtrlModes::IDLE << 24) | (acs::IDLE_CHARGE << 8) | 1, FixedArrayList<ModeListEntry, 4>());
|
||||
auto ACS_TABLE_IDLE_CHRG_TRANS_0 = std::make_pair(
|
||||
(acs::CtrlModes::IDLE << 24) | (acs::IDLE_CHARGE << 8) | 2, FixedArrayList<ModeListEntry, 5>());
|
||||
auto ACS_TABLE_IDLE_CHRG_TRANS_1 = std::make_pair(
|
||||
(acs::CtrlModes::IDLE << 24) | (acs::IDLE_CHARGE << 8) | 3, FixedArrayList<ModeListEntry, 1>());
|
||||
auto ACS_SEQUENCE_PTG_TARGET =
|
||||
std::make_pair(acs::CtrlSubmode::PTG_TARGET, FixedArrayList<ModeListEntry, 3>());
|
||||
auto ACS_TABLE_PTG_TARGET_TGT =
|
||||
std::make_pair((acs::CtrlSubmode::PTG_TARGET << 24) | 1, FixedArrayList<ModeListEntry, 6>());
|
||||
auto ACS_TABLE_PTG_TARGET_TRANS_0 =
|
||||
std::make_pair((acs::CtrlSubmode::PTG_TARGET << 24) | 2, FixedArrayList<ModeListEntry, 5>());
|
||||
auto ACS_TABLE_PTG_TARGET_TRANS_1 =
|
||||
std::make_pair((acs::CtrlSubmode::PTG_TARGET << 24) | 3, FixedArrayList<ModeListEntry, 1>());
|
||||
|
||||
auto ACS_SEQUENCE_TARGET_PT =
|
||||
std::make_pair(acs::CtrlModes::TARGET_PT, FixedArrayList<ModeListEntry, 3>());
|
||||
/*
|
||||
auto ACS_SEQUENCE_PTG_TARGET =
|
||||
std::make_pair(acs::CtrlSubmode::TARGET_PT, FixedArrayList<ModeListEntry, 3>());
|
||||
auto ACS_TABLE_TARGET_PT_TGT =
|
||||
std::make_pair((acs::CtrlModes::TARGET_PT << 24) | 1, FixedArrayList<ModeListEntry, 6>());
|
||||
std::make_pair((acs::CtrlSubmode::TARGET_PT << 24) | 1, FixedArrayList<ModeListEntry, 6>());
|
||||
auto ACS_TABLE_TARGET_PT_TRANS_0 =
|
||||
std::make_pair((acs::CtrlModes::TARGET_PT << 24) | 2, FixedArrayList<ModeListEntry, 5>());
|
||||
std::make_pair((acs::CtrlSubmode::TARGET_PT << 24) | 2, FixedArrayList<ModeListEntry, 5>());
|
||||
auto ACS_TABLE_TARGET_PT_TRANS_1 =
|
||||
std::make_pair((acs::CtrlModes::TARGET_PT << 24) | 3, FixedArrayList<ModeListEntry, 1>());
|
||||
std::make_pair((acs::CtrlSubmode::TARGET_PT << 24) | 3, FixedArrayList<ModeListEntry, 1>());
|
||||
*/
|
||||
|
||||
void satsystem::acs::init() {
|
||||
ModeListEntry entry;
|
||||
@ -85,9 +83,8 @@ void satsystem::acs::init() {
|
||||
buildSafeSequence(ACS_SUBSYSTEM, entry);
|
||||
buildDetumbleSequence(ACS_SUBSYSTEM, entry);
|
||||
buildIdleSequence(ACS_SUBSYSTEM, entry);
|
||||
buildIdleChargeSequence(ACS_SUBSYSTEM, entry);
|
||||
buildTargetPtSequence(ACS_SUBSYSTEM, entry);
|
||||
ACS_SUBSYSTEM.setInitialMode(HasModesIF::MODE_OFF);
|
||||
ACS_SUBSYSTEM.setInitialMode(::acs::CtrlSubmode::SAFE);
|
||||
}
|
||||
|
||||
namespace {
|
||||
@ -151,7 +148,7 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) {
|
||||
check(sequence.insert(eh), ctxc);
|
||||
};
|
||||
// Build SAFE target
|
||||
iht(objects::ACS_CONTROLLER, acs::CtrlModes::SAFE, 0, ACS_TABLE_SAFE_TGT.second);
|
||||
iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::SAFE, 0, ACS_TABLE_SAFE_TGT.second);
|
||||
iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_SAFE_TGT.second);
|
||||
iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TGT.second);
|
||||
iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TGT.second);
|
||||
@ -167,7 +164,7 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) {
|
||||
ctxc);
|
||||
|
||||
// Build SAFE transition 1
|
||||
iht(objects::ACS_CONTROLLER, acs::CtrlModes::SAFE, 0, ACS_TABLE_SAFE_TRANS_1.second);
|
||||
iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::SAFE, 0, ACS_TABLE_SAFE_TRANS_1.second);
|
||||
check(ss.addTable(&ACS_TABLE_SAFE_TRANS_1.second, ACS_TABLE_SAFE_TRANS_1.first, false, true),
|
||||
ctxc);
|
||||
|
||||
@ -200,7 +197,7 @@ void buildDetumbleSequence(Subsystem& ss, ModeListEntry& eh) {
|
||||
check(sequence.insert(eh), ctxc);
|
||||
};
|
||||
// Build DETUMBLE target
|
||||
iht(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TGT.second);
|
||||
iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TGT.second);
|
||||
iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TGT.second);
|
||||
iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second);
|
||||
iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second);
|
||||
@ -218,7 +215,7 @@ void buildDetumbleSequence(Subsystem& ss, ModeListEntry& eh) {
|
||||
ctxc);
|
||||
|
||||
// Build DETUMBLE transition 1
|
||||
iht(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TRANS_1.second);
|
||||
iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TRANS_1.second);
|
||||
check(ss.addTable(&ACS_TABLE_DETUMBLE_TRANS_1.second, ACS_TABLE_DETUMBLE_TRANS_1.first, false,
|
||||
true),
|
||||
ctxc);
|
||||
@ -252,7 +249,7 @@ void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) {
|
||||
check(sequence.insert(eh), ctxc);
|
||||
};
|
||||
// Build IDLE target
|
||||
iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, 0, ACS_TABLE_IDLE_TGT.second);
|
||||
iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::IDLE, 0, ACS_TABLE_IDLE_TGT.second);
|
||||
iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_TGT.second);
|
||||
iht(objects::RW_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second);
|
||||
iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second);
|
||||
@ -264,11 +261,11 @@ void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) {
|
||||
iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TRANS_0.second);
|
||||
iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TRANS_0.second);
|
||||
iht(objects::RW_ASS, NML, 0, ACS_TABLE_IDLE_TRANS_0.second);
|
||||
iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_IDLE_TRANS_0.second);
|
||||
iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_IDLE_TRANS_0.second);
|
||||
ss.addTable(&ACS_TABLE_IDLE_TRANS_0.second, ACS_TABLE_IDLE_TRANS_0.first, false, true);
|
||||
|
||||
// Build IDLE transition 1
|
||||
iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, 0, ACS_TABLE_IDLE_TRANS_1.second);
|
||||
iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::IDLE, 0, ACS_TABLE_IDLE_TRANS_1.second);
|
||||
ss.addTable(&ACS_TABLE_IDLE_TRANS_1.second, ACS_TABLE_IDLE_TRANS_1.first, false, true);
|
||||
|
||||
// Build IDLE sequence
|
||||
@ -279,60 +276,6 @@ void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) {
|
||||
true);
|
||||
}
|
||||
|
||||
void buildIdleChargeSequence(Subsystem& ss, ModeListEntry& eh) {
|
||||
std::string context = "satsystem::acs::buildIdleChargeSequence";
|
||||
auto ctxc = context.c_str();
|
||||
// Insert Helper Table
|
||||
auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode,
|
||||
ArrayList<ModeListEntry>& sequence) {
|
||||
eh.setObject(obj);
|
||||
eh.setMode(mode);
|
||||
eh.setSubmode(submode);
|
||||
check(sequence.insert(eh), ctxc);
|
||||
};
|
||||
// Insert Helper Sequence
|
||||
auto ihs = [&](ArrayList<ModeListEntry>& sequence, Mode_t tableId, uint32_t waitSeconds,
|
||||
bool checkSuccess) {
|
||||
eh.setTableId(tableId);
|
||||
eh.setWaitSeconds(waitSeconds);
|
||||
eh.setCheckSuccess(checkSuccess);
|
||||
check(sequence.insert(eh), ctxc);
|
||||
};
|
||||
// Build IDLE target
|
||||
iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, acs::IDLE_CHARGE,
|
||||
ACS_TABLE_IDLE_CHRG_TGT.second);
|
||||
iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second);
|
||||
iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second);
|
||||
iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second);
|
||||
check(ss.addTable(&ACS_TABLE_IDLE_CHRG_TGT.second, ACS_TABLE_IDLE_CHRG_TGT.first, false, true),
|
||||
ctxc);
|
||||
|
||||
// Build IDLE transition 0
|
||||
iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second);
|
||||
iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second);
|
||||
iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second);
|
||||
iht(objects::RW_ASS, OFF, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second);
|
||||
iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second);
|
||||
check(ss.addTable(&ACS_TABLE_IDLE_CHRG_TRANS_0.second, ACS_TABLE_IDLE_CHRG_TRANS_0.first, false,
|
||||
true),
|
||||
ctxc);
|
||||
|
||||
// Build IDLE transition 1
|
||||
iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, acs::IDLE_CHARGE,
|
||||
ACS_TABLE_IDLE_CHRG_TRANS_1.second);
|
||||
check(ss.addTable(&ACS_TABLE_IDLE_CHRG_TRANS_1.second, ACS_TABLE_IDLE_CHRG_TRANS_1.first, false,
|
||||
true),
|
||||
ctxc);
|
||||
|
||||
// Build IDLE sequence
|
||||
ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TGT.first, 0, true);
|
||||
ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TRANS_0.first, 0, true);
|
||||
ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TRANS_1.first, 0, false);
|
||||
check(ss.addSequence(&ACS_SEQUENCE_IDLE_CHRG.second, ACS_SEQUENCE_IDLE_CHRG.first,
|
||||
ACS_SEQUENCE_SAFE.first, false, true),
|
||||
ctxc);
|
||||
}
|
||||
|
||||
void buildTargetPtSequence(Subsystem& ss, ModeListEntry& eh) {
|
||||
std::string context = "satsystem::acs::buildTargetPtSequence";
|
||||
auto ctxc = context.c_str();
|
||||
@ -354,36 +297,37 @@ void buildTargetPtSequence(Subsystem& ss, ModeListEntry& eh) {
|
||||
};
|
||||
|
||||
// Build TARGET PT table
|
||||
iht(objects::ACS_CONTROLLER, acs::CtrlModes::TARGET_PT, 0, ACS_TABLE_TARGET_PT_TGT.second);
|
||||
iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_TARGET_PT_TGT.second);
|
||||
iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second);
|
||||
iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second);
|
||||
iht(objects::RW_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second);
|
||||
iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_TARGET_PT_TGT.second);
|
||||
check(ss.addTable(&ACS_TABLE_TARGET_PT_TGT.second, ACS_TABLE_TARGET_PT_TGT.first, false, true),
|
||||
iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::PTG_TARGET, 0, ACS_TABLE_PTG_TARGET_TGT.second);
|
||||
iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_PTG_TARGET_TGT.second);
|
||||
iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_TGT.second);
|
||||
iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_TGT.second);
|
||||
iht(objects::RW_ASS, NML, 0, ACS_TABLE_PTG_TARGET_TGT.second);
|
||||
iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_PTG_TARGET_TGT.second);
|
||||
check(ss.addTable(&ACS_TABLE_PTG_TARGET_TGT.second, ACS_TABLE_PTG_TARGET_TGT.first, false, true),
|
||||
ctxc);
|
||||
|
||||
// Build TARGET PT transition 0
|
||||
iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second);
|
||||
iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second);
|
||||
iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second);
|
||||
iht(objects::RW_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second);
|
||||
iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second);
|
||||
check(ss.addTable(&ACS_TABLE_TARGET_PT_TRANS_0.second, ACS_TABLE_TARGET_PT_TRANS_0.first, false,
|
||||
iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_PTG_TARGET_TRANS_0.second);
|
||||
iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_TRANS_0.second);
|
||||
iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_TRANS_0.second);
|
||||
iht(objects::RW_ASS, NML, 0, ACS_TABLE_PTG_TARGET_TRANS_0.second);
|
||||
iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_PTG_TARGET_TRANS_0.second);
|
||||
check(ss.addTable(&ACS_TABLE_PTG_TARGET_TRANS_0.second, ACS_TABLE_PTG_TARGET_TRANS_0.first, false,
|
||||
true),
|
||||
ctxc);
|
||||
|
||||
// Build TARGET PT transition 1
|
||||
iht(objects::ACS_CONTROLLER, acs::CtrlModes::TARGET_PT, 0, ACS_TABLE_TARGET_PT_TRANS_1.second);
|
||||
check(ss.addTable(&ACS_TABLE_TARGET_PT_TRANS_1.second, ACS_TABLE_TARGET_PT_TRANS_1.first, false,
|
||||
iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::PTG_TARGET, 0,
|
||||
ACS_TABLE_PTG_TARGET_TRANS_1.second);
|
||||
check(ss.addTable(&ACS_TABLE_PTG_TARGET_TRANS_1.second, ACS_TABLE_PTG_TARGET_TRANS_1.first, false,
|
||||
true),
|
||||
ctxc);
|
||||
|
||||
// Build IDLE sequence
|
||||
ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TGT.first, 0, true);
|
||||
ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TRANS_0.first, 0, true);
|
||||
ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TRANS_1.first, 0, false);
|
||||
check(ss.addSequence(&ACS_SEQUENCE_TARGET_PT.second, ACS_SEQUENCE_TARGET_PT.first,
|
||||
ihs(ACS_SEQUENCE_PTG_TARGET.second, ACS_TABLE_PTG_TARGET_TGT.first, 0, true);
|
||||
ihs(ACS_SEQUENCE_PTG_TARGET.second, ACS_TABLE_PTG_TARGET_TRANS_0.first, 0, true);
|
||||
ihs(ACS_SEQUENCE_PTG_TARGET.second, ACS_TABLE_PTG_TARGET_TRANS_1.first, 0, false);
|
||||
check(ss.addSequence(&ACS_SEQUENCE_PTG_TARGET.second, ACS_SEQUENCE_PTG_TARGET.first,
|
||||
ACS_SEQUENCE_IDLE.first, false, true),
|
||||
ctxc);
|
||||
}
|
||||
|
@ -361,7 +361,7 @@ void CcsdsIpCoreHandler::checkTxTimer() {
|
||||
}
|
||||
if (transmitterCountdown.hasTimedOut()) {
|
||||
disableTransmit();
|
||||
//TODO: set mode to off (move timer to subsystem)
|
||||
// TODO: set mode to off (move timer to subsystem)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user