blob: 7b7912e2273cedc5e53a39537ff3d3f8d448a4fd [file] [log] [blame]
Niko Sohmers3860f8a2024-01-12 21:05:19 -08001include "frc971/control_loops/control_loops.fbs";
2include "frc971/control_loops/profiled_subsystem.fbs";
3
4namespace y2024.control_loops.superstructure;
5
Niko Sohmers58e64c82024-01-14 12:49:54 -08006// Contains if intake is intaking
Filip Kujawa102a9b22024-02-18 09:40:23 -08007enum IntakeRollerStatus : ubyte {
Niko Sohmers58e64c82024-01-14 12:49:54 -08008 NONE = 0,
9 SPITTING = 1,
10 INTAKING = 2,
11}
12
Niko Sohmersc4d2c502024-02-19 19:35:35 -080013enum CatapultState: ubyte {
Maxwell Hendersoned970292024-02-02 20:08:08 -080014 // Means we are waiting for a game piece
Niko Sohmersc4d2c502024-02-19 19:35:35 -080015 READY = 0,
Maxwell Hendersoned970292024-02-02 20:08:08 -080016 // Means we have a game piece
17 LOADED = 1,
18 // Means we are firing a game piece
19 FIRING = 2,
Niko Sohmersc4d2c502024-02-19 19:35:35 -080020 // We are retracting the bucket to do it again.
21 RETRACTING = 3,
22}
23
24table AimerStatus {
25 // The current goal angle for the turret auto-tracking, in radians.
26 turret_position:double (id: 0);
27 // The current goal velocity for the turret, in radians / sec.
28 turret_velocity:double (id: 1);
29 // The current distance to the target, in meters.
30 target_distance:double (id: 2);
31 // The current "shot distance." When shooting on the fly, this may be
32 // different from the static distance to the target.
33 shot_distance:double (id: 3);
Maxwell Hendersoned970292024-02-02 20:08:08 -080034}
35
Maxwell Hendersonbf04fb62024-01-19 17:56:07 -080036table ShooterStatus {
37 // Estimated angle and angular velocitiy of the turret.
Filip Kujawa102a9b22024-02-18 09:40:23 -080038 turret:frc971.control_loops.PotAndAbsoluteEncoderProfiledJointStatus (id: 0);
Maxwell Hendersonbf04fb62024-01-19 17:56:07 -080039
40 // Estimated angle and angular velocitiy of the catapult.
Filip Kujawa102a9b22024-02-18 09:40:23 -080041 catapult:frc971.control_loops.PotAndAbsoluteEncoderProfiledJointStatus (id: 1);
Maxwell Hendersonbf04fb62024-01-19 17:56:07 -080042
43 // Estimated angle and angular velocitiy of the altitude.
Filip Kujawa102a9b22024-02-18 09:40:23 -080044 altitude:frc971.control_loops.PotAndAbsoluteEncoderProfiledJointStatus (id: 2);
Maxwell Hendersoned970292024-02-02 20:08:08 -080045
Niko Sohmersc4d2c502024-02-19 19:35:35 -080046 catapult_state: CatapultState (id: 3);
47
48 // Status of the aimer
49 aimer:AimerStatus (id: 4);
Maxwell Hendersonbf04fb62024-01-19 17:56:07 -080050}
51
Niko Sohmers78f71352024-02-02 16:47:40 -080052// Contains status of transfer rollers
Filip Kujawa102a9b22024-02-18 09:40:23 -080053enum TransferRollerStatus : ubyte {
Niko Sohmers78f71352024-02-02 16:47:40 -080054 NONE = 0,
55 TRANSFERING_IN = 1,
56 TRANSFERING_OUT = 2,
57}
58
Filip Kujawa102a9b22024-02-18 09:40:23 -080059// Contains status of extend rollers
60// HAS_GAME_PIECE means we have a game piece
61// EMPTY means we don't have a game piece
62enum ExtendRollerStatus: ubyte {
63 HAS_GAME_PIECE = 0,
64 EMPTY = 1
65}
66
Niko Sohmers3860f8a2024-01-12 21:05:19 -080067table Status {
68 // All subsystems know their location.
69 zeroed:bool (id: 0);
70
71 // If true, we have aborted. This is the or of all subsystem estops.
72 estopped:bool (id: 1);
Niko Sohmers58e64c82024-01-14 12:49:54 -080073
Filip Kujawa102a9b22024-02-18 09:40:23 -080074 // Status of the rollers
75 intake_roller:IntakeRollerStatus (id: 2);
Niko Sohmers58e64c82024-01-14 12:49:54 -080076
77 // Estimated angle and angular velocitiy of the intake.
Filip Kujawa102a9b22024-02-18 09:40:23 -080078 intake_pivot:frc971.control_loops.AbsoluteEncoderProfiledJointStatus (id: 3);
Niko Sohmers78f71352024-02-02 16:47:40 -080079
Filip Kujawa102a9b22024-02-18 09:40:23 -080080 // Status of transfer rollers
81 transfer_roller:TransferRollerStatus (id: 4);
Filip Kujawa57507152024-01-31 20:09:25 -080082
83 // Estimated angle and angular velocitiy of the climber.
Filip Kujawa102a9b22024-02-18 09:40:23 -080084 climber:frc971.control_loops.PotAndAbsoluteEncoderProfiledJointStatus (id: 5);
Niko Sohmers11017112024-02-18 16:03:58 -080085
86 // Status of the subsytems involved in the shooter
Filip Kujawa102a9b22024-02-18 09:40:23 -080087 shooter:ShooterStatus (id: 6);
88
89 // Estimated angle and angular velocitiy of the extend.
90 extend:frc971.control_loops.PotAndAbsoluteEncoderProfiledJointStatus (id: 7);
91
92 // State of the extender rollers
93 extend_roller:ExtendRollerStatus (id: 8);
Niko Sohmers3860f8a2024-01-12 21:05:19 -080094}
95
96root_type Status;