From bb45b0c38afa3affd0029fb2410c518cb04e3baf Mon Sep 17 00:00:00 2001 From: peabody124 Date: Sat, 4 Sep 2010 02:19:02 +0000 Subject: [PATCH] Ground/GCSControl: Swapped sign conventions of sticks to match the sign convention of roll/pitch/yaw. I.e. now right on the roll causes a + roll, pulling down on the pitch causes + pitch. git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1516 ebee16cc-31ac-478f-84a7-5cbb03baadba --- ground/src/plugins/gcscontrol/joystickcontrol.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ground/src/plugins/gcscontrol/joystickcontrol.cpp b/ground/src/plugins/gcscontrol/joystickcontrol.cpp index abaff6c55..1d10f87c5 100644 --- a/ground/src/plugins/gcscontrol/joystickcontrol.cpp +++ b/ground/src/plugins/gcscontrol/joystickcontrol.cpp @@ -90,7 +90,7 @@ void JoystickControl::mccChanged(UAVObject*) { ManualControlCommand::DataFields data = getMCC()->getData(); double x = (data.Yaw + 1) / 2 * scene()->sceneRect().width(); - double y = (-data.Pitch + 1) / 2 * scene()->sceneRect().height(); + double y = (data.Pitch + 1) / 2 * scene()->sceneRect().height(); m_joystickEnd->setPos(x-m_joystickEnd->boundingRect().width()/2,y-m_joystickEnd->boundingRect().height()/2); } else if( this->objectName() == QString("widgetRightStick")) @@ -161,7 +161,7 @@ void JoystickControl::updateMCC(QPointF point) QRectF sceneSize = scene()->sceneRect(); double x = 2 * ( point.x() / sceneSize.width() - .5 ); - double y = -2 * ( point.y() / sceneSize.height() - .5); + double y = 2 * ( point.y() / sceneSize.height() - .5); x = qBound( (double) -1, x, (double) 1); y = qBound( (double) -1, y, (double) 1); if( this->objectName() == QString("widgetLeftStick")) @@ -177,7 +177,7 @@ void JoystickControl::updateMCC(QPointF point) { ManualControlCommand::DataFields data = getMCC()->getData(); - data.Throttle = y; + data.Throttle = -y; data.Roll = x; getMCC()->setData(data); }