Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 1 | #include "absl/flags/flag.h" |
| 2 | |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 3 | #include "aos/events/shm_event_loop.h" |
| 4 | #include "aos/init.h" |
| 5 | #include "frc971/vision/foxglove_image_converter_lib.h" |
| 6 | |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 7 | ABSL_FLAG(std::string, config, "aos_config.json", |
| 8 | "Path to the config file to use."); |
| 9 | ABSL_FLAG(std::string, channel, "/camera", "Input/Output channel to use."); |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 10 | |
| 11 | int main(int argc, char *argv[]) { |
| 12 | aos::InitGoogle(&argc, &argv); |
| 13 | |
| 14 | aos::FlatbufferDetachedBuffer<aos::Configuration> config = |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 15 | aos::configuration::ReadConfig(absl::GetFlag(FLAGS_config)); |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 16 | |
| 17 | aos::ShmEventLoop event_loop(&config.message()); |
| 18 | |
| 19 | frc971::vision::FoxgloveImageConverter converter( |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 20 | &event_loop, absl::GetFlag(FLAGS_channel), absl::GetFlag(FLAGS_channel), |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 21 | frc971::vision::ImageCompression::kJpeg); |
| 22 | |
| 23 | event_loop.Run(); |
| 24 | } |