blob: 03dfc581991447eb9922f70b76d82cd03f1d3fd7 [file] [log] [blame]
Ravago Jonese12b7902022-02-04 22:50:44 -08001#include "aos/events/shm_event_loop.h"
2#include "aos/init.h"
Austin Schuh5f4cddd2023-01-27 21:01:28 -08003#include "aos/realtime.h"
Austin Schuh18cb1df2023-01-28 11:13:35 -08004#include "frc971/imu_reader/imu.h"
5#include "y2022/constants.h"
Ravago Jonese12b7902022-02-04 22:50:44 -08006
Austin Schuhc5fa6d92022-02-25 14:36:28 -08007DEFINE_string(config, "aos_config.json", "Path to the config file to use.");
Ravago Jonese12b7902022-02-04 22:50:44 -08008
9int main(int argc, char *argv[]) {
10 aos::InitGoogle(&argc, &argv);
11
12 aos::FlatbufferDetachedBuffer<aos::Configuration> config =
13 aos::configuration::ReadConfig(FLAGS_config);
14
Austin Schuh5f4cddd2023-01-27 21:01:28 -080015 PCHECK(system("sudo chmod 644 /dev/adis16505") == 0)
16 << ": Failed to set read permissions on IMU device.";
17
Ravago Jonese12b7902022-02-04 22:50:44 -080018 aos::ShmEventLoop event_loop(&config.message());
Austin Schuh18cb1df2023-01-28 11:13:35 -080019 frc971::imu::Imu imu(&event_loop,
20 y2022::constants::Values::DrivetrainEncoderToMeters(1));
Ravago Jonese12b7902022-02-04 22:50:44 -080021
Austin Schuh5f4cddd2023-01-27 21:01:28 -080022 event_loop.SetRuntimeRealtimePriority(30);
23
Ravago Jonese12b7902022-02-04 22:50:44 -080024 event_loop.Run();
25
26 return 0;
27}