Move aos/controls to frc971/control_loops

Also put what was aos/controls/control_loops.fbs in y2012/control_loops
because that's the only user.

Change-Id: I8f402b0708103077e135a41e55ef5e4f23681d87
Signed-off-by: James Kuszmaul <jabukuszmaul@gmail.com>
diff --git a/y2016/control_loops/superstructure/BUILD b/y2016/control_loops/superstructure/BUILD
index cb07ebe..b4c26d9 100644
--- a/y2016/control_loops/superstructure/BUILD
+++ b/y2016/control_loops/superstructure/BUILD
@@ -114,7 +114,7 @@
         ":superstructure_position_fbs",
         ":superstructure_status_fbs",
         "//aos:math",
-        "//aos/controls:control_loop",
+        "//frc971/control_loops:control_loop",
         "//aos/util:trapezoid_profile",
         "//frc971/control_loops:profiled_subsystem",
         "//frc971/control_loops:simple_capped_state_feedback_loop",
@@ -139,7 +139,7 @@
         ":superstructure_position_fbs",
         ":superstructure_status_fbs",
         "//aos:math",
-        "//aos/controls:control_loop_test",
+        "//frc971/control_loops:control_loop_test",
         "//aos/testing:googletest",
         "//aos/time",
         "//frc971/control_loops:position_sensor_sim",
diff --git a/y2016/control_loops/superstructure/superstructure.cc b/y2016/control_loops/superstructure/superstructure.cc
index 8f4d02e..3ee7730 100644
--- a/y2016/control_loops/superstructure/superstructure.cc
+++ b/y2016/control_loops/superstructure/superstructure.cc
@@ -2,14 +2,12 @@
 
 #include "aos/commonmath.h"
 #include "aos/logging/logging.h"
-
+#include "y2016/constants.h"
 #include "y2016/control_loops/superstructure/integral_arm_plant.h"
 #include "y2016/control_loops/superstructure/integral_intake_plant.h"
 #include "y2016/control_loops/superstructure/superstructure_controls.h"
 #include "y2016/queues/ball_detector_generated.h"
 
-#include "y2016/constants.h"
-
 namespace y2016 {
 namespace control_loops {
 namespace superstructure {
@@ -207,9 +205,9 @@
 
   // The wrist must go back to zero when the shoulder is moving the arm into
   // a stowed/intaking position.
-  if (shoulder_angle <
-          CollisionAvoidance::kMinShoulderAngleForHorizontalShooter &&
-      ::std::abs(wrist_angle) > kMaxWristAngleForSafeArmStowing) {
+  if (shoulder_angle<CollisionAvoidance::kMinShoulderAngleForHorizontalShooter
+                         && ::std::abs(wrist_angle)>
+          kMaxWristAngleForSafeArmStowing) {
     AOS_LOG(DEBUG, "Collided: Shoulder %f < %f and wrist |%f| > %f.\n",
             shoulder_angle,
             CollisionAvoidance::kMinShoulderAngleForHorizontalShooter,
@@ -228,8 +226,8 @@
 
 Superstructure::Superstructure(::aos::EventLoop *event_loop,
                                const ::std::string &name)
-    : aos::controls::ControlLoop<Goal, Position, Status, Output>(event_loop,
-                                                                 name),
+    : frc971::controls::ControlLoop<Goal, Position, Status, Output>(event_loop,
+                                                                    name),
       ball_detector_fetcher_(
           event_loop->MakeFetcher<::y2016::sensors::BallDetector>(
               "/superstructure")),
@@ -287,11 +285,10 @@
   }
 }
 
-void Superstructure::RunIteration(
-    const Goal *unsafe_goal,
-    const Position *position,
-    aos::Sender<Output>::Builder *output,
-    aos::Sender<Status>::Builder *status) {
+void Superstructure::RunIteration(const Goal *unsafe_goal,
+                                  const Position *position,
+                                  aos::Sender<Output>::Builder *output,
+                                  aos::Sender<Status>::Builder *status) {
   const State state_before_switch = state_;
   if (WasReset()) {
     AOS_LOG(ERROR, "WPILib reset, restarting\n");
@@ -727,9 +724,10 @@
 
       // Intake.
       if (unsafe_goal->force_intake() || !ball_detected) {
-        output_struct.voltage_top_rollers = ::std::max(
-            -kMaxIntakeTopVoltage,
-            ::std::min(unsafe_goal->voltage_top_rollers(), kMaxIntakeTopVoltage));
+        output_struct.voltage_top_rollers =
+            ::std::max(-kMaxIntakeTopVoltage,
+                       ::std::min(unsafe_goal->voltage_top_rollers(),
+                                  kMaxIntakeTopVoltage));
         output_struct.voltage_bottom_rollers =
             ::std::max(-kMaxIntakeBottomVoltage,
                        ::std::min(unsafe_goal->voltage_bottom_rollers(),
diff --git a/y2016/control_loops/superstructure/superstructure.h b/y2016/control_loops/superstructure/superstructure.h
index 2219c95..48da666 100644
--- a/y2016/control_loops/superstructure/superstructure.h
+++ b/y2016/control_loops/superstructure/superstructure.h
@@ -3,10 +3,9 @@
 
 #include <memory>
 
-#include "aos/controls/control_loop.h"
+#include "frc971/control_loops/control_loop.h"
 #include "aos/util/trapezoid_profile.h"
 #include "frc971/control_loops/state_feedback_loop.h"
-
 #include "frc971/zeroing/zeroing.h"
 #include "y2016/control_loops/superstructure/superstructure_controls.h"
 #include "y2016/control_loops/superstructure/superstructure_goal_generated.h"
@@ -108,7 +107,7 @@
 };
 
 class Superstructure
-    : public ::aos::controls::ControlLoop<Goal, Position, Status, Output> {
+    : public ::frc971::controls::ControlLoop<Goal, Position, Status, Output> {
  public:
   explicit Superstructure(::aos::EventLoop *event_loop,
                           const ::std::string &name = "/superstructure");
diff --git a/y2016/control_loops/superstructure/superstructure_controls.cc b/y2016/control_loops/superstructure/superstructure_controls.cc
index 269089b..d16c73c 100644
--- a/y2016/control_loops/superstructure/superstructure_controls.cc
+++ b/y2016/control_loops/superstructure/superstructure_controls.cc
@@ -1,11 +1,9 @@
 #include "y2016/control_loops/superstructure/superstructure_controls.h"
 
 #include "aos/logging/logging.h"
-
-#include "y2016/control_loops/superstructure/integral_intake_plant.h"
-#include "y2016/control_loops/superstructure/integral_arm_plant.h"
-
 #include "y2016/constants.h"
+#include "y2016/control_loops/superstructure/integral_arm_plant.h"
+#include "y2016/control_loops/superstructure/integral_intake_plant.h"
 
 namespace y2016 {
 namespace control_loops {
@@ -45,8 +43,8 @@
                 constants::GetValues().shoulder.zeroing),
             ::frc971::zeroing::PotAndIndexPulseZeroingEstimator(
                 constants::GetValues().wrist.zeroing)}}),
-      shoulder_profile_(::aos::controls::kLoopFrequency),
-      wrist_profile_(::aos::controls::kLoopFrequency) {
+      shoulder_profile_(::frc971::controls::kLoopFrequency),
+      wrist_profile_(::frc971::controls::kLoopFrequency) {
   Y_.setZero();
   offset_.setZero();
   AdjustProfile(0.0, 0.0, 0.0, 0.0);
diff --git a/y2016/control_loops/superstructure/superstructure_controls.h b/y2016/control_loops/superstructure/superstructure_controls.h
index d301054..a73883b 100644
--- a/y2016/control_loops/superstructure/superstructure_controls.h
+++ b/y2016/control_loops/superstructure/superstructure_controls.h
@@ -3,7 +3,7 @@
 
 #include <memory>
 
-#include "aos/controls/control_loop.h"
+#include "frc971/control_loops/control_loop.h"
 #include "aos/util/trapezoid_profile.h"
 #include "frc971/control_loops/profiled_subsystem.h"
 #include "frc971/control_loops/simple_capped_state_feedback_loop.h"
diff --git a/y2016/control_loops/superstructure/superstructure_lib_test.cc b/y2016/control_loops/superstructure/superstructure_lib_test.cc
index 24bc187..49ae033 100644
--- a/y2016/control_loops/superstructure/superstructure_lib_test.cc
+++ b/y2016/control_loops/superstructure/superstructure_lib_test.cc
@@ -1,25 +1,23 @@
-#include "y2016/control_loops/superstructure/superstructure.h"
-
 #include <unistd.h>
 
 #include <chrono>
 #include <memory>
 
 #include "aos/commonmath.h"
-#include "aos/controls/control_loop_test.h"
 #include "aos/time/time.h"
+#include "frc971/control_loops/control_loop_test.h"
 #include "frc971/control_loops/position_sensor_sim.h"
 #include "frc971/control_loops/team_number_test_environment.h"
 #include "gtest/gtest.h"
+#include "y2016/constants.h"
 #include "y2016/control_loops/superstructure/arm_plant.h"
 #include "y2016/control_loops/superstructure/intake_plant.h"
+#include "y2016/control_loops/superstructure/superstructure.h"
 #include "y2016/control_loops/superstructure/superstructure_goal_generated.h"
 #include "y2016/control_loops/superstructure/superstructure_output_generated.h"
 #include "y2016/control_loops/superstructure/superstructure_position_generated.h"
 #include "y2016/control_loops/superstructure/superstructure_status_generated.h"
 
-#include "y2016/constants.h"
-
 using ::frc971::control_loops::PositionSensorSimulator;
 
 namespace y2016 {
@@ -350,10 +348,10 @@
   double peak_wrist_velocity_ = 1e10;
 };
 
-class SuperstructureTest : public ::aos::testing::ControlLoopTest {
+class SuperstructureTest : public ::frc971::testing::ControlLoopTest {
  protected:
   SuperstructureTest()
-      : ::aos::testing::ControlLoopTest(
+      : ::frc971::testing::ControlLoopTest(
             aos::configuration::ReadConfig("y2016/config.json"),
             chrono::microseconds(5000)),
         test_event_loop_(MakeEventLoop("test")),