Browse Source

Fix flight mode channel not set bug

QGC4.4
Don Gagne 9 years ago
parent
commit
95f9b8fb52
  1. 6
      src/AutoPilotPlugins/PX4/PX4SimpleFlightModesController.cc

6
src/AutoPilotPlugins/PX4/PX4SimpleFlightModesController.cc

@ -51,6 +51,12 @@ void PX4SimpleFlightModesController::_rcChannelsChanged(int channelCount, int pw
} }
int flightModeChannel = pFact->rawValue().toInt() - 1; int flightModeChannel = pFact->rawValue().toInt() - 1;
if (flightModeChannel == -1) {
// Flight mode channel not set, can't track active flight mode
_activeFlightMode = 0;
emit activeFlightModeChanged(_activeFlightMode);
return;
}
pFact = getParameterFact(-1, QString("RC%1_REV").arg(flightModeChannel + 1)); pFact = getParameterFact(-1, QString("RC%1_REV").arg(flightModeChannel + 1));
if(!pFact) { if(!pFact) {

Loading…
Cancel
Save