filter galore
This commit is contained in:
parent
2c9df747e8
commit
fbff57dd45
@ -105,6 +105,9 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
|
|||||||
parameterWrapper->setVector(mgmHandlingParameters.mgm4variance);
|
parameterWrapper->setVector(mgmHandlingParameters.mgm4variance);
|
||||||
break;
|
break;
|
||||||
case 0x12:
|
case 0x12:
|
||||||
|
parameterWrapper->set(mgmHandlingParameters.mgmVectorFilterWeight);
|
||||||
|
break;
|
||||||
|
case 0x13:
|
||||||
parameterWrapper->set(mgmHandlingParameters.mgmDerivativeFilterWeight);
|
parameterWrapper->set(mgmHandlingParameters.mgmDerivativeFilterWeight);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -224,6 +227,12 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
|
|||||||
case 0x24:
|
case 0x24:
|
||||||
parameterWrapper->set(susHandlingParameters.susBrightnessThreshold);
|
parameterWrapper->set(susHandlingParameters.susBrightnessThreshold);
|
||||||
break;
|
break;
|
||||||
|
case 0x25:
|
||||||
|
parameterWrapper->set(susHandlingParameters.susVectorFilterWeight);
|
||||||
|
break;
|
||||||
|
case 0x26:
|
||||||
|
parameterWrapper->set(susHandlingParameters.susRateFilterWeight);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return INVALID_IDENTIFIER_ID;
|
return INVALID_IDENTIFIER_ID;
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,8 @@ class AcsParameters : public HasParametersIF {
|
|||||||
float mgm02variance[3] = {pow(3.2e-7, 2), pow(3.2e-7, 2), pow(4.1e-7, 2)};
|
float mgm02variance[3] = {pow(3.2e-7, 2), pow(3.2e-7, 2), pow(4.1e-7, 2)};
|
||||||
float mgm13variance[3] = {pow(1.5e-8, 2), pow(1.5e-8, 2), pow(1.5e-8, 2)};
|
float mgm13variance[3] = {pow(1.5e-8, 2), pow(1.5e-8, 2), pow(1.5e-8, 2)};
|
||||||
float mgm4variance[3] = {pow(1.7e-6, 2), pow(1.7e-6, 2), pow(1.7e-6, 2)};
|
float mgm4variance[3] = {pow(1.7e-6, 2), pow(1.7e-6, 2), pow(1.7e-6, 2)};
|
||||||
float mgmDerivativeFilterWeight = 0.5;
|
float mgmVectorFilterWeight = 0.85;
|
||||||
|
float mgmDerivativeFilterWeight = 0.85;
|
||||||
} mgmHandlingParameters;
|
} mgmHandlingParameters;
|
||||||
|
|
||||||
struct SusHandlingParameters {
|
struct SusHandlingParameters {
|
||||||
@ -767,6 +768,8 @@ class AcsParameters : public HasParametersIF {
|
|||||||
0.167666815691513, 0.163137400730063, -0.000609874123906977, -0.00205336098697513,
|
0.167666815691513, 0.163137400730063, -0.000609874123906977, -0.00205336098697513,
|
||||||
-0.000889232196185857, -0.00168429567131815}};
|
-0.000889232196185857, -0.00168429567131815}};
|
||||||
float susBrightnessThreshold = 0.7;
|
float susBrightnessThreshold = 0.7;
|
||||||
|
float susVectorFilterWeight = .85;
|
||||||
|
float susRateFilterWeight = .85;
|
||||||
} susHandlingParameters;
|
} susHandlingParameters;
|
||||||
|
|
||||||
struct GyrHandlingParameters {
|
struct GyrHandlingParameters {
|
||||||
|
@ -132,6 +132,10 @@ void SensorProcessing::processMgm(const float *mgm0Value, bool mgm0valid, const
|
|||||||
for (uint8_t i = 0; i < 3; i++) {
|
for (uint8_t i = 0; i < 3; i++) {
|
||||||
mgmVecTot[i] = sensorFusionNumerator[i] / sensorFusionDenominator[i];
|
mgmVecTot[i] = sensorFusionNumerator[i] / sensorFusionDenominator[i];
|
||||||
}
|
}
|
||||||
|
if (VectorOperations<double>::norm(mgmVecTot, 3) != 0 and mgmDataProcessed->mgmVecTot.isValid()) {
|
||||||
|
lowPassFilter(mgmVecTot, mgmDataProcessed->mgmVecTot.value,
|
||||||
|
mgmParameters->mgmVectorFilterWeight);
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------Mgm Rate Computation ---------------------------------------------------
|
//-----------------------Mgm Rate Computation ---------------------------------------------------
|
||||||
double mgmVecTotDerivative[3] = {0.0, 0.0, 0.0};
|
double mgmVecTotDerivative[3] = {0.0, 0.0, 0.0};
|
||||||
@ -351,6 +355,11 @@ void SensorProcessing::processSus(
|
|||||||
double susVecTot[3] = {0.0, 0.0, 0.0};
|
double susVecTot[3] = {0.0, 0.0, 0.0};
|
||||||
VectorOperations<double>::normalize(susMeanValue, susVecTot, 3);
|
VectorOperations<double>::normalize(susMeanValue, susVecTot, 3);
|
||||||
|
|
||||||
|
if (VectorOperations<double>::norm(susVecTot, 3) != 0 and susDataProcessed->susVecTot.isValid()) {
|
||||||
|
lowPassFilter(susVecTot, susDataProcessed->susVecTot.value,
|
||||||
|
susParameters->susVectorFilterWeight);
|
||||||
|
}
|
||||||
|
|
||||||
/* -------- Sun Derivatiative --------------------- */
|
/* -------- Sun Derivatiative --------------------- */
|
||||||
|
|
||||||
double susVecTotDerivative[3] = {0.0, 0.0, 0.0};
|
double susVecTotDerivative[3] = {0.0, 0.0, 0.0};
|
||||||
@ -363,6 +372,11 @@ void SensorProcessing::processSus(
|
|||||||
susVecTotDerivativeValid = true;
|
susVecTotDerivativeValid = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (VectorOperations<double>::norm(susVecTotDerivative, 3) != 0 and
|
||||||
|
susDataProcessed->susVecTotDerivative.isValid()) {
|
||||||
|
lowPassFilter(susVecTotDerivative, susDataProcessed->susVecTotDerivative.value,
|
||||||
|
susParameters->susRateFilterWeight);
|
||||||
|
}
|
||||||
timeOfSavedSusDirEst = timeOfSusMeasurement;
|
timeOfSavedSusDirEst = timeOfSusMeasurement;
|
||||||
{
|
{
|
||||||
PoolReadGuard pg(susDataProcessed);
|
PoolReadGuard pg(susDataProcessed);
|
||||||
|
Loading…
Reference in New Issue
Block a user