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:
Patrick
2016-01-28 14:25:39 -05:00
parent c6ff69079a
commit 7041cbc5eb
12 changed files with 207 additions and 41 deletions

View File

@@ -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,