blob: 680b4479728c2d1f14005c6d79629f51de9e17a2 [file] [log] [blame]
Stephan Massaltd021f972020-01-05 20:41:23 -08001#ifndef y2020_CONTROL_LOOPS_SUPERSTRUCTURE_SUPERSTRUCTURE_H_
2#define y2020_CONTROL_LOOPS_SUPERSTRUCTURE_SUPERSTRUCTURE_H_
3
4#include "aos/controls/control_loop.h"
5#include "aos/events/event_loop.h"
6#include "y2020/constants.h"
7#include "y2020/control_loops/superstructure/superstructure_goal_generated.h"
8#include "y2020/control_loops/superstructure/superstructure_output_generated.h"
9#include "y2020/control_loops/superstructure/superstructure_position_generated.h"
10#include "y2020/control_loops/superstructure/superstructure_status_generated.h"
11
12namespace y2020 {
13namespace control_loops {
14namespace superstructure {
15
16class Superstructure
17 : public ::aos::controls::ControlLoop<Goal, Position, Status, Output> {
18 public:
19 explicit Superstructure(::aos::EventLoop *event_loop,
20 const ::std::string &name = "/superstructure");
21
Sabina Daviscf08b152020-01-31 22:12:09 -080022 using AbsoluteEncoderSubsystem =
23 ::frc971::control_loops::StaticZeroingSingleDOFProfiledSubsystem<
24 ::frc971::zeroing::AbsoluteEncoderZeroingEstimator,
25 ::frc971::control_loops::AbsoluteEncoderProfiledJointStatus>;
26
27 const AbsoluteEncoderSubsystem &hood() const { return hood_; }
Sabina Davis0f2d38c2020-02-08 17:01:21 -080028 const AbsoluteEncoderSubsystem &intake_joint() const { return intake_joint_; }
Sabina Daviscf08b152020-01-31 22:12:09 -080029
Stephan Massaltd021f972020-01-05 20:41:23 -080030 protected:
31 virtual void RunIteration(const Goal *unsafe_goal, const Position *position,
32 aos::Sender<Output>::Builder *output,
33 aos::Sender<Status>::Builder *status) override;
34
35 private:
Sabina Daviscf08b152020-01-31 22:12:09 -080036 AbsoluteEncoderSubsystem hood_;
Sabina Davis0f2d38c2020-02-08 17:01:21 -080037 AbsoluteEncoderSubsystem intake_joint_;
Sabina Daviscf08b152020-01-31 22:12:09 -080038
Stephan Massaltd021f972020-01-05 20:41:23 -080039 DISALLOW_COPY_AND_ASSIGN(Superstructure);
40};
41
42} // namespace superstructure
43} // namespace control_loops
44} // namespace y2020
45
46#endif // y2020_CONTROL_LOOPS_SUPERSTRUCTURE_SUPERSTRUCTURE_H_