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:
Oblarg
2019-11-26 00:46:47 -05:00
committed by Peter Johnson
parent ce3973435e
commit 6dcd2b0e2c
19 changed files with 184 additions and 204 deletions

View File

@@ -24,16 +24,10 @@ class ArmSubsystem : public frc2::ProfiledPIDSubsystem<units::radians> {
void UseOutput(double output, State setpoint) override;
void SetGoal(units::radian_t goal);
State GetGoal() override;
units::radian_t GetMeasurement() override;
private:
frc::PWMVictorSPX m_motor;
frc::Encoder m_encoder;
frc::ArmFeedforward m_feedforward;
State m_goal;
};