Hey again! My co-lead and I came across what we believe are two separate bugs in the SoftwarePIDController. Seeing as they're each relatively small to review, I hope you don't mind that I've combined them both into one PR.
The checkTolerance method is inaccurate. It checks to see if the input is less than the setpoint minus the tolerance, which means basically any input less than the setpoint is considered in tolerance. This had the ugly effect of causing our controller commands to prematurely finish. I've thrown in a regression test that verifies the method now works as intended.
The gains don't appear on the SmartDashboard. It looks like this.table = table is the culprit :) I compared this line to the corresponding line in the WPILib PIDController and I believe it should have been set to subtable.
Hey again! My co-lead and I came across what we believe are two separate bugs in the SoftwarePIDController. Seeing as they're each relatively small to review, I hope you don't mind that I've combined them both into one PR.
The checkTolerance method is inaccurate. It checks to see if the input is less than the setpoint minus the tolerance, which means basically any input less than the setpoint is considered in tolerance. This had the ugly effect of causing our controller commands to prematurely finish. I've thrown in a regression test that verifies the method now works as intended.
The gains don't appear on the SmartDashboard. It looks like
this.table = table
is the culprit :) I compared this line to the corresponding line in the WPILib PIDController and I believe it should have been set tosubtable
.