View Single Post
  #1   Spotlight this post!  
Unread 15-01-2003, 20:34
Adam Collet Adam Collet is offline
Registered User
#0159 (Alpine Robotics)
 
Join Date: Nov 2002
Location: Ft. Collins, Colorado
Posts: 25
Adam Collet is an unknown quantity at this point
Question Translational Drive Code

How can we code translational drive off of one joystick? Right now all I can think of is to use and inverse tangent, which obviously isn't possible. Using inverse tanget it would be (for the first quadrant):

tan-1 (p1_y/p1_x) 'then code torotate it using timing or rotation sensor
pwm1=p1_y
pwm2=p1_y
pwm2=p1_y
pwm4=p1_y 'all the motors go forward/backward now that the angle is set, based on how far the drive moved p1_y


Any ideas?
__________________
"Without the wind, the grass does not move. Without software, hardware is useless.''

Thus spake the Master Programmer

The Tao of Programming
Translated by: Geoffrey James