mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user