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/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();
}