[wpimath] PIDController: Add getters for position & velocity tolerances (#4458)

This commit is contained in:
Justin
2022-10-25 19:10:19 -04:00
committed by GitHub
parent 9f36301dc8
commit 2a98d6b5d7
5 changed files with 76 additions and 0 deletions

View File

@@ -174,6 +174,24 @@ public class PIDController implements Sendable, AutoCloseable {
return m_period;
}
/**
* Returns the position tolerance of this controller.
*
* @return the position tolerance of the controller.
*/
public double getPositionTolerance() {
return m_positionTolerance;
}
/**
* Returns the velocity tolerance of this controller.
*
* @return the velocity tolerance of the controller.
*/
public double getVelocityTolerance() {
return m_velocityTolerance;
}
/**
* Sets the setpoint for the PIDController.
*

View File

@@ -131,6 +131,24 @@ public class ProfiledPIDController implements Sendable {
return m_controller.getPeriod();
}
/**
* Returns the position tolerance of this controller.
*
* @return the position tolerance of the controller.
*/
public double getPositionTolerance() {
return m_controller.getPositionTolerance();
}
/**
* Returns the velocity tolerance of this controller.
*
* @return the velocity tolerance of the controller.
*/
public double getVelocityTolerance() {
return m_controller.getVelocityTolerance();
}
/**
* Sets the goal for the ProfiledPIDController.
*