Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame^] | 1 | #ifndef FRC971_CONTROL_LOOPS_WRIST_H_ |
| 2 | #define FRC971_CONTROL_LOOPS_WRIST_H_ |
| 3 | |
| 4 | #include <memory> |
| 5 | |
| 6 | #include "aos/common/control_loop/ControlLoop.h" |
| 7 | #include "frc971/control_loops/state_feedback_loop.h" |
| 8 | #include "frc971/control_loops/wrist_motor.q.h" |
| 9 | #include "frc971/control_loops/wrist_motor_plant.h" |
| 10 | |
| 11 | namespace frc971 { |
| 12 | namespace control_loops { |
| 13 | |
| 14 | class WristMotor |
| 15 | : public aos::control_loops::ControlLoop<control_loops::WristLoop> { |
| 16 | public: |
| 17 | explicit WristMotor( |
| 18 | control_loops::WristLoop *my_wrist = &control_loops::wrist); |
| 19 | |
| 20 | protected: |
| 21 | virtual void RunIteration( |
| 22 | const ::aos::control_loops::Goal *goal, |
| 23 | const control_loops::WristLoop::Position *position, |
| 24 | ::aos::control_loops::Output *output, |
| 25 | ::aos::control_loops::Status *status); |
| 26 | |
| 27 | private: |
| 28 | ::std::unique_ptr<StateFeedbackLoop<2, 1, 1>> loop_; |
| 29 | bool stop_; |
| 30 | int error_count_; |
| 31 | bool zeroed_; |
| 32 | double zero_offset_; |
| 33 | }; |
| 34 | |
| 35 | } // namespace control_loops |
| 36 | } // namespace frc971 |
| 37 | |
| 38 | #endif // FRC971_CONTROL_LOOPS_WRIST_H_ |