From 7802cf04bf2615d199ec4416d492e19d5f0ee78f Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Sat, 2 Apr 2016 16:53:54 -0700 Subject: [PATCH] Only set reverse for multi-rotor --- .../Common/RadioComponentController.cc | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/AutoPilotPlugins/Common/RadioComponentController.cc b/src/AutoPilotPlugins/Common/RadioComponentController.cc index bf5a65dbb..8ae567dbf 100644 --- a/src/AutoPilotPlugins/Common/RadioComponentController.cc +++ b/src/AutoPilotPlugins/Common/RadioComponentController.cc @@ -786,16 +786,20 @@ void RadioComponentController::_writeCalibration(void) paramFact->setRawValue((float)info->rcMax); } - // APM has a backwards interpretation of "reversed" on the Pitch control. So be careful. - float reversedParamValue; - if (_px4Vehicle() || info->function != rcCalFunctionPitch) { - reversedParamValue = info->reversed ? -1.0f : 1.0f; - } else { - reversedParamValue = info->reversed ? 1.0f : -1.0f; - } - paramFact = getParameterFact(FactSystem::defaultComponentId, revTpl.arg(oneBasedChannel)); - if (paramFact) { - paramFact->setRawValue(reversedParamValue); + // For multi-rotor we can determine reverse setting during radio cal. For anything other than multi-rotor, servo installation + // may affect channel reversing so we can't automatically determine it. + if (_vehicle->multiRotor()) { + // APM multi-rotor has a backwards interpretation of "reversed" on the Pitch control. So be careful. + float reversedParamValue; + if (_px4Vehicle() || info->function != rcCalFunctionPitch) { + reversedParamValue = info->reversed ? -1.0f : 1.0f; + } else { + reversedParamValue = info->reversed ? 1.0f : -1.0f; + } + paramFact = getParameterFact(FactSystem::defaultComponentId, revTpl.arg(oneBasedChannel)); + if (paramFact) { + paramFact->setRawValue(reversedParamValue); + } } } -- 2.22.0