Stephan Massalt | d021f97 | 2020-01-05 20:41:23 -0800 | [diff] [blame] | 1 | include "frc971/control_loops/control_loops.fbs"; |
| 2 | include "frc971/control_loops/profiled_subsystem.fbs"; |
Maxwell Henderson | 3424299 | 2024-01-07 12:39:11 -0800 | [diff] [blame] | 3 | include "frc971/control_loops/flywheel/flywheel_controller_status.fbs"; |
Stephan Massalt | d021f97 | 2020-01-05 20:41:23 -0800 | [diff] [blame] | 4 | |
| 5 | namespace y2020.control_loops.superstructure; |
| 6 | |
milind-u | 0beb7dc | 2021-10-16 19:31:33 -0700 | [diff] [blame] | 7 | enum Subsystem:byte { |
| 8 | FINISHER, |
| 9 | ACCELERATOR, |
| 10 | TURRET |
| 11 | } |
| 12 | |
Tyler Chatow | cf41366 | 2020-02-09 14:36:36 -0800 | [diff] [blame] | 13 | table ShooterStatus { |
| 14 | // The final wheel shooting the ball |
Maxwell Henderson | 3424299 | 2024-01-07 12:39:11 -0800 | [diff] [blame] | 15 | finisher:frc971.control_loops.flywheel.FlywheelControllerStatus (id: 0); |
Tyler Chatow | cf41366 | 2020-02-09 14:36:36 -0800 | [diff] [blame] | 16 | |
Sabina Davis | edf8947 | 2020-02-17 15:27:37 -0800 | [diff] [blame] | 17 | // The subsystem to accelerate the ball before the finisher |
Austin Schuh | 9dcd520 | 2020-02-20 20:06:04 -0800 | [diff] [blame] | 18 | // Velocity is the fastest (top) wheel |
Maxwell Henderson | 3424299 | 2024-01-07 12:39:11 -0800 | [diff] [blame] | 19 | accelerator_left:frc971.control_loops.flywheel.FlywheelControllerStatus (id: 1); |
| 20 | accelerator_right:frc971.control_loops.flywheel.FlywheelControllerStatus (id: 2); |
Austin Schuh | 5c40ea4 | 2021-09-26 13:28:03 -0700 | [diff] [blame] | 21 | |
| 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-u | 7baf734 | 2021-08-25 18:31:26 -0700 | [diff] [blame] | 25 | |
| 26 | // The total number of balls we have shot |
| 27 | balls_shot:int (id: 4); |
Tyler Chatow | cf41366 | 2020-02-09 14:36:36 -0800 | [diff] [blame] | 28 | } |
| 29 | |
James Kuszmaul | b1b2d8e | 2020-02-21 21:11:46 -0800 | [diff] [blame] | 30 | table AimerStatus { |
| 31 | // The current goal angle for the turret auto-tracking, in radians. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 32 | turret_position:double (id: 0); |
James Kuszmaul | b1b2d8e | 2020-02-21 21:11:46 -0800 | [diff] [blame] | 33 | // The current goal velocity for the turret, in radians / sec. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 34 | turret_velocity:double (id: 1); |
James Kuszmaul | a53c3ac | 2020-02-22 19:36:01 -0800 | [diff] [blame] | 35 | // Whether we are currently aiming for the inner port. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 36 | aiming_for_inner_port:bool (id: 2); |
James Kuszmaul | 519585d | 2020-03-08 22:32:48 -0700 | [diff] [blame] | 37 | // The current distance to the target, in meters. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 38 | target_distance:double (id: 3); |
James Kuszmaul | 519585d | 2020-03-08 22:32:48 -0700 | [diff] [blame] | 39 | // The current "shot distance." When shooting on the fly, this may be |
| 40 | // different from the static distance to the target. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 41 | shot_distance:double (id: 4); |
James Kuszmaul | 88c5cef | 2021-10-23 13:17:36 -0700 | [diff] [blame] | 42 | // Amount the shot is off from being dead-straight relative to the inner port. |
| 43 | inner_port_angle:double (id: 5); |
James Kuszmaul | b1b2d8e | 2020-02-21 21:11:46 -0800 | [diff] [blame] | 44 | } |
| 45 | |
Stephan Massalt | d021f97 | 2020-01-05 20:41:23 -0800 | [diff] [blame] | 46 | table Status { |
| 47 | // All subsystems know their location. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 48 | zeroed:bool (id: 0); |
Stephan Massalt | d021f97 | 2020-01-05 20:41:23 -0800 | [diff] [blame] | 49 | |
Sabina Davis | 5187f86 | 2020-02-09 13:16:51 -0800 | [diff] [blame] | 50 | // If true, we have aborted. This is if one or all subsystem estops. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 51 | estopped:bool (id: 1); |
Stephan Massalt | d021f97 | 2020-01-05 20:41:23 -0800 | [diff] [blame] | 52 | |
Austin Schuh | 9dcd520 | 2020-02-20 20:06:04 -0800 | [diff] [blame] | 53 | // Subsystem status. |
Ravago Jones | 937587c | 2020-12-26 17:21:09 -0800 | [diff] [blame] | 54 | hood:frc971.control_loops.AbsoluteAndAbsoluteEncoderProfiledJointStatus (id: 2); |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 55 | intake:frc971.control_loops.AbsoluteEncoderProfiledJointStatus (id: 3); |
| 56 | turret:frc971.control_loops.PotAndAbsoluteEncoderProfiledJointStatus (id: 4); |
Tyler Chatow | cf41366 | 2020-02-09 14:36:36 -0800 | [diff] [blame] | 57 | |
| 58 | // Shooter subsystem status. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 59 | shooter:ShooterStatus (id: 5); |
Sabina Davis | 5187f86 | 2020-02-09 13:16:51 -0800 | [diff] [blame] | 60 | |
| 61 | // Status of the control_panel |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 62 | control_panel:frc971.control_loops.RelativeEncoderProfiledJointStatus (id: 6); |
James Kuszmaul | b1b2d8e | 2020-02-21 21:11:46 -0800 | [diff] [blame] | 63 | |
| 64 | // Status of the vision auto-tracking. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 65 | aimer:AimerStatus (id: 7); |
milind-u | 0beb7dc | 2021-10-16 19:31:33 -0700 | [diff] [blame] | 66 | |
| 67 | // Vector of the subsystems that are not at goal and are preventing shooting. |
| 68 | subsystems_not_ready:[Subsystem] (id: 8); |
milind | 1f1dca3 | 2021-07-03 13:50:07 -0700 | [diff] [blame] | 69 | |
| 70 | // Total number of status send failures. |
| 71 | send_failures:uint64 (id: 9); |
Stephan Massalt | d021f97 | 2020-01-05 20:41:23 -0800 | [diff] [blame] | 72 | } |
| 73 | |
| 74 | root_type Status; |