blob: adca3260155a8b2c8e86e4a8462b2907f8911e97 [file] [log] [blame]
Stephan Massaltd021f972020-01-05 20:41:23 -08001include "frc971/control_loops/control_loops.fbs";
2include "frc971/control_loops/profiled_subsystem.fbs";
3
4namespace y2020.control_loops.superstructure;
5
Sabina Davisedf89472020-02-17 15:27:37 -08006table FlywheelControllerStatus {
Tyler Chatowcf413662020-02-09 14:36:36 -08007 // The current average velocity in radians/second over the last kHistoryLength
8 // in shooter.h
Austin Schuhd7851b02020-11-14 13:46:27 -08009 avg_angular_velocity:double (id: 0);
Tyler Chatowcf413662020-02-09 14:36:36 -080010
11 // The current instantaneous filtered velocity in radians/second.
Austin Schuhd7851b02020-11-14 13:46:27 -080012 angular_velocity:double (id: 1);
Tyler Chatowcf413662020-02-09 14:36:36 -080013
14 // The target speed selected by the lookup table or from manual override
15 // Can be compared to velocity to determine if ready.
Austin Schuhd7851b02020-11-14 13:46:27 -080016 angular_velocity_goal:double (id: 2);
Austin Schuh43b9ae92020-02-29 23:08:38 -080017
18 // Voltage error.
Austin Schuhd7851b02020-11-14 13:46:27 -080019 voltage_error:double (id: 3);
Austin Schuh80476772021-03-06 20:17:36 -080020
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 Chatowcf413662020-02-09 14:36:36 -080026}
27
28table ShooterStatus {
29 // The final wheel shooting the ball
Austin Schuhd7851b02020-11-14 13:46:27 -080030 finisher:FlywheelControllerStatus (id: 0);
Tyler Chatowcf413662020-02-09 14:36:36 -080031
Sabina Davisedf89472020-02-17 15:27:37 -080032 // The subsystem to accelerate the ball before the finisher
Austin Schuh9dcd5202020-02-20 20:06:04 -080033 // Velocity is the fastest (top) wheel
Austin Schuhd7851b02020-11-14 13:46:27 -080034 accelerator_left:FlywheelControllerStatus (id: 1);
35 accelerator_right:FlywheelControllerStatus (id: 2);
Tyler Chatowcf413662020-02-09 14:36:36 -080036}
37
James Kuszmaulb1b2d8e2020-02-21 21:11:46 -080038table AimerStatus {
39 // The current goal angle for the turret auto-tracking, in radians.
Austin Schuhd7851b02020-11-14 13:46:27 -080040 turret_position:double (id: 0);
James Kuszmaulb1b2d8e2020-02-21 21:11:46 -080041 // The current goal velocity for the turret, in radians / sec.
Austin Schuhd7851b02020-11-14 13:46:27 -080042 turret_velocity:double (id: 1);
James Kuszmaula53c3ac2020-02-22 19:36:01 -080043 // Whether we are currently aiming for the inner port.
Austin Schuhd7851b02020-11-14 13:46:27 -080044 aiming_for_inner_port:bool (id: 2);
James Kuszmaul519585d2020-03-08 22:32:48 -070045 // The current distance to the target, in meters.
Austin Schuhd7851b02020-11-14 13:46:27 -080046 target_distance:double (id: 3);
James Kuszmaul519585d2020-03-08 22:32:48 -070047 // The current "shot distance." When shooting on the fly, this may be
48 // different from the static distance to the target.
Austin Schuhd7851b02020-11-14 13:46:27 -080049 shot_distance:double (id: 4);
James Kuszmaulb1b2d8e2020-02-21 21:11:46 -080050}
51
Stephan Massaltd021f972020-01-05 20:41:23 -080052table Status {
53 // All subsystems know their location.
Austin Schuhd7851b02020-11-14 13:46:27 -080054 zeroed:bool (id: 0);
Stephan Massaltd021f972020-01-05 20:41:23 -080055
Sabina Davis5187f862020-02-09 13:16:51 -080056 // If true, we have aborted. This is if one or all subsystem estops.
Austin Schuhd7851b02020-11-14 13:46:27 -080057 estopped:bool (id: 1);
Stephan Massaltd021f972020-01-05 20:41:23 -080058
Austin Schuh9dcd5202020-02-20 20:06:04 -080059 // Subsystem status.
Ravago Jones937587c2020-12-26 17:21:09 -080060 hood:frc971.control_loops.AbsoluteAndAbsoluteEncoderProfiledJointStatus (id: 2);
Austin Schuhd7851b02020-11-14 13:46:27 -080061 intake:frc971.control_loops.AbsoluteEncoderProfiledJointStatus (id: 3);
62 turret:frc971.control_loops.PotAndAbsoluteEncoderProfiledJointStatus (id: 4);
Tyler Chatowcf413662020-02-09 14:36:36 -080063
64 // Shooter subsystem status.
Austin Schuhd7851b02020-11-14 13:46:27 -080065 shooter:ShooterStatus (id: 5);
Sabina Davis5187f862020-02-09 13:16:51 -080066
67 // Status of the control_panel
Austin Schuhd7851b02020-11-14 13:46:27 -080068 control_panel:frc971.control_loops.RelativeEncoderProfiledJointStatus (id: 6);
James Kuszmaulb1b2d8e2020-02-21 21:11:46 -080069
70 // Status of the vision auto-tracking.
Austin Schuhd7851b02020-11-14 13:46:27 -080071 aimer:AimerStatus (id: 7);
Stephan Massaltd021f972020-01-05 20:41:23 -080072}
73
74root_type Status;