Ben Fredrickson | 6b5ba79 | 2015-01-25 17:14:40 -0800 | [diff] [blame] | 1 | #ifndef FRC971_CONTROL_LOOPS_FRIDGE_H_ |
| 2 | #define FRC971_CONTROL_LOOPS_FRIDGE_H_ |
| 3 | |
| 4 | #include <memory> |
| 5 | |
| 6 | #include "aos/common/controls/control_loop.h" |
| 7 | #include "frc971/control_loops/state_feedback_loop.h" |
| 8 | #include "frc971/control_loops/fridge/fridge.q.h" |
| 9 | #include "frc971/control_loops/fridge/arm_motor_plant.h" |
| 10 | #include "frc971/control_loops/fridge/elevator_motor_plant.h" |
| 11 | |
| 12 | namespace frc971 { |
| 13 | namespace control_loops { |
| 14 | |
| 15 | class Fridge |
| 16 | : public aos::controls::ControlLoop<control_loops::FridgeQueue> { |
| 17 | public: |
| 18 | explicit Fridge( |
| 19 | control_loops::FridgeQueue *fridge_queue = &control_loops::fridge_queue); |
| 20 | |
| 21 | // Control loop time step. |
| 22 | // Please figure out how to set dt from a common location |
| 23 | // Please decide the correct value |
| 24 | // Please use dt in your implementation so we can change looptimnig |
| 25 | // and be consistent with legacy |
| 26 | // And Brian please approve my code review as people are wait on |
| 27 | // these files to exist and they will be rewritten anyway |
| 28 | //static constexpr double dt; |
| 29 | |
| 30 | protected: |
| 31 | virtual void RunIteration( |
| 32 | const control_loops::FridgeQueue::Goal *goal, |
| 33 | const control_loops::FridgeQueue::Position *position, |
| 34 | control_loops::FridgeQueue::Output *output, |
| 35 | control_loops::FridgeQueue::Status *status); |
| 36 | |
| 37 | private: |
| 38 | // The state feedback control loop or loops to talk to. |
Austin Schuh | 1a38796 | 2015-01-31 16:36:20 -0800 | [diff] [blame] | 39 | ::std::unique_ptr<StateFeedbackLoop<4, 2, 2>> arm_loop_; |
| 40 | ::std::unique_ptr<StateFeedbackLoop<4, 2, 2>> elev_loop_; |
Ben Fredrickson | 6b5ba79 | 2015-01-25 17:14:40 -0800 | [diff] [blame] | 41 | }; |
| 42 | |
| 43 | } // namespace control_loops |
| 44 | } // namespace frc971 |
| 45 | |
| 46 | #endif // FRC971_CONTROL_LOOPS_FRIDGE_H_ |
| 47 | |