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/aos/events/BUILD b/aos/events/BUILD
index b4c2385..c408b7b 100644
--- a/aos/events/BUILD
+++ b/aos/events/BUILD
@@ -234,6 +234,7 @@
":event_loop_fbs",
":test_message_fbs",
":timing_statistics",
+ "//aos:init",
"//aos:realtime",
"//aos/ipc_lib:lockless_queue",
"//aos/ipc_lib:signalfd",
@@ -311,6 +312,7 @@
":aos_logging",
":event_loop",
":simple_channel",
+ "//aos:init",
"//aos:realtime",
"//aos/events/logging:logger_fbs",
"//aos/ipc_lib:index",
diff --git a/aos/events/shm_event_loop.cc b/aos/events/shm_event_loop.cc
index 6e152cc..fed5f4c 100644
--- a/aos/events/shm_event_loop.cc
+++ b/aos/events/shm_event_loop.cc
@@ -17,6 +17,7 @@
#include "aos/events/epoll.h"
#include "aos/events/event_loop_generated.h"
#include "aos/events/timing_statistics.h"
+#include "aos/init.h"
#include "aos/ipc_lib/lockless_queue.h"
#include "aos/ipc_lib/signalfd.h"
#include "aos/realtime.h"
@@ -225,6 +226,7 @@
shm_base_(FLAGS_shm_base),
name_(FLAGS_application_name),
node_(MaybeMyNode(configuration)) {
+ CHECK(IsInitialized()) << ": Need to initialize AOS first.";
if (configuration->has_nodes()) {
CHECK(node_ != nullptr) << ": Couldn't find node in config.";
}
diff --git a/aos/events/simulated_event_loop.cc b/aos/events/simulated_event_loop.cc
index bc15643..0b919e4 100644
--- a/aos/events/simulated_event_loop.cc
+++ b/aos/events/simulated_event_loop.cc
@@ -8,6 +8,7 @@
#include "absl/container/btree_map.h"
#include "aos/events/aos_logging.h"
#include "aos/events/simulated_network_bridge.h"
+#include "aos/init.h"
#include "aos/json_to_flatbuffer.h"
#include "aos/realtime.h"
#include "aos/util/phased_loop.h"
@@ -969,6 +970,7 @@
const Configuration *configuration)
: configuration_(CHECK_NOTNULL(configuration)),
nodes_(configuration::GetNodes(configuration_)) {
+ CHECK(IsInitialized()) << ": Need to initialize AOS first.";
for (const Node *node : nodes_) {
node_factories_.emplace_back(new NodeEventLoopFactory(
&scheduler_scheduler_, this, node, &raw_event_loops_));
diff --git a/aos/init.cc b/aos/init.cc
index 71eeabd..b4036a3 100644
--- a/aos/init.cc
+++ b/aos/init.cc
@@ -9,101 +9,33 @@
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
-#include <stdint.h>
-#include <sys/prctl.h>
-#include <malloc.h>
-#include "aos/die.h"
-#include "aos/logging/implementations.h"
#include "aos/realtime.h"
-
-namespace FLAG__namespace_do_not_use_directly_use_DECLARE_double_instead {
-extern double FLAGS_tcmalloc_release_rate __attribute__((weak));
-}
-using FLAG__namespace_do_not_use_directly_use_DECLARE_double_instead::
- FLAGS_tcmalloc_release_rate;
+#include "gflags/gflags.h"
+#include "glog/logging.h"
DEFINE_bool(coredump, false, "If true, write core dumps on failure.");
namespace aos {
-namespace logging {
-namespace internal {
-
-// Implemented in aos/logging/context.cc.
-void ReloadThreadName();
-
-} // namespace internal
-} // namespace logging
namespace {
-
-// Common stuff that needs to happen at the beginning of both the realtime and
-// non-realtime initialization sequences. May be called twice.
-void InitStart() {
- RegisterMallocHook();
- if (FLAGS_coredump) {
- WriteCoreDumps();
- }
- google::InstallFailureSignalHandler();
-}
-
-const char *const kNoRealtimeEnvironmentVariable = "AOS_NO_REALTIME";
-
-bool ShouldBeRealtime() {
- return getenv(kNoRealtimeEnvironmentVariable) == nullptr;
-}
-
+bool initialized = false;
} // namespace
+bool IsInitialized() { return initialized; }
+
void InitGoogle(int *argc, char ***argv) {
+ CHECK(!IsInitialized()) << "Only initialize once.";
FLAGS_logtostderr = true;
google::InitGoogleLogging((*argv)[0]);
gflags::ParseCommandLineFlags(argc, argv, true);
google::InstallFailureSignalHandler();
- RegisterMallocHook();
-}
-
-void InitNRT() {
- InitStart();
- ExpandStackSize();
-}
-
-void InitCreate() {
- InitStart();
- AOS_LOG(INFO, "%s created shm\n", program_invocation_short_name);
-}
-
-void Init(int relative_priority) {
- InitStart();
- GoRT(relative_priority);
-}
-
-void GoRT(int relative_priority) {
- if (ShouldBeRealtime()) {
- InitRT();
-
- // Set our process to the appropriate priority.
- struct sched_param param;
- param.sched_priority = 30 + relative_priority;
- if (sched_setscheduler(0, SCHED_FIFO, ¶m) != 0) {
- PDie("%s-init: setting SCHED_FIFO failed", program_invocation_short_name);
- }
- } else {
- fprintf(stderr,
- "%s not doing realtime initialization because environment"
- " variable %s is set\n",
- program_invocation_short_name, kNoRealtimeEnvironmentVariable);
- printf("no realtime for %s. see stderr\n", program_invocation_short_name);
+ if (FLAGS_coredump) {
+ WriteCoreDumps();
}
- AOS_LOG(INFO, "%s initialized realtime\n", program_invocation_short_name);
-}
-
-void PinCurrentThreadToCPU(int number) {
- cpu_set_t cpuset;
- CPU_ZERO(&cpuset);
- CPU_SET(number, &cpuset);
- AOS_PRCHECK(pthread_setaffinity_np(pthread_self(), sizeof(cpuset), &cpuset));
+ RegisterMallocHook();
+ initialized = true;
}
} // namespace aos
diff --git a/aos/init.h b/aos/init.h
index 98bc266..1e2b7a4 100644
--- a/aos/init.h
+++ b/aos/init.h
@@ -1,34 +1,14 @@
#ifndef AOS_INIT_H_
#define AOS_INIT_H_
-#include <string>
-
namespace aos {
-// TODO(james): Clean up/unify the various init functions.
-
-// Initializes glog and gflags.
+// Initializes AOS.
void InitGoogle(int *argc, char ***argv);
-// In order to use shared memory, one of the Init* functions must be called in
-// exactly 1 thread per process. It is OK to keep going without calling one of
-// them again after fork(2)ing.
-
-// Does the non-realtime parts of the initialization process.
-void InitNRT();
-// Initializes everything, including the realtime stuff.
-// relative_priority adjusts the priority of this process relative to all of the
-// other ones (positive for higher priority).
-void Init(int relative_priority = 0);
-// Same as InitNRT, except will remove an existing shared memory file and create
-// a new one.
-void InitCreate();
-
-// Performs the realtime parts of initialization after InitNRT() has been called.
-void GoRT(int relative_priority = 0);
-
-// Pins the current thread to CPU #number.
-void PinCurrentThreadToCPU(int number);
+// Returns true if we have been initialized. This is mostly here so
+// ShmEventLoop can confirm the world was initialized before running.
+bool IsInitialized();
} // namespace aos
diff --git a/aos/input/joystick_input.h b/aos/input/joystick_input.h
index 7a6e8c3..aceda52 100644
--- a/aos/input/joystick_input.h
+++ b/aos/input/joystick_input.h
@@ -22,7 +22,7 @@
"/aos", [this](const ::aos::JoystickState &joystick_state) {
this->HandleData(&joystick_state);
});
- event_loop->SetRuntimeRealtimePriority(29);
+ event_loop->SetRuntimeRealtimePriority(28);
}
protected:
diff --git a/aos/ipc_lib/eventfd_latency.cc b/aos/ipc_lib/eventfd_latency.cc
index d146c13..47f6528 100644
--- a/aos/ipc_lib/eventfd_latency.cc
+++ b/aos/ipc_lib/eventfd_latency.cc
@@ -43,7 +43,13 @@
// Sleep between 1 and 15 ms.
::std::uniform_int_distribution<> distribution(1000, 15000);
- PinCurrentThreadToCPU(FLAGS_core);
+ {
+ cpu_set_t cpuset;
+ CPU_ZERO(&cpuset);
+ CPU_SET(FLAGS_core, &cpuset);
+
+ SetCurrentThreadAffinity(cpuset);
+ }
SetCurrentThreadRealtimePriority(FLAGS_sender_priority);
while (true) {
const monotonic_clock::time_point wakeup_time =
@@ -117,7 +123,13 @@
}
});
- PinCurrentThreadToCPU(FLAGS_core);
+ {
+ cpu_set_t cpuset;
+ CPU_ZERO(&cpuset);
+ CPU_SET(FLAGS_core, &cpuset);
+
+ SetCurrentThreadAffinity(cpuset);
+ }
SetCurrentThreadRealtimePriority(FLAGS_receiver_priority);
epoll.Run();
UnsetCurrentThreadRealtimePriority();
diff --git a/aos/ipc_lib/futex_latency.cc b/aos/ipc_lib/futex_latency.cc
index ef27e29..3d609f8 100644
--- a/aos/ipc_lib/futex_latency.cc
+++ b/aos/ipc_lib/futex_latency.cc
@@ -54,7 +54,13 @@
// Sleep between 1 and 15 ms.
::std::uniform_int_distribution<> distribution(1000, 15000);
- PinCurrentThreadToCPU(FLAGS_core);
+ {
+ cpu_set_t cpuset;
+ CPU_ZERO(&cpuset);
+ CPU_SET(FLAGS_core, &cpuset);
+
+ SetCurrentThreadAffinity(cpuset);
+ }
SetCurrentThreadRealtimePriority(FLAGS_sender_priority);
while (true) {
const monotonic_clock::time_point wakeup_time =
@@ -91,7 +97,13 @@
chrono::nanoseconds sum_latency = chrono::nanoseconds(0);
int latency_count = 0;
- PinCurrentThreadToCPU(FLAGS_core);
+ {
+ cpu_set_t cpuset;
+ CPU_ZERO(&cpuset);
+ CPU_SET(FLAGS_core, &cpuset);
+
+ SetCurrentThreadAffinity(cpuset);
+ }
SetCurrentThreadRealtimePriority(FLAGS_receiver_priority);
while (true) {
chrono::nanoseconds wakeup_latency;
diff --git a/aos/ipc_lib/ipc_comparison.cc b/aos/ipc_lib/ipc_comparison.cc
index 6435ee7..f5614a6 100644
--- a/aos/ipc_lib/ipc_comparison.cc
+++ b/aos/ipc_lib/ipc_comparison.cc
@@ -811,7 +811,13 @@
if (FLAGS_server_priority > 0) {
SetCurrentThreadRealtimePriority(FLAGS_server_priority);
}
- PinCurrentThreadToCPU(FLAGS_server_cpu);
+ {
+ cpu_set_t cpuset;
+ CPU_ZERO(&cpuset);
+ CPU_SET(FLAGS_server_cpu, &cpuset);
+
+ SetCurrentThreadAffinity(cpuset);
+ }
while (!done) {
const PingPongerInterface::Data *data = ping_ponger->Wait();
@@ -826,7 +832,13 @@
if (FLAGS_client_priority > 0) {
SetCurrentThreadRealtimePriority(FLAGS_client_priority);
}
- PinCurrentThreadToCPU(FLAGS_client_cpu);
+ {
+ cpu_set_t cpuset;
+ CPU_ZERO(&cpuset);
+ CPU_SET(FLAGS_client_cpu, &cpuset);
+
+ SetCurrentThreadAffinity(cpuset);
+ }
// Warm everything up.
for (int i = 0; i < 1000; ++i) {
@@ -899,9 +911,7 @@
"\ttcp\n"
"\ttcp_nodelay\n"
"\tudp\n");
- ::gflags::ParseCommandLineFlags(&argc, &argv, true);
-
- ::aos::InitNRT();
+ ::aos::InitGoogle(&argc, &argv);
return ::aos::Main(argc, argv);
}
diff --git a/aos/ipc_lib/named_pipe_latency.cc b/aos/ipc_lib/named_pipe_latency.cc
index 2bd24f3..030852c 100644
--- a/aos/ipc_lib/named_pipe_latency.cc
+++ b/aos/ipc_lib/named_pipe_latency.cc
@@ -47,7 +47,13 @@
// Sleep between 1 and 15 ms.
::std::uniform_int_distribution<> distribution(1000, 15000);
- PinCurrentThreadToCPU(FLAGS_core);
+ {
+ cpu_set_t cpuset;
+ CPU_ZERO(&cpuset);
+ CPU_SET(FLAGS_core, &cpuset);
+
+ SetCurrentThreadAffinity(cpuset);
+ }
SetCurrentThreadRealtimePriority(FLAGS_sender_priority);
while (true) {
const monotonic_clock::time_point wakeup_time =
@@ -125,7 +131,13 @@
}
});
- PinCurrentThreadToCPU(FLAGS_core);
+ {
+ cpu_set_t cpuset;
+ CPU_ZERO(&cpuset);
+ CPU_SET(FLAGS_core, &cpuset);
+
+ SetCurrentThreadAffinity(cpuset);
+ }
SetCurrentThreadRealtimePriority(FLAGS_receiver_priority);
epoll.Run();
UnsetCurrentThreadRealtimePriority();
diff --git a/aos/ipc_lib/signal_stress.cc b/aos/ipc_lib/signal_stress.cc
index 60243fd..a9fdb94 100644
--- a/aos/ipc_lib/signal_stress.cc
+++ b/aos/ipc_lib/signal_stress.cc
@@ -56,7 +56,13 @@
}
AOS_LOG(INFO, "Current PID: %d\n", pid);
- PinCurrentThreadToCPU(FLAGS_core);
+ {
+ cpu_set_t cpuset;
+ CPU_ZERO(&cpuset);
+ CPU_SET(FLAGS_core, &cpuset);
+
+ SetCurrentThreadAffinity(cpuset);
+ }
SetCurrentThreadRealtimePriority(FLAGS_sender_priority);
while (true) {
const monotonic_clock::time_point wakeup_time =
@@ -145,7 +151,13 @@
}
});
- PinCurrentThreadToCPU(FLAGS_core);
+ {
+ cpu_set_t cpuset;
+ CPU_ZERO(&cpuset);
+ CPU_SET(FLAGS_core, &cpuset);
+
+ SetCurrentThreadAffinity(cpuset);
+ }
SetCurrentThreadRealtimePriority(FLAGS_receiver_priority);
epoll.Run();
UnsetCurrentThreadRealtimePriority();
diff --git a/aos/network/web_proxy_main.cc b/aos/network/web_proxy_main.cc
index 2d8b97b..78528ea 100644
--- a/aos/network/web_proxy_main.cc
+++ b/aos/network/web_proxy_main.cc
@@ -17,8 +17,6 @@
// Make sure to reference this to force the linker to include it.
findEmbeddedContent("");
- aos::InitNRT();
-
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig(FLAGS_config);
diff --git a/aos/realtime.h b/aos/realtime.h
index bb5ea84..c695add 100644
--- a/aos/realtime.h
+++ b/aos/realtime.h
@@ -13,20 +13,6 @@
// your thread RT. Called as part of ShmEventLoop::Run()
void InitRT();
-// Sets the current thread back down to non-realtime priority.
-void UnsetCurrentThreadRealtimePriority();
-
-// Sets the name of the current thread.
-// This will displayed by `top -H`, dump_rtprio, and show up in logs.
-// name can have a maximum of 16 characters.
-void SetCurrentThreadName(const std::string_view name);
-
-// Sets the current thread's realtime priority.
-void SetCurrentThreadRealtimePriority(int priority);
-
-// Sets the current thread's scheduling affinity.
-void SetCurrentThreadAffinity(const cpu_set_t &cpuset);
-
// Sets up this process to write core dump files.
// This is called by Init*, but it's here for other files that want this
// behavior without calling Init*.
@@ -36,6 +22,23 @@
void ExpandStackSize();
+// Sets the name of the current thread.
+// This will displayed by `top -H`, dump_rtprio, and show up in logs.
+// name can have a maximum of 16 characters.
+void SetCurrentThreadName(const std::string_view name);
+
+// Sets the current thread's scheduling affinity.
+void SetCurrentThreadAffinity(const cpu_set_t &cpuset);
+
+// Everything below here needs AOS to be initialized before it will work
+// properly.
+
+// Sets the current thread's realtime priority.
+void SetCurrentThreadRealtimePriority(int priority);
+
+// Sets the current thread back down to non-realtime priority.
+void UnsetCurrentThreadRealtimePriority();
+
// Registers our hooks which crash on RT malloc.
void RegisterMallocHook();
diff --git a/aos/starter/starter.cc b/aos/starter/starter.cc
index 9e149c0..340bbeb 100644
--- a/aos/starter/starter.cc
+++ b/aos/starter/starter.cc
@@ -770,9 +770,6 @@
// This is the callback for when core creates the file indicating that it has
// started.
void Run() {
- // It's safe now because core is up.
- aos::InitNRT();
-
std::ifstream list_file(child_list_file);
while (true) {
@@ -806,6 +803,8 @@
} // namespace aos
int main(int argc, char *argv[]) {
+ ::aos::InitGoogle(&argc, &argv);
+
if (argc != 2) {
aos::starter::PrintHelp();
exit(EXIT_FAILURE);
diff --git a/aos/starter/starter_cmd.cc b/aos/starter/starter_cmd.cc
index abc2816..d076afc 100644
--- a/aos/starter/starter_cmd.cc
+++ b/aos/starter/starter_cmd.cc
@@ -16,7 +16,6 @@
int main(int argc, char **argv) {
aos::InitGoogle(&argc, &argv);
- aos::InitNRT();
CHECK(argc == 3) << "Invalid number of command arguments";
diff --git a/frc971/analysis/py_log_reader.cc b/frc971/analysis/py_log_reader.cc
index e8843a9..8d3e2a6 100644
--- a/frc971/analysis/py_log_reader.cc
+++ b/frc971/analysis/py_log_reader.cc
@@ -13,11 +13,13 @@
#include <Python.h>
#include <memory>
+#include <errno.h>
#include "aos/configuration.h"
#include "aos/events/logging/logger.h"
#include "aos/events/simulated_event_loop.h"
#include "aos/flatbuffer_merge.h"
+#include "aos/init.h"
#include "aos/json_to_flatbuffer.h"
namespace frc971 {
@@ -75,6 +77,15 @@
}
int LogReader_init(LogReaderType *self, PyObject *args, PyObject *kwds) {
+ int count = 1;
+ if (!aos::IsInitialized()) {
+ // Fake out argc and argv to let InitGoogle run properly to instrument
+ // malloc, setup glog, and such.
+ char *name = program_invocation_name;
+ char **argv = &name;
+ aos::InitGoogle(&count, &argv);
+ }
+
const char *kwlist[] = {"log_file_name", nullptr};
const char *log_file_name;
diff --git a/frc971/autonomous/base_autonomous_actor.cc b/frc971/autonomous/base_autonomous_actor.cc
index 27b63cc..7df6998 100644
--- a/frc971/autonomous/base_autonomous_actor.cc
+++ b/frc971/autonomous/base_autonomous_actor.cc
@@ -36,7 +36,9 @@
drivetrain_status_fetcher_(
event_loop->MakeFetcher<drivetrain::Status>("/drivetrain")),
drivetrain_goal_fetcher_(
- event_loop->MakeFetcher<drivetrain::Goal>("/drivetrain")) {}
+ event_loop->MakeFetcher<drivetrain::Goal>("/drivetrain")) {
+ event_loop->SetRuntimeRealtimePriority(29);
+}
void BaseAutonomousActor::ResetDrivetrain() {
AOS_LOG(INFO, "resetting the drivetrain\n");
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();
}
diff --git a/y2012/control_loops/accessories/accessories.cc b/y2012/control_loops/accessories/accessories.cc
index 4618b48..5627c7b 100644
--- a/y2012/control_loops/accessories/accessories.cc
+++ b/y2012/control_loops/accessories/accessories.cc
@@ -46,8 +46,8 @@
} // namespace control_loops
} // namespace y2012
-int main() {
- ::aos::InitNRT();
+int main(int argc, char **argv) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2012/control_loops/drivetrain/drivetrain_main.cc b/y2012/control_loops/drivetrain/drivetrain_main.cc
index 3bc9dce..050f00e 100644
--- a/y2012/control_loops/drivetrain/drivetrain_main.cc
+++ b/y2012/control_loops/drivetrain/drivetrain_main.cc
@@ -6,8 +6,8 @@
using ::frc971::control_loops::drivetrain::DrivetrainLoop;
-int main() {
- ::aos::InitNRT();
+int main(int argc, char **argv) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2012/joystick_reader.cc b/y2012/joystick_reader.cc
index a40d148..e723fa4 100644
--- a/y2012/joystick_reader.cc
+++ b/y2012/joystick_reader.cc
@@ -151,8 +151,8 @@
} // namespace input
} // namespace y2012
-int main() {
- ::aos::InitNRT();
+int main(int argc, char **argv) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2014/actors/autonomous_actor_main.cc b/y2014/actors/autonomous_actor_main.cc
index 524c8f8..871933b 100644
--- a/y2014/actors/autonomous_actor_main.cc
+++ b/y2014/actors/autonomous_actor_main.cc
@@ -4,8 +4,8 @@
#include "aos/init.h"
#include "y2014/actors/autonomous_actor.h"
-int main(int /*argc*/, char * /*argv*/ []) {
- ::aos::Init(-1);
+int main(int argc, char *argv[]) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2014/actors/shoot_actor.cc b/y2014/actors/shoot_actor.cc
index 58df186..095a972 100644
--- a/y2014/actors/shoot_actor.cc
+++ b/y2014/actors/shoot_actor.cc
@@ -35,7 +35,9 @@
"/shooter")),
shooter_goal_sender_(
event_loop->MakeSender<::y2014::control_loops::shooter::Goal>(
- "/shooter")) {}
+ "/shooter")) {
+ event_loop->SetRuntimeRealtimePriority(29);
+}
double ShootActor::SpeedToAngleOffset(double speed) {
const constants::Values &values = constants::GetValues();
diff --git a/y2014/actors/shoot_actor_main.cc b/y2014/actors/shoot_actor_main.cc
index 9ae0f9d..a28e9a2 100644
--- a/y2014/actors/shoot_actor_main.cc
+++ b/y2014/actors/shoot_actor_main.cc
@@ -4,8 +4,8 @@
#include "aos/init.h"
#include "y2014/actors/shoot_actor.h"
-int main(int /*argc*/, char * /*argv*/[]) {
- ::aos::Init(-1);
+int main(int argc, char *argv[]) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2014/control_loops/claw/claw_main.cc b/y2014/control_loops/claw/claw_main.cc
index 94936b5..4cffa44 100644
--- a/y2014/control_loops/claw/claw_main.cc
+++ b/y2014/control_loops/claw/claw_main.cc
@@ -3,8 +3,8 @@
#include "aos/events/shm_event_loop.h"
#include "aos/init.h"
-int main() {
- ::aos::InitNRT();
+int main(int argc, char **argv) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2014/control_loops/drivetrain/drivetrain_main.cc b/y2014/control_loops/drivetrain/drivetrain_main.cc
index c208738..8367ec1 100644
--- a/y2014/control_loops/drivetrain/drivetrain_main.cc
+++ b/y2014/control_loops/drivetrain/drivetrain_main.cc
@@ -6,8 +6,8 @@
using ::frc971::control_loops::drivetrain::DrivetrainLoop;
-int main() {
- ::aos::InitNRT();
+int main(int argc, char **argv) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2014/control_loops/shooter/shooter_main.cc b/y2014/control_loops/shooter/shooter_main.cc
index 88c40d0..be3fd41 100644
--- a/y2014/control_loops/shooter/shooter_main.cc
+++ b/y2014/control_loops/shooter/shooter_main.cc
@@ -3,8 +3,8 @@
#include "aos/events/shm_event_loop.h"
#include "aos/init.h"
-int main() {
- ::aos::InitNRT();
+int main(int argc, char **argv) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2014/hot_goal_reader.cc b/y2014/hot_goal_reader.cc
index 8eb4efb..68ee071 100644
--- a/y2014/hot_goal_reader.cc
+++ b/y2014/hot_goal_reader.cc
@@ -13,8 +13,8 @@
#include "aos/time/time.h"
#include "y2014/queues/hot_goal_generated.h"
-int main() {
- ::aos::InitNRT();
+int main(int argc, char **argv) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2014/joystick_reader.cc b/y2014/joystick_reader.cc
index f903270..136f65a 100644
--- a/y2014/joystick_reader.cc
+++ b/y2014/joystick_reader.cc
@@ -443,8 +443,8 @@
} // namespace input
} // namespace y2014
-int main() {
- ::aos::InitNRT();
+int main(int argc, char **argv) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2014_bot3/actors/autonomous_actor_main.cc b/y2014_bot3/actors/autonomous_actor_main.cc
index c028cf7..06ff335 100644
--- a/y2014_bot3/actors/autonomous_actor_main.cc
+++ b/y2014_bot3/actors/autonomous_actor_main.cc
@@ -4,8 +4,8 @@
#include "aos/init.h"
#include "y2014_bot3/actors/autonomous_actor.h"
-int main(int /*argc*/, char * /*argv*/ []) {
- ::aos::Init(-1);
+int main(int argc, char *argv[]) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2014_bot3/control_loops/drivetrain/drivetrain_main.cc b/y2014_bot3/control_loops/drivetrain/drivetrain_main.cc
index 3678aa7..1b7bda1 100644
--- a/y2014_bot3/control_loops/drivetrain/drivetrain_main.cc
+++ b/y2014_bot3/control_loops/drivetrain/drivetrain_main.cc
@@ -6,8 +6,8 @@
using ::frc971::control_loops::drivetrain::DrivetrainLoop;
-int main() {
- ::aos::InitNRT();
+int main(int argc, char **argv) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2014_bot3/control_loops/rollers/rollers_main.cc b/y2014_bot3/control_loops/rollers/rollers_main.cc
index 53f2e8f..6caf886 100644
--- a/y2014_bot3/control_loops/rollers/rollers_main.cc
+++ b/y2014_bot3/control_loops/rollers/rollers_main.cc
@@ -3,8 +3,8 @@
#include "aos/events/shm_event_loop.h"
#include "aos/init.h"
-int main() {
- ::aos::InitNRT();
+int main(int argc, char **argv) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2014_bot3/joystick_reader.cc b/y2014_bot3/joystick_reader.cc
index 23b08ea..b2fe9dc 100644
--- a/y2014_bot3/joystick_reader.cc
+++ b/y2014_bot3/joystick_reader.cc
@@ -137,8 +137,8 @@
} // namespace input
} // namespace y2014_bot3
-int main() {
- ::aos::InitNRT();
+int main(int argc, char **argv) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2016/actors/autonomous_actor_main.cc b/y2016/actors/autonomous_actor_main.cc
index 41b4539..b422faf 100644
--- a/y2016/actors/autonomous_actor_main.cc
+++ b/y2016/actors/autonomous_actor_main.cc
@@ -4,8 +4,8 @@
#include "aos/init.h"
#include "y2016/actors/autonomous_actor.h"
-int main(int /*argc*/, char * /*argv*/ []) {
- ::aos::Init(-1);
+int main(int argc, char *argv[]) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2016/actors/superstructure_actor.cc b/y2016/actors/superstructure_actor.cc
index bed7b3a..e193243 100644
--- a/y2016/actors/superstructure_actor.cc
+++ b/y2016/actors/superstructure_actor.cc
@@ -22,7 +22,9 @@
superstructure_status_fetcher_(
event_loop
->MakeFetcher<::y2016::control_loops::superstructure::Status>(
- "/superstructure")) {}
+ "/superstructure")) {
+ event_loop->SetRuntimeRealtimePriority(29);
+}
bool SuperstructureActor::RunAction(
const superstructure_action::SuperstructureActionParams *params) {
diff --git a/y2016/actors/superstructure_actor_main.cc b/y2016/actors/superstructure_actor_main.cc
index 54331c9..4cc65a1 100644
--- a/y2016/actors/superstructure_actor_main.cc
+++ b/y2016/actors/superstructure_actor_main.cc
@@ -4,8 +4,8 @@
#include "aos/init.h"
#include "y2016/actors/superstructure_actor.h"
-int main(int /*argc*/, char* /*argv*/ []) {
- ::aos::Init(-1);
+int main(int argc, char *argv[]) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2016/actors/vision_align_actor.cc b/y2016/actors/vision_align_actor.cc
index 1761a72..56a858c 100644
--- a/y2016/actors/vision_align_actor.cc
+++ b/y2016/actors/vision_align_actor.cc
@@ -23,11 +23,12 @@
: aos::common::actions::ActorBase<vision_align_action::Goal>(
event_loop, "/vision_align_action"),
vision_status_fetcher_(
- event_loop->MakeFetcher<::y2016::vision::VisionStatus>(
- "/vision")),
+ event_loop->MakeFetcher<::y2016::vision::VisionStatus>("/vision")),
drivetrain_goal_sender_(
event_loop->MakeSender<::frc971::control_loops::drivetrain::Goal>(
- "/drivetrain")) {}
+ "/drivetrain")) {
+ event_loop->SetRuntimeRealtimePriority(29);
+}
bool VisionAlignActor::RunAction(
const vision_align_action::VisionAlignActionParams * /*params*/) {
diff --git a/y2016/actors/vision_align_actor_main.cc b/y2016/actors/vision_align_actor_main.cc
index b62fc2d..518b405 100644
--- a/y2016/actors/vision_align_actor_main.cc
+++ b/y2016/actors/vision_align_actor_main.cc
@@ -4,8 +4,8 @@
#include "aos/init.h"
#include "y2016/actors/vision_align_actor.h"
-int main(int /*argc*/, char* /*argv*/ []) {
- ::aos::Init(-1);
+int main(int argc, char *argv[]) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2016/control_loops/drivetrain/drivetrain_main.cc b/y2016/control_loops/drivetrain/drivetrain_main.cc
index ad28119..3c60a63 100644
--- a/y2016/control_loops/drivetrain/drivetrain_main.cc
+++ b/y2016/control_loops/drivetrain/drivetrain_main.cc
@@ -6,8 +6,8 @@
using ::frc971::control_loops::drivetrain::DrivetrainLoop;
-int main() {
- ::aos::InitNRT();
+int main(int argc, char **argv) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2016/control_loops/shooter/shooter_main.cc b/y2016/control_loops/shooter/shooter_main.cc
index 2b045fa..2e47a6f 100644
--- a/y2016/control_loops/shooter/shooter_main.cc
+++ b/y2016/control_loops/shooter/shooter_main.cc
@@ -3,8 +3,8 @@
#include "aos/events/shm_event_loop.h"
#include "aos/init.h"
-int main() {
- ::aos::InitNRT();
+int main(int argc, char **argv) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2016/control_loops/superstructure/superstructure_main.cc b/y2016/control_loops/superstructure/superstructure_main.cc
index 5f2cbb4..ea871f2 100644
--- a/y2016/control_loops/superstructure/superstructure_main.cc
+++ b/y2016/control_loops/superstructure/superstructure_main.cc
@@ -3,8 +3,8 @@
#include "aos/events/shm_event_loop.h"
#include "aos/init.h"
-int main() {
- ::aos::InitNRT();
+int main(int argc, char **argv) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2016/dashboard/dashboard.cc b/y2016/dashboard/dashboard.cc
index ae4f7ed..b16c66e 100644
--- a/y2016/dashboard/dashboard.cc
+++ b/y2016/dashboard/dashboard.cc
@@ -279,11 +279,11 @@
} // namespace dashboard
} // namespace y2016
-int main(int, char *[]) {
+int main(int argc, char **argv) {
// Make sure to reference this to force the linker to include it.
findEmbeddedContent("");
- ::aos::InitNRT();
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2016/joystick_reader.cc b/y2016/joystick_reader.cc
index e81942d..09ff112 100644
--- a/y2016/joystick_reader.cc
+++ b/y2016/joystick_reader.cc
@@ -460,8 +460,8 @@
} // namespace input
} // namespace y2016
-int main() {
- ::aos::InitNRT();
+int main(int argc, char **argv) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2016/vision/target_receiver.cc b/y2016/vision/target_receiver.cc
index 0dd5cb9..cc9f41b 100644
--- a/y2016/vision/target_receiver.cc
+++ b/y2016/vision/target_receiver.cc
@@ -430,7 +430,7 @@
} // namespace vision
} // namespace y2016
-int main(int /*argc*/, char ** /*argv*/) {
- ::aos::InitNRT();
+int main(int argc, char **argv) {
+ ::aos::InitGoogle(&argc, &argv);
::y2016::vision::Main();
}
diff --git a/y2017/actors/autonomous_actor_main.cc b/y2017/actors/autonomous_actor_main.cc
index 116e801..436902c 100644
--- a/y2017/actors/autonomous_actor_main.cc
+++ b/y2017/actors/autonomous_actor_main.cc
@@ -4,8 +4,8 @@
#include "aos/init.h"
#include "y2017/actors/autonomous_actor.h"
-int main(int /*argc*/, char * /*argv*/ []) {
- ::aos::Init(-1);
+int main(int argc, char *argv[]) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2017/control_loops/drivetrain/drivetrain_main.cc b/y2017/control_loops/drivetrain/drivetrain_main.cc
index 7f9a838..444838c 100644
--- a/y2017/control_loops/drivetrain/drivetrain_main.cc
+++ b/y2017/control_loops/drivetrain/drivetrain_main.cc
@@ -6,8 +6,8 @@
using ::frc971::control_loops::drivetrain::DrivetrainLoop;
-int main() {
- ::aos::InitNRT();
+int main(int argc, char **argv) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2017/control_loops/superstructure/superstructure_main.cc b/y2017/control_loops/superstructure/superstructure_main.cc
index 38b750f..1a8627c 100644
--- a/y2017/control_loops/superstructure/superstructure_main.cc
+++ b/y2017/control_loops/superstructure/superstructure_main.cc
@@ -3,8 +3,8 @@
#include "aos/events/shm_event_loop.h"
#include "aos/init.h"
-int main() {
- ::aos::InitNRT();
+int main(int argc, char **argv) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2017/joystick_reader.cc b/y2017/joystick_reader.cc
index a0c20d1..58a3918 100644
--- a/y2017/joystick_reader.cc
+++ b/y2017/joystick_reader.cc
@@ -320,8 +320,8 @@
} // namespace input
} // namespace y2017
-int main() {
- ::aos::InitNRT();
+int main(int argc, char **argv) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2017/vision/target_receiver.cc b/y2017/vision/target_receiver.cc
index e96fba9..84d3428 100644
--- a/y2017/vision/target_receiver.cc
+++ b/y2017/vision/target_receiver.cc
@@ -72,7 +72,7 @@
} // namespace vision
} // namespace y2017
-int main(int /*argc*/, char ** /*argv*/) {
- ::aos::InitNRT();
+int main(int argc, char **argv) {
+ ::aos::InitGoogle(&argc, &argv);
::y2017::vision::Main();
}
diff --git a/y2018/actors/autonomous_actor_main.cc b/y2018/actors/autonomous_actor_main.cc
index e9d775b..bce375c 100644
--- a/y2018/actors/autonomous_actor_main.cc
+++ b/y2018/actors/autonomous_actor_main.cc
@@ -4,8 +4,8 @@
#include "aos/init.h"
#include "y2018/actors/autonomous_actor.h"
-int main(int /*argc*/, char * /*argv*/ []) {
- ::aos::Init(-1);
+int main(int argc, char *argv[]) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2018/control_loops/drivetrain/drivetrain_main.cc b/y2018/control_loops/drivetrain/drivetrain_main.cc
index 59c8c78..ad1d9bd 100644
--- a/y2018/control_loops/drivetrain/drivetrain_main.cc
+++ b/y2018/control_loops/drivetrain/drivetrain_main.cc
@@ -6,8 +6,8 @@
using ::frc971::control_loops::drivetrain::DrivetrainLoop;
-int main() {
- ::aos::InitNRT();
+int main(int argc, char **argv) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2018/control_loops/superstructure/superstructure_main.cc b/y2018/control_loops/superstructure/superstructure_main.cc
index fb2d1e4..25a3448 100644
--- a/y2018/control_loops/superstructure/superstructure_main.cc
+++ b/y2018/control_loops/superstructure/superstructure_main.cc
@@ -3,8 +3,8 @@
#include "aos/events/shm_event_loop.h"
#include "aos/init.h"
-int main() {
- ::aos::InitNRT();
+int main(int argc, char **argv) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2018/joystick_reader.cc b/y2018/joystick_reader.cc
index 91737e3..1f4a495 100644
--- a/y2018/joystick_reader.cc
+++ b/y2018/joystick_reader.cc
@@ -388,8 +388,8 @@
} // namespace input
} // namespace y2018
-int main() {
- ::aos::InitNRT();
+int main(int argc, char **argv) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2018/vision/vision_status.cc b/y2018/vision/vision_status.cc
index fdd6ffe..15daefc 100644
--- a/y2018/vision/vision_status.cc
+++ b/y2018/vision/vision_status.cc
@@ -45,7 +45,7 @@
} // namespace vision
} // namespace y2018
-int main(int /*argc*/, char ** /*argv*/) {
- ::aos::InitNRT();
+int main(int argc, char **argv) {
+ ::aos::InitGoogle(&argc, &argv);
::y2018::vision::Main();
}
diff --git a/y2019/actors/autonomous_actor_main.cc b/y2019/actors/autonomous_actor_main.cc
index 705db28..ec5234b 100644
--- a/y2019/actors/autonomous_actor_main.cc
+++ b/y2019/actors/autonomous_actor_main.cc
@@ -4,8 +4,8 @@
#include "aos/init.h"
#include "y2019/actors/autonomous_actor.h"
-int main(int /*argc*/, char * /*argv*/ []) {
- ::aos::Init(-1);
+int main(int argc, char *argv[]) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2019/control_loops/drivetrain/drivetrain_main.cc b/y2019/control_loops/drivetrain/drivetrain_main.cc
index 53e2bf5..5641d1d 100644
--- a/y2019/control_loops/drivetrain/drivetrain_main.cc
+++ b/y2019/control_loops/drivetrain/drivetrain_main.cc
@@ -7,8 +7,8 @@
using ::frc971::control_loops::drivetrain::DrivetrainLoop;
-int main() {
- ::aos::InitNRT();
+int main(int argc, char **argv) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2019/control_loops/drivetrain/drivetrain_replay.cc b/y2019/control_loops/drivetrain/drivetrain_replay.cc
index 98f3eeb..69cce4f 100644
--- a/y2019/control_loops/drivetrain/drivetrain_replay.cc
+++ b/y2019/control_loops/drivetrain/drivetrain_replay.cc
@@ -23,8 +23,6 @@
aos::network::OverrideTeamNumber(FLAGS_team);
- aos::InitCreate();
-
const aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig(FLAGS_config);
diff --git a/y2019/control_loops/drivetrain/replay_localizer.cc b/y2019/control_loops/drivetrain/replay_localizer.cc
index de28317..3687e3d 100644
--- a/y2019/control_loops/drivetrain/replay_localizer.cc
+++ b/y2019/control_loops/drivetrain/replay_localizer.cc
@@ -398,8 +398,6 @@
::aos::network::OverrideTeamNumber(FLAGS_team);
- ::aos::InitCreate();
-
::y2019::control_loops::drivetrain::LocalizerReplayer replay;
replay.ProcessFile(FLAGS_logfile.c_str());
diff --git a/y2019/control_loops/superstructure/superstructure_main.cc b/y2019/control_loops/superstructure/superstructure_main.cc
index 7a7eff9..c55ac4b 100644
--- a/y2019/control_loops/superstructure/superstructure_main.cc
+++ b/y2019/control_loops/superstructure/superstructure_main.cc
@@ -3,8 +3,8 @@
#include "aos/events/shm_event_loop.h"
#include "aos/init.h"
-int main(int /*argc*/, char * /*argv*/ []) {
- ::aos::InitNRT();
+int main(int argc, char **argv) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2019/joystick_reader.cc b/y2019/joystick_reader.cc
index 5dc75a7..823507d 100644
--- a/y2019/joystick_reader.cc
+++ b/y2019/joystick_reader.cc
@@ -662,8 +662,8 @@
} // namespace input
} // namespace y2019
-int main() {
- ::aos::InitNRT();
+int main(int argc, char **argv) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2019/vision/server/server.cc b/y2019/vision/server/server.cc
index 56aa289..6d436e9 100644
--- a/y2019/vision/server/server.cc
+++ b/y2019/vision/server/server.cc
@@ -280,11 +280,11 @@
} // namespace vision
} // namespace y2019
-int main(int, char *[]) {
+int main(int argc, char **argv) {
// Make sure to reference this to force the linker to include it.
findEmbeddedContent("");
- aos::InitNRT();
+ ::aos::InitGoogle(&argc, &argv);
seasocks::Server server(::std::shared_ptr<seasocks::Logger>(
new ::aos::seasocks::SeasocksLogger(seasocks::Logger::Level::Info)));
diff --git a/y2020/actors/autonomous_actor_main.cc b/y2020/actors/autonomous_actor_main.cc
index b242e05..dcd0133 100644
--- a/y2020/actors/autonomous_actor_main.cc
+++ b/y2020/actors/autonomous_actor_main.cc
@@ -4,8 +4,8 @@
#include "aos/init.h"
#include "y2020/actors/autonomous_actor.h"
-int main(int /*argc*/, char * /*argv*/ []) {
- ::aos::Init(-1);
+int main(int argc, char *argv[]) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2020/control_loops/drivetrain/drivetrain_main.cc b/y2020/control_loops/drivetrain/drivetrain_main.cc
index 38a1b0d..e73c023 100644
--- a/y2020/control_loops/drivetrain/drivetrain_main.cc
+++ b/y2020/control_loops/drivetrain/drivetrain_main.cc
@@ -8,7 +8,6 @@
int main(int argc, char *argv[]) {
::aos::InitGoogle(&argc, &argv);
- ::aos::InitNRT();
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2020/control_loops/drivetrain/drivetrain_replay.cc b/y2020/control_loops/drivetrain/drivetrain_replay.cc
index 0ed57c5..dfd8623 100644
--- a/y2020/control_loops/drivetrain/drivetrain_replay.cc
+++ b/y2020/control_loops/drivetrain/drivetrain_replay.cc
@@ -27,8 +27,6 @@
aos::network::OverrideTeamNumber(FLAGS_team);
- aos::InitCreate();
-
const aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig(FLAGS_config);
diff --git a/y2020/control_loops/superstructure/superstructure_main.cc b/y2020/control_loops/superstructure/superstructure_main.cc
index c0ac956..a9f071d 100644
--- a/y2020/control_loops/superstructure/superstructure_main.cc
+++ b/y2020/control_loops/superstructure/superstructure_main.cc
@@ -3,8 +3,8 @@
#include "aos/events/shm_event_loop.h"
#include "aos/init.h"
-int main(int /*argc*/, char * /*argv*/ []) {
- ::aos::InitNRT();
+int main(int argc, char **argv) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2020/joystick_reader.cc b/y2020/joystick_reader.cc
index 1cd3295..4528298 100644
--- a/y2020/joystick_reader.cc
+++ b/y2020/joystick_reader.cc
@@ -188,8 +188,8 @@
} // namespace input
} // namespace y2020
-int main() {
- ::aos::InitNRT();
+int main(int argc, char **argv) {
+ ::aos::InitGoogle(&argc, &argv);
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2020/setpoint_setter.cc b/y2020/setpoint_setter.cc
index f4aa03a..3f493c9 100644
--- a/y2020/setpoint_setter.cc
+++ b/y2020/setpoint_setter.cc
@@ -7,9 +7,8 @@
DEFINE_double(finisher, 500.0, "Finsher speed");
DEFINE_double(hood, 0.45, "Hood setpoint");
-int main(int argc, char ** argv) {
+int main(int argc, char **argv) {
aos::InitGoogle(&argc, &argv);
- aos::InitNRT();
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");