View Single Post
  #6   Spotlight this post!  
Unread 10-02-2014, 12:17
parsodark parsodark is offline
Registered User
FRC #3996
 
Join Date: Feb 2014
Location: Canada
Posts: 4
parsodark is an unknown quantity at this point
Re: Is RobotDrive required ?

Quote:
Originally Posted by Ether View Post
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));
Reply With Quote