Thanks, this helps a BUNCH! The problem is mixing mecanum drive with your code
Quote:
Originally Posted by dawonn
The code is not particularly well documented, but here's the code we used this year:
https://github.com/CopperBots/Copper...obot.java#L632
We pass in the rotation joystick value that has already been deadband'ed.
If the joystick is at zero rotation, we use a proportional controller to keep the robot straight.
If the joystick is not at zero, we update the current heading of the robot and pass the joystick value back to the drive system unchanged.
We also have the option to disable gyro mode at any time in case something goes wrong like a bad calibration, or a loose cable.
There is also an option to update the kP value from the smart dashboard and some diagnostic information sent back to help troubleshoot when things go wrong.
|