mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[wpimath] Add getAccumulatedError() to PIDController (#6813)
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user