[wpimath] Add getAccumulatedError() to PIDController (#6813)

This commit is contained in:
Brendan Raykoff
2024-07-21 02:17:13 -04:00
committed by GitHub
parent eda63dc162
commit 45f3e3a069
5 changed files with 40 additions and 0 deletions

View File

@@ -241,6 +241,15 @@ public class PIDController implements Sendable, AutoCloseable {
return m_velocityTolerance;
}
/**
* Returns the accumulated error used in the integral calculation of this controller.
*
* @return The accumulated error of this controller.
*/
public double getAccumulatedError() {
return m_totalError;
}
/**
* Sets the setpoint for the PIDController.
*

View File

@@ -186,6 +186,15 @@ public class ProfiledPIDController implements Sendable {
return m_controller.getVelocityTolerance();
}
/**
* Returns the accumulated error used in the integral calculation of this controller.
*
* @return The accumulated error of this controller.
*/
public double getAccumulatedError() {
return m_controller.getAccumulatedError();
}
/**
* Sets the goal for the ProfiledPIDController.
*