Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame^] | 1 | #include "absl/flags/flag.h" |
Philipp Schrader | 790cb54 | 2023-07-05 21:06:52 -0700 | [diff] [blame] | 2 | |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 3 | #include "aos/configuration.h" |
| 4 | #include "aos/events/shm_event_loop.h" |
| 5 | #include "aos/init.h" |
| 6 | #include "aos/json_to_flatbuffer.h" |
| 7 | #include "frc971/constants/constants_sender_lib.h" |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 8 | #include "y2023/constants/constants_generated.h" |
| 9 | #include "y2023/constants/constants_list_generated.h" |
| 10 | |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame^] | 11 | ABSL_FLAG(std::string, config, "aos_config.json", "Path to the AOS config."); |
| 12 | ABSL_FLAG(std::string, constants_path, "constants.json", |
| 13 | "Path to the constant file"); |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 14 | |
| 15 | int main(int argc, char **argv) { |
| 16 | aos::InitGoogle(&argc, &argv); |
| 17 | aos::FlatbufferDetachedBuffer<aos::Configuration> config = |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame^] | 18 | aos::configuration::ReadConfig(absl::GetFlag(FLAGS_config)); |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 19 | aos::ShmEventLoop event_loop(&config.message()); |
| 20 | frc971::constants::ConstantSender<y2023::Constants, y2023::ConstantsList> |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame^] | 21 | constants_sender(&event_loop, absl::GetFlag(FLAGS_constants_path)); |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 22 | // Don't need to call Run(). |
| 23 | return 0; |
| 24 | } |