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
|