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); |
Tyler Chatow | cf41366 | 2020-02-09 14:36:36 -0800 | [diff] [blame] | 36 | } |
| 37 | |
James Kuszmaul | b1b2d8e | 2020-02-21 21:11:46 -0800 | [diff] [blame] | 38 | table AimerStatus { |
| 39 | // The current goal angle for the turret auto-tracking, in radians. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 40 | turret_position:double (id: 0); |
James Kuszmaul | b1b2d8e | 2020-02-21 21:11:46 -0800 | [diff] [blame] | 41 | // The current goal velocity for the turret, in radians / sec. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 42 | turret_velocity:double (id: 1); |
James Kuszmaul | a53c3ac | 2020-02-22 19:36:01 -0800 | [diff] [blame] | 43 | // Whether we are currently aiming for the inner port. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 44 | aiming_for_inner_port:bool (id: 2); |
James Kuszmaul | 519585d | 2020-03-08 22:32:48 -0700 | [diff] [blame] | 45 | // The current distance to the target, in meters. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 46 | target_distance:double (id: 3); |
James Kuszmaul | 519585d | 2020-03-08 22:32:48 -0700 | [diff] [blame] | 47 | // The current "shot distance." When shooting on the fly, this may be |
| 48 | // different from the static distance to the target. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 49 | shot_distance:double (id: 4); |
James Kuszmaul | b1b2d8e | 2020-02-21 21:11:46 -0800 | [diff] [blame] | 50 | } |
| 51 | |
Stephan Massalt | d021f97 | 2020-01-05 20:41:23 -0800 | [diff] [blame] | 52 | table Status { |
| 53 | // All subsystems know their location. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 54 | zeroed:bool (id: 0); |
Stephan Massalt | d021f97 | 2020-01-05 20:41:23 -0800 | [diff] [blame] | 55 | |
Sabina Davis | 5187f86 | 2020-02-09 13:16:51 -0800 | [diff] [blame] | 56 | // 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] | 57 | estopped:bool (id: 1); |
Stephan Massalt | d021f97 | 2020-01-05 20:41:23 -0800 | [diff] [blame] | 58 | |
Austin Schuh | 9dcd520 | 2020-02-20 20:06:04 -0800 | [diff] [blame] | 59 | // Subsystem status. |
Ravago Jones | 937587c | 2020-12-26 17:21:09 -0800 | [diff] [blame] | 60 | hood:frc971.control_loops.AbsoluteAndAbsoluteEncoderProfiledJointStatus (id: 2); |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 61 | intake:frc971.control_loops.AbsoluteEncoderProfiledJointStatus (id: 3); |
| 62 | turret:frc971.control_loops.PotAndAbsoluteEncoderProfiledJointStatus (id: 4); |
Tyler Chatow | cf41366 | 2020-02-09 14:36:36 -0800 | [diff] [blame] | 63 | |
| 64 | // Shooter subsystem status. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 65 | shooter:ShooterStatus (id: 5); |
Sabina Davis | 5187f86 | 2020-02-09 13:16:51 -0800 | [diff] [blame] | 66 | |
| 67 | // Status of the control_panel |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 68 | control_panel:frc971.control_loops.RelativeEncoderProfiledJointStatus (id: 6); |
James Kuszmaul | b1b2d8e | 2020-02-21 21:11:46 -0800 | [diff] [blame] | 69 | |
| 70 | // Status of the vision auto-tracking. |
Austin Schuh | d7851b0 | 2020-11-14 13:46:27 -0800 | [diff] [blame] | 71 | aimer:AimerStatus (id: 7); |
Stephan Massalt | d021f97 | 2020-01-05 20:41:23 -0800 | [diff] [blame] | 72 | } |
| 73 | |
| 74 | root_type Status; |