milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 1 | #ifndef Y2022_CONTROL_LOOPS_SUPERSTRUCTURE_SUPERSTRUCTURE_H_ |
| 2 | #define Y2022_CONTROL_LOOPS_SUPERSTRUCTURE_SUPERSTRUCTURE_H_ |
| 3 | |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 4 | #include "aos/events/event_loop.h" |
Siddhant Kanwar | 0e37f59 | 2022-02-21 19:26:50 -0800 | [diff] [blame^] | 5 | #include "frc971/control_loops/control_loop.h" |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 6 | #include "y2022/constants.h" |
| 7 | #include "y2022/control_loops/superstructure/superstructure_goal_generated.h" |
| 8 | #include "y2022/control_loops/superstructure/superstructure_output_generated.h" |
| 9 | #include "y2022/control_loops/superstructure/superstructure_position_generated.h" |
| 10 | #include "y2022/control_loops/superstructure/superstructure_status_generated.h" |
| 11 | |
| 12 | namespace y2022 { |
| 13 | namespace control_loops { |
| 14 | namespace superstructure { |
| 15 | |
| 16 | class Superstructure |
| 17 | : public ::frc971::controls::ControlLoop<Goal, Position, Status, Output> { |
| 18 | public: |
Siddhant Kanwar | 0e37f59 | 2022-02-21 19:26:50 -0800 | [diff] [blame^] | 19 | using RelativeEncoderSubsystem = |
| 20 | ::frc971::control_loops::StaticZeroingSingleDOFProfiledSubsystem< |
| 21 | ::frc971::zeroing::RelativeEncoderZeroingEstimator, |
| 22 | ::frc971::control_loops::RelativeEncoderProfiledJointStatus>; |
| 23 | |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 24 | explicit Superstructure(::aos::EventLoop *event_loop, |
| 25 | const ::std::string &name = "/superstructure"); |
| 26 | |
| 27 | protected: |
| 28 | virtual void RunIteration(const Goal *unsafe_goal, const Position *position, |
| 29 | aos::Sender<Output>::Builder *output, |
| 30 | aos::Sender<Status>::Builder *status) override; |
| 31 | |
| 32 | private: |
Siddhant Kanwar | 0e37f59 | 2022-02-21 19:26:50 -0800 | [diff] [blame^] | 33 | RelativeEncoderSubsystem climber_; |
| 34 | |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 35 | DISALLOW_COPY_AND_ASSIGN(Superstructure); |
| 36 | }; |
| 37 | |
| 38 | } // namespace superstructure |
| 39 | } // namespace control_loops |
| 40 | } // namespace y2022 |
| 41 | |
| 42 | #endif // Y2022_CONTROL_LOOPS_SUPERSTRUCTURE_SUPERSTRUCTURE_H_ |