added low pass filter for gyr and mgmDot values
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
This commit is contained in:
@ -150,6 +150,11 @@ void SensorProcessing::processMgm(const float *mgm0Value, bool mgm0valid, const
|
||||
}
|
||||
timeOfSavedMagFieldEst = timeOfMgmMeasurement;
|
||||
|
||||
if (mgmDataProcessed->mgmVecTotDerivative.isValid()) {
|
||||
lowPassFilter(mgmVecTotDerivative, mgmDataProcessed->mgmVecTotDerivative.value,
|
||||
mgmParameters->mgmDerivativeFilterWeight);
|
||||
}
|
||||
|
||||
{
|
||||
PoolReadGuard pg(mgmDataProcessed);
|
||||
if (pg.getReadResult() == returnvalue::OK) {
|
||||
@ -527,6 +532,11 @@ void SensorProcessing::processGyr(
|
||||
gyrVecTot[i] = sensorFusionNumerator[i] / sensorFusionDenominator[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (gyrDataProcessed->gyrVecTot.isValid()) {
|
||||
lowPassFilter(gyrVecTot, gyrDataProcessed->gyrVecTot.value, gyrParameters->gyrFilterWeight);
|
||||
}
|
||||
|
||||
{
|
||||
PoolReadGuard pg(gyrDataProcessed);
|
||||
if (pg.getReadResult() == returnvalue::OK) {
|
||||
@ -656,3 +666,10 @@ void SensorProcessing::process(timeval now, ACS::SensorValues *sensorValues,
|
||||
sensorValues->gyr3L3gSet.angVelocZ.value, sensorValues->gyr3L3gSet.angVelocZ.isValid(), now,
|
||||
&acsParameters->gyrHandlingParameters, gyrDataProcessed);
|
||||
}
|
||||
|
||||
void SensorProcessing::lowPassFilter(double *newValue, double *oldValue, const double weight) {
|
||||
double leftSide[3] = {0, 0, 0}, rightSide[3] = {0, 0, 0};
|
||||
VectorOperations<double>::mulScalar(newValue, (1 - weight), leftSide, 3);
|
||||
VectorOperations<double>::mulScalar(oldValue, weight, rightSide, 3);
|
||||
VectorOperations<double>::add(leftSide, rightSide, newValue, 3);
|
||||
}
|
||||
|
Reference in New Issue
Block a user