blob: a605db0ec290ebf0d4c0f6bc9e8d45f49b418b6b [file] [log] [blame]
Austin Schuh87c10632017-02-05 19:02:17 -08001#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"
8#include "y2017/control_loops/superstructure/hood/hood.h"
Adam Snaider79900c22017-02-08 20:23:15 -08009#include "y2017/control_loops/superstructure/intake/intake.h"
Tyler Chatow2737d2a2017-02-08 21:20:51 -080010#include "y2017/control_loops/superstructure/shooter/shooter.h"
Austin Schuhcd3237a2017-02-18 14:19:26 -080011#include "y2017/control_loops/superstructure/superstructure.q.h"
Austin Schuhd5ccb862017-03-11 22:06:36 -080012#include "y2017/control_loops/superstructure/column/column.h"
Austin Schuh87c10632017-02-05 19:02:17 -080013
14namespace y2017 {
15namespace control_loops {
16namespace superstructure {
17
18class Superstructure
19 : public ::aos::controls::ControlLoop<control_loops::SuperstructureQueue> {
20 public:
21 explicit Superstructure(
22 control_loops::SuperstructureQueue *my_superstructure =
23 &control_loops::superstructure_queue);
24
Adam Snaidercfe13062017-02-05 18:23:09 -080025 const hood::Hood &hood() const { return hood_; }
Adam Snaider79900c22017-02-08 20:23:15 -080026 const intake::Intake &intake() const { return intake_; }
Austin Schuhcd3237a2017-02-18 14:19:26 -080027 const shooter::Shooter &shooter() const { return shooter_; }
Austin Schuhd5ccb862017-03-11 22:06:36 -080028 const column::Column &column() const { return column_; }
29
30 // Sets the ignore collisions bit. This should *not* be used on the robot.
31 void set_ignore_collisions(bool ignore_collisions) {
32 ignore_collisions_ = ignore_collisions;
33 }
Austin Schuh87c10632017-02-05 19:02:17 -080034
35 protected:
36 virtual void RunIteration(
37 const control_loops::SuperstructureQueue::Goal *unsafe_goal,
38 const control_loops::SuperstructureQueue::Position *position,
39 control_loops::SuperstructureQueue::Output *output,
40 control_loops::SuperstructureQueue::Status *status) override;
41
42 private:
43 hood::Hood hood_;
Adam Snaider79900c22017-02-08 20:23:15 -080044 intake::Intake intake_;
Tyler Chatow2737d2a2017-02-08 21:20:51 -080045 shooter::Shooter shooter_;
Austin Schuhd5ccb862017-03-11 22:06:36 -080046 column::Column column_;
47
48 // If true, we ignore collisions.
49 bool ignore_collisions_ = false;
Austin Schuh87c10632017-02-05 19:02:17 -080050
51 DISALLOW_COPY_AND_ASSIGN(Superstructure);
52};
53
54} // namespace superstructure
55} // namespace control_loops
56} // namespace y2017
57
58#endif // Y2017_CONTROL_LOOPS_SUPERSTRUCTURE_SUPERSTRUCTURE_H_