Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame^] | 1 | #include "absl/flags/flag.h" |
| 2 | |
James Kuszmaul | 04a343c | 2023-02-20 16:38:22 -0800 | [diff] [blame] | 3 | #include "aos/events/shm_event_loop.h" |
| 4 | #include "aos/init.h" |
| 5 | #include "frc971/constants/constants_sender_lib.h" |
| 6 | #include "y2023/control_loops/drivetrain/drivetrain_base.h" |
| 7 | #include "y2023/localizer/localizer.h" |
| 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."); |
James Kuszmaul | 04a343c | 2023-02-20 16:38:22 -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)); |
James Kuszmaul | 04a343c | 2023-02-20 16:38:22 -0800 | [diff] [blame] | 17 | |
| 18 | frc971::constants::WaitForConstants<y2023::Constants>(&config.message()); |
| 19 | |
| 20 | aos::ShmEventLoop event_loop(&config.message()); |
| 21 | y2023::localizer::Localizer localizer( |
| 22 | &event_loop, ::y2023::control_loops::drivetrain::GetDrivetrainConfig()); |
| 23 | |
| 24 | event_loop.Run(); |
| 25 | |
| 26 | return 0; |
| 27 | } |