Commit 3b4e9825 authored by DonLakeFlyer's avatar DonLakeFlyer

Fix ArduCopter Start Mission support

parent 4d97eebf
...@@ -987,8 +987,6 @@ void APMFirmwarePlugin::startMission(Vehicle* vehicle) ...@@ -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) ...@@ -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 */);
}
} }
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