View Single Post
  #6   Spotlight this post!  
Unread 21-01-2015, 23:54
kinganu123 kinganu123 is offline
Registered User
FRC #1747
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Piscataway, NJ
Posts: 243
kinganu123 is on a distinguished road
Re: H-Drive Programming

I figure I might as well throw in my two cents. The code (at least for my team's untested implementation) will look a lot like RobotDrive's mecanumDrive_Polar/Cartesian.
  1. You want to take the joystick degrees and break it up into x and y vectors (kind of like what you do in physics).
  2. Use the magnitude to compute the size of the x and y vectors.
  3. Divide by the original x and y vectors so that you can bring your magnitudes back to a scale of -1 to 1. Without this last step, you robot won't be able to go diagonal at max speed.
__________________
Reply With Quote