Ravago Jones | b84f206 | 2023-01-29 13:46:59 -0800 | [diff] [blame^] | 1 | #include "aos/events/shm_event_loop.h" |
| 2 | #include "aos/init.h" |
| 3 | #include "y2023/vision/aprilrobotics.h" |
| 4 | |
| 5 | DEFINE_string(config, "aos_config.json", "Path to the config file to use."); |
| 6 | |
| 7 | namespace y2023::vision { |
| 8 | void AprilViewerMain() { |
| 9 | aos::FlatbufferDetachedBuffer<aos::Configuration> config = |
| 10 | aos::configuration::ReadConfig(FLAGS_config); |
| 11 | |
| 12 | aos::ShmEventLoop event_loop(&config.message()); |
| 13 | |
| 14 | AprilRoboticsDetector detector(&event_loop, "/camera"); |
| 15 | |
| 16 | detector.SetWorkerpoolAffinities(); |
| 17 | |
| 18 | event_loop.SetRuntimeAffinity(aos::MakeCpusetFromCpus({5})); |
| 19 | |
| 20 | struct sched_param param; |
| 21 | param.sched_priority = 21; |
| 22 | PCHECK(sched_setscheduler(0, SCHED_FIFO, ¶m) == 0); |
| 23 | |
| 24 | event_loop.Run(); |
| 25 | } |
| 26 | |
| 27 | } // namespace y2023::vision |
| 28 | |
| 29 | int main(int argc, char **argv) { |
| 30 | aos::InitGoogle(&argc, &argv); |
| 31 | y2023::vision::AprilViewerMain(); |
| 32 | |
| 33 | return 0; |
| 34 | } |