mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
[wpimath] PIDController: Add getters for position & velocity tolerances (#4458)
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -68,6 +68,14 @@ units::second_t PIDController::GetPeriod() const {
|
||||
return m_period;
|
||||
}
|
||||
|
||||
double PIDController::GetPositionTolerance() const {
|
||||
return m_positionTolerance;
|
||||
}
|
||||
|
||||
double PIDController::GetVelocityTolerance() const {
|
||||
return m_velocityTolerance;
|
||||
}
|
||||
|
||||
void PIDController::SetSetpoint(double setpoint) {
|
||||
m_setpoint = setpoint;
|
||||
|
||||
|
||||
@@ -101,6 +101,20 @@ class WPILIB_DLLEXPORT PIDController
|
||||
*/
|
||||
units::second_t GetPeriod() const;
|
||||
|
||||
/**
|
||||
* Gets the position tolerance of this controller.
|
||||
*
|
||||
* @return The position tolerance of the controller.
|
||||
*/
|
||||
double GetPositionTolerance() const;
|
||||
|
||||
/**
|
||||
* Gets the velocity tolerance of this controller.
|
||||
*
|
||||
* @return The velocity tolerance of the controller.
|
||||
*/
|
||||
double GetVelocityTolerance() const;
|
||||
|
||||
/**
|
||||
* Sets the setpoint for the PIDController.
|
||||
*
|
||||
|
||||
@@ -131,6 +131,24 @@ class ProfiledPIDController
|
||||
*/
|
||||
units::second_t GetPeriod() const { return m_controller.GetPeriod(); }
|
||||
|
||||
/**
|
||||
* Gets the position tolerance of this controller.
|
||||
*
|
||||
* @return The position tolerance of the controller.
|
||||
*/
|
||||
double GetPositionTolerance() const {
|
||||
return m_controller.GetPositionTolerance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the velocity tolerance of this controller.
|
||||
*
|
||||
* @return The velocity tolerance of the controller.
|
||||
*/
|
||||
double GetVelocityTolerance() const {
|
||||
return m_controller.GetVelocityTolerance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the goal for the ProfiledPIDController.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user