blob: 2a5fb000b125f6b7bfe65bfc1a6f9584aeb80b1a [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
James Kuszmauldf3a3cb2024-03-15 22:03:37 -070015enum IntakePivotGoal : ubyte {
16 UP = 0,
17 DOWN = 1,
18}
19
Filip Kujawa57507152024-01-31 20:09:25 -080020// Represents goal for climber
21// FULL_EXTEND is for fully extending the climber
Filip Kujawa57507152024-01-31 20:09:25 -080022// RETRACT is for retracting the climber
23enum ClimberGoal : ubyte {
24 FULL_EXTEND = 0,
Filip Kujawaa7c8b412024-02-24 18:29:29 -080025 RETRACT = 1,
Maxwell Henderson7db29782024-02-24 20:10:26 -080026 STOWED = 2,
Filip Kujawa57507152024-01-31 20:09:25 -080027}
28
Filip Kujawa1286c012024-03-31 22:53:27 -070029enum AutoAimMode: ubyte {
30 NONE = 0, // No auto aim.
31 SPEAKER = 1, // Auto aim for the speaker shot.
32 SHUTTLE = 2, // Auto aim for the shuttle shot.
33}
34
Maxwell Hendersoned970292024-02-02 20:08:08 -080035table ShooterGoal {
36 catapult_goal:frc971.control_loops.catapult.CatapultGoal (id: 0);
Filip Kujawaa7c8b412024-02-24 18:29:29 -080037
Filip Kujawa1286c012024-03-31 22:53:27 -070038 auto_aim: AutoAimMode (id: 1);
Maxwell Hendersoned970292024-02-02 20:08:08 -080039
40 // Position for the turret when we aren't auto aiming
Filip Kujawa7a799602024-02-23 12:27:47 -080041 turret_position: frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 2);
Maxwell Hendersoned970292024-02-02 20:08:08 -080042
43 // Position for the altitude when we aren't auto aiming
Filip Kujawa7a799602024-02-23 12:27:47 -080044 altitude_position: frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 3);
Niko Sohmersc4d2c502024-02-19 19:35:35 -080045
Filip Kujawaa7c8b412024-02-24 18:29:29 -080046 // If true, we started with the ball loaded and should proceed to that state.
Filip Kujawa7a799602024-02-23 12:27:47 -080047 preloaded:bool = false (id: 4);
Maxwell Hendersoned970292024-02-02 20:08:08 -080048}
49
Filip Kujawaa7c8b412024-02-24 18:29:29 -080050// Represents goal for the note movement through the robot
Filip Kujawa7a799602024-02-23 12:27:47 -080051// to various scoring positions
52// NONE represents no goal for the note
53// AMP represents the goal to move the note and the extend to the AMP scoring position
54// TRAP represents the goal to move the note and the extend to the TRAP scoring position
55// CATAPULT represents the goal to load the note in the catapult.
56// It will complete the catapult goal before accepting new goals.
57enum NoteGoal : ubyte {
58 NONE = 0,
Filip Kujawa102a9b22024-02-18 09:40:23 -080059 AMP = 1,
60 TRAP = 2,
Filip Kujawa7a799602024-02-23 12:27:47 -080061 CATAPULT = 3,
Filip Kujawa102a9b22024-02-18 09:40:23 -080062}
63
Filip Kujawa102a9b22024-02-18 09:40:23 -080064
Niko Sohmers58e64c82024-01-14 12:49:54 -080065table Goal {
Filip Kujawa7a799602024-02-23 12:27:47 -080066 intake_goal:IntakeGoal = NONE (id: 0);
James Kuszmauldf3a3cb2024-03-15 22:03:37 -070067 intake_pivot:IntakePivotGoal = UP (id: 5);
Niko Sohmers4d93d4c2024-03-24 14:48:26 -070068
69 // Deprecated since climber no longer has an encoder
Filip Kujawaa7c8b412024-02-24 18:29:29 -080070 climber_goal:ClimberGoal (id: 1);
Niko Sohmers4d93d4c2024-03-24 14:48:26 -070071
72 // Voltage we want to give to climber
73 // Positive voltage is for climber up
74 // Negative voltage is for climber down
75 climber_goal_voltage:double = 0.0 (id: 8);
76
Filip Kujawaa7c8b412024-02-24 18:29:29 -080077 shooter_goal:ShooterGoal (id: 2);
78 note_goal:NoteGoal (id: 3);
79 fire: bool (id: 4);
James Kuszmauldf3a3cb2024-03-15 22:03:37 -070080
81 // Tells the climber to go absurdly slow on FULL_EXTEND
Niko Sohmers4d93d4c2024-03-24 14:48:26 -070082 // Deprecated now because we take care of this through
83 // climber_goal_voltage
84 slow_climber: bool = false (id: 6, deprecated);
Maxwell Henderson45878502024-03-15 19:35:25 -070085
86 // Spit on the extend motors
87 spit_extend: bool = false (id: 7);
Niko Sohmers58e64c82024-01-14 12:49:54 -080088}
Niko Sohmers3860f8a2024-01-12 21:05:19 -080089root_type Goal;