Commit 8f0e4e7f authored by Don Gagne's avatar Don Gagne

Fix backwards APM Stack Pitch setting

parent ef4fff63
......@@ -854,7 +854,15 @@ void RadioComponentController::_writeCalibration(void)
getParameterFact(FactSystem::defaultComponentId, trimTpl.arg(oneBasedChannel))->setRawValue((float)info->rcTrim);
getParameterFact(FactSystem::defaultComponentId, minTpl.arg(oneBasedChannel))->setRawValue((float)info->rcMin);
getParameterFact(FactSystem::defaultComponentId, maxTpl.arg(oneBasedChannel))->setRawValue((float)info->rcMax);
getParameterFact(FactSystem::defaultComponentId, revTpl.arg(oneBasedChannel))->setRawValue(info->reversed ? -1.0f : 1.0f);
// 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;
}
getParameterFact(FactSystem::defaultComponentId, revTpl.arg(oneBasedChannel))->setRawValue(reversedParamValue);
}
// Write function mapping parameters
......
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