View Single Post
  #4   Spotlight this post!  
Unread 06-12-2005, 17:17
seanwitte seanwitte is offline
Registered User
None #0116
Team Role: Engineer
 
Join Date: Nov 2002
Location: Herndon, VA
Posts: 378
seanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant future
Send a message via AIM to seanwitte
Re: Omnidrive Programming

Mount the four wheels so that the axles are all perpendicular. Label them North, South, East, and West clockwise. The following formulas will drive the wheels, where x, y, and r are in the range -127 to 127.

x = (signed int)p1_x - 127;
y = (signed int)p1_y - 127;
r = (signed int)p2_x - 127;

North = x - r;
South = -x - r;
East = -y - r;
West = y - r;

A joystick connected to port 1 will control forward/backward and strafe left/right. The joystick on port 2 will control the rotation clockwise/anti-clockwise.