Merge branch 'main' into detumble-fix
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good

This commit is contained in:
Marius Eggert 2024-01-29 14:23:05 +01:00
commit e17ef1bcfd
10 changed files with 72 additions and 66 deletions

View File

@ -27,6 +27,20 @@ will consitute of a breaking change warranting a new major release:
current mode is a higher pointing mode, the STR will be set to faulty, to trigger a current mode is a higher pointing mode, the STR will be set to faulty, to trigger a
transition to safe first. Then, in a second step, a transition to detumble is triggered. transition to safe first. Then, in a second step, a transition to detumble is triggered.
## Fixed
- If the PCDU handler fails reading data from the IPC store, it will
not try to do a deserialization anymore.
- All action commands sent by the PLOC SUPV to itself will have no sender now.
- RW speed commands get reset to 0 RPM, if the `AcsController` has changed its mode
to Safe
- Antistiction for RWs will set commanded speed to 0 RPM, if a wheel is detected as not
working
- Removed parameter to disable antistiction, as deactivating it would result in the
`AcsController` being allowed sending invalid speed commands to the RW Handler, which
would then trigger FDIR and turning off the functioning device
- `RwHandler` returnvalues would use the `INTERFACE_ID` of the `DeviceHandlerBase`
# [v7.5.5] 2024-01-22 # [v7.5.5] 2024-01-22
## Fixed ## Fixed

View File

