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" |
Philipp Schrader | 790cb54 | 2023-07-05 21:06:52 -0700 | [diff] [blame] | 4 | |
Henry Speiser | e5f05aa | 2022-05-02 21:24:26 -0700 | [diff] [blame] | 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" |
Philipp Schrader | 790cb54 | 2023-07-05 21:06:52 -0700 | [diff] [blame] | 9 | #include "frc971/constants/constants_sender_lib.h" |
Henry Speiser | e5f05aa | 2022-05-02 21:24:26 -0700 | [diff] [blame] | 10 | #include "frc971/constants/testdata/constants_data_generated.h" |
| 11 | #include "frc971/constants/testdata/constants_list_generated.h" |
Henry Speiser | e5f05aa | 2022-05-02 21:24:26 -0700 | [diff] [blame] | 12 | |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 13 | ABSL_FLAG(std::string, config, "frc971/constants/testdata/aos_config.json", |
| 14 | "Path to the config."); |
| 15 | ABSL_FLAG(std::string, constants_path, |
| 16 | "frc971/constants/testdata/test_constants.json", |
| 17 | "Path to the constant file"); |
Henry Speiser | e5f05aa | 2022-05-02 21:24:26 -0700 | [diff] [blame] | 18 | // This is just a sample binary |
| 19 | int main(int argc, char **argv) { |
| 20 | aos::InitGoogle(&argc, &argv); |
| 21 | aos::FlatbufferDetachedBuffer<aos::Configuration> config = |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 22 | aos::configuration::ReadConfig(absl::GetFlag(FLAGS_config)); |
Henry Speiser | e5f05aa | 2022-05-02 21:24:26 -0700 | [diff] [blame] | 23 | aos::ShmEventLoop event_loop(&config.message()); |
| 24 | frc971::constants::ConstantSender<frc971::constants::testdata::ConstantsData, |
| 25 | frc971::constants::testdata::ConstantsList> |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 26 | constants_sender(&event_loop, absl::GetFlag(FLAGS_constants_path)); |
Henry Speiser | e5f05aa | 2022-05-02 21:24:26 -0700 | [diff] [blame] | 27 | event_loop.Run(); |
| 28 | |
| 29 | return 0; |
| 30 | } |