Fix MEKF Inits #896
@ -119,7 +119,8 @@ ReturnValue_t MultiplicativeKalmanFilter::mekfEst(
|
||||
measVec[matrixDimensionFactor] = {}, estVec[matrixDimensionFactor] = {};
|
||||
kfUpdate(susData, mgmData, *measSensMatrix, *measCovMatrix, measVec, estVec);
|
||||
|
||||
double kalmanGain[6][matrixDimensionFactor] = {};
|
||||
double kalmanGain[6][matrixDimensionFactor];
|
||||
std::memset(kalmanGain, 0, sizeof(kalmanGain));
|
||||
result = kfGain(*measSensMatrix, *measCovMatrix, *kalmanGain, attitudeEstimationData);
|
||||
if (result != returnvalue::OK) {
|
||||
reset(attitudeEstimationData);
|
||||
@ -343,9 +344,10 @@ ReturnValue_t MultiplicativeKalmanFilter::kfGain(
|
||||
acsctrl::AttitudeEstimationData *attitudeEstimationData) {
|
||||
// Kalman Gain: K = P * H' / (H * P * H' + R)
|
||||
double kalmanGainDen[matrixDimensionFactor][matrixDimensionFactor] = {},
|
||||
invKalmanGainDen[matrixDimensionFactor][matrixDimensionFactor] = {},
|
||||
residualCov[6][matrixDimensionFactor] = {},
|
||||
measSensMatrixTransposed[6][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] = {};
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user