Commit 7802cf04 authored by Don Gagne's avatar Don Gagne

Only set reverse for multi-rotor

parent 482ef626
...@@ -786,16 +786,20 @@ void RadioComponentController::_writeCalibration(void) ...@@ -786,16 +786,20 @@ void RadioComponentController::_writeCalibration(void)
paramFact->setRawValue((float)info->rcMax); paramFact->setRawValue((float)info->rcMax);
} }
// APM has a backwards interpretation of "reversed" on the Pitch control. So be careful. // For multi-rotor we can determine reverse setting during radio cal. For anything other than multi-rotor, servo installation
float reversedParamValue; // may affect channel reversing so we can't automatically determine it.
if (_px4Vehicle() || info->function != rcCalFunctionPitch) { if (_vehicle->multiRotor()) {
reversedParamValue = info->reversed ? -1.0f : 1.0f; // APM multi-rotor has a backwards interpretation of "reversed" on the Pitch control. So be careful.
} else { float reversedParamValue;
reversedParamValue = info->reversed ? 1.0f : -1.0f; if (_px4Vehicle() || info->function != rcCalFunctionPitch) {
} reversedParamValue = info->reversed ? -1.0f : 1.0f;
paramFact = getParameterFact(FactSystem::defaultComponentId, revTpl.arg(oneBasedChannel)); } else {
if (paramFact) { reversedParamValue = info->reversed ? 1.0f : -1.0f;
paramFact->setRawValue(reversedParamValue); }
paramFact = getParameterFact(FactSystem::defaultComponentId, revTpl.arg(oneBasedChannel));
if (paramFact) {
paramFact->setRawValue(reversedParamValue);
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment