Quote:
Originally Posted by sjspry
mainJoy is the one used for forward/back and strafing, rotJoy is used for rotation... Remember forward is -1.
front_Left = -mainJoy.getY() - rotJoy.getX() + mainJoy.getX()
front_Right = -mainJoy.getY() + rotJoy.getX() - mainJoy.getX()
back_Left = -mainJoy.getY() - rotJoy.getX() - mainJoy.getX()
back_Right = -mainJoy.getY() + rotJoy.getX() + mainJoy.getX()
|
Two suggestions:
1) I would think it would be more intuitive if pushing rotJoy to the right would cause clockwise rotation*.
2) You need to
normalize the 4 wheel commands, in a way that preserves their holonomic relationship, before sending them to the motors.
* I am assuming that the motors are set up so that issuing a + command causes the wheels to rotate in the "forward" direction