Merge remote-tracking branch 'origin/main' into ploc-supv-bugfix
Some checks are pending
EIVE/eive-obsw/pipeline/pr-main Build queued...

This commit is contained in:
Robin Müller 2024-05-29 10:13:52 +02:00
commit 98a92a6b88
5 changed files with 20 additions and 14 deletions

View File

@ -16,12 +16,16 @@ will consitute of a breaking change warranting a new major release:
# [unreleased]
# [v8.0.1] 2024-05-28
# [v8.1.0] 2024-05-29
## Fixed
- Small fix for transition failure handling of the MPSoC when the `START_MPSOC` action command
to the supervisor fails.
- Fixed inits of arrays within the `MEKF` not being zeros.
- Important bugfix for PLOC SUPV: The SUPV previously was able to steal packets from the special
communication helper, for example during software updates.
- Corrected sigma of STR for `MEKF`.
## Added

View File

@ -10,7 +10,7 @@
cmake_minimum_required(VERSION 3.13)
set(OBSW_VERSION_MAJOR 8)
set(OBSW_VERSION_MINOR 0)
set(OBSW_VERSION_MINOR 1)
set(OBSW_VERSION_REVISION 0)
# set(CMAKE_VERBOSE TRUE)

View File

@ -456,7 +456,7 @@ void FreshMpsocHandler::handleActionCommandFailure(ActionId_t actionId, ReturnVa
if (actionId != supv::START_MPSOC) {
return;
}
sif::info << "PlocMPSoCHandler::handleActionCommandFailure: MPSoC boot command failed"
sif::info << "FreshMpsocHandler::handleActionCommandFailure: MPSoC boot command failed"
<< std::endl;
// This is commonly the case when the MPSoC is already operational. Thus the power state is
// set to on here
@ -1224,6 +1224,7 @@ bool FreshMpsocHandler::handleHwStartup() {
if (powerState == PowerState::SUPV_FAILED) {
setMode(MODE_OFF);
powerState = PowerState::IDLE;
transitionState = TransitionState::NONE;
return false;
}
if (powerState == PowerState::PENDING_STARTUP) {

View File

@ -941,7 +941,7 @@ class AcsParameters : public HasParametersIF {
} sunModelParameters;
struct KalmanFilterParameters {
double sensorNoiseStr = 0.1 * DEG2RAD;
double sensorNoiseStr = 0.0028 * DEG2RAD;
double sensorNoiseSus = 8. * DEG2RAD;
double sensorNoiseMgm = 4. * DEG2RAD;
double sensorNoiseGyr = 0.1 * DEG2RAD;

View File

@ -114,12 +114,13 @@ ReturnValue_t MultiplicativeKalmanFilter::mekfEst(
return result;
}
double measSensMatrix[matrixDimensionFactor][6] = {{0}},
measCovMatrix[matrixDimensionFactor][matrixDimensionFactor] = {{0}},
measVec[matrixDimensionFactor] = {0}, estVec[matrixDimensionFactor] = {0};
double measSensMatrix[matrixDimensionFactor][6] = {},
measCovMatrix[matrixDimensionFactor][matrixDimensionFactor] = {},
measVec[matrixDimensionFactor] = {}, estVec[matrixDimensionFactor] = {};
kfUpdate(susData, mgmData, *measSensMatrix, *measCovMatrix, measVec, estVec);
double kalmanGain[6][matrixDimensionFactor] = {{0}};
double kalmanGain[6][matrixDimensionFactor];
std::memset(kalmanGain, 0, sizeof(kalmanGain));
result = kfGain(*measSensMatrix, *measCovMatrix, *kalmanGain, attitudeEstimationData);
if (result != returnvalue::OK) {
reset(attitudeEstimationData);
@ -342,10 +343,11 @@ ReturnValue_t MultiplicativeKalmanFilter::kfGain(
double *measSensMatrix, double *measCovMatrix, double *kalmanGain,
acsctrl::AttitudeEstimationData *attitudeEstimationData) {
// Kalman Gain: K = P * H' / (H * P * H' + R)
double kalmanGainDen[matrixDimensionFactor][matrixDimensionFactor] = {{0}},
invKalmanGainDen[matrixDimensionFactor][matrixDimensionFactor] = {{0}},
residualCov[6][matrixDimensionFactor] = {{0}},
measSensMatrixTransposed[6][matrixDimensionFactor] = {{0}};
double kalmanGainDen[matrixDimensionFactor][matrixDimensionFactor] = {},
invKalmanGainDen[matrixDimensionFactor][matrixDimensionFactor] = {};
double residualCov[6][matrixDimensionFactor], measSensMatrixTransposed[6][matrixDimensionFactor];
std::memset(residualCov, 0, sizeof(residualCov));
std::memset(measSensMatrixTransposed, 0, sizeof(measSensMatrixTransposed));
MatrixOperations<double>::transpose(measSensMatrix, *measSensMatrixTransposed,
matrixDimensionFactor, 6);
@ -382,8 +384,7 @@ void MultiplicativeKalmanFilter::kfCovAposteriori(double *kalmanGain, double *me
void MultiplicativeKalmanFilter::kfStateAposteriori(double *kalmanGain, double *measVec,
double *estVec) {
double stateVecErr[6] = {0, 0, 0, 0, 0, 0};
double plantOutputDiff[matrixDimensionFactor] = {0};
double stateVecErr[6] = {0, 0, 0, 0, 0, 0}, plantOutputDiff[matrixDimensionFactor] = {};
VectorOperations<double>::subtract(measVec, estVec, plantOutputDiff, matrixDimensionFactor);
MatrixOperations<double>::multiply(kalmanGain, plantOutputDiff, stateVecErr, 6,
matrixDimensionFactor, 1);