Log in

View Full Version : arcadeDrive, 3D Pro, pushing forward, goes backward


rame
14-02-2015, 04:31
Hi,

I am a newbie and this my first post. Sorry.

We are using this Java code without making any changes.

https://wpilib.screenstepslive.com/s/4485/m/13809/l/145307-creating-your-benchtop-test-program
...
myRobot.arcadeDrive(stick);
....

We are using the Logitech 3D Pro from the KOP.

The robot moves. But pulling backwards on the joystick = robot moves forwards. Pushing the joystick forwards = robot moves backwards.

How can we reverse this?

Sorry I do not know how to post code and I do not want to paste the code here.

Thanks in advance for your help.

Rakusan2
14-02-2015, 07:36
My suggestions is to take appart stick and use it as stick.getX () and stick.getY (). Also since you want to reverse forawd with backward, you can reverse the y value.
Therefore instead of myRobot.arcadeDrive (stick) put myRobot.arcadeDrive (-stick.getY(), stick.getX ())

GeeTwo
14-02-2015, 09:13
Check that you have the left and right motors connected to the correct ports as written into your code. Reversing left and right motors rotates the robot so that front is back and back is front.

rame
14-02-2015, 16:47
My suggestions is to take appart stick and use it as stick.getX () and stick.getY (). Also since you want to reverse forawd with backward, you can reverse the y value.
Therefore instead of myRobot.arcadeDrive (stick) put myRobot.arcadeDrive (-stick.getY(), stick.getX ())

Thanks, I will try this and report back. Much appreciated.

rame
14-02-2015, 18:06
Thanks! That worked!!! Reversing the x and y value did the trick. Thanks!