Added forwards and backwards flash lights.
Change-Id: I813aeb1f300115e323d32823fbbca7d01a834d00
diff --git a/y2016/control_loops/shooter/shooter.cc b/y2016/control_loops/shooter/shooter.cc
index 0936eea..629b980 100644
--- a/y2016/control_loops/shooter/shooter.cc
+++ b/y2016/control_loops/shooter/shooter.cc
@@ -84,7 +84,17 @@
// Turn the lights on if we are supposed to spin.
if (output) {
- if (::std::abs(goal->angular_velocity) > 0.0 || goal->force_lights_on) {
+ if (::std::abs(goal->angular_velocity) > 0.0) {
+ output->lights_on = true;
+ if (goal->shooting_forwards) {
+ output->forwards_flashlight = true;
+ output->backwards_flashlight = false;
+ } else {
+ output->forwards_flashlight = false;
+ output->backwards_flashlight = true;
+ }
+ }
+ if (goal->force_lights_on) {
output->lights_on = true;
}
}
diff --git a/y2016/control_loops/shooter/shooter.q b/y2016/control_loops/shooter/shooter.q
index b799b5a..0e00a02 100644
--- a/y2016/control_loops/shooter/shooter.q
+++ b/y2016/control_loops/shooter/shooter.q
@@ -31,6 +31,9 @@
// Forces the lights on.
bool force_lights_on;
+
+ // If true, the robot is shooting forwards.
+ bool shooting_forwards;
};
message Position {
@@ -65,6 +68,9 @@
// If true, the lights are on.
bool lights_on;
+
+ bool forwards_flashlight;
+ bool backwards_flashlight;
};
queue Goal goal;