We are trying to make a PID command using the wpilib PIDCommand class. It turns out, PIDCommand uses the deprecated version of PIDController, though PIDCommand itself isn’t deprecated or listed as deprecated on the wpilib site. Does anyone know how we can make a PID command work with these classes?
Potentially useful links:
https://docs.wpilib.org/en/latest/docs/software/commandbased/pid-subsystems-commands.html
https://first.wpi.edu/FRC/roborio/release/docs/java/edu/wpi/first/wpilibj/controller/PIDController.html
https://first.wpi.edu/FRC/roborio/release/docs/java/edu/wpi/first/wpilibj/PIDController.html
You could use the PIDCommand
from the edu.wpi.first.wpilibj2.command
package instead. https://first.wpi.edu/FRC/roborio/release/docs/java/edu/wpi/first/wpilibj2/command/PIDCommand.html
(this requires the new command based framework)
Is your only problem that it is deprecated, or are you having an implementation issue?
Only if you’re using the wpilibj2 ie new command framework. You can’t mix them.
Try using this class. Make sure to just use the one class/file that this link leads you to, chief Delphi wont let me upload individual files. you wont need anything else for a pid function(besides your error, and output mechanism) no mess no fuss. Have fun and good luck! And let me know if you need help with implementation. https://github.com/Byron-MN-FRC/Main-2018/blob/cae01854fe0f9c69af79477d177a9e8f5183c994/src/org/usfirst/frc/team4859/robot/ThrottleLookup/MiniPID.java
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.