blob: 88c335b9d5f2d7811d1711a2bef013ab7d815a0c [file] [log] [blame]
Alex Perrycb7da4b2019-08-28 19:35:56 -07001include "frc971/control_loops/control_loops.fbs";
2include "frc971/control_loops/profiled_subsystem.fbs";
3
4namespace y2017.control_loops.superstructure;
5
6table IndexerStatus {
7 // The current average velocity in radians/second. Positive is moving balls up
8 // towards the shooter. This is the angular velocity of the inner piece.
Austin Schuhd7851b02020-11-14 13:46:27 -08009 avg_angular_velocity:double (id: 0);
Alex Perrycb7da4b2019-08-28 19:35:56 -070010
11 // The current instantaneous filtered velocity in radians/second.
Austin Schuhd7851b02020-11-14 13:46:27 -080012 angular_velocity:double (id: 1);
Alex Perrycb7da4b2019-08-28 19:35:56 -070013
14 // True if the indexer is ready. It is better to compare the velocities
15 // directly so there isn't confusion on if the goal is up to date.
Austin Schuhd7851b02020-11-14 13:46:27 -080016 ready:bool (id: 2);
Alex Perrycb7da4b2019-08-28 19:35:56 -070017
18 // True if the indexer is stuck.
Austin Schuhd7851b02020-11-14 13:46:27 -080019 stuck:bool (id: 3);
20 stuck_voltage:float (id: 4);
Alex Perrycb7da4b2019-08-28 19:35:56 -070021
22 // The state of the indexer state machine.
Austin Schuhd7851b02020-11-14 13:46:27 -080023 state:int32 (id: 5);
Alex Perrycb7da4b2019-08-28 19:35:56 -070024
25 // The estimated voltage error from the kalman filter in volts.
Austin Schuhd7851b02020-11-14 13:46:27 -080026 voltage_error:double (id: 6);
Alex Perrycb7da4b2019-08-28 19:35:56 -070027 // The estimated voltage error from the stuck indexer kalman filter.
Austin Schuhd7851b02020-11-14 13:46:27 -080028 stuck_voltage_error:double (id: 7);
Alex Perrycb7da4b2019-08-28 19:35:56 -070029
30 // The current velocity measured as delta x / delta t in radians/sec.
Austin Schuhd7851b02020-11-14 13:46:27 -080031 instantaneous_velocity:double (id: 8);
Alex Perrycb7da4b2019-08-28 19:35:56 -070032
33 // The error between our measurement and expected measurement in radians.
Austin Schuhd7851b02020-11-14 13:46:27 -080034 position_error:double (id: 9);
Alex Perrycb7da4b2019-08-28 19:35:56 -070035}
36
37table ShooterStatus {
38 // The current average velocity in radians/second.
Austin Schuhd7851b02020-11-14 13:46:27 -080039 avg_angular_velocity:double (id: 0);
Alex Perrycb7da4b2019-08-28 19:35:56 -070040
41 // The current instantaneous filtered velocity in radians/second.
Austin Schuhd7851b02020-11-14 13:46:27 -080042 angular_velocity:double (id: 1);
Alex Perrycb7da4b2019-08-28 19:35:56 -070043
44 // True if the shooter is ready. It is better to compare the velocities
45 // directly so there isn't confusion on if the goal is up to date.
Austin Schuhd7851b02020-11-14 13:46:27 -080046 ready:bool (id: 2);
Alex Perrycb7da4b2019-08-28 19:35:56 -070047
48 // The estimated voltage error from the kalman filter in volts.
Austin Schuhd7851b02020-11-14 13:46:27 -080049 voltage_error:double (id: 3);
Alex Perrycb7da4b2019-08-28 19:35:56 -070050
51 // The current velocity measured as delta x / delta t in radians/sec.
Austin Schuhd7851b02020-11-14 13:46:27 -080052 instantaneous_velocity:double (id: 4);
53 filtered_velocity:double (id: 5);
54 fixed_instantaneous_velocity:double (id: 6);
Alex Perrycb7da4b2019-08-28 19:35:56 -070055
56 // The error between our measurement and expected measurement in radians.
Austin Schuhd7851b02020-11-14 13:46:27 -080057 position_error:double (id: 7);
Alex Perrycb7da4b2019-08-28 19:35:56 -070058}
59
60table ColumnEstimatorState {
Austin Schuhd7851b02020-11-14 13:46:27 -080061 error:bool (id: 0);
62 zeroed:bool (id: 1);
63 indexer:frc971.HallEffectAndPositionEstimatorState (id: 2);
64 turret:frc971.HallEffectAndPositionEstimatorState (id: 3);
Alex Perrycb7da4b2019-08-28 19:35:56 -070065}
66
Austin Schuhd7851b02020-11-14 13:46:27 -080067table TurretProfiledSubsystemStatus {
Alex Perrycb7da4b2019-08-28 19:35:56 -070068 // Is the subsystem zeroed?
Austin Schuhd7851b02020-11-14 13:46:27 -080069 zeroed:bool (id: 0);
Alex Perrycb7da4b2019-08-28 19:35:56 -070070
71 // The state of the subsystem, if applicable. -1 otherwise.
Austin Schuhd7851b02020-11-14 13:46:27 -080072 state:int (id: 1);
Alex Perrycb7da4b2019-08-28 19:35:56 -070073
74 // If true, we have aborted.
Austin Schuhd7851b02020-11-14 13:46:27 -080075 estopped:bool (id: 2);
Alex Perrycb7da4b2019-08-28 19:35:56 -070076
77 // Position of the joint.
Austin Schuhd7851b02020-11-14 13:46:27 -080078 position:float (id: 3);
Alex Perrycb7da4b2019-08-28 19:35:56 -070079 // Velocity of the joint in units/second.
Austin Schuhd7851b02020-11-14 13:46:27 -080080 velocity:float (id: 4);
Alex Perrycb7da4b2019-08-28 19:35:56 -070081 // Profiled goal position of the joint.
Austin Schuhd7851b02020-11-14 13:46:27 -080082 goal_position:float (id: 5);
Alex Perrycb7da4b2019-08-28 19:35:56 -070083 // Profiled goal velocity of the joint in units/second.
Austin Schuhd7851b02020-11-14 13:46:27 -080084 goal_velocity:float (id: 6);
Alex Perrycb7da4b2019-08-28 19:35:56 -070085 // Unprofiled goal position from absoulte zero of the joint.
Austin Schuhd7851b02020-11-14 13:46:27 -080086 unprofiled_goal_position:float (id: 7);
Alex Perrycb7da4b2019-08-28 19:35:56 -070087 // Unprofiled goal velocity of the joint in units/second.
Austin Schuhd7851b02020-11-14 13:46:27 -080088 unprofiled_goal_velocity:float (id: 8);
Alex Perrycb7da4b2019-08-28 19:35:56 -070089
90 // The estimated voltage error.
Austin Schuhd7851b02020-11-14 13:46:27 -080091 voltage_error:float (id: 9);
Alex Perrycb7da4b2019-08-28 19:35:56 -070092
93 // The calculated velocity with delta x/delta t
Austin Schuhd7851b02020-11-14 13:46:27 -080094 calculated_velocity:float (id: 10);
Alex Perrycb7da4b2019-08-28 19:35:56 -070095
96 // Components of the control loop output
Austin Schuhd7851b02020-11-14 13:46:27 -080097 position_power:float (id: 11);
98 velocity_power:float (id: 12);
99 feedforwards_power:float (id: 13);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700100
101 // State of the estimator.
Austin Schuhd7851b02020-11-14 13:46:27 -0800102 estimator_state:ColumnEstimatorState (id: 14);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700103
Austin Schuhd7851b02020-11-14 13:46:27 -0800104 raw_vision_angle:double (id: 15);
105 vision_angle:double (id: 16);
106 vision_tracking:bool (id: 17);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700107
Austin Schuhd7851b02020-11-14 13:46:27 -0800108 turret_encoder_angle:double (id: 18);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700109}
110
111table Status {
112 // Are all the subsystems zeroed?
Austin Schuhd7851b02020-11-14 13:46:27 -0800113 zeroed:bool (id: 0);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700114
115 // If true, we have aborted. This is the or of all subsystem estops.
Austin Schuhd7851b02020-11-14 13:46:27 -0800116 estopped:bool (id: 1);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700117
118 // Each subsystems status.
Austin Schuhd7851b02020-11-14 13:46:27 -0800119 intake:frc971.control_loops.PotAndAbsoluteEncoderProfiledJointStatus (id: 2);
120 hood:frc971.control_loops.IndexProfiledJointStatus (id: 3);
121 shooter:ShooterStatus (id: 4);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700122
Austin Schuhd7851b02020-11-14 13:46:27 -0800123 turret:TurretProfiledSubsystemStatus (id: 5);
124 indexer:IndexerStatus (id: 6);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700125
Austin Schuhd7851b02020-11-14 13:46:27 -0800126 vision_distance:float (id: 7);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700127}
128
129root_type Status;