Quote:
Originally Posted by JesseK
For robot-centric steering, it is that simple. For field-centric steering (where pushing away on the joystick moves the robot away from the driver's station regardless of robot orientation) it can get quite complex.
|
It's a bit more work, but not at all complex.
And it's no more complex for mecanum than it is for nonadrive.
To do field-centric control, you must know the angle of the robot with respect to the field (using a gyro for example).
Use this angle to do a
2D coordinate rotation on the joystick X and Y inputs
* . Then use these rotated values (plus the unmodified Z joystick value
*) as inputs to your robot-centric code.
*assuming X and Y represent the strafe and fwd/rev commands, and Z represents the spin command