diff --git a/aos/crio/controls/ControlsManager.cpp b/aos/crio/controls/ControlsManager.cpp
new file mode 100644
index 0000000..a37ec6f
--- /dev/null
+++ b/aos/crio/controls/ControlsManager.cpp
@@ -0,0 +1,53 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "WPILib/Compressor.h"
+
+#include "aos/aos_core.h"
+#include "aos/crio/controls/ControlsManager.h"
+#include "aos/common/Configuration.h"
+#include "aos/crio/aos_ctdt.h"
+#include "aos/crio/motor_server/CRIOControlLoopRunner.h"
+#include "aos/crio/motor_server/MotorServer.h"
+
+namespace aos {
+namespace crio {
+
+// Everything gets an explicit Start call here before calling all of the init
+// functions because it means that all static variables will be initialized
+// before anything actually starts running. It also means that everything will
+// be initialized before any of the init functions start trying to register
+// themselves etc.
+void ControlsManager::StartCompetition() {
+  printf("aos::ControlsManager::RobotMain\n");
+  (new Compressor(14, 1))->Start();
+
+  logging::Start();
+  LOG(INFO, "logging started\n");
+
+  GetWatchdog().SetEnabled(false);
+  LOG(INFO, "disabled watchdog\n");
+
+  RegisterControlLoops();
+  LOG(INFO, "registered control loops\n");
+
+  // CRIOControlLoopRunner calls part of MotorServer, so MotorServer has to get
+  // initialized first.
+  MotorServer::Start();
+  LOG(INFO, "MotorServer started\n");
+  CRIOControlLoopRunner::Start();
+  LOG(INFO, "cRIO control loops started\n");
+
+  LOG(INFO, "calling init functions\n");
+  aos_call_init_functions();
+  LOG(INFO, "initialized\n");
+
+  // Wait forever so that this task doesn't end to avoid confusing any brittle
+  // FIRST code that might be hiding somewhere.
+  while (true) {
+    select(0, NULL, NULL, NULL, NULL);
+  }
+}
+
+}  // namespace crio
+} // namespace aos
diff --git a/aos/crio/controls/ControlsManager.h b/aos/crio/controls/ControlsManager.h
new file mode 100644
index 0000000..986fe02
--- /dev/null
+++ b/aos/crio/controls/ControlsManager.h
@@ -0,0 +1,21 @@
+#include "WPILib/DriverStation.h"
+#include "WPILib/RobotBase.h"
+
+namespace aos {
+namespace crio {
+
+class ControlsManager : public RobotBase {
+ public:
+  // Gets called when it is time to register all the control loops.
+  virtual void RegisterControlLoops() = 0;
+  virtual void StartCompetition();
+  static inline ControlsManager &GetInstance() {
+    return *static_cast<ControlsManager *>(&RobotBase::getInstance());
+  }
+  inline DriverStation *GetDS() {
+    return m_ds;
+  }
+};
+
+}  // namespace crio
+}  // namespace aos
diff --git a/aos/crio/controls/JoyStickRead.cpp b/aos/crio/controls/JoyStickRead.cpp
new file mode 100644
index 0000000..1f5e4c7
--- /dev/null
+++ b/aos/crio/controls/JoyStickRead.cpp
@@ -0,0 +1,91 @@
+#include "WPILib/Task.h"
+#include "WPILib/Timer.h"
+
+#include "aos/aos_core.h"
+#include "aos/crio/controls/ControlsManager.h"
+#include "aos/common/network/SendSocket.h"
+#include "aos/common/messages/RobotState.q.h"
+
+namespace aos {
+namespace crio {
+
+class JoystickRead {
+  /*virtual void Disabled () {
+    int i = 0;
+    while (IsDisabled()) {
+    printf("Disabled! %d\n", i);
+    Wait(0.1);
+    i++;
+    }
+    printf("Done with disabled. %d\n", i);
+    }
+    virtual void Autonomous () {
+    int j = 0;
+    while (IsAutonomous()) {
+    printf("Autonomous!  %d\n", j);
+    Wait(0.1);
+  //if (j > 5) {
+  //i(0);
+  //}
+  j ++;
+  }
+  printf("Done with autonomous. %d\n", j);
+  }
+  virtual void OperatorControl () {
+  int i = 0;
+  while (IsOperatorControl()) {
+  printf("Operator Control!  %d\n", i);
+  Wait(0.1);
+  i ++;
+  }
+  printf("Done with operator control. %d\n", i);
+  }*/
+ public:
+  DriverStation *ds;
+  JoystickRead() {}
+  void Run() {
+    SendSocket sock(NetworkPort::kDS,
+                    configuration::GetIPAddress(
+                        configuration::NetworkDevice::kAtom));
+    FRCCommonControlData data;
+
+    ds = ControlsManager::GetInstance().GetDS();
+
+    while (true) {
+      // I checked, and this is done intelligently in WPILib.
+      ds->WaitForData();
+
+      robot_state.MakeWithBuilder().enabled(ds->IsEnabled())
+          .autonomous(ds->IsAutonomous()).team_id(ds->GetTeamNumber()).Send();
+      LOG(DEBUG, "sending joystick data\n");
+      data.enabled = ds->IsEnabled();
+      data.autonomous = ds->IsAutonomous();
+      data.fmsAttached = ds->IsFMSAttached();
+      SetStick(data.stick0Axes, 1);
+      SetStick(data.stick1Axes, 2);
+      SetStick(data.stick2Axes, 3);
+      SetStick(data.stick3Axes, 4);
+      data.stick0Buttons = ds->GetStickButtons(1);
+      data.stick1Buttons = ds->GetStickButtons(2);
+      data.stick2Buttons = ds->GetStickButtons(3);
+      data.stick3Buttons = ds->GetStickButtons(4);
+      data.teamID = ds->GetTeamNumber();
+      sock.Send(&data, sizeof(data));
+    }
+  }
+  void SetStick(int8_t axes[6], uint32_t stick) {
+    for (int i = 0; i < 6; ++i) {
+      double val = ds->GetStickAxis(stick, i + 1);
+      if (val < 0) {
+        axes[i] = (val * 128.0) + 0.5;
+      } else {
+        axes[i] = (val * 127.0) + 0.5;
+      }
+    }
+  }
+};
+
+}  // namespace crio
+}  // namespace aos
+
+AOS_RUN_FORK(aos::crio::JoystickRead, "JSR", 100)
