Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIDCommand: getController().atSetpoint() returns false #5020

Closed
ka930 opened this issue Jan 28, 2023 · 1 comment · Fixed by #5021
Closed

PIDCommand: getController().atSetpoint() returns false #5020

ka930 opened this issue Jan 28, 2023 · 1 comment · Fixed by #5021

Comments

@ka930
Copy link

ka930 commented Jan 28, 2023

In a PIDCommand (created similarly to the example), using getController().atSetpoint() returns false, even if the error is below the tolerance.
This seems to be because PIDCommand uses calculate(measurement, setpoint) to set the setpoint, instead of setSetpoint.
However, the calculate method doesn't actually set m_haveSetPoint to true, so atSetPoint continues to return false (m_haveSetPoint is still false).
This was probably caused by 1e05b21.

@srimanachanta
Copy link
Contributor

Yes, I was having this issue too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants