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

Fix PIDSubsystem setSetpoint behavior #4759

Merged
merged 1 commit into from
Dec 3, 2022

Conversation

sciencewhiz
Copy link
Contributor

No longer stores a temporary setpoint in PIDSubsystem, instead immediately sending to PIDController. This fixes an issue where the setpoint didn't take effect until the Subsystem Periodic method ran, and could cause commands to finish early if they were scheduled after the subsystem periodic method ran because it used the old setpoint.

This is similar to #4062 / #4414 for ProfiledPIDSubsystem Fixes wpilibsuite/BetaTest#148

No longer stores a temporary setpoint in PIDSubsystem, instead
immediately sending to PIDController. This fixes an issue where the
setpoint didn't take effect until the Subsystem Periodic method ran, and
could cause commands to finish early if they were scheduled after the
subsystem periodic method ran because it used the old setpoint.

This is similar to wpilibsuite#4062 / wpilibsuite#4414 for ProfiledPIDSubsystem
Fixes wpilibsuite/BetaTest#148
@sciencewhiz sciencewhiz requested a review from a team as a code owner December 3, 2022 16:23
@Starlight220
Copy link
Member

Are there any similar caching issues in the other control algorithm commands/subsystems?

@sciencewhiz
Copy link
Contributor Author

It looks like TrapezoidProfileSubsystem may have the same issue with setGoal, but I don't feel confident enough in how it works to fix and test.

Copy link
Member

@Starlight220 Starlight220 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TrapezoidProfileSubsystem doesn't have this issue, it has no underlying controller (the profile is calculated and followed every iteration, rather similar to ProfiledPID).

@PeterJohnson PeterJohnson merged commit 8f40264 into wpilibsuite:main Dec 3, 2022
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 this pull request may close these issues.

3 participants