blob: 51bab219f69e430dadb726e214795a0794c884c1 [file] [log] [blame]
Austin Schuh6d1ee0c2015-11-21 14:36:04 -08001#include "y2015_bot3/control_loops/intake/intake.h"
Comran Morshedfab32002015-08-30 14:48:54 +00002
Austin Schuh6d1ee0c2015-11-21 14:36:04 -08003#include "y2015_bot3/control_loops/intake/intake.q.h"
Comran Morshedfab32002015-08-30 14:48:54 +00004
Austin Schuh6d1ee0c2015-11-21 14:36:04 -08005namespace y2015_bot3 {
Comran Morshedfab32002015-08-30 14:48:54 +00006namespace control_loops {
7
8Intake::Intake(control_loops::IntakeQueue *intake)
9 : aos::controls::ControlLoop<control_loops::IntakeQueue>(intake) {}
10
11void Intake::RunIteration(
12 const control_loops::IntakeQueue::Goal *goal,
13 const control_loops::IntakeQueue::Position * /*position*/,
14 control_loops::IntakeQueue::Output *output,
15 control_loops::IntakeQueue::Status * /*status*/) {
Comran Morshedfab32002015-08-30 14:48:54 +000016 if (output != nullptr) {
17 output->Zero();
18
Austin Schuh40855b02015-09-28 00:34:24 +000019 if (goal != nullptr) {
20 output->intake = goal->movement;
21 output->claw_closed = goal->claw_closed;
22 } else {
23 output->intake = 0.0;
24 output->claw_closed = false;
25 }
Comran Morshedfab32002015-08-30 14:48:54 +000026 }
27}
28
29} // namespace control_loops
Austin Schuh6d1ee0c2015-11-21 14:36:04 -080030} // namespace y2015_bot3