Only update the catapult firing bool when enabled
If we updated last_firing_ while disabled, the state would never
transition to FIRING and the ball would never get shot. This is why the
catapult was stuck last Sunday.
Signed-off-by: Milind Upadhyay <milind.upadhyay@gmail.com>
Change-Id: I54e363e9f44290601e23391692af2948b0642dbe
diff --git a/y2022/control_loops/superstructure/catapult/catapult.cc b/y2022/control_loops/superstructure/catapult/catapult.cc
index 2093174..feb4917 100644
--- a/y2022/control_loops/superstructure/catapult/catapult.cc
+++ b/y2022/control_loops/superstructure/catapult/catapult.cc
@@ -342,7 +342,9 @@
latched_shot_velocity = catapult_goal->shot_velocity();
}
- if (catapult_.running()) {
+ // Don't update last_firing_ if the catapult is disabled, so that we actually
+ // end up firing once it's enabled
+ if (catapult_.running() && !catapult_disabled) {
last_firing_ = fire;
}