Skip to content

Commit

Permalink
[wpimath] PIDController::Calculate(double, double): update setpoint f…
Browse files Browse the repository at this point in the history
…lag (#5021)

Fixes #5020.
  • Loading branch information
calcmogul authored Jan 29, 2023
1 parent 49bb135 commit 8bf67b1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ public double getVelocityError() {
*/
public double calculate(double measurement, double setpoint) {
m_setpoint = setpoint;
m_haveSetpoint = true;
return calculate(measurement);
}

Expand Down
1 change: 1 addition & 0 deletions wpimath/src/main/native/cpp/controller/PIDController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ double PIDController::Calculate(double measurement) {

double PIDController::Calculate(double measurement, double setpoint) {
m_setpoint = setpoint;
m_haveSetpoint = true;
return Calculate(measurement);
}

Expand Down

0 comments on commit 8bf67b1

Please sign in to comment.