@ -1115,7 +1115,7 @@ void FreshSupvHandler::handleEvent(EventMessage* eventMessage) {
if (not isCommandAlreadyActive(supv::SHUTDOWN_MPSOC)) { if (not isCommandAlreadyActive(supv::SHUTDOWN_MPSOC)) {
CommandMessage actionMsg; CommandMessage actionMsg;
ActionMessage::setCommand(&actionMsg, supv::SHUTDOWN_MPSOC, store_address_t::invalid()); ActionMessage::setCommand(&actionMsg, supv::SHUTDOWN_MPSOC, store_address_t::invalid());
result = messageQueue->sendMessage(getCommandQueue(), &actionMsg); result = messageQueue->sendMessageFrom(getCommandQueue(), &actionMsg, MessageQueueIF::NO_QUEUE);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
triggerEvent(supv::SUPV_MPSOC_SHUTDOWN_BUILD_FAILED); triggerEvent(supv::SUPV_MPSOC_SHUTDOWN_BUILD_FAILED);
sif::warning << "PlocSupervisorHandler::handleEvent: Failed to build MPSoC shutdown " sif::warning << "PlocSupervisorHandler::handleEvent: Failed to build MPSoC shutdown "

View File

@ -945,15 +945,7 @@ ReturnValue_t PlocSupvUartManager::handleRunningLongerRequest() {
break; break;
} }
case Request::REQUEST_EVENT_BUFFER: { case Request::REQUEST_EVENT_BUFFER: {
// result = performEventBufferRequest(); sif::error << "Requesting event buffer is not implemented" << std::endl;
// if (result == returnvalue::OK) {
// triggerEvent(SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL, result);
// } else if (result == PROCESS_TERMINATED) {
// // Event already triggered
// break;
// } else {
// triggerEvent(SUPV_EVENT_BUFFER_REQUEST_FAILED, result);
// }
break; break;
} }
case Request::DEFAULT: { case Request::DEFAULT: {

View File

@ -59,6 +59,7 @@ class RwHandler : public DeviceHandlerBase {
LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override;
private: private:
static const uint8_t INTERFACE_ID = CLASS_ID::RW_HANDLER;
//! [EXPORT] : [COMMENT] Action Message with invalid speed was received. Valid speeds must be in //! [EXPORT] : [COMMENT] Action Message with invalid speed was received. Valid speeds must be in
//! the range of [-65000; 1000] or [1000; 65000] //! the range of [-65000; 1000] or [1000; 65000]
static const ReturnValue_t INVALID_SPEED = MAKE_RETURN_CODE(0xA0); static const ReturnValue_t INVALID_SPEED = MAKE_RETURN_CODE(0xA0);

View File

@ -393,7 +393,6 @@ void AcsController::performPointingCtrl() {
break; break;
} }
uint8_t enableAntiStiction = true;
double rwPseudoInv[4][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; double rwPseudoInv[4][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}};
ReturnValue_t result = guidance.getDistributionMatrixRw(&sensorValues, *rwPseudoInv); ReturnValue_t result = guidance.getDistributionMatrixRw(&sensorValues, *rwPseudoInv);
if (result == returnvalue::FAILED) { if (result == returnvalue::FAILED) {
@ -434,7 +433,6 @@ void AcsController::performPointingCtrl() {
mgmDataProcessed.mgmVecTot.isValid(), rotRateB, sensorValues.rw1Set.currSpeed.value, mgmDataProcessed.mgmVecTot.isValid(), rotRateB, sensorValues.rw1Set.currSpeed.value,
sensorValues.rw2Set.currSpeed.value, sensorValues.rw3Set.currSpeed.value, sensorValues.rw2Set.currSpeed.value, sensorValues.rw3Set.currSpeed.value,
sensorValues.rw4Set.currSpeed.value, mgtDpDes); sensorValues.rw4Set.currSpeed.value, mgtDpDes);
enableAntiStiction = acsParameters.idleModeControllerParameters.enableAntiStiction;
break; break;
case acs::PTG_TARGET: case acs::PTG_TARGET:
@ -458,7 +456,6 @@ void AcsController::performPointingCtrl() {
mgmDataProcessed.mgmVecTot.isValid(), rotRateB, sensorValues.rw1Set.currSpeed.value, mgmDataProcessed.mgmVecTot.isValid(), rotRateB, sensorValues.rw1Set.currSpeed.value,
sensorValues.rw2Set.currSpeed.value, sensorValues.rw3Set.currSpeed.value, sensorValues.rw2Set.currSpeed.value, sensorValues.rw3Set.currSpeed.value,
sensorValues.rw4Set.currSpeed.value, mgtDpDes); sensorValues.rw4Set.currSpeed.value, mgtDpDes);
enableAntiStiction = acsParameters.targetModeControllerParameters.enableAntiStiction;
break; break;
case acs::PTG_TARGET_GS: case acs::PTG_TARGET_GS:
@ -479,7 +476,6 @@ void AcsController::performPointingCtrl() {
mgmDataProcessed.mgmVecTot.isValid(), rotRateB, sensorValues.rw1Set.currSpeed.value, mgmDataProcessed.mgmVecTot.isValid(), rotRateB, sensorValues.rw1Set.currSpeed.value,
sensorValues.rw2Set.currSpeed.value, sensorValues.rw3Set.currSpeed.value, sensorValues.rw2Set.currSpeed.value, sensorValues.rw3Set.currSpeed.value,
sensorValues.rw4Set.currSpeed.value, mgtDpDes); sensorValues.rw4Set.currSpeed.value, mgtDpDes);
enableAntiStiction = acsParameters.gsTargetModeControllerParameters.enableAntiStiction;
break; break;
case acs::PTG_NADIR: case acs::PTG_NADIR:
@ -503,7 +499,6 @@ void AcsController::performPointingCtrl() {
mgmDataProcessed.mgmVecTot.isValid(), rotRateB, sensorValues.rw1Set.currSpeed.value, mgmDataProcessed.mgmVecTot.isValid(), rotRateB, sensorValues.rw1Set.currSpeed.value,
sensorValues.rw2Set.currSpeed.value, sensorValues.rw3Set.currSpeed.value, sensorValues.rw2Set.currSpeed.value, sensorValues.rw3Set.currSpeed.value,
sensorValues.rw4Set.currSpeed.value, mgtDpDes); sensorValues.rw4Set.currSpeed.value, mgtDpDes);
enableAntiStiction = acsParameters.nadirModeControllerParameters.enableAntiStiction;
break; break;
case acs::PTG_INERTIAL: case acs::PTG_INERTIAL:
@ -526,7 +521,6 @@ void AcsController::performPointingCtrl() {
mgmDataProcessed.mgmVecTot.isValid(), rotRateB, sensorValues.rw1Set.currSpeed.value, mgmDataProcessed.mgmVecTot.isValid(), rotRateB, sensorValues.rw1Set.currSpeed.value,
sensorValues.rw2Set.currSpeed.value, sensorValues.rw3Set.currSpeed.value, sensorValues.rw2Set.currSpeed.value, sensorValues.rw3Set.currSpeed.value,
sensorValues.rw4Set.currSpeed.value, mgtDpDes); sensorValues.rw4Set.currSpeed.value, mgtDpDes);
enableAntiStiction = acsParameters.inertialModeControllerParameters.enableAntiStiction;
break; break;
default: default:
sif::error << "AcsController: Invalid mode for performPointingCtrl" << std::endl; sif::error << "AcsController: Invalid mode for performPointingCtrl" << std::endl;
@ -538,9 +532,7 @@ void AcsController::performPointingCtrl() {
sensorValues.rw3Set.currSpeed.value, sensorValues.rw4Set.currSpeed.value, sensorValues.rw3Set.currSpeed.value, sensorValues.rw4Set.currSpeed.value,
acsParameters.onBoardParams.sampleTime, acsParameters.rwHandlingParameters.inertiaWheel, acsParameters.onBoardParams.sampleTime, acsParameters.rwHandlingParameters.inertiaWheel,
acsParameters.rwHandlingParameters.maxRwSpeed, torqueRws, cmdSpeedRws); acsParameters.rwHandlingParameters.maxRwSpeed, torqueRws, cmdSpeedRws);
if (enableAntiStiction) { ptgCtrl.rwAntistiction(&sensorValues, cmdSpeedRws);
ptgCtrl.rwAntistiction(&sensorValues, cmdSpeedRws);
}
actuatorCmd.cmdDipoleMtq(*acsParameters.magnetorquerParameter.inverseAlignment, actuatorCmd.cmdDipoleMtq(*acsParameters.magnetorquerParameter.inverseAlignment,
acsParameters.magnetorquerParameter.dipoleMax, mgtDpDes, cmdDipoleMtqs); acsParameters.magnetorquerParameter.dipoleMax, mgtDpDes, cmdDipoleMtqs);
@ -889,6 +881,24 @@ ReturnValue_t AcsController::checkModeCommand(Mode_t mode, Submode_t submode,
} }
void AcsController::modeChanged(Mode_t mode, Submode_t submode) { void AcsController::modeChanged(Mode_t mode, Submode_t submode) {
if (mode == acs::AcsMode::SAFE) {
{
PoolReadGuard pg(&rw1SpeedSet);
rw1SpeedSet.setRwSpeed(0, 10);
}
{
PoolReadGuard pg(&rw2SpeedSet);
rw2SpeedSet.setRwSpeed(0, 10);
}
{
PoolReadGuard pg(&rw3SpeedSet);
rw3SpeedSet.setRwSpeed(0, 10);
}
{
PoolReadGuard pg(&rw4SpeedSet);
rw4SpeedSet.setRwSpeed(0, 10);
}
}
return ExtendedControllerBase::modeChanged(mode, submode); return ExtendedControllerBase::modeChanged(mode, submode);
} }

