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