Kill target_selector_hint queue

Use EventLoop instead.

Change-Id: I84f839e6ec247648470c70be234611517dff8f51
diff --git a/y2019/control_loops/drivetrain/BUILD b/y2019/control_loops/drivetrain/BUILD
index 8cfa45e..845575f 100644
--- a/y2019/control_loops/drivetrain/BUILD
+++ b/y2019/control_loops/drivetrain/BUILD
@@ -147,6 +147,7 @@
     srcs = ["target_selector_test.cc"],
     deps = [
         ":target_selector",
+        "//aos/events:shm-event-loop",
         "//aos/testing:googletest",
         "//aos/testing:test_shm",
     ],
diff --git a/y2019/control_loops/drivetrain/target_selector.q b/y2019/control_loops/drivetrain/target_selector.q
index 7ad2013..021bd3a 100644
--- a/y2019/control_loops/drivetrain/target_selector.q
+++ b/y2019/control_loops/drivetrain/target_selector.q
@@ -1,6 +1,7 @@
 package y2019.control_loops.drivetrain;
 
 // A message to provide information to the target selector about what it should
+// The drivetrain listens on ".y2019.control_loops.drivetrain.target_selector_hint"
 message TargetSelectorHint {
   // Which target we should go for:
   // 0 implies no selection, we should just default to whatever.
@@ -9,5 +10,3 @@
   // These should match the SelectionHint enum in target_selector.h.
   uint8_t suggested_target;
 };
-
-queue TargetSelectorHint target_selector_hint;
diff --git a/y2019/control_loops/drivetrain/target_selector_test.cc b/y2019/control_loops/drivetrain/target_selector_test.cc
index aa655e6..966f766 100644
--- a/y2019/control_loops/drivetrain/target_selector_test.cc
+++ b/y2019/control_loops/drivetrain/target_selector_test.cc
@@ -1,5 +1,6 @@
 #include "y2019/control_loops/drivetrain/target_selector.h"
 
+#include "aos/events/shm-event-loop.h"
 #include "aos/testing/test_shm.h"
 #include "gtest/gtest.h"
 #include "y2019/control_loops/superstructure/superstructure.q.h"
@@ -36,15 +37,27 @@
   double expected_radius;
 };
 class TargetSelectorParamTest : public ::testing::TestWithParam<TestParams> {
- protected:
-  virtual void TearDown() override {
-    ::y2019::control_loops::superstructure::superstructure_queue.goal.Clear();
-    ::y2019::control_loops::drivetrain::target_selector_hint.Clear();
-  }
-  ::aos::ShmEventLoop event_loop_;
+ public:
+  TargetSelectorParamTest()
+      : target_selector_hint_sender_(
+            test_event_loop_.MakeSender<
+                ::y2019::control_loops::drivetrain::TargetSelectorHint>(
+                ".y2019.control_loops.drivetrain.target_selector_hint")) {}
 
  private:
   ::aos::testing::TestSharedMemory my_shm_;
+
+ protected:
+  virtual void TearDown() override {
+    ::y2019::control_loops::superstructure::superstructure_queue.goal.Clear();
+  }
+
+  ::aos::ShmEventLoop event_loop_;
+  ::aos::ShmEventLoop test_event_loop_;
+
+  ::aos::Sender<::y2019::control_loops::drivetrain::TargetSelectorHint>
+      target_selector_hint_sender_;
+
 };
 
 TEST_P(TargetSelectorParamTest, ExpectReturn) {
@@ -57,8 +70,7 @@
     ASSERT_TRUE(super_goal.Send());
   }
   {
-    auto hint =
-        ::y2019::control_loops::drivetrain::target_selector_hint.MakeMessage();
+    auto hint = target_selector_hint_sender_.MakeMessage();
     hint->suggested_target = static_cast<int>(GetParam().selection_hint);
     ASSERT_TRUE(hint.Send());
   }
diff --git a/y2019/joystick_reader.cc b/y2019/joystick_reader.cc
index 2108846..58d1c36 100644
--- a/y2019/joystick_reader.cc
+++ b/y2019/joystick_reader.cc
@@ -28,7 +28,6 @@
 #include "y2019/vision.pb.h"
 
 using ::y2019::control_loops::superstructure::superstructure_queue;
-using ::y2019::control_loops::drivetrain::target_selector_hint;
 using ::frc971::control_loops::drivetrain::localizer_control;
 using ::aos::input::driver_station::ButtonLocation;
 using ::aos::input::driver_station::ControlBit;
@@ -141,7 +140,11 @@
             event_loop,
             ::y2019::control_loops::drivetrain::GetDrivetrainConfig(),
             {.run_teleop_in_auto = true,
-             .cancel_auto_button = kCancelAutoMode}) {
+             .cancel_auto_button = kCancelAutoMode}),
+        target_selector_hint_sender_(
+            event_loop->MakeSender<
+                ::y2019::control_loops::drivetrain::TargetSelectorHint>(
+                ".y2019.control_loops.drivetrain.target_selector_hint")) {
     const uint16_t team = ::aos::network::GetTeamNumber();
     superstructure_queue.goal.FetchLatest();
     if (superstructure_queue.goal.get()) {
@@ -176,7 +179,7 @@
     auto new_superstructure_goal = superstructure_queue.goal.MakeMessage();
 
     {
-      auto target_hint = target_selector_hint.MakeMessage();
+      auto target_hint = target_selector_hint_sender_.MakeMessage();
       if (data.IsPressed(kNearCargoHint)) {
         target_hint->suggested_target = 1;
       } else if (data.IsPressed(kMidCargoHint)) {
@@ -495,6 +498,9 @@
     return ::frc971::autonomous::auto_mode->mode;
   }
 
+  ::aos::Sender<::y2019::control_loops::drivetrain::TargetSelectorHint>
+      target_selector_hint_sender_;
+
   // Bool to track if we've been above the deploy position.  Once this bool is
   // set, don't let the stilts retract until we see the platform.
   bool was_above_ = false;