Quote:
Originally Posted by Ether
How is your home-brew mecanum code different from what's in WPILib??
|
Basically, its a tank drive, with both x axis controlling the sideway movement.
Both joysticks up : move forward
Both joysticks down : move backward
One up, one down : rotation
Both left/right : sideway movement
We used it in other competitions (Vex) and we found it to be way more intuitive
Here's the code itself (in a stripped down version):
frontLeft->Set(-stick.GetRawAxis(2)+stick.GetRawAxis(1));
backLeft->Set(-stick.GetRawAxis(2)-stick.GetRawAxis(1));
frontRight->Set(stick.GetRawAxis(4)+stick.GetRawAxis(3));
backRight->Set(stick.GetRawAxis(4)-stick.GetRawAxis(3));