Austin Schuh | 87c1063 | 2017-02-05 19:02:17 -0800 | [diff] [blame] | 1 | #ifndef Y2017_CONTROL_LOOPS_SUPERSTRUCTURE_SUPERSTRUCTURE_H_ |
| 2 | #define Y2017_CONTROL_LOOPS_SUPERSTRUCTURE_SUPERSTRUCTURE_H_ |
| 3 | |
| 4 | #include <memory> |
| 5 | |
| 6 | #include "aos/common/controls/control_loop.h" |
| 7 | #include "frc971/control_loops/state_feedback_loop.h" |
Parker Schuh | 208a58d | 2017-04-12 20:51:38 -0700 | [diff] [blame] | 8 | #include "y2017/control_loops/superstructure/column/column.h" |
Austin Schuh | 87c1063 | 2017-02-05 19:02:17 -0800 | [diff] [blame] | 9 | #include "y2017/control_loops/superstructure/hood/hood.h" |
Adam Snaider | 79900c2 | 2017-02-08 20:23:15 -0800 | [diff] [blame] | 10 | #include "y2017/control_loops/superstructure/intake/intake.h" |
Tyler Chatow | 2737d2a | 2017-02-08 21:20:51 -0800 | [diff] [blame] | 11 | #include "y2017/control_loops/superstructure/shooter/shooter.h" |
Austin Schuh | cd3237a | 2017-02-18 14:19:26 -0800 | [diff] [blame] | 12 | #include "y2017/control_loops/superstructure/superstructure.q.h" |
Parker Schuh | 208a58d | 2017-04-12 20:51:38 -0700 | [diff] [blame] | 13 | #include "y2017/control_loops/superstructure/vision_distance_average.h" |
Austin Schuh | 87c1063 | 2017-02-05 19:02:17 -0800 | [diff] [blame] | 14 | |
| 15 | namespace y2017 { |
| 16 | namespace control_loops { |
| 17 | namespace superstructure { |
| 18 | |
| 19 | class Superstructure |
| 20 | : public ::aos::controls::ControlLoop<control_loops::SuperstructureQueue> { |
| 21 | public: |
| 22 | explicit Superstructure( |
| 23 | control_loops::SuperstructureQueue *my_superstructure = |
| 24 | &control_loops::superstructure_queue); |
| 25 | |
Adam Snaider | cfe1306 | 2017-02-05 18:23:09 -0800 | [diff] [blame] | 26 | const hood::Hood &hood() const { return hood_; } |
Adam Snaider | 79900c2 | 2017-02-08 20:23:15 -0800 | [diff] [blame] | 27 | const intake::Intake &intake() const { return intake_; } |
Austin Schuh | cd3237a | 2017-02-18 14:19:26 -0800 | [diff] [blame] | 28 | const shooter::Shooter &shooter() const { return shooter_; } |
Austin Schuh | d5ccb86 | 2017-03-11 22:06:36 -0800 | [diff] [blame] | 29 | const column::Column &column() const { return column_; } |
| 30 | |
| 31 | // Sets the ignore collisions bit. This should *not* be used on the robot. |
| 32 | void set_ignore_collisions(bool ignore_collisions) { |
| 33 | ignore_collisions_ = ignore_collisions; |
| 34 | } |
Austin Schuh | 87c1063 | 2017-02-05 19:02:17 -0800 | [diff] [blame] | 35 | |
| 36 | protected: |
| 37 | virtual void RunIteration( |
| 38 | const control_loops::SuperstructureQueue::Goal *unsafe_goal, |
| 39 | const control_loops::SuperstructureQueue::Position *position, |
| 40 | control_loops::SuperstructureQueue::Output *output, |
| 41 | control_loops::SuperstructureQueue::Status *status) override; |
| 42 | |
| 43 | private: |
| 44 | hood::Hood hood_; |
Adam Snaider | 79900c2 | 2017-02-08 20:23:15 -0800 | [diff] [blame] | 45 | intake::Intake intake_; |
Tyler Chatow | 2737d2a | 2017-02-08 21:20:51 -0800 | [diff] [blame] | 46 | shooter::Shooter shooter_; |
Austin Schuh | d5ccb86 | 2017-03-11 22:06:36 -0800 | [diff] [blame] | 47 | column::Column column_; |
| 48 | |
| 49 | // If true, we ignore collisions. |
| 50 | bool ignore_collisions_ = false; |
Austin Schuh | 87c1063 | 2017-02-05 19:02:17 -0800 | [diff] [blame] | 51 | |
Parker Schuh | 208a58d | 2017-04-12 20:51:38 -0700 | [diff] [blame] | 52 | VisionDistanceAverage distance_average_; |
| 53 | |
Austin Schuh | e8b0075 | 2017-04-16 19:14:31 -0700 | [diff] [blame^] | 54 | ::frc971::shooter_interpolation::InterpolationTable< |
| 55 | ::y2017::constants::Values::ShotParams> |
| 56 | shot_interpolation_table_; |
| 57 | |
Austin Schuh | 87c1063 | 2017-02-05 19:02:17 -0800 | [diff] [blame] | 58 | DISALLOW_COPY_AND_ASSIGN(Superstructure); |
| 59 | }; |
| 60 | |
| 61 | } // namespace superstructure |
| 62 | } // namespace control_loops |
| 63 | } // namespace y2017 |
| 64 | |
| 65 | #endif // Y2017_CONTROL_LOOPS_SUPERSTRUCTURE_SUPERSTRUCTURE_H_ |