Browse Source

Merge pull request #6518 from acfloria/fix/high_latency_joystick

Do not send virtual joystick commmands over high latency links
QGC4.4
Don Gagne 7 years ago committed by GitHub
parent
commit
e4dc651d96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/FlightDisplay/FlightDisplayView.qml
  2. 2
      src/Vehicle/Vehicle.cc

4
src/FlightDisplay/FlightDisplayView.qml

@ -484,12 +484,12 @@ QGCView { @@ -484,12 +484,12 @@ QGCView {
z: _panel.z + 5
width: parent.width - (_flightVideoPipControl.width / 2)
height: Math.min(ScreenTools.availableHeight * 0.25, ScreenTools.defaultFontPixelWidth * 16)
visible: (_virtualJoystick ? _virtualJoystick.value : false) && !QGroundControl.videoManager.fullScreen
visible: (_virtualJoystick ? _virtualJoystick.value : false) && !QGroundControl.videoManager.fullScreen && !(_activeVehicle ? _activeVehicle.highLatencyLink : false)
anchors.bottom: _flightVideoPipControl.top
anchors.bottomMargin: ScreenTools.defaultFontPixelHeight * 2
anchors.horizontalCenter: flightDisplayViewWidgets.horizontalCenter
source: "qrc:/qml/VirtualJoystick.qml"
active: _virtualJoystick ? _virtualJoystick.value : false
active: (_virtualJoystick ? _virtualJoystick.value : false) && !(_activeVehicle ? _activeVehicle.highLatencyLink : false)
property bool useLightColors: isBackgroundDark

2
src/Vehicle/Vehicle.cc

@ -2465,7 +2465,7 @@ void Vehicle::_remoteControlRSSIChanged(uint8_t rssi) @@ -2465,7 +2465,7 @@ void Vehicle::_remoteControlRSSIChanged(uint8_t rssi)
void Vehicle::virtualTabletJoystickValue(double roll, double pitch, double yaw, double thrust)
{
// The following if statement prevents the virtualTabletJoystick from sending values if the standard joystick is enabled
if ( !_joystickEnabled ) {
if ( !_joystickEnabled && !_highLatencyLink) {
_uas->setExternalControlSetpoint(roll, pitch, yaw, thrust, 0, JoystickModeRC);
}
}

Loading…
Cancel
Save