Comran Morshed | 41ed7c2 | 2015-11-04 21:03:37 +0000 | [diff] [blame] | 1 | #ifndef Y2014_BOT3_CONTROL_LOOPS_ROLLERS_H_ |
| 2 | #define Y2014_BOT3_CONTROL_LOOPS_ROLLERS_H_ |
Comran Morshed | e9b1292 | 2015-11-04 19:46:48 +0000 | [diff] [blame] | 3 | |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 4 | #include "aos/controls/control_loop.h" |
Comran Morshed | e9b1292 | 2015-11-04 19:46:48 +0000 | [diff] [blame] | 5 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 6 | #include "y2014_bot3/control_loops/rollers/rollers_goal_generated.h" |
| 7 | #include "y2014_bot3/control_loops/rollers/rollers_output_generated.h" |
| 8 | #include "y2014_bot3/control_loops/rollers/rollers_position_generated.h" |
| 9 | #include "y2014_bot3/control_loops/rollers/rollers_status_generated.h" |
Comran Morshed | 41ed7c2 | 2015-11-04 21:03:37 +0000 | [diff] [blame] | 10 | |
| 11 | namespace y2014_bot3 { |
Comran Morshed | e9b1292 | 2015-11-04 19:46:48 +0000 | [diff] [blame] | 12 | namespace control_loops { |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 13 | namespace rollers { |
Comran Morshed | e9b1292 | 2015-11-04 19:46:48 +0000 | [diff] [blame] | 14 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 15 | class Rollers |
| 16 | : public aos::controls::ControlLoop<Goal, Position, Status, Output> { |
Comran Morshed | e9b1292 | 2015-11-04 19:46:48 +0000 | [diff] [blame] | 17 | public: |
| 18 | // Constructs a control loops which can take a rollers or defaults to the |
Comran Morshed | 41ed7c2 | 2015-11-04 21:03:37 +0000 | [diff] [blame] | 19 | // rollers at ::2014_bot3::control_loops::rollers. |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 20 | explicit Rollers(::aos::EventLoop *event_loop, |
| 21 | const ::std::string &name = "/rollers"); |
Comran Morshed | e9b1292 | 2015-11-04 19:46:48 +0000 | [diff] [blame] | 22 | |
| 23 | protected: |
| 24 | // Executes one cycle of the control loop. |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 25 | void RunIteration(const Goal *goal, const Position *position, |
| 26 | aos::Sender<Output>::Builder *output, |
| 27 | aos::Sender<Status>::Builder *status) override; |
Comran Morshed | e9b1292 | 2015-11-04 19:46:48 +0000 | [diff] [blame] | 28 | }; |
| 29 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 30 | } // namespace rollers |
Comran Morshed | e9b1292 | 2015-11-04 19:46:48 +0000 | [diff] [blame] | 31 | } // namespace control_loops |
Comran Morshed | 41ed7c2 | 2015-11-04 21:03:37 +0000 | [diff] [blame] | 32 | } // namespace y2014_bot3 |
Comran Morshed | e9b1292 | 2015-11-04 19:46:48 +0000 | [diff] [blame] | 33 | |
Comran Morshed | 41ed7c2 | 2015-11-04 21:03:37 +0000 | [diff] [blame] | 34 | #endif // Y2014_BOT3_CONTROL_LOOPS_ROLLERS_H_ |