Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 1 | #include "absl/flags/flag.h" |
| 2 | |
Austin Schuh | e8153ae | 2023-01-28 11:15:58 -0800 | [diff] [blame] | 3 | #include "aos/events/shm_event_loop.h" |
| 4 | #include "aos/init.h" |
| 5 | #include "aos/realtime.h" |
| 6 | #include "frc971/imu_reader/imu.h" |
James Kuszmaul | 41c6815 | 2023-02-23 14:54:59 -0800 | [diff] [blame] | 7 | #include "y2023/constants.h" |
Austin Schuh | e8153ae | 2023-01-28 11:15:58 -0800 | [diff] [blame] | 8 | |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 9 | ABSL_FLAG(std::string, config, "aos_config.json", |
| 10 | "Path to the config file to use."); |
Austin Schuh | e8153ae | 2023-01-28 11:15:58 -0800 | [diff] [blame] | 11 | |
| 12 | int main(int argc, char *argv[]) { |
| 13 | aos::InitGoogle(&argc, &argv); |
| 14 | |
| 15 | aos::FlatbufferDetachedBuffer<aos::Configuration> config = |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 16 | aos::configuration::ReadConfig(absl::GetFlag(FLAGS_config)); |
Austin Schuh | e8153ae | 2023-01-28 11:15:58 -0800 | [diff] [blame] | 17 | |
| 18 | aos::ShmEventLoop event_loop(&config.message()); |
James Kuszmaul | 41c6815 | 2023-02-23 14:54:59 -0800 | [diff] [blame] | 19 | frc971::imu::Imu imu(&event_loop, |
| 20 | y2023::constants::Values::DrivetrainEncoderToMeters(1)); |
Austin Schuh | e8153ae | 2023-01-28 11:15:58 -0800 | [diff] [blame] | 21 | |
| 22 | event_loop.SetRuntimeAffinity(aos::MakeCpusetFromCpus({0})); |
| 23 | event_loop.SetRuntimeRealtimePriority(55); |
| 24 | |
| 25 | event_loop.Run(); |
| 26 | |
| 27 | return 0; |
| 28 | } |