From 67c9d52f8aef3a29aea654a2b510e18173e1402a Mon Sep 17 00:00:00 2001 From: Rustom Jehangir Date: Tue, 31 May 2016 16:07:20 -0700 Subject: [PATCH] Disable "MANUAL_CONTROL" warning message for ArduSub, which supports it. --- src/FlightDisplay/FlightDisplayView.qml | 2 +- src/Vehicle/Vehicle.cc | 13 +++++++++++++ src/Vehicle/Vehicle.h | 3 +++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/FlightDisplay/FlightDisplayView.qml b/src/FlightDisplay/FlightDisplayView.qml index f03e74cd4..88341a80d 100644 --- a/src/FlightDisplay/FlightDisplayView.qml +++ b/src/FlightDisplay/FlightDisplayView.qml @@ -91,7 +91,7 @@ QGCView { } function px4JoystickCheck() { - if (_activeVehicle && !_activeVehicle.px4Firmware && (QGroundControl.virtualTabletJoystick || _activeVehicle.joystickEnabled)) { + if ( _activeVehicle && !_activeVehicle.supportsManualControl && (QGroundControl.virtualTabletJoystick || _activeVehicle.joystickEnabled)) { px4JoystickSupport.open() } } diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc index 90020ecdf..dae78daaa 100644 --- a/src/Vehicle/Vehicle.cc +++ b/src/Vehicle/Vehicle.cc @@ -1505,6 +1505,19 @@ bool Vehicle::vtol(void) const } } +bool Vehicle::supportsManualControl(void) const +{ + // PX4 Firmware supports manual control message + if ( px4Firmware() ) { + return true; + } + // ArduSub supports manual control message (identified by APM + Submarine type) + if ( apmFirmware() && vehicleType() == MAV_TYPE_SUBMARINE ) { + return true; + } + return false; +} + void Vehicle::_setCoordinateValid(bool coordinateValid) { if (coordinateValid != _coordinateValid) { diff --git a/src/Vehicle/Vehicle.h b/src/Vehicle/Vehicle.h index d01d21e5e..5803d26e6 100644 --- a/src/Vehicle/Vehicle.h +++ b/src/Vehicle/Vehicle.h @@ -275,6 +275,7 @@ public: Q_PROPERTY(bool multiRotor READ multiRotor CONSTANT) Q_PROPERTY(bool vtol READ vtol CONSTANT) Q_PROPERTY(bool rover READ rover CONSTANT) + Q_PROPERTY(bool supportsManualControl READ supportsManualControl CONSTANT) Q_PROPERTY(bool autoDisconnect MEMBER _autoDisconnect NOTIFY autoDisconnectChanged) Q_PROPERTY(QString prearmError READ prearmError WRITE setPrearmError NOTIFY prearmErrorChanged) Q_PROPERTY(int motorCount READ motorCount CONSTANT) @@ -466,6 +467,8 @@ public: bool vtol(void) const; bool rover(void) const; + bool supportsManualControl(void) const; + void setFlying(bool flying); void setGuidedMode(bool guidedMode); -- 2.22.0