From da3d4cdab8a358c4850f321b5e0a58d246f0b2bc Mon Sep 17 00:00:00 2001 From: edouard Date: Tue, 21 Dec 2010 20:05:56 +0000 Subject: [PATCH] GCS Control Gadget: After double checks on actual quad, correct pitch sign now implemented. git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2266 ebee16cc-31ac-478f-84a7-5cbb03baadba --- .../src/plugins/gcscontrol/gcscontrolgadget.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ground/src/plugins/gcscontrol/gcscontrolgadget.cpp b/ground/src/plugins/gcscontrol/gcscontrolgadget.cpp index b93e7cbce..602dadb01 100644 --- a/ground/src/plugins/gcscontrol/gcscontrolgadget.cpp +++ b/ground/src/plugins/gcscontrol/gcscontrolgadget.cpp @@ -96,19 +96,19 @@ void GCSControlGadget::manualControlCommandUpdated(UAVObject * obj) { switch (controlsMode) { case 1: // Mode 1: LeftX = Yaw, LeftY = Pitch, RightX = Roll, RightY = Throttle - emit sticksChangedRemotely(yaw,pitch,roll,throttle); + emit sticksChangedRemotely(yaw,-pitch,roll,throttle); break; case 2: // Mode 2: LeftX = Yaw, LeftY = Throttle, RightX = Roll, RightY = Pitch - emit sticksChangedRemotely(yaw,throttle,roll,pitch); + emit sticksChangedRemotely(yaw,throttle,roll,-pitch); break; case 3: // Mode 3: LeftX = Roll, LeftY = Pitch, RightX = Yaw, RightY = Throttle - emit sticksChangedRemotely(roll,pitch,yaw,throttle); + emit sticksChangedRemotely(roll,-pitch,yaw,throttle); break; case 4: // Mode 4: LeftX = Roll, LeftY = Throttle, RightX = Yaw, RightY = Pitch; - emit sticksChangedRemotely(roll,throttle,yaw,pitch); + emit sticksChangedRemotely(roll,throttle,yaw,-pitch); break; } } @@ -133,28 +133,28 @@ void GCSControlGadget::sticksChangedLocally(double leftX, double leftY, double r case 1: // Mode 1: LeftX = Yaw, LeftY = Pitch, RightX = Roll, RightY = Throttle newRoll = rightX; - newPitch = leftY; + newPitch = -leftY; newYaw = leftX; newThrottle = rightY; break; case 2: // Mode 2: LeftX = Yaw, LeftY = Throttle, RightX = Roll, RightY = Pitch newRoll = rightX; - newPitch = rightY; + newPitch = -rightY; newYaw = leftX; newThrottle = leftY; break; case 3: // Mode 3: LeftX = Roll, LeftY = Pitch, RightX = Yaw, RightY = Throttle newRoll = leftX; - newPitch = leftY; + newPitch = -leftY; newYaw = rightX; newThrottle = rightY; break; case 4: // Mode 4: LeftX = Roll, LeftY = Throttle, RightX = Yaw, RightY = Pitch; newRoll = leftX; - newPitch = rightY; + newPitch = -rightY; newYaw = rightX; newThrottle = leftY; break;