mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Fixed the motor tests by reducing speed to within the limits of the encoders we use. Also fixed java pid tolerances since getAvgError() was broken. It is now fixed and works properly. Added tests for both java and cpp that test if pid tolerances are working using fake input output pairs.
Change-Id: I5bf23dbbdab996c582e1035fc2b2f36dd5f52417
This commit is contained in:
@@ -46,7 +46,7 @@ public class PIDTest extends AbstractComsSetup {
|
||||
private NetworkTable table;
|
||||
|
||||
private static final double absoluteTolerance = 50;
|
||||
private static final double outputRange = 0.3;
|
||||
private static final double outputRange = 0.25;
|
||||
|
||||
private PIDController controller = null;
|
||||
private static MotorEncoderFixture me = null;
|
||||
@@ -181,7 +181,7 @@ public class PIDTest extends AbstractComsSetup {
|
||||
public void testRotateToTarget() {
|
||||
setupAbsoluteTolerance();
|
||||
setupOutputRange();
|
||||
double setpoint = 2500.0;
|
||||
double setpoint = 1000.0;
|
||||
assertEquals(pidData() + "did not start at 0", 0, controller.get(), 0);
|
||||
controller.setSetpoint(setpoint);
|
||||
assertEquals(pidData() + "did not have an error of " + setpoint, setpoint,
|
||||
|
||||
Reference in New Issue
Block a user