View Single Post
  #4   Spotlight this post!  
Unread 08-02-2015, 10:50
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: WPILib Mecanum Drive, PID and drift

Using Mecanum_Cartesian() with the gyro input is intended to give you field-centric driving. The joystick commands are rotated to reflect the current heading of the robot. What would normally be "straight forward" becomes "down field". If your robot drifts to the right, it means the gyro angle is measuring the robot as facing a little to the left of where it was facing when the gyro was calibrated on powerup.

If you don't want field-centric motion control, don't use the gyro input that way.
Reply With Quote