[wpimath] PIDController: Update field and method names for error and errorDerivative (#7088)

This commit is contained in:
Nicholas Armstrong
2024-09-23 13:57:20 -04:00
committed by GitHub
parent 64e5e6db59
commit 6281ec0810
9 changed files with 192 additions and 91 deletions

View File

@@ -208,7 +208,7 @@ public class MotorEncoderTest extends AbstractComsSetup {
assertTrue(
"PID loop did not reach reference within 10 seconds. The current error was"
+ pidController.getPositionError(),
+ pidController.getError(),
pidController.atSetpoint());
}
}
@@ -233,7 +233,7 @@ public class MotorEncoderTest extends AbstractComsSetup {
assertTrue(
"PID loop did not reach reference within 10 seconds. The error was: "
+ pidController.getPositionError(),
+ pidController.getError(),
pidController.atSetpoint());
}
}

View File

@@ -133,7 +133,7 @@ public class PIDTest extends AbstractComsSetup {
assertEquals(
"PID.getPositionError() did not start at " + reference,
reference,
m_controller.getPositionError(),
m_controller.getError(),
0);
m_builder.update();
assertEquals(m_p, m_table.getEntry("Kp").getDouble(9999999), 0);
@@ -160,10 +160,7 @@ public class PIDTest extends AbstractComsSetup {
assertEquals(pidData() + "did not start at 0", 0, me.getMotor().get(), 0);
m_controller.setSetpoint(reference);
assertEquals(
pidData() + "did not have an error of " + reference,
reference,
m_controller.getPositionError(),
0);
pidData() + "did not have an error of " + reference, reference, m_controller.getError(), 0);
Notifier pidRunner =
new Notifier(
() -> me.getMotor().set(m_controller.calculate(me.getEncoder().getDistance())));
@@ -171,7 +168,7 @@ public class PIDTest extends AbstractComsSetup {
Timer.delay(5);
pidRunner.stop();
assertTrue(
pidData() + "Was not on Target. Controller Error: " + m_controller.getPositionError(),
pidData() + "Was not on Target. Controller Error: " + m_controller.getError(),
m_controller.atSetpoint());
pidRunner.close();