Maxwell Henderson | f29e318 | 2023-05-25 06:51:24 -0700 | [diff] [blame] | 1 | #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 | |
| 12 | namespace frc971 { |
| 13 | namespace wpilib { |
| 14 | class CANSensorReader { |
| 15 | public: |
| 16 | CANSensorReader( |
| 17 | aos::EventLoop *event_loop, |
Maxwell Henderson | fcc0d12 | 2023-08-05 17:03:34 -0700 | [diff] [blame^] | 18 | std::vector<ctre::phoenix6::BaseStatusSignal *> signals_registry, |
Maxwell Henderson | f29e318 | 2023-05-25 06:51:24 -0700 | [diff] [blame] | 19 | std::vector<std::shared_ptr<Falcon>> falcons); |
| 20 | |
| 21 | private: |
| 22 | void Loop(); |
| 23 | |
| 24 | aos::EventLoop *event_loop_; |
| 25 | |
Maxwell Henderson | fcc0d12 | 2023-08-05 17:03:34 -0700 | [diff] [blame^] | 26 | const std::vector<ctre::phoenix6::BaseStatusSignal *> signals_; |
Maxwell Henderson | f29e318 | 2023-05-25 06:51:24 -0700 | [diff] [blame] | 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_ |