blob: 40bddf76d2707001ac6bde44e1f1313010aa2b72 [file] [log] [blame]
Daniel Petti1f448512013-10-19 19:35:55 +00001#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
7namespace bot3 {
8namespace control_loops {
9
10class DrivetrainLoop
Daniel Petti96c1b572013-11-12 05:47:16 +000011 : public aos::control_loops::ControlLoop<control_loops::Drivetrain, false> {
Daniel Petti1f448512013-10-19 19:35:55 +000012 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(
Daniel Petti96c1b572013-11-12 05:47:16 +000016 control_loops::Drivetrain *my_drivetrain = &::bot3::control_loops::drivetrain)
17 : aos::control_loops::ControlLoop<control_loops::Drivetrain, false>(
Daniel Petti1f448512013-10-19 19:35:55 +000018 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_