Adam Snaider | 79900c2 | 2017-02-08 20:23:15 -0800 | [diff] [blame] | 1 | #ifndef Y2017_CONTROL_LOOPS_SUPERSTRUCTURE_INTAKE_INTAKE_H_ |
| 2 | #define Y2017_CONTROL_LOOPS_SUPERSTRUCTURE_INTAKE_INTAKE_H_ |
| 3 | |
| 4 | #include "frc971/control_loops/profiled_subsystem.h" |
| 5 | #include "y2017/control_loops/superstructure/superstructure.q.h" |
| 6 | |
| 7 | namespace y2017 { |
| 8 | namespace control_loops { |
| 9 | namespace superstructure { |
| 10 | namespace intake { |
| 11 | |
| 12 | class Intake { |
| 13 | public: |
| 14 | Intake(); |
| 15 | double goal(int row, int col) const { |
| 16 | return profiled_subsystem_.goal(row, col); |
| 17 | } |
| 18 | |
| 19 | // The zeroing and operating voltages. |
| 20 | static constexpr double kZeroingVoltage = 2.5; |
| 21 | static constexpr double kOperatingVoltage = 12.0; |
| 22 | |
| 23 | void Iterate(const control_loops::IntakeGoal *unsafe_goal, |
| 24 | const ::frc971::PotAndAbsolutePosition *position, |
| 25 | double *output, |
| 26 | ::frc971::control_loops::AbsoluteProfiledJointStatus *status); |
| 27 | |
| 28 | void Reset(); |
| 29 | |
| 30 | enum class State : int32_t{ |
| 31 | UNINITIALIZED, |
| 32 | DISABLED_INITIALIZED, |
| 33 | ZEROING, |
| 34 | RUNNING, |
| 35 | ESTOP, |
| 36 | }; |
| 37 | |
| 38 | State state() const { return state_; } |
| 39 | |
| 40 | private: |
| 41 | State state_; |
| 42 | |
| 43 | ::frc971::control_loops::SingleDOFProfiledSubsystem< |
| 44 | ::frc971::zeroing::PotAndAbsEncoderZeroingEstimator> |
| 45 | profiled_subsystem_; |
| 46 | }; |
| 47 | |
| 48 | } // namespace intake |
| 49 | } // namespace superstructure |
| 50 | } // namespace control_loops |
| 51 | } // namespace y2017 |
| 52 | |
| 53 | #endif // Y2017_CONTROL_LOOPS_SUPERSTRUCTURE_INTAKE_INTAKE_H_ |