View File

@ -432,9 +432,6 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
parameterWrapper->set(idleModeControllerParameters.desatOn); parameterWrapper->set(idleModeControllerParameters.desatOn);
break; break;
case 0x9: case 0x9:
parameterWrapper->set(idleModeControllerParameters.enableAntiStiction);
break;
case 0xA:
parameterWrapper->set(idleModeControllerParameters.useMekf); parameterWrapper->set(idleModeControllerParameters.useMekf);
break; break;
default: default:
@ -471,42 +468,39 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
parameterWrapper->set(targetModeControllerParameters.desatOn); parameterWrapper->set(targetModeControllerParameters.desatOn);
break; break;
case 0x9: case 0x9:
parameterWrapper->set(targetModeControllerParameters.enableAntiStiction);
break;
case 0xA:
parameterWrapper->set(targetModeControllerParameters.useMekf); parameterWrapper->set(targetModeControllerParameters.useMekf);
break; break;
case 0xB: case 0xA:
parameterWrapper->setVector(targetModeControllerParameters.refDirection); parameterWrapper->setVector(targetModeControllerParameters.refDirection);
break; break;
case 0xC: case 0xB:
parameterWrapper->setVector(targetModeControllerParameters.refRotRate); parameterWrapper->setVector(targetModeControllerParameters.refRotRate);
break; break;
case 0xD: case 0xC:
parameterWrapper->setVector(targetModeControllerParameters.quatRef); parameterWrapper->setVector(targetModeControllerParameters.quatRef);
break; break;
case 0xE: case 0xD:
parameterWrapper->set(targetModeControllerParameters.timeElapsedMax); parameterWrapper->set(targetModeControllerParameters.timeElapsedMax);
break; break;
case 0xF: case 0xE:
parameterWrapper->set(targetModeControllerParameters.latitudeTgt); parameterWrapper->set(targetModeControllerParameters.latitudeTgt);
break; break;
case 0x10: case 0xF:
parameterWrapper->set(targetModeControllerParameters.longitudeTgt); parameterWrapper->set(targetModeControllerParameters.longitudeTgt);
break; break;
case 0x11: case 0x10:
parameterWrapper->set(targetModeControllerParameters.altitudeTgt); parameterWrapper->set(targetModeControllerParameters.altitudeTgt);
break; break;
case 0x12: case 0x11:
parameterWrapper->set(targetModeControllerParameters.avoidBlindStr); parameterWrapper->set(targetModeControllerParameters.avoidBlindStr);
break; break;
case 0x13: case 0x12:
parameterWrapper->set(targetModeControllerParameters.blindAvoidStart); parameterWrapper->set(targetModeControllerParameters.blindAvoidStart);
break; break;
case 0x14: case 0x13:
parameterWrapper->set(targetModeControllerParameters.blindAvoidStop); parameterWrapper->set(targetModeControllerParameters.blindAvoidStop);
break; break;
case 0x15: case 0x14:
parameterWrapper->set(targetModeControllerParameters.blindRotRate); parameterWrapper->set(targetModeControllerParameters.blindRotRate);
break; break;
default: default:
@ -543,24 +537,21 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
parameterWrapper->set(gsTargetModeControllerParameters.desatOn); parameterWrapper->set(gsTargetModeControllerParameters.desatOn);
break; break;
case 0x9: case 0x9:
parameterWrapper->set(gsTargetModeControllerParameters.enableAntiStiction);
break;
case 0xA:
parameterWrapper->set(gsTargetModeControllerParameters.useMekf); parameterWrapper->set(gsTargetModeControllerParameters.useMekf);
break; break;
case 0xB: case 0xA:
parameterWrapper->setVector(gsTargetModeControllerParameters.refDirection); parameterWrapper->setVector(gsTargetModeControllerParameters.refDirection);
break; break;
case 0xC: case 0xB:
parameterWrapper->set(gsTargetModeControllerParameters.timeElapsedMax); parameterWrapper->set(gsTargetModeControllerParameters.timeElapsedMax);
break; break;
case 0xD: case 0xC:
parameterWrapper->set(gsTargetModeControllerParameters.latitudeTgt); parameterWrapper->set(gsTargetModeControllerParameters.latitudeTgt);
break; break;
case 0xE: case 0xD:
parameterWrapper->set(gsTargetModeControllerParameters.longitudeTgt); parameterWrapper->set(gsTargetModeControllerParameters.longitudeTgt);
break; break;
case 0xF: case 0xE:
parameterWrapper->set(gsTargetModeControllerParameters.altitudeTgt); parameterWrapper->set(gsTargetModeControllerParameters.altitudeTgt);
break; break;
default: default:
@ -597,21 +588,18 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
parameterWrapper->set(nadirModeControllerParameters.desatOn); parameterWrapper->set(nadirModeControllerParameters.desatOn);
break; break;
case 0x9: case 0x9:
parameterWrapper->set(nadirModeControllerParameters.enableAntiStiction);
break;
case 0xA:
parameterWrapper->set(nadirModeControllerParameters.useMekf); parameterWrapper->set(nadirModeControllerParameters.useMekf);
break; break;
case 0xB: case 0xA:
parameterWrapper->setVector(nadirModeControllerParameters.refDirection); parameterWrapper->setVector(nadirModeControllerParameters.refDirection);
break; break;
case 0xC: case 0xB:
parameterWrapper->setVector(nadirModeControllerParameters.quatRef); parameterWrapper->setVector(nadirModeControllerParameters.quatRef);
break; break;
case 0xD: case 0xC:
parameterWrapper->setVector(nadirModeControllerParameters.refRotRate); parameterWrapper->setVector(nadirModeControllerParameters.refRotRate);
break; break;
case 0xE: case 0xD:
parameterWrapper->set(nadirModeControllerParameters.timeElapsedMax); parameterWrapper->set(nadirModeControllerParameters.timeElapsedMax);
break; break;
default: default:
@ -648,18 +636,15 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
parameterWrapper->set(inertialModeControllerParameters.desatOn); parameterWrapper->set(inertialModeControllerParameters.desatOn);
break; break;
case 0x9: case 0x9:
parameterWrapper->set(inertialModeControllerParameters.enableAntiStiction);
break;
case 0xA:
parameterWrapper->set(inertialModeControllerParameters.useMekf); parameterWrapper->set(inertialModeControllerParameters.useMekf);
break; break;
case 0xB: case 0xA:
parameterWrapper->setVector(inertialModeControllerParameters.tgtQuat); parameterWrapper->setVector(inertialModeControllerParameters.tgtQuat);
break; break;
case 0xC: case 0xB:
parameterWrapper->setVector(inertialModeControllerParameters.refRotRate); parameterWrapper->setVector(inertialModeControllerParameters.refRotRate);
break; break;
case 0xD: case 0xC:
parameterWrapper->setVector(inertialModeControllerParameters.quatRef); parameterWrapper->setVector(inertialModeControllerParameters.quatRef);
break; break;
default: default:

