domainId now points to structs. sunVectorSafeLeop added

This commit is contained in:
Marius Eggert 2023-01-12 11:47:56 +01:00
parent 25867e76b1
commit 66e2d782b2
2 changed files with 27 additions and 26 deletions

View File

@ -11,16 +11,15 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
ParameterWrapper* parameterWrapper,
const ParameterWrapper* newValues,
uint16_t startAtIndex) {
// if (domainId == parameterModuleId) {
switch (parameterId >> 8) {
switch (domainId) {
case 0x0: // direct members
switch (parameterId & 0xFF) {
switch (parameterId) {
default:
return INVALID_IDENTIFIER_ID;
}
break;
case 0x1: // OnBoardParams
switch (parameterId & 0xFF) {
switch (parameterId) {
case 0x0:
parameterWrapper->set(onBoardParams.sampleTime);
break;
@ -29,7 +28,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
}
break;
case 0x2: // InertiaEIVE
switch (parameterId & 0xFF) {
switch (parameterId) {
case 0x0:
parameterWrapper->set(inertiaEIVE.inertiaMatrix);
break;
@ -50,7 +49,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
}
break;
case 0x3: // MgmHandlingParameters
switch (parameterId & 0xFF) {
switch (parameterId) {
case 0x0:
parameterWrapper->set(mgmHandlingParameters.mgm0orientationMatrix);
break;
@ -110,7 +109,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
}
break;
case 0x4: // SusHandlingParameters
switch (parameterId & 0xFF) {
switch (parameterId) {
case 0x0:
parameterWrapper->set(susHandlingParameters.sus0orientationMatrix);
break;
@ -224,7 +223,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
}
break;
case (0x5): // GyrHandlingParameters
switch (parameterId & 0xFF) {
switch (parameterId) {
case 0x0:
parameterWrapper->set(gyrHandlingParameters.gyr0orientationMatrix);
break;
@ -251,7 +250,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
}
break;
case (0x6): // RwHandlingParameters
switch (parameterId & 0xFF) {
switch (parameterId) {
case 0x0:
parameterWrapper->set(rwHandlingParameters.inertiaWheel);
break;
@ -272,7 +271,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
}
break;
case (0x7): // RwMatrices
switch (parameterId & 0xFF) {
switch (parameterId) {
case 0x0:
parameterWrapper->set(rwMatrices.alignmentMatrix);
break;
@ -299,7 +298,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
}
break;
case (0x8): // SafeModeControllerParameters
switch (parameterId & 0xFF) {
switch (parameterId) {
case 0x0:
parameterWrapper->set(safeModeControllerParameters.k_rate_mekf);
break;
@ -316,9 +315,12 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
parameterWrapper->set(safeModeControllerParameters.sunMagAngleMin);
break;
case 0x5:
parameterWrapper->set(safeModeControllerParameters.sunTargetDir);
parameterWrapper->set(safeModeControllerParameters.sunTargetDirLeop);
break;
case 0x6:
parameterWrapper->set(safeModeControllerParameters.sunTargetDir);
break;
case 0x7:
parameterWrapper->set(safeModeControllerParameters.satRateRef);
break;
default:
@ -326,7 +328,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
}
break;
case (0x9): // PointingModeControllerParameters
switch (parameterId & 0xFF) {
switch (parameterId) {
case 0x0:
parameterWrapper->set(targetModeControllerParameters.refDirection);
break;
@ -392,7 +394,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
}
break;
case (0xA): // StrParameters
switch (parameterId & 0xFF) {
switch (parameterId) {
case 0x0:
parameterWrapper->set(strParameters.exclusionAngle);
break;
@ -404,7 +406,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
}
break;
case (0xB): // GpsParameters
switch (parameterId & 0xFF) {
switch (parameterId) {
case 0x0:
parameterWrapper->set(gpsParameters.timeDiffVelocityMax);
break;
@ -413,7 +415,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
}
break;
case (0xC): // PtgTargetParameters
switch (parameterId & 0xFF) {
switch (parameterId) {
case 0x0:
parameterWrapper->set(ptgTargetParameters.latitudeTgt);
break;
@ -428,7 +430,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
}
break;
case (0xD): // SunModelParameters
switch (parameterId & 0xFF) {
switch (parameterId) {
case 0x0:
parameterWrapper->set(sunModelParameters.domega);
break;
@ -458,7 +460,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
}
break;
case (0xE): // KalmanFilterParameters
switch (parameterId & 0xFF) {
switch (parameterId) {
case 0x0:
parameterWrapper->set(kalmanFilterParameters.sensorNoiseSTR);
break;
@ -482,7 +484,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
}
break;
case (0xF): // MagnetorquesParameter
switch (parameterId & 0xFF) {
switch (parameterId) {
case 0x0:
parameterWrapper->set(magnetorquesParameter.mtq0orientationMatrix);
break;
@ -506,7 +508,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
}
break;
case (0x10): // DetumbleParameter
switch (parameterId & 0xFF) {
switch (parameterId) {
case 0x0:
parameterWrapper->set(detumbleParameter.detumblecounter);
break;
@ -524,10 +526,7 @@ ReturnValue_t AcsParameters::getParameter(uint8_t domainId, uint8_t parameterId,
}
break;
default:
return INVALID_IDENTIFIER_ID;
}
return returnvalue::OK;
// } else {
// return INVALID_DOMAIN_ID;
// }
return INVALID_DOMAIN_ID;
}
return returnvalue::OK;
}

View File

@ -810,7 +810,9 @@ class AcsParameters : public HasParametersIF {
double sunMagAngleMin = 5 * M_PI / 180;
double sunTargetDirLeop[3] = {0, .5, .5};
double sunTargetDir[3] = {0, 0, 1};
double satRateRef[3] = {0, 0, 0};
} safeModeControllerParameters;