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); }