blob: 42caf9bda99b45c3e702b396ce6533ef129ce128 [file] [log] [blame]
Niko Sohmers3860f8a2024-01-12 21:05:19 -08001include "frc971/control_loops/profiled_subsystem.fbs";
Nathan Leongdd728002024-02-03 15:26:53 -08002include "frc971/control_loops/catapult/catapult_goal.fbs";
Niko Sohmers3860f8a2024-01-12 21:05:19 -08003
4namespace y2024.control_loops.superstructure;
5
Filip Kujawa7a799602024-02-23 12:27:47 -08006// Represents goal for the intake pivot and rollers
7// INTAKE will extend the pivot and turn on the rollers to intake the note.
8// SPIT will extend the pivot and turn on the rollers (in reverse) to spit out the note.
9enum IntakeGoal : ubyte {
Niko Sohmers58e64c82024-01-14 12:49:54 -080010 NONE = 0,
Filip Kujawa7a799602024-02-23 12:27:47 -080011 INTAKE = 1,
12 SPIT = 2,
Niko Sohmers78f71352024-02-02 16:47:40 -080013}
14
Filip Kujawa57507152024-01-31 20:09:25 -080015// Represents goal for climber
16// FULL_EXTEND is for fully extending the climber
Filip Kujawa57507152024-01-31 20:09:25 -080017// RETRACT is for retracting the climber
18enum ClimberGoal : ubyte {
19 FULL_EXTEND = 0,
Filip Kujawaa7c8b412024-02-24 18:29:29 -080020 RETRACT = 1,
Maxwell Henderson7db29782024-02-24 20:10:26 -080021 STOWED = 2,
Filip Kujawa57507152024-01-31 20:09:25 -080022}
23
Maxwell Hendersoned970292024-02-02 20:08:08 -080024table ShooterGoal {
25 catapult_goal:frc971.control_loops.catapult.CatapultGoal (id: 0);
Filip Kujawaa7c8b412024-02-24 18:29:29 -080026
27 // If true we ignore the other provided positions
Filip Kujawa7a799602024-02-23 12:27:47 -080028 auto_aim: bool (id: 1);
Maxwell Hendersoned970292024-02-02 20:08:08 -080029
30 // Position for the turret when we aren't auto aiming
Filip Kujawa7a799602024-02-23 12:27:47 -080031 turret_position: frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 2);
Maxwell Hendersoned970292024-02-02 20:08:08 -080032
33 // Position for the altitude when we aren't auto aiming
Filip Kujawa7a799602024-02-23 12:27:47 -080034 altitude_position: frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 3);
Niko Sohmersc4d2c502024-02-19 19:35:35 -080035
Filip Kujawaa7c8b412024-02-24 18:29:29 -080036 // If true, we started with the ball loaded and should proceed to that state.
Filip Kujawa7a799602024-02-23 12:27:47 -080037 preloaded:bool = false (id: 4);
Maxwell Hendersoned970292024-02-02 20:08:08 -080038}
39
Filip Kujawaa7c8b412024-02-24 18:29:29 -080040// Represents goal for the note movement through the robot
Filip Kujawa7a799602024-02-23 12:27:47 -080041// to various scoring positions
42// NONE represents no goal for the note
43// AMP represents the goal to move the note and the extend to the AMP scoring position
44// TRAP represents the goal to move the note and the extend to the TRAP scoring position
45// CATAPULT represents the goal to load the note in the catapult.
46// It will complete the catapult goal before accepting new goals.
47enum NoteGoal : ubyte {
48 NONE = 0,
Filip Kujawa102a9b22024-02-18 09:40:23 -080049 AMP = 1,
50 TRAP = 2,
Filip Kujawa7a799602024-02-23 12:27:47 -080051 CATAPULT = 3,
Filip Kujawa102a9b22024-02-18 09:40:23 -080052}
53
Filip Kujawa102a9b22024-02-18 09:40:23 -080054
Niko Sohmers58e64c82024-01-14 12:49:54 -080055table Goal {
Filip Kujawa7a799602024-02-23 12:27:47 -080056 intake_goal:IntakeGoal = NONE (id: 0);
Filip Kujawaa7c8b412024-02-24 18:29:29 -080057 climber_goal:ClimberGoal (id: 1);
58 shooter_goal:ShooterGoal (id: 2);
59 note_goal:NoteGoal (id: 3);
60 fire: bool (id: 4);
Niko Sohmers58e64c82024-01-14 12:49:54 -080061}
Niko Sohmers3860f8a2024-01-12 21:05:19 -080062root_type Goal;