Commit 2418d073 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Warn on reversed throttle (#3655)

parent ba486be4
......@@ -64,6 +64,7 @@ QGCView {
onChannelCountChanged: updateChannelCount()
onFunctionMappingChangedAPMReboot: showMessage(qsTr("Reboot required"), qsTr("Your stick mappings have changed, you must reboot the vehicle for correct operation."), StandardButton.Ok)
onThrottleReversedCalFailure: showMessage(qsTr("Throttle channel reversed"), qsTr("Calibration failed. The throttle channel on your transmitter is reversed. You must correct this on your transmitter in order to complete calibration."), StandardButton.Ok)
}
onCompleted: {
......
......@@ -325,7 +325,7 @@ void RadioComponentController::_saveAllTrims(void)
// trims reset to correct values.
for (int i=0; i<_chanCount; i++) {
qCDebug(RadioComponentControllerLog) << "_saveAllTrims trim" << _rcRawValue[i];
qCDebug(RadioComponentControllerLog) << "_saveAllTrims channel trim" << i<< _rcRawValue[i];
_rgChannelInfo[i].rcTrim = _rcRawValue[i];
}
_advanceState();
......@@ -752,6 +752,11 @@ void RadioComponentController::_writeCalibration(void)
_uas->stopCalibration();
}
if (!_px4Vehicle() && _rgChannelInfo[_rgFunctionChannelMapping[rcCalFunctionThrottle]].reversed) {
// A reversed throttle could lead to dangerous power up issues if the firmware doesn't handle it absolutely correctly in all places.
// So in this case fail the calibration for anything other than PX4 which is known to be able to handle this correctly.
emit throttleReversedCalFailure();
} else {
_validateCalibration();
QString minTpl("RC%1_MIN");
......@@ -821,6 +826,7 @@ void RadioComponentController::_writeCalibration(void)
}
}
}
}
if (_px4Vehicle()) {
// If the RC_CHAN_COUNT parameter is available write the channel count
......
......@@ -124,12 +124,15 @@ signals:
void imageHelpChanged(QString source);
void transmitterModeChanged(int mode);
// @brief Signalled when in unit test mode and a message box should be displayed by the next button
/// Signalled when in unit test mode and a message box should be displayed by the next button
void nextButtonMessageBoxDisplayed(void);
// Signaled to QML to indicator reboot is required
/// Signalled to QML to indicate reboot is required
void functionMappingChangedAPMReboot(void);
/// Signalled to Qml to indicate cal failure due to reversed throttle
void throttleReversedCalFailure(void);
private slots:
void _rcChannelsChanged(int channelCount, int pwmValues[Vehicle::cMaxRcChannels]);
......
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