1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-30 08:24:11 +01:00

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
This commit is contained in:
peabody124 2010-09-04 02:19:02 +00:00 committed by peabody124
parent a406034ed9
commit bb45b0c38a

View File

@ -90,7 +90,7 @@ void JoystickControl::mccChanged(UAVObject*)
{ {
ManualControlCommand::DataFields data = getMCC()->getData(); ManualControlCommand::DataFields data = getMCC()->getData();
double x = (data.Yaw + 1) / 2 * scene()->sceneRect().width(); 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); m_joystickEnd->setPos(x-m_joystickEnd->boundingRect().width()/2,y-m_joystickEnd->boundingRect().height()/2);
} }
else if( this->objectName() == QString("widgetRightStick")) else if( this->objectName() == QString("widgetRightStick"))
@ -161,7 +161,7 @@ void JoystickControl::updateMCC(QPointF point)
QRectF sceneSize = scene()->sceneRect(); QRectF sceneSize = scene()->sceneRect();
double x = 2 * ( point.x() / sceneSize.width() - .5 ); 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); x = qBound( (double) -1, x, (double) 1);
y = qBound( (double) -1, y, (double) 1); y = qBound( (double) -1, y, (double) 1);
if( this->objectName() == QString("widgetLeftStick")) if( this->objectName() == QString("widgetLeftStick"))
@ -177,7 +177,7 @@ void JoystickControl::updateMCC(QPointF point)
{ {
ManualControlCommand::DataFields data = getMCC()->getData(); ManualControlCommand::DataFields data = getMCC()->getData();
data.Throttle = y; data.Throttle = -y;
data.Roll = x; data.Roll = x;
getMCC()->setData(data); getMCC()->setData(data);
} }