Simplify aos::Init

Most of the variants were to deal with core, which has been gone for a
year.  Simplify those all into InitGoogle.

InitGoogle should be renamed to Init at some point.  It does everything
now.

Change-Id: I738ee03e9c5b2e6348ef33302835f915df68011f
diff --git a/frc971/wpilib/ahal/RobotBase.h b/frc971/wpilib/ahal/RobotBase.h
index cf1ed4c..5b4ce5b 100644
--- a/frc971/wpilib/ahal/RobotBase.h
+++ b/frc971/wpilib/ahal/RobotBase.h
@@ -19,20 +19,6 @@
 
 class DriverStation;
 
-#ifdef WPILIB2017
-#define START_ROBOT_CLASS(_ClassName_)                                       \
-  int main() {                                                               \
-    if (!HAL_Initialize(0)) {                                                \
-      std::cerr << "FATAL ERROR: HAL could not be initialized" << std::endl; \
-      return -1;                                                             \
-    }                                                                        \
-    HAL_Report(HALUsageReporting::kResourceType_Language,                    \
-               HALUsageReporting::kLanguage_CPlusPlus);                      \
-    static _ClassName_ robot;                                                \
-    std::printf("\n********** Robot program starting **********\n");         \
-    robot.StartCompetition();                                                \
-  }
-#else
 #define START_ROBOT_CLASS(_ClassName_)                                       \
   int main(int argc, char *argv[]) {                                         \
     aos::InitGoogle(&argc, &argv);                                           \
@@ -50,7 +36,6 @@
     std::printf("\n********** Robot program starting **********\n");         \
     robot.StartCompetition();                                                \
   }
-#endif
 
 /**
  * Implement a Robot Program framework.
diff --git a/frc971/wpilib/joystick_sender.cc b/frc971/wpilib/joystick_sender.cc
index d31d4a5..a4634bf 100644
--- a/frc971/wpilib/joystick_sender.cc
+++ b/frc971/wpilib/joystick_sender.cc
@@ -19,7 +19,7 @@
       joystick_state_sender_(
           event_loop_->MakeSender<::aos::JoystickState>("/aos")),
       team_id_(::aos::network::GetTeamNumber()) {
-  event_loop_->SetRuntimeRealtimePriority(29);
+  event_loop_->SetRuntimeRealtimePriority(28);
   event_loop->set_name("joystick_sender");
 
   event_loop_->OnRun([this]() {
diff --git a/frc971/wpilib/wpilib_robot_base.h b/frc971/wpilib/wpilib_robot_base.h
index 3404bb8..e34e3ad 100644
--- a/frc971/wpilib/wpilib_robot_base.h
+++ b/frc971/wpilib/wpilib_robot_base.h
@@ -48,7 +48,18 @@
 class WPILibAdapterRobot : public frc::RobotBase {
  public:
   void StartCompetition() override {
-    ::aos::InitNRT();
+    // Just allow overcommit memory like usual. Various processes map memory
+    // they will never use, and the roboRIO doesn't have enough RAM to handle
+    // it. This is in here instead of starter.sh because starter.sh doesn't run
+    // with permissions on a roboRIO.
+    AOS_CHECK(system("echo 0 > /proc/sys/vm/overcommit_memory") == 0);
+
+    // Configure throttling so we reserve 5% of the CPU for non-rt work.
+    // This makes things significantly more stable when work explodes.
+    // This is in here instead of starter.sh for the same reasons, starter is
+    // suid and runs as admin, so this actually works.
+    AOS_CHECK(system("/sbin/sysctl -w kernel.sched_rt_period_us=1000000") == 0);
+    AOS_CHECK(system("/sbin/sysctl -w kernel.sched_rt_runtime_us=950000") == 0);
 
     robot_.Run();
   }