Quote:
Originally Posted by acrilex
Thanks,
I do understand the logic within this, we had a code with this kind of calculations, even slowing down when approaching at less than 5 inches, but the real problem is to actually make it work with PID, as I see many other teams are using this and it works perfectly.
Acrilex
|
If you want to do precision autonomous driving, you may want to look at our library class TrcPidDrive.
https://github.com/trc492/Frc2016Fir...cPidDrive.java
This class contains several overloads of the method setTarget. The mecanum version of it takes the parameters xTarget, yTarget and turnTarget among other things. It uses three PID controllers, one controlling the X direction using the encoder, one on Y direction also using the encoder and one controlling the turn (or keeping it straight) using the gyro.