Refactor year-agnostic catapult code to frc971
This breaks up the y2022 catapult code into multiple files and moves
them into the frc971 folder. Year-specific parameters are now
provided via the constructors, and the goal message is moved into
frc971 as well.
Signed-off-by: Niko Sohmers <nikolai@sohmers.com>
Change-Id: I4ea720ae62a7c6c229d6c24a1f08edd7bc5b9728
diff --git a/y2022/control_loops/superstructure/superstructure_goal.fbs b/y2022/control_loops/superstructure/superstructure_goal.fbs
index 4d4a81f..0c57362 100644
--- a/y2022/control_loops/superstructure/superstructure_goal.fbs
+++ b/y2022/control_loops/superstructure/superstructure_goal.fbs
@@ -1,4 +1,5 @@
include "frc971/control_loops/profiled_subsystem.fbs";
+include "frc971/control_loops/catapult/catapult_goal.fbs";
namespace y2022.control_loops.superstructure;
@@ -8,20 +9,6 @@
kBack = 1,
}
-table CatapultGoal {
- // Old fire flag, only kept for backwards-compatability with logs.
- // Use the fire flag in the root Goal instead
- fire:bool (id: 0, deprecated);
-
- // The target shot position and velocity. If these are provided before fire
- // is called, the optimizer can pre-compute the trajectory.
- shot_position:double (id: 1);
- shot_velocity:double (id: 2);
-
- // The target position to return the catapult to when not shooting.
- return_position:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 3);
-}
-
table Goal {
// Height of the climber above rest point
climber:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 0);
@@ -52,7 +39,7 @@
turret:frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 7);
// Catapult goal state.
- catapult:CatapultGoal (id: 8);
+ catapult:frc971.control_loops.catapult.CatapultGoal (id: 8);
// If true, fire! The robot will only fire when ready.
fire:bool (id: 9);