brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 1 | #ifndef FRC971_CONTROL_LOOPS_DRIVETRAIN_H_ |
| 2 | #define FRC971_CONTROL_LOOPS_DRIVETRAIN_H_ |
| 3 | |
| 4 | #include "aos/common/control_loop/ControlLoop.h" |
James Kuszmaul | f254c1a | 2013-03-10 16:31:26 -0700 | [diff] [blame] | 5 | #include "frc971/control_loops/drivetrain/drivetrain.q.h" |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 6 | |
| 7 | namespace frc971 { |
| 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 frc971 |
| 31 | |
| 32 | #endif // FRC971_CONTROL_LOOPS_DRIVETRAIN_H_ |