blob: 2e1a4066cac8dfa2d8ceb2bebd5f7964c2d97a93 [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,
18 std::vector<ctre::phoenixpro::BaseStatusSignalValue *> signals_registry,
19 std::vector<std::shared_ptr<Falcon>> falcons);
20
21 private:
22 void Loop();
23
24 aos::EventLoop *event_loop_;
25
26 const std::vector<ctre::phoenixpro::BaseStatusSignalValue *> signals_;
27 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_