blob: ddb116e3ce840dd15c3c365ebd97e6215b9552e2 [file] [log] [blame]
James Kuszmaul910fbe42023-04-09 16:18:40 -07001#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"
6namespace 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.
10class 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_