View File

@ -863,7 +863,6 @@ class AcsParameters : public HasParametersIF {
double desatMomentumRef[3] = {0, 0, 0}; double desatMomentumRef[3] = {0, 0, 0};
double deSatGainFactor = 1000; double deSatGainFactor = 1000;
uint8_t desatOn = true; uint8_t desatOn = true;
uint8_t enableAntiStiction = true;
uint8_t useMekf = false; uint8_t useMekf = false;
} pointingLawParameters; } pointingLawParameters;

View File

@ -220,6 +220,8 @@ void PtgCtrl::rwAntistiction(ACS::SensorValues *sensorValues, int32_t *rwCmdSpee
} }
} }
} }
} else {
rwCmdSpeeds[i] = 0;
} }
} }
} }

View File

@ -65,8 +65,8 @@ ReturnValue_t PcduHandler::performOperation(uint8_t counter) {
ReturnValue_t PcduHandler::initialize() { ReturnValue_t PcduHandler::initialize() {
ReturnValue_t result; ReturnValue_t result;
IPCStore = ObjectManager::instance()->get<StorageManagerIF>(objects::IPC_STORE); ipcStore = ObjectManager::instance()->get<StorageManagerIF>(objects::IPC_STORE);
if (IPCStore == nullptr) { if (ipcStore == nullptr) {
return ObjectManagerIF::CHILD_INIT_FAILED; return ObjectManagerIF::CHILD_INIT_FAILED;
} }
@ -162,10 +162,13 @@ void PcduHandler::updateHkTableDataset(store_address_t storeId, LocalPoolDataSet
sizeof(CCSDSTime::CDS_short), dataset); sizeof(CCSDSTime::CDS_short), dataset);
const uint8_t* packet_ptr = nullptr; const uint8_t* packet_ptr = nullptr;
size_t size = 0; size_t size = 0;
result = IPCStore->getData(storeId, &packet_ptr, &size); result = ipcStore->getData(storeId, &packet_ptr, &size);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
sif::error << "PCDUHandler::updateHkTableDataset: Failed to get data from IPCStore." sif::error << "PCDUHandler::updateHkTableDataset: Failed to get data from IPC store, result 0x"
<< std::endl; << std::hex << std::setw(4) << std::setfill('0') << result << std::dec
<< std::setfill(' ') << std::endl;
result = ipcStore->deleteData(storeId);
return;
} }
result = packetUpdate.deSerialize(&packet_ptr, &size, SerializeIF::Endianness::MACHINE); result = packetUpdate.deSerialize(&packet_ptr, &size, SerializeIF::Endianness::MACHINE);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
@ -173,7 +176,7 @@ void PcduHandler::updateHkTableDataset(store_address_t storeId, LocalPoolDataSet
"in hk table dataset" "in hk table dataset"
<< std::endl; << std::endl;
} }
result = IPCStore->deleteData(storeId); result = ipcStore->deleteData(storeId);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
sif::error << "PCDUHandler::updateHkTableDataset: Failed to delete data in IPCStore" sif::error << "PCDUHandler::updateHkTableDataset: Failed to delete data in IPCStore"
<< std::endl; << std::endl;
@ -396,7 +399,7 @@ ReturnValue_t PcduHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onO
setParamMessage.serialize(&commandPtr, &serializedLength, maxSize, SerializeIF::Endianness::BIG); setParamMessage.serialize(&commandPtr, &serializedLength, maxSize, SerializeIF::Endianness::BIG);
store_address_t storeAddress; store_address_t storeAddress;
result = IPCStore->addData(&storeAddress, command, sizeof(command)); result = ipcStore->addData(&storeAddress, command, sizeof(command));
CommandMessage message; CommandMessage message;
ActionMessage::setCommand(&message, GOMSPACE::PARAM_SET, storeAddress); ActionMessage::setCommand(&message, GOMSPACE::PARAM_SET, storeAddress);

View File

@ -94,7 +94,7 @@ class PcduHandler : public PowerSwitchIF,
* Pointer to the IPCStore. * Pointer to the IPCStore.
* This caches the pointer received from the objectManager in the constructor. * This caches the pointer received from the objectManager in the constructor.
*/ */
StorageManagerIF* IPCStore = nullptr; StorageManagerIF* ipcStore = nullptr;
/** /**
* Message queue to communicate with other objetcs. Used for example to receive * Message queue to communicate with other objetcs. Used for example to receive