Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame^] | 1 | #include "absl/flags/flag.h" |
| 2 | |
Filip Kujawa | 3004f20 | 2023-02-12 16:41:40 -0800 | [diff] [blame] | 3 | #include "aos/events/shm_event_loop.h" |
| 4 | #include "aos/init.h" |
| 5 | #include "y2023/vision/game_pieces.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."); |
Filip Kujawa | 3004f20 | 2023-02-12 16:41:40 -0800 | [diff] [blame] | 9 | |
Stephan Pleines | f63bde8 | 2024-01-13 15:59:33 -0800 | [diff] [blame] | 10 | namespace y2023::vision { |
Filip Kujawa | 3004f20 | 2023-02-12 16:41:40 -0800 | [diff] [blame] | 11 | namespace { |
| 12 | |
| 13 | void GamePiecesDetectorMain() { |
| 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)); |
Filip Kujawa | 3004f20 | 2023-02-12 16:41:40 -0800 | [diff] [blame] | 16 | aos::ShmEventLoop event_loop(&config.message()); |
| 17 | GamePiecesDetector game_pieces_detector(&event_loop); |
| 18 | event_loop.Run(); |
| 19 | } |
| 20 | } // namespace |
Stephan Pleines | f63bde8 | 2024-01-13 15:59:33 -0800 | [diff] [blame] | 21 | } // namespace y2023::vision |
Filip Kujawa | 3004f20 | 2023-02-12 16:41:40 -0800 | [diff] [blame] | 22 | |
| 23 | int main(int argc, char **argv) { |
| 24 | aos::InitGoogle(&argc, &argv); |
| 25 | y2023::vision::GamePiecesDetectorMain(); |
| 26 | } |