Ravago Jones | e12b790 | 2022-02-04 22:50:44 -0800 | [diff] [blame] | 1 | #include "aos/events/shm_event_loop.h" |
| 2 | #include "aos/init.h" |
Austin Schuh | 5f4cddd | 2023-01-27 21:01:28 -0800 | [diff] [blame^] | 3 | #include "aos/realtime.h" |
Ravago Jones | e12b790 | 2022-02-04 22:50:44 -0800 | [diff] [blame] | 4 | #include "y2022/localizer/imu.h" |
| 5 | |
Austin Schuh | c5fa6d9 | 2022-02-25 14:36:28 -0800 | [diff] [blame] | 6 | DEFINE_string(config, "aos_config.json", "Path to the config file to use."); |
Ravago Jones | e12b790 | 2022-02-04 22:50:44 -0800 | [diff] [blame] | 7 | |
| 8 | int 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 Schuh | 5f4cddd | 2023-01-27 21:01:28 -0800 | [diff] [blame^] | 14 | PCHECK(system("sudo chmod 644 /dev/adis16505") == 0) |
| 15 | << ": Failed to set read permissions on IMU device."; |
| 16 | |
Ravago Jones | e12b790 | 2022-02-04 22:50:44 -0800 | [diff] [blame] | 17 | aos::ShmEventLoop event_loop(&config.message()); |
| 18 | y2022::localizer::Imu imu(&event_loop); |
| 19 | |
Austin Schuh | 5f4cddd | 2023-01-27 21:01:28 -0800 | [diff] [blame^] | 20 | event_loop.SetRuntimeRealtimePriority(30); |
| 21 | |
Ravago Jones | e12b790 | 2022-02-04 22:50:44 -0800 | [diff] [blame] | 22 | event_loop.Run(); |
| 23 | |
| 24 | return 0; |
| 25 | } |