Lights turn on when shooter is on.
Change-Id: I434dc4a3eecd2fc3b96e954831cedaba8d8ee4e4
diff --git a/y2016/control_loops/shooter/shooter.cc b/y2016/control_loops/shooter/shooter.cc
index 2f1ae4a..699903d 100644
--- a/y2016/control_loops/shooter/shooter.cc
+++ b/y2016/control_loops/shooter/shooter.cc
@@ -80,6 +80,13 @@
// Update position/goal for our two shooter sides.
left_.set_goal(goal->angular_velocity);
right_.set_goal(goal->angular_velocity);
+
+ // Turn the lights on if we are supposed to spin.
+ if (output) {
+ if (::std::abs(goal->angular_velocity) > 0.0) {
+ output->lights_on = true;
+ }
+ }
}
left_.set_position(position->theta_left);
diff --git a/y2016/control_loops/shooter/shooter.q b/y2016/control_loops/shooter/shooter.q
index 5559bbb..00149a8 100644
--- a/y2016/control_loops/shooter/shooter.q
+++ b/y2016/control_loops/shooter/shooter.q
@@ -55,6 +55,9 @@
// See comments on the identical fields in Goal for details.
bool clamp_open;
bool push_to_shooter;
+
+ // If true, the lights are on.
+ bool lights_on;
};
queue Goal goal;