blob: f72eeeb8b78f20bc2263a14a429d256cc6a9ced9 [file] [log] [blame]
Sabina Davisedf89472020-02-17 15:27:37 -08001#ifndef Y2020_CONTROL_LOOPS_SHOOTER_SHOOTER_H_
2#define Y2020_CONTROL_LOOPS_SHOOTER_SHOOTER_H_
3
4#include "aos/controls/control_loop.h"
5#include "frc971/control_loops/state_feedback_loop.h"
6#include "y2020/control_loops/superstructure/shooter/flywheel_controller.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 {
15namespace shooter {
16
17// Handles all flywheels together.
18class Shooter {
19 public:
20 Shooter();
21
22 flatbuffers::Offset<ShooterStatus> RunIteration(
23 const ShooterGoal *goal, const ShooterPosition *position,
Sabina Davis0f31d3f2020-02-20 20:41:00 -080024 flatbuffers::FlatBufferBuilder *fbb, OutputT *output,
25 const aos::monotonic_clock::time_point position_timestamp);
26
27 bool ready() { return ready_; }
Sabina Davisedf89472020-02-17 15:27:37 -080028
29 private:
30 FlywheelController finisher_, accelerator_left_, accelerator_right_;
31
Sabina Davis0f31d3f2020-02-20 20:41:00 -080032 bool UpToSpeed(const ShooterGoal *goal);
33 bool ready_ = false;
34
Sabina Davisedf89472020-02-17 15:27:37 -080035 DISALLOW_COPY_AND_ASSIGN(Shooter);
36};
37
38} // namespace shooter
39} // namespace superstructure
40} // namespace control_loops
41} // namespace y2020
42
43#endif // Y2020_CONTROL_LOOPS_SHOOTER_SHOOTER_H_