Make sure turret is ready before taking the shot
Change-Id: I0d06a9389234d35a63bc53954df64cf8de345f3e
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/y2020/control_loops/superstructure/superstructure.cc b/y2020/control_loops/superstructure/superstructure.cc
index b2390ce..72fb1ac 100644
--- a/y2020/control_loops/superstructure/superstructure.cc
+++ b/y2020/control_loops/superstructure/superstructure.cc
@@ -233,7 +233,8 @@
if (unsafe_goal->shooting()) {
if (shooter_.ready() && shooter_.finisher_goal() > 10.0 &&
- shooter_.accelerator_goal() > 10.0) {
+ shooter_.accelerator_goal() > 10.0 &&
+ std::abs(turret_.goal(0) - turret_.position()) < 0.025) {
output_struct.feeder_voltage = 12.0;
}
output_struct.washing_machine_spinner_voltage = 5.0;