Add timeout and backpower to ball preloading

A timeout to continue preserializing after a request
and backpowering to prevent accidental shots.

Change-Id: I7e6975bf2493562811fc14ecfcd6a91c0d0f2860
Signed-off-by: Ravago Jones <ravagojones@gmail.com>
diff --git a/y2020/control_loops/superstructure/superstructure.cc b/y2020/control_loops/superstructure/superstructure.cc
index 4d446ee..b2390ce 100644
--- a/y2020/control_loops/superstructure/superstructure.cc
+++ b/y2020/control_loops/superstructure/superstructure.cc
@@ -213,10 +213,22 @@
     output_struct.feeder_voltage = 0.0;
     output_struct.intake_roller_voltage = 0.0;
     if (unsafe_goal) {
-      if ((unsafe_goal->shooting() || unsafe_goal->intake_preloading()) &&
+      if (unsafe_goal->shooting() || unsafe_goal->intake_preloading()) {
+        preloading_timeout_ = position_timestamp + kPreloadingTimeout;
+      }
+
+      if (position_timestamp <= preloading_timeout_ &&
           !position->intake_beambreak_triggered()) {
         output_struct.washing_machine_spinner_voltage = 5.0;
         output_struct.feeder_voltage = 12.0;
+
+        preloading_backpower_timeout_ =
+            position_timestamp + kPreloadingBackpowerDuration;
+      }
+
+      if (position->intake_beambreak_triggered() &&
+          position_timestamp <= preloading_backpower_timeout_) {
+        output_struct.feeder_voltage = -12.0;
       }
 
       if (unsafe_goal->shooting()) {