blob: 53811eab21ae01bb810e524e306217e417967906 [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"
Ravago Jonese12b7902022-02-04 22:50:44 -08004#include "y2022/localizer/imu.h"
5
Austin Schuhc5fa6d92022-02-25 14:36:28 -08006DEFINE_string(config, "aos_config.json", "Path to the config file to use.");
Ravago Jonese12b7902022-02-04 22:50:44 -08007
8int main(int argc, char *argv[]) {
9 aos::InitGoogle(&argc, &argv);
10
11 aos::FlatbufferDetachedBuffer<aos::Configuration> config =
12 aos::configuration::ReadConfig(FLAGS_config);
13
Austin Schuh5f4cddd2023-01-27 21:01:28 -080014 PCHECK(system("sudo chmod 644 /dev/adis16505") == 0)
15 << ": Failed to set read permissions on IMU device.";
16
Ravago Jonese12b7902022-02-04 22:50:44 -080017 aos::ShmEventLoop event_loop(&config.message());
18 y2022::localizer::Imu imu(&event_loop);
19
Austin Schuh5f4cddd2023-01-27 21:01:28 -080020 event_loop.SetRuntimeRealtimePriority(30);
21
Ravago Jonese12b7902022-02-04 22:50:44 -080022 event_loop.Run();
23
24 return 0;
25}