From 57d83dbd5fa9cf8cfaec50fe45f5886f93c7432b Mon Sep 17 00:00:00 2001 From: Rustom Jehangir Date: Sat, 9 Jan 2016 23:43:52 -0800 Subject: [PATCH] Prioritize real joystick over virtual joystick. Added conditional statement to disable the virtualTabletJoystick output if a real joystick is connected and enabled. Without this, two different sets of values would be sent and would appear highly sporadic. --- src/Vehicle/Vehicle.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc index cff363007..615dc2aa9 100644 --- a/src/Vehicle/Vehicle.cc +++ b/src/Vehicle/Vehicle.cc @@ -1215,5 +1215,8 @@ void Vehicle::_remoteControlRSSIChanged(uint8_t rssi) void Vehicle::virtualTabletJoystickValue(double roll, double pitch, double yaw, double thrust) { - _uas->setExternalControlSetpoint(roll, pitch, yaw, thrust, 0, JoystickModeRC); + // The following if statement prevents the virtualTabletJoystick from sending values if the standard joystick is enabled + if ( !_joystickEnabled ) { + _uas->setExternalControlSetpoint(roll, pitch, yaw, thrust, 0, JoystickModeRC); + } } -- 2.22.0