Quote:
Originally Posted by JesseK
With a single joystick, in code I can create a system that has some variables (aka coefficients). Based upon the variables I can determine different integral-based rotational neutral zones, scale within certain regions of joystick movement, how the robot reacts based upon its direction, and can eliminate jerky joystick movements that translate to jerky bot movements for both rotation and lateral at the same time. For tank drive, doing all of these things requires at least twice the code so you can determine a rotation vector, where as single-joystick drive rotation is a direct input.
|
To convert dual-joystick tank-style control to single-joystick arcade-style control is two lines of code.
Code:
speed = left + right;
turn = left - right;
I have left off scaling and offset, because some people like to keep the 0-254 range and others like +/- 127 instead (the TechnoKats Overdrive code this year actually uses +/- 100 for all internal computations).