Add rollers control loop.
The rollers are a separate control loop because Austin wanted
Comran to get practice writing them.
This change contains modifications that Comran made to the rollers
control loop. There was a lot of cleaning up and fixing by me
as well.
Change-Id: I3d012fb8a9652c0b85ed27f5d23fe7d63bb977ce
diff --git a/bot3/control_loops/rollers/rollers.h b/bot3/control_loops/rollers/rollers.h
new file mode 100644
index 0000000..f67b372
--- /dev/null
+++ b/bot3/control_loops/rollers/rollers.h
@@ -0,0 +1,33 @@
+#ifndef BOT3_CONTROL_LOOPS_ROLLERS_H_
+#define BOT3_CONTROL_LOOPS_ROLLERS_H_
+
+#include "aos/common/controls/control_loop.h"
+#include "bot3/control_loops/rollers/rollers.q.h"
+
+namespace bot3 {
+namespace control_loops {
+
+class RollersLoop
+ : public aos::controls::ControlLoop<control_loops::Rollers,
+ false, false, true> {
+ public:
+ // Constructs a control loops which can take a rollers or defaults to the
+ // rollers at ::bot3::control_loops::rollers.
+ explicit RollersLoop(
+ control_loops::Rollers *my_rollers = &control_loops::rollers)
+ : aos::controls::ControlLoop<control_loops::Rollers, false, false, true>(
+ my_rollers) {}
+
+ protected:
+ // Executes one cycle of the control loop.
+ virtual void RunIteration(
+ const control_loops::Rollers::Goal *goal,
+ const control_loops::Rollers::Position *position,
+ control_loops::Rollers::Output *output,
+ control_loops::Rollers::Status *status);
+};
+
+} // namespace control_loops
+} // namespace bot3
+
+#endif // BOT3_CONTROL_LOOPS_ROLLERS_H_