Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 1 | include "frc971/control_loops/control_loops.fbs"; |
| 2 | include "frc971/control_loops/profiled_subsystem.fbs"; |
| 3 | |
| 4 | namespace y2024.control_loops.superstructure; |
| 5 | |
Niko Sohmers | 58e64c8 | 2024-01-14 12:49:54 -0800 | [diff] [blame] | 6 | // Contains if intake is intaking |
Filip Kujawa | 102a9b2 | 2024-02-18 09:40:23 -0800 | [diff] [blame] | 7 | enum IntakeRollerStatus : ubyte { |
Niko Sohmers | 58e64c8 | 2024-01-14 12:49:54 -0800 | [diff] [blame] | 8 | NONE = 0, |
| 9 | SPITTING = 1, |
| 10 | INTAKING = 2, |
| 11 | } |
| 12 | |
Maxwell Henderson | ed97029 | 2024-02-02 20:08:08 -0800 | [diff] [blame] | 13 | enum CatapultStatus: ubyte { |
| 14 | // Means we are waiting for a game piece |
| 15 | IDLE = 0, |
| 16 | // Means we have a game piece |
| 17 | LOADED = 1, |
| 18 | // Means we are firing a game piece |
| 19 | FIRING = 2, |
| 20 | } |
| 21 | |
Maxwell Henderson | bf04fb6 | 2024-01-19 17:56:07 -0800 | [diff] [blame] | 22 | table ShooterStatus { |
| 23 | // Estimated angle and angular velocitiy of the turret. |
Filip Kujawa | 102a9b2 | 2024-02-18 09:40:23 -0800 | [diff] [blame] | 24 | turret:frc971.control_loops.PotAndAbsoluteEncoderProfiledJointStatus (id: 0); |
Maxwell Henderson | bf04fb6 | 2024-01-19 17:56:07 -0800 | [diff] [blame] | 25 | |
| 26 | // Estimated angle and angular velocitiy of the catapult. |
Filip Kujawa | 102a9b2 | 2024-02-18 09:40:23 -0800 | [diff] [blame] | 27 | catapult:frc971.control_loops.PotAndAbsoluteEncoderProfiledJointStatus (id: 1); |
Maxwell Henderson | bf04fb6 | 2024-01-19 17:56:07 -0800 | [diff] [blame] | 28 | |
| 29 | // Estimated angle and angular velocitiy of the altitude. |
Filip Kujawa | 102a9b2 | 2024-02-18 09:40:23 -0800 | [diff] [blame] | 30 | altitude:frc971.control_loops.PotAndAbsoluteEncoderProfiledJointStatus (id: 2); |
Maxwell Henderson | ed97029 | 2024-02-02 20:08:08 -0800 | [diff] [blame] | 31 | |
Filip Kujawa | 102a9b2 | 2024-02-18 09:40:23 -0800 | [diff] [blame] | 32 | catapult_state: CatapultStatus (id: 3); |
Maxwell Henderson | bf04fb6 | 2024-01-19 17:56:07 -0800 | [diff] [blame] | 33 | } |
| 34 | |
Niko Sohmers | 78f7135 | 2024-02-02 16:47:40 -0800 | [diff] [blame] | 35 | // Contains status of transfer rollers |
Filip Kujawa | 102a9b2 | 2024-02-18 09:40:23 -0800 | [diff] [blame] | 36 | enum TransferRollerStatus : ubyte { |
Niko Sohmers | 78f7135 | 2024-02-02 16:47:40 -0800 | [diff] [blame] | 37 | NONE = 0, |
| 38 | TRANSFERING_IN = 1, |
| 39 | TRANSFERING_OUT = 2, |
| 40 | } |
| 41 | |
Filip Kujawa | 102a9b2 | 2024-02-18 09:40:23 -0800 | [diff] [blame] | 42 | // Contains status of extend rollers |
| 43 | // HAS_GAME_PIECE means we have a game piece |
| 44 | // EMPTY means we don't have a game piece |
| 45 | enum ExtendRollerStatus: ubyte { |
| 46 | HAS_GAME_PIECE = 0, |
| 47 | EMPTY = 1 |
| 48 | } |
| 49 | |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 50 | table Status { |
| 51 | // All subsystems know their location. |
| 52 | zeroed:bool (id: 0); |
| 53 | |
| 54 | // If true, we have aborted. This is the or of all subsystem estops. |
| 55 | estopped:bool (id: 1); |
Niko Sohmers | 58e64c8 | 2024-01-14 12:49:54 -0800 | [diff] [blame] | 56 | |
Filip Kujawa | 102a9b2 | 2024-02-18 09:40:23 -0800 | [diff] [blame] | 57 | // Status of the rollers |
| 58 | intake_roller:IntakeRollerStatus (id: 2); |
Niko Sohmers | 58e64c8 | 2024-01-14 12:49:54 -0800 | [diff] [blame] | 59 | |
| 60 | // Estimated angle and angular velocitiy of the intake. |
Filip Kujawa | 102a9b2 | 2024-02-18 09:40:23 -0800 | [diff] [blame] | 61 | intake_pivot:frc971.control_loops.AbsoluteEncoderProfiledJointStatus (id: 3); |
Niko Sohmers | 78f7135 | 2024-02-02 16:47:40 -0800 | [diff] [blame] | 62 | |
Filip Kujawa | 102a9b2 | 2024-02-18 09:40:23 -0800 | [diff] [blame] | 63 | // Status of transfer rollers |
| 64 | transfer_roller:TransferRollerStatus (id: 4); |
Filip Kujawa | 5750715 | 2024-01-31 20:09:25 -0800 | [diff] [blame] | 65 | |
| 66 | // Estimated angle and angular velocitiy of the climber. |
Filip Kujawa | 102a9b2 | 2024-02-18 09:40:23 -0800 | [diff] [blame] | 67 | climber:frc971.control_loops.PotAndAbsoluteEncoderProfiledJointStatus (id: 5); |
Niko Sohmers | 1101711 | 2024-02-18 16:03:58 -0800 | [diff] [blame] | 68 | |
| 69 | // Status of the subsytems involved in the shooter |
Filip Kujawa | 102a9b2 | 2024-02-18 09:40:23 -0800 | [diff] [blame] | 70 | shooter:ShooterStatus (id: 6); |
| 71 | |
| 72 | // Estimated angle and angular velocitiy of the extend. |
| 73 | extend:frc971.control_loops.PotAndAbsoluteEncoderProfiledJointStatus (id: 7); |
| 74 | |
| 75 | // State of the extender rollers |
| 76 | extend_roller:ExtendRollerStatus (id: 8); |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 77 | } |
| 78 | |
| 79 | root_type Status; |