Daniel Petti | 1f44851 | 2013-10-19 19:35:55 +0000 | [diff] [blame] | 1 | #ifndef BOT3_CONTROL_LOOPS_DRIVETRAIN_H_ |
| 2 | #define BOT3_CONTROL_LOOPS_DRIVETRAIN_H_ |
| 3 | |
| 4 | #include "aos/common/control_loop/ControlLoop.h" |
| 5 | #include "bot3/control_loops/drivetrain/drivetrain.q.h" |
| 6 | |
| 7 | namespace bot3 { |
| 8 | namespace control_loops { |
| 9 | |
| 10 | class DrivetrainLoop |
| 11 | : public aos::control_loops::ControlLoop<control_loops::Drivetrain> { |
| 12 | public: |
| 13 | // Constructs a control loop which can take a Drivetrain or defaults to the |
| 14 | // drivetrain at frc971::control_loops::drivetrain |
| 15 | explicit DrivetrainLoop( |
| 16 | control_loops::Drivetrain *my_drivetrain = &control_loops::drivetrain) |
| 17 | : aos::control_loops::ControlLoop<control_loops::Drivetrain>( |
| 18 | my_drivetrain) {} |
| 19 | |
| 20 | protected: |
| 21 | // Executes one cycle of the control loop. |
| 22 | virtual void RunIteration( |
| 23 | const control_loops::Drivetrain::Goal *goal, |
| 24 | const control_loops::Drivetrain::Position *position, |
| 25 | control_loops::Drivetrain::Output *output, |
| 26 | control_loops::Drivetrain::Status *status); |
| 27 | }; |
| 28 | |
| 29 | } // namespace control_loops |
| 30 | } // namespace bot3 |
| 31 | |
| 32 | #endif // BOT3_CONTROL_LOOPS_DRIVETRAIN_H_ |