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"; |
| 3 | |
| 4 | namespace y2020.control_loops.superstructure; |
| 5 | |
Sabina Davis | edf8947 | 2020-02-17 15:27:37 -0800 | [diff] [blame] | 6 | table FlywheelControllerStatus { |
Tyler Chatow | cf41366 | 2020-02-09 14:36:36 -0800 | [diff] [blame] | 7 | // The current average velocity in radians/second over the last kHistoryLength |
| 8 | // in shooter.h |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 9 | avg_angular_velocity:double (id: 0); |
Tyler Chatow | cf41366 | 2020-02-09 14:36:36 -0800 | [diff] [blame] | 10 | |
| 11 | // The current instantaneous filtered velocity in radians/second. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 12 | angular_velocity:double (id: 1); |
Tyler Chatow | cf41366 | 2020-02-09 14:36:36 -0800 | [diff] [blame] | 13 | |
| 14 | // The target speed selected by the lookup table or from manual override |
| 15 | // Can be compared to velocity to determine if ready. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 16 | angular_velocity_goal:double (id: 2); |
Austin Schuh | 43b9ae9 | 2020-02-29 23:08:38 -0800 | [diff] [blame] | 17 | |
| 18 | // Voltage error. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 19 | voltage_error:double (id: 3); |
Austin Schuh | 8047677 | 2021-03-06 20:17:36 -0800 | [diff] [blame] | 20 | |
| 21 | // The commanded battery current. |
| 22 | commanded_current:double (id: 4); |
| 23 | |
| 24 | // The angular velocity of the flywheel computed using delta x / delta t |
| 25 | dt_angular_velocity:double (id: 5); |
Tyler Chatow | cf41366 | 2020-02-09 14:36:36 -0800 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | table ShooterStatus { |
| 29 | // The final wheel shooting the ball |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 30 | finisher:FlywheelControllerStatus (id: 0); |
Tyler Chatow | cf41366 | 2020-02-09 14:36:36 -0800 | [diff] [blame] | 31 | |
Sabina Davis | edf8947 | 2020-02-17 15:27:37 -0800 | [diff] [blame] | 32 | // The subsystem to accelerate the ball before the finisher |
Austin Schuh | 9dcd520 | 2020-02-20 20:06:04 -0800 | [diff] [blame] | 33 | // Velocity is the fastest (top) wheel |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 34 | accelerator_left:FlywheelControllerStatus (id: 1); |
| 35 | accelerator_right:FlywheelControllerStatus (id: 2); |
Austin Schuh | 5c40ea4 | 2021-09-26 13:28:03 -0700 | [diff] [blame] | 36 | |
| 37 | // If the shooter is ready, this is true. Note: don't use this for status |
| 38 | // checking, only for plotting. Changes in goal take time to impact this. |
| 39 | ready:bool (id: 3); |
milind-u | 7baf734 | 2021-08-25 18:31:26 -0700 | [diff] [blame^] | 40 | |
| 41 | // The total number of balls we have shot |
| 42 | balls_shot:int (id: 4); |
Tyler Chatow | cf41366 | 2020-02-09 14:36:36 -0800 | [diff] [blame] | 43 | } |
| 44 | |
James Kuszmaul | b1b2d8e | 2020-02-21 21:11:46 -0800 | [diff] [blame] | 45 | table AimerStatus { |
| 46 | // The current goal angle for the turret auto-tracking, in radians. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 47 | turret_position:double (id: 0); |
James Kuszmaul | b1b2d8e | 2020-02-21 21:11:46 -0800 | [diff] [blame] | 48 | // The current goal velocity for the turret, in radians / sec. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 49 | turret_velocity:double (id: 1); |
James Kuszmaul | a53c3ac | 2020-02-22 19:36:01 -0800 | [diff] [blame] | 50 | // Whether we are currently aiming for the inner port. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 51 | aiming_for_inner_port:bool (id: 2); |
James Kuszmaul | 519585d | 2020-03-08 22:32:48 -0700 | [diff] [blame] | 52 | // The current distance to the target, in meters. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 53 | target_distance:double (id: 3); |
James Kuszmaul | 519585d | 2020-03-08 22:32:48 -0700 | [diff] [blame] | 54 | // The current "shot distance." When shooting on the fly, this may be |
| 55 | // different from the static distance to the target. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 56 | shot_distance:double (id: 4); |
James Kuszmaul | b1b2d8e | 2020-02-21 21:11:46 -0800 | [diff] [blame] | 57 | } |
| 58 | |
Stephan Massalt | d021f97 | 2020-01-05 20:41:23 -0800 | [diff] [blame] | 59 | table Status { |
| 60 | // All subsystems know their location. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 61 | zeroed:bool (id: 0); |
Stephan Massalt | d021f97 | 2020-01-05 20:41:23 -0800 | [diff] [blame] | 62 | |
Sabina Davis | 5187f86 | 2020-02-09 13:16:51 -0800 | [diff] [blame] | 63 | // 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] | 64 | estopped:bool (id: 1); |
Stephan Massalt | d021f97 | 2020-01-05 20:41:23 -0800 | [diff] [blame] | 65 | |
Austin Schuh | 9dcd520 | 2020-02-20 20:06:04 -0800 | [diff] [blame] | 66 | // Subsystem status. |
Ravago Jones | 937587c | 2020-12-26 17:21:09 -0800 | [diff] [blame] | 67 | hood:frc971.control_loops.AbsoluteAndAbsoluteEncoderProfiledJointStatus (id: 2); |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 68 | intake:frc971.control_loops.AbsoluteEncoderProfiledJointStatus (id: 3); |
| 69 | turret:frc971.control_loops.PotAndAbsoluteEncoderProfiledJointStatus (id: 4); |
Tyler Chatow | cf41366 | 2020-02-09 14:36:36 -0800 | [diff] [blame] | 70 | |
| 71 | // Shooter subsystem status. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 72 | shooter:ShooterStatus (id: 5); |
Sabina Davis | 5187f86 | 2020-02-09 13:16:51 -0800 | [diff] [blame] | 73 | |
| 74 | // Status of the control_panel |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 75 | control_panel:frc971.control_loops.RelativeEncoderProfiledJointStatus (id: 6); |
James Kuszmaul | b1b2d8e | 2020-02-21 21:11:46 -0800 | [diff] [blame] | 76 | |
| 77 | // Status of the vision auto-tracking. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 78 | aimer:AimerStatus (id: 7); |
Stephan Massalt | d021f97 | 2020-01-05 20:41:23 -0800 | [diff] [blame] | 79 | } |
| 80 | |
| 81 | root_type Status; |