diff --git a/src/FirmwarePlugin/FirmwarePlugin.cc b/src/FirmwarePlugin/FirmwarePlugin.cc index f42ed6efd9c407894df9d75c50371c2a7833b60b..fb6d02816ff6e32b23d09814d2867872cea807c2 100644 --- a/src/FirmwarePlugin/FirmwarePlugin.cc +++ b/src/FirmwarePlugin/FirmwarePlugin.cc @@ -16,7 +16,6 @@ static FirmwarePluginFactoryRegister* _instance = NULL; const char* guided_mode_not_supported_by_vehicle = "Guided mode not supported by Vehicle."; -const char* landing_aborted = "Landing aborted."; const char* FirmwarePlugin::px4FollowMeFlightMode = "Follow Me"; @@ -232,12 +231,6 @@ void FirmwarePlugin::pauseVehicle(Vehicle* vehicle) qgcApp()->showMessage(guided_mode_not_supported_by_vehicle); } -void FirmwarePlugin::abortLanding(Vehicle* vehicle) -{ - Q_UNUSED(vehicle); - qgcApp()->showMessage(landing_aborted); -} - void FirmwarePlugin::guidedModeRTL(Vehicle* vehicle) { // Not supported by generic vehicle diff --git a/src/FirmwarePlugin/FirmwarePlugin.h b/src/FirmwarePlugin/FirmwarePlugin.h index f5c27eab0061fe9e563ba0967d8fd3181b65ab66..0c0eb0f77fbe1bbcf233a073725977511c481d44 100644 --- a/src/FirmwarePlugin/FirmwarePlugin.h +++ b/src/FirmwarePlugin/FirmwarePlugin.h @@ -105,9 +105,6 @@ public: /// If not, vehicle will be left in Loiter. virtual void pauseVehicle(Vehicle* vehicle); - /// Command vehicle to abort landing - virtual void abortLanding(Vehicle* vehicle); - /// Command vehicle to return to launch virtual void guidedModeRTL(Vehicle* vehicle); diff --git a/src/FlightDisplay/FlightDisplayViewWidgets.qml b/src/FlightDisplay/FlightDisplayViewWidgets.qml index f60854c4a50de5cdc55c5e76c8542c04d02a389a..b2667bb3606084b4ac740ee72bb3fb0870a7a0c5 100644 --- a/src/FlightDisplay/FlightDisplayViewWidgets.qml +++ b/src/FlightDisplay/FlightDisplayViewWidgets.qml @@ -240,7 +240,7 @@ Item { //_activeVehicle.guidedModeOrbit(QGroundControl.flightMapPosition, 50.0) break; case confirmAbort: - _activeVehicle.abortLanding() + _activeVehicle.abortLanding(50) // hardcoded value for climbOutAltitude that is currently ignored break; default: console.warn(qsTr("Internal error: unknown confirmActionCode"), confirmActionCode) @@ -366,7 +366,7 @@ Item { QGCButton { pointSize: _guidedModeBar._fontPointSize text: qsTr("Abort") - visible: _activeVehicle && _activeVehicle.flying + visible: _activeVehicle && _activeVehicle.flying && _activeVehicle.fixedWing onClicked: _guidedModeBar.confirmAction(_guidedModeBar.confirmAbort) } diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc index f9399cbc39d2cfa283d93e18f0fd2d131a06a9fe..fa5b2f1257cf214e4808a0a43cc1e2c668aeac2f 100644 --- a/src/Vehicle/Vehicle.cc +++ b/src/Vehicle/Vehicle.cc @@ -1838,14 +1838,12 @@ void Vehicle::pauseVehicle(void) _firmwarePlugin->pauseVehicle(this); } -void Vehicle::abortLanding(void) +void Vehicle::abortLanding(double climbOutAltitude) { sendMavCommand(defaultComponentId(), MAV_CMD_DO_GO_AROUND, true, // show error if fails - 50); // this is a dummy value that is currently ignored - - _firmwarePlugin->abortLanding(this); + climbOutAltitude); } bool Vehicle::guidedMode(void) const diff --git a/src/Vehicle/Vehicle.h b/src/Vehicle/Vehicle.h index 9d168eb004bb55c63b3110142a9d729718691650..d880b8769024e7cab6daf41d72d3ce6dedc9a4a2 100644 --- a/src/Vehicle/Vehicle.h +++ b/src/Vehicle/Vehicle.h @@ -356,7 +356,7 @@ public: Q_INVOKABLE void emergencyStop(void); /// Command vehicle to abort landing - Q_INVOKABLE void abortLanding(void); + Q_INVOKABLE void abortLanding(double climbOutAltitude); /// Alter the current mission item on the vehicle Q_INVOKABLE void setCurrentMissionSequence(int seq);