blob: 217eb5b62150a825aabe1f69fd1f2ad37bcc6eab [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.
9 avg_angular_velocity:double;
10
11 // The current instantaneous filtered velocity in radians/second.
12 angular_velocity:double;
13
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.
16 ready:bool;
17
18 // True if the indexer is stuck.
19 stuck:bool;
20 stuck_voltage:float;
21
22 // The state of the indexer state machine.
23 state:int;
24
25 // The estimated voltage error from the kalman filter in volts.
26 voltage_error:double;
27 // The estimated voltage error from the stuck indexer kalman filter.
28 stuck_voltage_error:double;
29
30 // The current velocity measured as delta x / delta t in radians/sec.
31 instantaneous_velocity:double;
32
33 // The error between our measurement and expected measurement in radians.
34 position_error:double;
35}
36
37table ShooterStatus {
38 // The current average velocity in radians/second.
39 avg_angular_velocity:double;
40
41 // The current instantaneous filtered velocity in radians/second.
42 angular_velocity:double;
43
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.
46 ready:bool;
47
48 // The estimated voltage error from the kalman filter in volts.
49 voltage_error:double;
50
51 // The current velocity measured as delta x / delta t in radians/sec.
52 instantaneous_velocity:double;
53 filtered_velocity:double;
54 fixed_instantaneous_velocity:double;
55
56 // The error between our measurement and expected measurement in radians.
57 position_error:double;
58}
59
60table ColumnEstimatorState {
61 error:bool;
62 zeroed:bool;
63 indexer:frc971.HallEffectAndPositionEstimatorState;
64 turret:frc971.HallEffectAndPositionEstimatorState;
65}
66
67table TurretProfiledSubsystemStatus {
68 // Is the subsystem zeroed?
69 zeroed:bool;
70
71 // The state of the subsystem, if applicable. -1 otherwise.
72 state:int;
73
74 // If true, we have aborted.
75 estopped:bool;
76
77 // Position of the joint.
78 position:float;
79 // Velocity of the joint in units/second.
80 velocity:float;
81 // Profiled goal position of the joint.
82 goal_position:float;
83 // Profiled goal velocity of the joint in units/second.
84 goal_velocity:float;
85 // Unprofiled goal position from absoulte zero of the joint.
86 unprofiled_goal_position:float;
87 // Unprofiled goal velocity of the joint in units/second.
88 unprofiled_goal_velocity:float;
89
90 // The estimated voltage error.
91 voltage_error:float;
92
93 // The calculated velocity with delta x/delta t
94 calculated_velocity:float;
95
96 // Components of the control loop output
97 position_power:float;
98 velocity_power:float;
99 feedforwards_power:float;
100
101 // State of the estimator.
102 estimator_state:ColumnEstimatorState;
103
104 raw_vision_angle:double;
105 vision_angle:double;
106 vision_tracking:bool;
107
108 turret_encoder_angle:double;
109}
110
111table Status {
112 // Are all the subsystems zeroed?
113 zeroed:bool;
114
115 // If true, we have aborted. This is the or of all subsystem estops.
116 estopped:bool;
117
118 // Each subsystems status.
119 intake:frc971.control_loops.PotAndAbsoluteEncoderProfiledJointStatus;
120 hood:frc971.control_loops.IndexProfiledJointStatus;
121 shooter:ShooterStatus;
122
123 turret:TurretProfiledSubsystemStatus;
124 indexer:IndexerStatus;
125
126 vision_distance:float;
127}
128
129root_type Status;