Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 1 | include "frc971/control_loops/profiled_subsystem.fbs"; |
Nathan Leong | dd72800 | 2024-02-03 15:26:53 -0800 | [diff] [blame] | 2 | include "frc971/control_loops/catapult/catapult_goal.fbs"; |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 3 | |
| 4 | namespace y2024.control_loops.superstructure; |
| 5 | |
Filip Kujawa | 7a79960 | 2024-02-23 12:27:47 -0800 | [diff] [blame] | 6 | // 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. |
| 9 | enum IntakeGoal : ubyte { |
Niko Sohmers | 58e64c8 | 2024-01-14 12:49:54 -0800 | [diff] [blame] | 10 | NONE = 0, |
Filip Kujawa | 7a79960 | 2024-02-23 12:27:47 -0800 | [diff] [blame] | 11 | INTAKE = 1, |
| 12 | SPIT = 2, |
Niko Sohmers | 78f7135 | 2024-02-02 16:47:40 -0800 | [diff] [blame] | 13 | } |
| 14 | |
James Kuszmaul | df3a3cb | 2024-03-15 22:03:37 -0700 | [diff] [blame] | 15 | enum IntakePivotGoal : ubyte { |
| 16 | UP = 0, |
| 17 | DOWN = 1, |
| 18 | } |
| 19 | |
Filip Kujawa | 5750715 | 2024-01-31 20:09:25 -0800 | [diff] [blame] | 20 | // Represents goal for climber |
| 21 | // FULL_EXTEND is for fully extending the climber |
Filip Kujawa | 5750715 | 2024-01-31 20:09:25 -0800 | [diff] [blame] | 22 | // RETRACT is for retracting the climber |
| 23 | enum ClimberGoal : ubyte { |
| 24 | FULL_EXTEND = 0, |
Filip Kujawa | a7c8b41 | 2024-02-24 18:29:29 -0800 | [diff] [blame] | 25 | RETRACT = 1, |
Maxwell Henderson | 7db2978 | 2024-02-24 20:10:26 -0800 | [diff] [blame] | 26 | STOWED = 2, |
Filip Kujawa | 5750715 | 2024-01-31 20:09:25 -0800 | [diff] [blame] | 27 | } |
| 28 | |
Maxwell Henderson | ed97029 | 2024-02-02 20:08:08 -0800 | [diff] [blame] | 29 | table ShooterGoal { |
| 30 | catapult_goal:frc971.control_loops.catapult.CatapultGoal (id: 0); |
Filip Kujawa | a7c8b41 | 2024-02-24 18:29:29 -0800 | [diff] [blame] | 31 | |
| 32 | // If true we ignore the other provided positions |
Filip Kujawa | 7a79960 | 2024-02-23 12:27:47 -0800 | [diff] [blame] | 33 | auto_aim: bool (id: 1); |
Maxwell Henderson | ed97029 | 2024-02-02 20:08:08 -0800 | [diff] [blame] | 34 | |
| 35 | // Position for the turret when we aren't auto aiming |
Filip Kujawa | 7a79960 | 2024-02-23 12:27:47 -0800 | [diff] [blame] | 36 | turret_position: frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 2); |
Maxwell Henderson | ed97029 | 2024-02-02 20:08:08 -0800 | [diff] [blame] | 37 | |
| 38 | // Position for the altitude when we aren't auto aiming |
Filip Kujawa | 7a79960 | 2024-02-23 12:27:47 -0800 | [diff] [blame] | 39 | altitude_position: frc971.control_loops.StaticZeroingSingleDOFProfiledSubsystemGoal (id: 3); |
Niko Sohmers | c4d2c50 | 2024-02-19 19:35:35 -0800 | [diff] [blame] | 40 | |
Filip Kujawa | a7c8b41 | 2024-02-24 18:29:29 -0800 | [diff] [blame] | 41 | // If true, we started with the ball loaded and should proceed to that state. |
Filip Kujawa | 7a79960 | 2024-02-23 12:27:47 -0800 | [diff] [blame] | 42 | preloaded:bool = false (id: 4); |
Maxwell Henderson | ed97029 | 2024-02-02 20:08:08 -0800 | [diff] [blame] | 43 | } |
| 44 | |
Filip Kujawa | a7c8b41 | 2024-02-24 18:29:29 -0800 | [diff] [blame] | 45 | // Represents goal for the note movement through the robot |
Filip Kujawa | 7a79960 | 2024-02-23 12:27:47 -0800 | [diff] [blame] | 46 | // to various scoring positions |
| 47 | // NONE represents no goal for the note |
| 48 | // AMP represents the goal to move the note and the extend to the AMP scoring position |
| 49 | // TRAP represents the goal to move the note and the extend to the TRAP scoring position |
| 50 | // CATAPULT represents the goal to load the note in the catapult. |
| 51 | // It will complete the catapult goal before accepting new goals. |
| 52 | enum NoteGoal : ubyte { |
| 53 | NONE = 0, |
Filip Kujawa | 102a9b2 | 2024-02-18 09:40:23 -0800 | [diff] [blame] | 54 | AMP = 1, |
| 55 | TRAP = 2, |
Filip Kujawa | 7a79960 | 2024-02-23 12:27:47 -0800 | [diff] [blame] | 56 | CATAPULT = 3, |
Filip Kujawa | 102a9b2 | 2024-02-18 09:40:23 -0800 | [diff] [blame] | 57 | } |
| 58 | |
Filip Kujawa | 102a9b2 | 2024-02-18 09:40:23 -0800 | [diff] [blame] | 59 | |
Niko Sohmers | 58e64c8 | 2024-01-14 12:49:54 -0800 | [diff] [blame] | 60 | table Goal { |
Filip Kujawa | 7a79960 | 2024-02-23 12:27:47 -0800 | [diff] [blame] | 61 | intake_goal:IntakeGoal = NONE (id: 0); |
James Kuszmaul | df3a3cb | 2024-03-15 22:03:37 -0700 | [diff] [blame] | 62 | intake_pivot:IntakePivotGoal = UP (id: 5); |
Niko Sohmers | 4d93d4c | 2024-03-24 14:48:26 -0700 | [diff] [blame^] | 63 | |
| 64 | // Deprecated since climber no longer has an encoder |
Filip Kujawa | a7c8b41 | 2024-02-24 18:29:29 -0800 | [diff] [blame] | 65 | climber_goal:ClimberGoal (id: 1); |
Niko Sohmers | 4d93d4c | 2024-03-24 14:48:26 -0700 | [diff] [blame^] | 66 | |
| 67 | // Voltage we want to give to climber |
| 68 | // Positive voltage is for climber up |
| 69 | // Negative voltage is for climber down |
| 70 | climber_goal_voltage:double = 0.0 (id: 8); |
| 71 | |
Filip Kujawa | a7c8b41 | 2024-02-24 18:29:29 -0800 | [diff] [blame] | 72 | shooter_goal:ShooterGoal (id: 2); |
| 73 | note_goal:NoteGoal (id: 3); |
| 74 | fire: bool (id: 4); |
James Kuszmaul | df3a3cb | 2024-03-15 22:03:37 -0700 | [diff] [blame] | 75 | |
| 76 | // Tells the climber to go absurdly slow on FULL_EXTEND |
Niko Sohmers | 4d93d4c | 2024-03-24 14:48:26 -0700 | [diff] [blame^] | 77 | // Deprecated now because we take care of this through |
| 78 | // climber_goal_voltage |
| 79 | slow_climber: bool = false (id: 6, deprecated); |
Maxwell Henderson | 4587850 | 2024-03-15 19:35:25 -0700 | [diff] [blame] | 80 | |
| 81 | // Spit on the extend motors |
| 82 | spit_extend: bool = false (id: 7); |
Niko Sohmers | 58e64c8 | 2024-01-14 12:49:54 -0800 | [diff] [blame] | 83 | } |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 84 | root_type Goal; |