Browse Source

Merge pull request #6538 from DonLakeFlyer/CopterStartMission

Fix ArduCopter Start Mission support
QGC4.4
Don Gagne 7 years ago committed by GitHub
parent
commit
9fad53c6ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      src/FirmwarePlugin/APM/APMFirmwarePlugin.cc

16
src/FirmwarePlugin/APM/APMFirmwarePlugin.cc

@ -987,8 +987,6 @@ void APMFirmwarePlugin::startMission(Vehicle* vehicle)
return; return;
} }
if (vehicle->fixedWing()) {
// Fixed wing will automatically start a mission if you switch to Auto while armed
if (!vehicle->armed()) { if (!vehicle->armed()) {
// First switch to flight mode we can arm from // First switch to flight mode we can arm from
if (!_setFlightModeAndValidate(vehicle, "Guided")) { if (!_setFlightModeAndValidate(vehicle, "Guided")) {
@ -1001,19 +999,13 @@ void APMFirmwarePlugin::startMission(Vehicle* vehicle)
return; return;
} }
} }
} else {
// Copter will automatically start a mission from the ground if you change to Auto and do a START+MIS
if (!_setFlightModeAndValidate(vehicle, "Auto")) {
qgcApp()->showMessage(tr("Unable to start mission: Vehicle failed to change to Guided mode."));
return;
}
vehicle->sendMavCommand(vehicle->defaultComponentId(), MAV_CMD_MISSION_START, true /*show error */); if (vehicle->fixedWing()) {
}
// Final step is to go into Auto
if (!_setFlightModeAndValidate(vehicle, "Auto")) { if (!_setFlightModeAndValidate(vehicle, "Auto")) {
qgcApp()->showMessage(tr("Unable to start mission: Vehicle failed to change to Auto mode.")); qgcApp()->showMessage(tr("Unable to start mission: Vehicle failed to change to Auto mode."));
return; return;
} }
} else {
vehicle->sendMavCommand(vehicle->defaultComponentId(), MAV_CMD_MISSION_START, true /*show error */);
}
} }

Loading…
Cancel
Save