View Single Post
  #4   Spotlight this post!  
Unread 03-01-2011, 17:56
buildmaster5000 buildmaster5000 is offline
Trying to program the swerve drive
AKA: Alex
FRC #2421 (Rolling Thunder Robotics)
Team Role: Alumni
 
Join Date: May 2009
Rookie Year: 2009
Location: Northern Virginia
Posts: 207
buildmaster5000 has much to be proud ofbuildmaster5000 has much to be proud ofbuildmaster5000 has much to be proud ofbuildmaster5000 has much to be proud ofbuildmaster5000 has much to be proud ofbuildmaster5000 has much to be proud ofbuildmaster5000 has much to be proud ofbuildmaster5000 has much to be proud of
Re: paper: 4 wheel independent drive & independent steering ("swerve")

I've developed code for a swerve drive that is based on magnitude and direction from the joystick origin (using halo style controls) and have found that a simple code snippet produces the 180 degree limitation (90 degrees from straight ahead), but certain situations prove this to only work to a limited degree (when the angle moves from 180 to 190, the wheels rotate 170 degrees)

Code:
if(angle>180)//zero is the positive x axis and positive is in the counter clockwise direction
{
angle-=180;
magnitude*=-1;//magnitude is distance from joystick center, it is always positive unless modified in this line
}
__________________
-Alex



2010 Washington DC Regional: Engineering Excellence Award
Reply With Quote