2019-08-25 23:55:59 -04:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
|
|
|
|
|
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
|
|
|
|
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
|
|
|
|
/* the project. */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <frc/Encoder.h>
|
|
|
|
|
#include <frc/PWMVictorSPX.h>
|
2019-11-26 00:46:47 -05:00
|
|
|
#include <frc/controller/SimpleMotorFeedforward.h>
|
2019-08-26 23:11:07 -07:00
|
|
|
#include <frc2/command/PIDSubsystem.h>
|
2019-11-26 00:46:47 -05:00
|
|
|
#include <units/units.h>
|
2019-08-25 23:55:59 -04:00
|
|
|
|
|
|
|
|
class ShooterSubsystem : public frc2::PIDSubsystem {
|
|
|
|
|
public:
|
|
|
|
|
ShooterSubsystem();
|
|
|
|
|
|
2019-11-26 00:46:47 -05:00
|
|
|
void UseOutput(double output, double setpoint) override;
|
2019-08-25 23:55:59 -04:00
|
|
|
|
|
|
|
|
double GetMeasurement() override;
|
|
|
|
|
|
|
|
|
|
bool AtSetpoint();
|
|
|
|
|
|
|
|
|
|
void RunFeeder();
|
|
|
|
|
|
|
|
|
|
void StopFeeder();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
frc::PWMVictorSPX m_shooterMotor;
|
|
|
|
|
frc::PWMVictorSPX m_feederMotor;
|
|
|
|
|
frc::Encoder m_shooterEncoder;
|
2019-11-26 00:46:47 -05:00
|
|
|
frc::SimpleMotorFeedforward<units::turns> m_shooterFeedforward;
|
2019-08-25 23:55:59 -04:00
|
|
|
};
|