Move core/RT configuration for imu to y2022 main

This lets us share the 2022 and 2023 IMU userspace code.

Change-Id: I1c7b648b78b677932745ab669e1b332eaffb3b38
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/y2022/localizer/imu_main.cc b/y2022/localizer/imu_main.cc
index 5bdab41..53811ea 100644
--- a/y2022/localizer/imu_main.cc
+++ b/y2022/localizer/imu_main.cc
@@ -1,5 +1,6 @@
 #include "aos/events/shm_event_loop.h"
 #include "aos/init.h"
+#include "aos/realtime.h"
 #include "y2022/localizer/imu.h"
 
 DEFINE_string(config, "aos_config.json", "Path to the config file to use.");
@@ -10,9 +11,14 @@
   aos::FlatbufferDetachedBuffer<aos::Configuration> config =
       aos::configuration::ReadConfig(FLAGS_config);
 
+  PCHECK(system("sudo chmod 644 /dev/adis16505") == 0)
+      << ": Failed to set read permissions on IMU device.";
+
   aos::ShmEventLoop event_loop(&config.message());
   y2022::localizer::Imu imu(&event_loop);
 
+  event_loop.SetRuntimeRealtimePriority(30);
+
   event_loop.Run();
 
   return 0;