Commit fa461ada authored by Lorenz Meier's avatar Lorenz Meier

PX4 Firmware plugin: First try to switch flight mode, then arm if successful -...

PX4 Firmware plugin: First try to switch flight mode, then arm if successful - which is a lot safer than arming and then seeing if we can switch modes.
parent 16cda58b
......@@ -452,12 +452,15 @@ void PX4FirmwarePlugin::guidedModeChangeAltitude(Vehicle* vehicle, double altitu
void PX4FirmwarePlugin::startMission(Vehicle* vehicle)
{
if (!_armVehicleAndValidate(vehicle)) {
qgcApp()->showMessage(tr("Unable to start mission: Vehicle failed to arm."));
return;
}
_setFlightModeAndValidate(vehicle, missionFlightMode());
if (_setFlightModeAndValidate(vehicle, missionFlightMode())) {
if (!_armVehicleAndValidate(vehicle)) {
qgcApp()->showMessage(tr("Unable to start mission: Vehicle rejected arming."));
return;
}
} else {
qgcApp()->showMessage(tr("Unable to start mission: Vehicle not ready."));
}
}
void PX4FirmwarePlugin::setGuidedMode(Vehicle* vehicle, bool guidedMode)
......
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