blob: d3f98e5fa0d644ed82bbf67c1073d9d8bd9b122b [file] [log] [blame]
Stephan Massaltd021f972020-01-05 20:41:23 -08001include "frc971/control_loops/control_loops.fbs";
2include "frc971/control_loops/profiled_subsystem.fbs";
Maxwell Henderson34242992024-01-07 12:39:11 -08003include "frc971/control_loops/flywheel/flywheel_controller_status.fbs";
Stephan Massaltd021f972020-01-05 20:41:23 -08004
5namespace y2020.control_loops.superstructure;
6
milind-u0beb7dc2021-10-16 19:31:33 -07007enum Subsystem:byte {
8 FINISHER,
9 ACCELERATOR,
10 TURRET
11}
12
Tyler Chatowcf413662020-02-09 14:36:36 -080013table ShooterStatus {
14 // The final wheel shooting the ball
Maxwell Henderson34242992024-01-07 12:39:11 -080015 finisher:frc971.control_loops.flywheel.FlywheelControllerStatus (id: 0);
Tyler Chatowcf413662020-02-09 14:36:36 -080016
Sabina Davisedf89472020-02-17 15:27:37 -080017 // The subsystem to accelerate the ball before the finisher
Austin Schuh9dcd5202020-02-20 20:06:04 -080018 // Velocity is the fastest (top) wheel
Maxwell Henderson34242992024-01-07 12:39:11 -080019 accelerator_left:frc971.control_loops.flywheel.FlywheelControllerStatus (id: 1);
20 accelerator_right:frc971.control_loops.flywheel.FlywheelControllerStatus (id: 2);
Austin Schuh5c40ea42021-09-26 13:28:03 -070021
22 // If the shooter is ready, this is true. Note: don't use this for status
23 // checking, only for plotting. Changes in goal take time to impact this.
24 ready:bool (id: 3);
milind-u7baf7342021-08-25 18:31:26 -070025
26 // The total number of balls we have shot
27 balls_shot:int (id: 4);
Tyler Chatowcf413662020-02-09 14:36:36 -080028}
29
James Kuszmaulb1b2d8e2020-02-21 21:11:46 -080030table AimerStatus {
31 // The current goal angle for the turret auto-tracking, in radians.
Austin Schuhd7851b02020-11-14 13:46:27 -080032 turret_position:double (id: 0);
James Kuszmaulb1b2d8e2020-02-21 21:11:46 -080033 // The current goal velocity for the turret, in radians / sec.
Austin Schuhd7851b02020-11-14 13:46:27 -080034 turret_velocity:double (id: 1);
James Kuszmaula53c3ac2020-02-22 19:36:01 -080035 // Whether we are currently aiming for the inner port.
Austin Schuhd7851b02020-11-14 13:46:27 -080036 aiming_for_inner_port:bool (id: 2);
James Kuszmaul519585d2020-03-08 22:32:48 -070037 // The current distance to the target, in meters.
Austin Schuhd7851b02020-11-14 13:46:27 -080038 target_distance:double (id: 3);
James Kuszmaul519585d2020-03-08 22:32:48 -070039 // The current "shot distance." When shooting on the fly, this may be
40 // different from the static distance to the target.
Austin Schuhd7851b02020-11-14 13:46:27 -080041 shot_distance:double (id: 4);
James Kuszmaul88c5cef2021-10-23 13:17:36 -070042 // Amount the shot is off from being dead-straight relative to the inner port.
43 inner_port_angle:double (id: 5);
James Kuszmaulb1b2d8e2020-02-21 21:11:46 -080044}
45
Stephan Massaltd021f972020-01-05 20:41:23 -080046table Status {
47 // All subsystems know their location.
Austin Schuhd7851b02020-11-14 13:46:27 -080048 zeroed:bool (id: 0);
Stephan Massaltd021f972020-01-05 20:41:23 -080049
Sabina Davis5187f862020-02-09 13:16:51 -080050 // If true, we have aborted. This is if one or all subsystem estops.
Austin Schuhd7851b02020-11-14 13:46:27 -080051 estopped:bool (id: 1);
Stephan Massaltd021f972020-01-05 20:41:23 -080052
Austin Schuh9dcd5202020-02-20 20:06:04 -080053 // Subsystem status.
Ravago Jones937587c2020-12-26 17:21:09 -080054 hood:frc971.control_loops.AbsoluteAndAbsoluteEncoderProfiledJointStatus (id: 2);
Austin Schuhd7851b02020-11-14 13:46:27 -080055 intake:frc971.control_loops.AbsoluteEncoderProfiledJointStatus (id: 3);
56 turret:frc971.control_loops.PotAndAbsoluteEncoderProfiledJointStatus (id: 4);
Tyler Chatowcf413662020-02-09 14:36:36 -080057
58 // Shooter subsystem status.
Austin Schuhd7851b02020-11-14 13:46:27 -080059 shooter:ShooterStatus (id: 5);
Sabina Davis5187f862020-02-09 13:16:51 -080060
61 // Status of the control_panel
Austin Schuhd7851b02020-11-14 13:46:27 -080062 control_panel:frc971.control_loops.RelativeEncoderProfiledJointStatus (id: 6);
James Kuszmaulb1b2d8e2020-02-21 21:11:46 -080063
64 // Status of the vision auto-tracking.
Austin Schuhd7851b02020-11-14 13:46:27 -080065 aimer:AimerStatus (id: 7);
milind-u0beb7dc2021-10-16 19:31:33 -070066
67 // Vector of the subsystems that are not at goal and are preventing shooting.
68 subsystems_not_ready:[Subsystem] (id: 8);
milind1f1dca32021-07-03 13:50:07 -070069
70 // Total number of status send failures.
71 send_failures:uint64 (id: 9);
Stephan Massaltd021f972020-01-05 20:41:23 -080072}
73
74root_type Status;