Commit 9ae456cb authored by Don Gagne's avatar Don Gagne

Merge pull request #2486 from DonLakeFlyer/RadioCal

Radio cal fixes
parents f517889f 35e6e1f4
...@@ -108,7 +108,8 @@ QGCView { ...@@ -108,7 +108,8 @@ QGCView {
id: zeroTrimsDialogComponent id: zeroTrimsDialogComponent
QGCViewMessage { 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() { function accept() {
hideDialog() hideDialog()
......
...@@ -854,7 +854,15 @@ void RadioComponentController::_writeCalibration(void) ...@@ -854,7 +854,15 @@ void RadioComponentController::_writeCalibration(void)
getParameterFact(FactSystem::defaultComponentId, trimTpl.arg(oneBasedChannel))->setRawValue((float)info->rcTrim); getParameterFact(FactSystem::defaultComponentId, trimTpl.arg(oneBasedChannel))->setRawValue((float)info->rcTrim);
getParameterFact(FactSystem::defaultComponentId, minTpl.arg(oneBasedChannel))->setRawValue((float)info->rcMin); getParameterFact(FactSystem::defaultComponentId, minTpl.arg(oneBasedChannel))->setRawValue((float)info->rcMin);
getParameterFact(FactSystem::defaultComponentId, maxTpl.arg(oneBasedChannel))->setRawValue((float)info->rcMax); 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 // Write function mapping parameters
......
...@@ -375,7 +375,7 @@ void Vehicle::_handleRCChannelsRaw(mavlink_message_t& message) ...@@ -375,7 +375,7 @@ void Vehicle::_handleRCChannelsRaw(mavlink_message_t& message)
if (channelValue == UINT16_MAX) { if (channelValue == UINT16_MAX) {
pwmValues[i] = -1; pwmValues[i] = -1;
} else { } else {
channelCount = i; channelCount = i + 1;
pwmValues[i] = channelValue; pwmValues[i] = channelValue;
} }
} }
......
...@@ -176,7 +176,7 @@ const struct RadioConfigTest::ChannelSettings RadioConfigTest::_rgChannelSetting ...@@ -176,7 +176,7 @@ const struct RadioConfigTest::ChannelSettings RadioConfigTest::_rgChannelSetting
// Channels 1-4: Mapped to attitude control function // Channels 1-4: Mapped to attitude control function
{ RadioComponentController::rcCalFunctionRoll, _testMinValue, _testMaxValue, _testCenterValue, true }, { 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::rcCalFunctionYaw, _testMinValue, _testMaxValue, _testCenterValue, true },
{ RadioComponentController::rcCalFunctionThrottle, _testMinValue, _testMaxValue, _testMinValue, false }, { RadioComponentController::rcCalFunctionThrottle, _testMinValue, _testMaxValue, _testMinValue, false },
......
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