diff --git a/src/FlightDisplay/FlightDisplayView.qml b/src/FlightDisplay/FlightDisplayView.qml index f03e74cd492b36c888d4db41cc789d2ba8e7762a..88341a80dd38d22fe086b52c1b0abc095fd72019 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 90020ecdf9043c0dbcb8b7aab5b913fbc63500ba..dae78daaaee6ec548405639465c9f764f6067bb8 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 d01d21e5e56d82a45ebc634a625e02f2e13aefc5..5803d26e601b61dc5dcf8b05b2be6f3ec8fc1045 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);