mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Improve various subsystem APIs (#2130)
Improves the APIs for various prebuilt subsystems (PIDSubsystem, TrapezoidProfileSubsystem, ProfiledPIDSubsystem). Addresses #2128, and also changes the rather cumbersome getSetpoint API to a more intuitive setSetpoint one. Updates examples to match.
This commit is contained in:
@@ -37,14 +37,7 @@ class Elevator : public frc2::PIDSubsystem {
|
||||
* by
|
||||
* the subsystem.
|
||||
*/
|
||||
void UseOutput(double d) override;
|
||||
|
||||
double GetSetpoint() override;
|
||||
|
||||
/**
|
||||
* Sets the setpoint for the subsystem.
|
||||
*/
|
||||
void SetSetpoint(double setpoint);
|
||||
void UseOutput(double output, double setpoint) override;
|
||||
|
||||
private:
|
||||
frc::PWMVictorSPX m_motor{5};
|
||||
|
||||
@@ -35,14 +35,7 @@ class Wrist : public frc2::PIDSubsystem {
|
||||
* by
|
||||
* the subsystem.
|
||||
*/
|
||||
void UseOutput(double d) override;
|
||||
|
||||
double GetSetpoint() override;
|
||||
|
||||
/**
|
||||
* Sets the setpoint for the subsystem.
|
||||
*/
|
||||
void SetSetpoint(double setpoint);
|
||||
void UseOutput(double output, double setpoint) override;
|
||||
|
||||
private:
|
||||
frc::PWMVictorSPX m_motor{6};
|
||||
|
||||
Reference in New Issue
Block a user