[commands] Fix PIDSubsystem setSetpoint behavior (#4759)

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 commit is contained in:
sciencewhiz
2022-12-03 11:32:46 -08:00
committed by GitHub
parent f24ad1d715
commit 8f402645f5
3 changed files with 7 additions and 12 deletions

View File

@@ -85,8 +85,5 @@ class PIDSubsystem : public SubsystemBase {
* @param setpoint the setpoint of the PIDController (for feedforward)
*/
virtual void UseOutput(double output, double setpoint) = 0;
private:
double m_setpoint{0};
};
} // namespace frc2