|
|
@ -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 */); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|