Superstructure tunings and changes from SFR
Change-Id: I89b801bc37b557630f561993419ad30b8fca484b
Signed-off-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
diff --git a/y2024/control_loops/superstructure/shooter.h b/y2024/control_loops/superstructure/shooter.h
index 12078ff..a551993 100644
--- a/y2024/control_loops/superstructure/shooter.h
+++ b/y2024/control_loops/superstructure/shooter.h
@@ -109,9 +109,22 @@
NoteGoal requested_note_goal, flatbuffers::FlatBufferBuilder *fbb,
aos::monotonic_clock::time_point monotonic_now);
+ bool loaded() const { return state_ == CatapultState::LOADED; }
+
+ uint32_t shot_count() const { return shot_count_; }
+
+ bool Firing() const {
+ return state_ != CatapultState::READY && state_ != CatapultState::LOADED &&
+ state_ != CatapultState::RETRACTING;
+ }
+
private:
CatapultState state_ = CatapultState::RETRACTING;
+ bool CatapultRetracted() const {
+ return catapult_.estimated_position() < 0.5;
+ }
+
bool CatapultClose() const {
return (std::abs(catapult_.estimated_position() -
catapult_.unprofiled_goal(0, 0)) < 0.05 &&
@@ -138,6 +151,8 @@
interpolation_table_;
Debouncer debouncer_;
+
+ uint32_t shot_count_ = 0;
};
} // namespace y2024::control_loops::superstructure