blob: 56da2fbe5a1578f0595628919a4eff2858b71ba5 [file] [log] [blame]
Maxwell Hendersonf29e3182023-05-25 06:51:24 -07001#ifndef FRC971_WPILIB_CAN_SENSOR_READER_H_
2#define FRC971_WPILIB_CAN_SENSOR_READER_H_
3
4#include <vector>
5
6#include "aos/containers/sized_array.h"
7#include "aos/events/event_loop.h"
8#include "aos/events/shm_event_loop.h"
9#include "aos/realtime.h"
10#include "frc971/wpilib/falcon.h"
11
12namespace frc971 {
13namespace wpilib {
14class CANSensorReader {
15 public:
16 CANSensorReader(
17 aos::EventLoop *event_loop,
Maxwell Hendersonfcc0d122023-08-05 17:03:34 -070018 std::vector<ctre::phoenix6::BaseStatusSignal *> signals_registry,
Maxwell Hendersonf29e3182023-05-25 06:51:24 -070019 std::vector<std::shared_ptr<Falcon>> falcons);
20
21 private:
22 void Loop();
23
24 aos::EventLoop *event_loop_;
25
Maxwell Hendersonfcc0d122023-08-05 17:03:34 -070026 const std::vector<ctre::phoenix6::BaseStatusSignal *> signals_;
Maxwell Hendersonf29e3182023-05-25 06:51:24 -070027 aos::Sender<control_loops::drivetrain::CANPosition> can_position_sender_;
28
29 // This is a vector of falcons becuase we don't need to care
30 // about falcons individually.
31 std::vector<std::shared_ptr<Falcon>> falcons_;
32
33 // Pointer to the timer handler used to modify the wakeup.
34 ::aos::TimerHandler *timer_handler_;
35};
36} // namespace wpilib
37} // namespace frc971
38#endif // FRC971_WPILIB_CAN_SENSOR_READER_H_