James Kuszmaul | 910fbe4 | 2023-04-09 16:18:40 -0700 | [diff] [blame] | 1 | #ifndef Y2023_VISION_CAMERA_MONITOR_LIB_H_ |
| 2 | #define Y2023_VISION_CAMERA_MONITOR_LIB_H_ |
| 3 | #include "aos/events/event_loop.h" |
| 4 | #include "aos/starter/starter_rpc_lib.h" |
| 5 | #include "frc971/vision/vision_generated.h" |
| 6 | namespace y2023::vision { |
| 7 | // This class provides an application that will restart the camera_reader |
| 8 | // process whenever images stop flowing for too long. This is to mitigate an |
| 9 | // issue where sometimes we stop getting camera images. |
| 10 | class CameraMonitor { |
| 11 | public: |
| 12 | CameraMonitor(aos::EventLoop *event_loop); |
| 13 | |
| 14 | private: |
| 15 | void SetImageTimeout(); |
| 16 | aos::EventLoop *event_loop_; |
| 17 | aos::starter::StarterClient starter_; |
| 18 | aos::TimerHandler *image_timeout_; |
| 19 | }; |
| 20 | } // namespace y2023::vision |
| 21 | #endif // Y2023_VISION_CAMERA_MONITOR_LIB_H_ |