Make starter actually start on the roboRIO
Some of the commands run need to actually run as root. Make sure you
are root for those.
We also were missing channels, and some channels needed to be bigger.
Change-Id: I33b474bc51be01558cc4675a0b1c4510beb2c0a3
diff --git a/frc971/wpilib/wpilib_robot_base.h b/frc971/wpilib/wpilib_robot_base.h
index e34e3ad..33a17bc 100644
--- a/frc971/wpilib/wpilib_robot_base.h
+++ b/frc971/wpilib/wpilib_robot_base.h
@@ -48,18 +48,19 @@
class WPILibAdapterRobot : public frc::RobotBase {
public:
void StartCompetition() override {
+ PCHECK(setuid(0) == 0) << ": Failed to change user to root";
// 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);
+ PCHECK(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);
+ PCHECK(system("/sbin/sysctl -w kernel.sched_rt_period_us=1000000") == 0);
+ PCHECK(system("/sbin/sysctl -w kernel.sched_rt_runtime_us=950000") == 0);
robot_.Run();
}
diff --git a/y2020/y2020_laptop.json b/y2020/y2020_laptop.json
index bb835c0..9ebac58 100644
--- a/y2020/y2020_laptop.json
+++ b/y2020/y2020_laptop.json
@@ -106,7 +106,7 @@
"source_node": "laptop",
"frequency": 50,
"num_senders": 20,
- "max_size": 2048
+ "max_size": 4096
},
{
"name": "/laptop/aos",
diff --git a/y2020/y2020_pi_template.json b/y2020/y2020_pi_template.json
index b504599..db1de5e 100644
--- a/y2020/y2020_pi_template.json
+++ b/y2020/y2020_pi_template.json
@@ -7,7 +7,7 @@
"source_node": "pi{{ NUM }}",
"frequency": 50,
"num_senders": 20,
- "max_size": 2048
+ "max_size": 4096
},
{
"name": "/pi{{ NUM }}/aos",
@@ -18,6 +18,20 @@
},
{
"name": "/pi{{ NUM }}/aos",
+ "type": "aos.starter.Status",
+ "source_node": "pi{{ NUM }}",
+ "frequency": 50,
+ "num_senders": 20
+ },
+ {
+ "name": "/pi{{ NUM }}/aos",
+ "type": "aos.starter.StarterRpc",
+ "source_node": "pi{{ NUM }}",
+ "frequency": 10,
+ "num_senders": 2
+ },
+ {
+ "name": "/pi{{ NUM }}/aos",
"type": "aos.message_bridge.ServerStatistics",
"source_node": "pi{{ NUM }}",
"frequency": 2,
diff --git a/y2020/y2020_roborio.json b/y2020/y2020_roborio.json
index d463848..ec559d5 100644
--- a/y2020/y2020_roborio.json
+++ b/y2020/y2020_roborio.json
@@ -19,7 +19,7 @@
"source_node": "roborio",
"frequency": 50,
"num_senders": 20,
- "max_size": 2048
+ "max_size": 4096
},
{
"name": "/roborio/aos",
@@ -30,6 +30,20 @@
},
{
"name": "/roborio/aos",
+ "type": "aos.starter.Status",
+ "source_node": "roborio",
+ "frequency": 50,
+ "num_senders": 20
+ },
+ {
+ "name": "/roborio/aos",
+ "type": "aos.starter.StarterRpc",
+ "source_node": "roborio",
+ "frequency": 10,
+ "num_senders": 2
+ },
+ {
+ "name": "/roborio/aos",
"type": "aos.message_bridge.ServerStatistics",
"source_node": "roborio",
"frequency": 2,