Add SFR 4/5-piece auto

This brings in the 5 piece auto as it existed at the end of SFR.

Note: This squashes multiple commits worth of work.

Change-Id: Ia0bca787647cba9620be40d27d8d1e424d567b03
Signed-off-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
diff --git a/y2024/autonomous/autonomous_actor.h b/y2024/autonomous/autonomous_actor.h
index 6796c94..fd5038d 100644
--- a/y2024/autonomous/autonomous_actor.h
+++ b/y2024/autonomous/autonomous_actor.h
@@ -8,6 +8,8 @@
 #include "frc971/control_loops/drivetrain/drivetrain_config.h"
 #include "frc971/control_loops/drivetrain/localizer_generated.h"
 #include "y2024/autonomous/auto_splines.h"
+#include "y2024/constants.h"
+#include "y2024/constants/constants_generated.h"
 #include "y2024/control_loops/superstructure/superstructure_goal_static.h"
 #include "y2024/control_loops/superstructure/superstructure_status_static.h"
 
@@ -16,7 +18,8 @@
 class AutonomousActor
     : public ::frc971::autonomous::UserButtonLocalizedAutonomousActor {
  public:
-  explicit AutonomousActor(::aos::EventLoop *event_loop);
+  explicit AutonomousActor(::aos::EventLoop *event_loop,
+                           const y2024::Constants *robot_constants);
 
  private:
   void set_intake_goal(control_loops::superstructure::IntakeGoal intake_goal) {
@@ -35,13 +38,21 @@
   void Reset() override;
 
   void SplineAuto();
+  void MobilityAndShoot();
+  void FourPieceAuto();
   void SendSuperstructureGoal();
 
   void Intake();
   void Aim();
   void Shoot();
+  void StopFiring();
+
+  uint32_t shot_count();
 
   [[nodiscard]] bool WaitForPreloaded();
+  [[nodiscard]] bool WaitForNoteFired(uint32_t penultimate_target_shot_count,
+                                      std::chrono::nanoseconds timeout);
+  [[nodiscard]] bool WaitForCatapultReady();
 
   aos::Sender<frc971::control_loops::drivetrain::LocalizerControl>
       localizer_control_sender_;
@@ -52,15 +63,19 @@
   aos::Fetcher<y2024::control_loops::superstructure::Status>
       superstructure_status_fetcher_;
 
+  const Constants *robot_constants_;
+
   AutonomousSplines auto_splines_;
 
   std::optional<SplineHandle> test_spline_;
+  std::optional<std::array<SplineHandle, 1>> mobility_and_shoot_splines_;
+  std::optional<std::array<SplineHandle, 5>> four_piece_splines_;
 
   control_loops::superstructure::IntakeGoal intake_goal_ =
       control_loops::superstructure::IntakeGoal::NONE;
 
   control_loops::superstructure::NoteGoal note_goal_ =
-      control_loops::superstructure::NoteGoal::NONE;
+      control_loops::superstructure::NoteGoal::CATAPULT;
 
   bool auto_aim_ = false;
   bool fire_ = false;
@@ -69,4 +84,4 @@
 
 }  // namespace y2024::autonomous
 
-#endif  // Y2024_AUTONOMOUS_AUTONOMOUS_ACTOR_H_
\ No newline at end of file
+#endif  // Y2024_AUTONOMOUS_AUTONOMOUS_ACTOR_H_