Refactor handling of dual intaking
* Add flag to goal message to explicitly indicate which intake we are
requesting, rather than attempting to infer it from the exact settings
of the intake roller speeds.
* While idle, latch the turret to one of the two intaking locations,
chosen based on whichever intake was either last requested or which
intake currently has a ball (if only one has a ball).
* Clean up some of the logic to operate the front/back intakes
independently since we actually have separate transfer rollers for them.
Change-Id: Ib97052a011fe01784077a7b66fccbcc02aa49952
Signed-off-by: James Kuszmaul <jabukuszmaul@gmail.com>
diff --git a/y2022/control_loops/superstructure/superstructure.h b/y2022/control_loops/superstructure/superstructure.h
index e9afcc1..11cd38f 100644
--- a/y2022/control_loops/superstructure/superstructure.h
+++ b/y2022/control_loops/superstructure/superstructure.h
@@ -81,7 +81,9 @@
bool reseating_in_catapult_ = false;
bool fire_ = false;
- aos::monotonic_clock::time_point intake_beambreak_timer_ =
+ aos::monotonic_clock::time_point front_intake_beambreak_timer_ =
+ aos::monotonic_clock::min_time;
+ aos::monotonic_clock::time_point back_intake_beambreak_timer_ =
aos::monotonic_clock::min_time;
aos::monotonic_clock::time_point transferring_timer_ =
aos::monotonic_clock::min_time;
@@ -90,7 +92,9 @@
aos::monotonic_clock::time_point flipper_opening_start_time_ =
aos::monotonic_clock::min_time;
SuperstructureState state_ = SuperstructureState::IDLE;
- IntakeState intake_state_ = IntakeState::NO_BALL;
+ bool front_intake_has_ball_ = false;
+ bool back_intake_has_ball_ = false;
+ RequestedIntake turret_intake_state_ = RequestedIntake::kFront;
DISALLOW_COPY_AND_ASSIGN(Superstructure);
};