Austin Schuh | 87c1063 | 2017-02-05 19:02:17 -0800 | [diff] [blame^] | 1 | #ifndef Y2017_CONTROL_LOOPS_SUPERSTRUCTURE_HOOD_HOOD_H_ |
| 2 | #define Y2017_CONTROL_LOOPS_SUPERSTRUCTURE_HOOD_HOOD_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 hood { |
| 11 | |
| 12 | class Hood { |
| 13 | public: |
| 14 | Hood(); |
| 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::HoodGoal *unsafe_goal, |
| 24 | const ::frc971::PotAndIndexPosition *position, double *output, |
| 25 | ::frc971::control_loops::ProfiledJointStatus *status); |
| 26 | |
| 27 | void Reset(); |
| 28 | |
| 29 | enum class State : int32_t{ |
| 30 | UNINITIALIZED, |
| 31 | DISABLED_INITIALIZED, |
| 32 | ZEROING, |
| 33 | RUNNING, |
| 34 | ESTOP, |
| 35 | }; |
| 36 | |
| 37 | State state() const { return state_; } |
| 38 | |
| 39 | private: |
| 40 | State state_; |
| 41 | |
| 42 | ::frc971::control_loops::SingleDOFProfiledSubsystem<> profiled_subsystem_; |
| 43 | }; |
| 44 | |
| 45 | } // namespace hood |
| 46 | } // namespace superstructure |
| 47 | } // namespace control_loops |
| 48 | } // namespace y2017 |
| 49 | |
| 50 | #endif // Y2017_CONTROL_LOOPS_SUPERSTRUCTURE_HOOD_HOOD_H_ |