diff --git a/src/AutoPilotPlugins/Common/RadioComponent.qml b/src/AutoPilotPlugins/Common/RadioComponent.qml index c62a9e909530fe9d772829446d9ddb8f83e7a4a6..fe5a030afd3ec7ad27f71eba0d5517e055be275f 100644 --- a/src/AutoPilotPlugins/Common/RadioComponent.qml +++ b/src/AutoPilotPlugins/Common/RadioComponent.qml @@ -108,7 +108,8 @@ QGCView { id: zeroTrimsDialogComponent QGCViewMessage { - message: "Before calibrating you should zero all your trims and subtrims. Click Ok to start Calibration." + message: "Before calibrating you should zero all your trims and subtrims. Click Ok to start Calibration.\n\n" + + (QGroundControl.multiVehicleManager.activeVehicle.px4Firmware ? "" : "Please ensure all motor power is disconnected AND all props are removed from the vehicle.") function accept() { hideDialog() diff --git a/src/AutoPilotPlugins/Common/RadioComponentController.cc b/src/AutoPilotPlugins/Common/RadioComponentController.cc index b4e8cb3fb68cfc66507cd41cf7be0771b009aa84..abf2e726b5e03fb8f4319e32f560ee24f5181acb 100644 --- a/src/AutoPilotPlugins/Common/RadioComponentController.cc +++ b/src/AutoPilotPlugins/Common/RadioComponentController.cc @@ -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 diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc index 6edc82999be031bf3eb986cbbace4e97b19c2ea2..a973cc9d1dad730aa62481ee26e95655802babae 100644 --- a/src/Vehicle/Vehicle.cc +++ b/src/Vehicle/Vehicle.cc @@ -375,7 +375,7 @@ void Vehicle::_handleRCChannelsRaw(mavlink_message_t& message) if (channelValue == UINT16_MAX) { pwmValues[i] = -1; } else { - channelCount = i; + channelCount = i + 1; pwmValues[i] = channelValue; } } diff --git a/src/qgcunittest/RadioConfigTest.cc b/src/qgcunittest/RadioConfigTest.cc index 5e876d7d64beedba94fd2ec34bcb7aca04b771b2..99923b04eec47780832a92d4aa434177ed48c879 100644 --- a/src/qgcunittest/RadioConfigTest.cc +++ b/src/qgcunittest/RadioConfigTest.cc @@ -176,7 +176,7 @@ const struct RadioConfigTest::ChannelSettings RadioConfigTest::_rgChannelSetting // Channels 1-4: Mapped to attitude control function { RadioComponentController::rcCalFunctionRoll, _testMinValue, _testMaxValue, _testCenterValue, true }, - { RadioComponentController::rcCalFunctionPitch, _testMinValue, _testMaxValue, _testCenterValue, false }, + { RadioComponentController::rcCalFunctionPitch, _testMinValue, _testMaxValue, _testCenterValue, true }, { RadioComponentController::rcCalFunctionYaw, _testMinValue, _testMaxValue, _testCenterValue, true }, { RadioComponentController::rcCalFunctionThrottle, _testMinValue, _testMaxValue, _testMinValue, false },