blob: 049b52fb1cfd7b33d5fa429a4c3fa409083c0378 [file] [log] [blame]
Alex Perrycb7da4b2019-08-28 19:35:56 -07001include "frc971/control_loops/control_loops.fbs";
2
3namespace frc971.control_loops;
4
5table ProfiledJointStatus {
6 // Is the subsystem zeroed?
Ravago Jonesfb6a7a52020-11-14 13:47:46 -08007 zeroed:bool (id: 0);
Alex Perrycb7da4b2019-08-28 19:35:56 -07008
9 // The state of the subsystem, if applicable. -1 otherwise.
10 // TODO(alex): replace with enum.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080011 state:int (id: 1);
Alex Perrycb7da4b2019-08-28 19:35:56 -070012
13 // If true, we have aborted.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080014 estopped:bool (id: 2);
Alex Perrycb7da4b2019-08-28 19:35:56 -070015
16 // Position of the joint.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080017 position:float (id: 3);
Alex Perrycb7da4b2019-08-28 19:35:56 -070018 // Velocity of the joint in units/second.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080019 velocity:float (id: 4);
Alex Perrycb7da4b2019-08-28 19:35:56 -070020 // Profiled goal position of the joint.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080021 goal_position:float (id: 5);
Alex Perrycb7da4b2019-08-28 19:35:56 -070022 // Profiled goal velocity of the joint in units/second.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080023 goal_velocity:float (id: 6);
Alex Perrycb7da4b2019-08-28 19:35:56 -070024 // Unprofiled goal position from absoulte zero of the joint.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080025 unprofiled_goal_position:float (id: 7);
Alex Perrycb7da4b2019-08-28 19:35:56 -070026 // Unprofiled goal velocity of the joint in units/second.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080027 unprofiled_goal_velocity:float (id: 8);
Alex Perrycb7da4b2019-08-28 19:35:56 -070028
29 // The estimated voltage error.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080030 voltage_error:float (id: 9);
Alex Perrycb7da4b2019-08-28 19:35:56 -070031
32 // The calculated velocity with delta x/delta t
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080033 calculated_velocity:float (id: 10);
Alex Perrycb7da4b2019-08-28 19:35:56 -070034
35 // Components of the control loop output
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080036 position_power:float (id: 11);
37 velocity_power:float (id: 12);
38 feedforwards_power:float (id: 13);
Alex Perrycb7da4b2019-08-28 19:35:56 -070039
40 // State of the estimator.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080041 estimator_state:frc971.EstimatorState (id: 14);
Alex Perrycb7da4b2019-08-28 19:35:56 -070042}
43
44table HallProfiledJointStatus {
45 // Is the subsystem zeroed?
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080046 zeroed:bool (id: 0);
Alex Perrycb7da4b2019-08-28 19:35:56 -070047
48 // The state of the subsystem, if applicable. -1 otherwise.
49 // TODO(alex): replace with enum.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080050 state:int (id: 1);
Alex Perrycb7da4b2019-08-28 19:35:56 -070051
52 // If true, we have aborted.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080053 estopped:bool (id: 2);
Alex Perrycb7da4b2019-08-28 19:35:56 -070054
55 // Position of the joint.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080056 position:float (id: 3);
Alex Perrycb7da4b2019-08-28 19:35:56 -070057 // Velocity of the joint in units/second.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080058 velocity:float (id: 4);
Alex Perrycb7da4b2019-08-28 19:35:56 -070059 // Profiled goal position of the joint.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080060 goal_position:float (id: 5);
Alex Perrycb7da4b2019-08-28 19:35:56 -070061 // Profiled goal velocity of the joint in units/second.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080062 goal_velocity:float (id: 6);
Alex Perrycb7da4b2019-08-28 19:35:56 -070063 // Unprofiled goal position from absoulte zero of the joint.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080064 unprofiled_goal_position:float (id: 7);
Alex Perrycb7da4b2019-08-28 19:35:56 -070065 // Unprofiled goal velocity of the joint in units/second.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080066 unprofiled_goal_velocity:float (id: 8);
Alex Perrycb7da4b2019-08-28 19:35:56 -070067
68 // The estimated voltage error.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080069 voltage_error:float (id: 9);
Alex Perrycb7da4b2019-08-28 19:35:56 -070070
71 // The calculated velocity with delta x/delta t
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080072 calculated_velocity:float (id: 10);
Alex Perrycb7da4b2019-08-28 19:35:56 -070073
74 // Components of the control loop output
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080075 position_power:float (id: 11);
76 velocity_power:float (id: 12);
77 feedforwards_power:float (id: 13);
Alex Perrycb7da4b2019-08-28 19:35:56 -070078
79 // State of the estimator.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080080 estimator_state:frc971.HallEffectAndPositionEstimatorState (id: 14);
Alex Perrycb7da4b2019-08-28 19:35:56 -070081}
82
83table PotAndAbsoluteEncoderProfiledJointStatus {
84 // Is the subsystem zeroed?
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080085 zeroed:bool (id: 0);
Alex Perrycb7da4b2019-08-28 19:35:56 -070086
87 // The state of the subsystem, if applicable. -1 otherwise.
88 // TODO(alex): replace with enum.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080089 state:int (id: 1);
Alex Perrycb7da4b2019-08-28 19:35:56 -070090
91 // If true, we have aborted.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080092 estopped:bool (id: 2);
Alex Perrycb7da4b2019-08-28 19:35:56 -070093
94 // Position of the joint.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080095 position:float (id: 3);
Alex Perrycb7da4b2019-08-28 19:35:56 -070096 // Velocity of the joint in units/second.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080097 velocity:float (id: 4);
Alex Perrycb7da4b2019-08-28 19:35:56 -070098 // Profiled goal position of the joint.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080099 goal_position:float (id: 5);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700100 // Profiled goal velocity of the joint in units/second.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800101 goal_velocity:float (id: 6);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700102 // Unprofiled goal position from absoulte zero of the joint.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800103 unprofiled_goal_position:float (id: 7);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700104 // Unprofiled goal velocity of the joint in units/second.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800105 unprofiled_goal_velocity:float (id: 8);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700106
107 // The estimated voltage error.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800108 voltage_error:float (id: 9);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700109
110 // The calculated velocity with delta x/delta t
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800111 calculated_velocity:float (id: 10);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700112
113 // Components of the control loop output
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800114 position_power:float (id: 11);
115 velocity_power:float (id: 12);
116 feedforwards_power:float (id: 13);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700117
118 // State of the estimator.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800119 estimator_state:frc971.PotAndAbsoluteEncoderEstimatorState (id: 14);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700120}
121
122table IndexProfiledJointStatus {
123 // Is the subsystem zeroed?
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800124 zeroed:bool (id: 0);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700125
126 // The state of the subsystem, if applicable. -1 otherwise.
127 // TODO(alex): replace with enum.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800128 state:int (id: 1);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700129
130 // If true, we have aborted.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800131 estopped:bool (id: 2);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700132
133 // Position of the joint.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800134 position:float (id: 3);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700135 // Velocity of the joint in units/second.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800136 velocity:float (id: 4);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700137 // Profiled goal position of the joint.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800138 goal_position:float (id: 5);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700139 // Profiled goal velocity of the joint in units/second.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800140 goal_velocity:float (id: 6);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700141 // Unprofiled goal position from absoulte zero of the joint.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800142 unprofiled_goal_position:float (id: 7);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700143 // Unprofiled goal velocity of the joint in units/second.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800144 unprofiled_goal_velocity:float (id: 8);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700145
146 // The estimated voltage error.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800147 voltage_error:float (id: 9);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700148
149 // The calculated velocity with delta x/delta t
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800150 calculated_velocity:float (id: 10);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700151
152 // Components of the control loop output
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800153 position_power:float (id: 11);
154 velocity_power:float (id: 12);
155 feedforwards_power:float (id: 13);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700156
157 // State of the estimator.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800158 estimator_state:frc971.IndexEstimatorState (id: 14);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700159}
160
161table AbsoluteEncoderProfiledJointStatus {
162 // Is the subsystem zeroed?
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800163 zeroed:bool (id: 0);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700164
165 // The state of the subsystem, if applicable. -1 otherwise.
166 // TODO(alex): replace with enum.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800167 state:int (id: 1);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700168
169 // If true, we have aborted.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800170 estopped:bool (id: 2);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700171
172 // Position of the joint.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800173 position:float (id: 3);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700174 // Velocity of the joint in units/second.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800175 velocity:float (id: 4);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700176 // Profiled goal position of the joint.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800177 goal_position:float (id: 5);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700178 // Profiled goal velocity of the joint in units/second.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800179 goal_velocity:float (id: 6);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700180 // Unprofiled goal position from absoulte zero of the joint.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800181 unprofiled_goal_position:float (id: 7);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700182 // Unprofiled goal velocity of the joint in units/second.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800183 unprofiled_goal_velocity:float (id: 8);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700184
185 // The estimated voltage error.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800186 voltage_error:float (id: 9);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700187
188 // The calculated velocity with delta x/delta t
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800189 calculated_velocity:float (id: 10);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700190
191 // Components of the control loop output
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800192 position_power:float (id: 11);
193 velocity_power:float (id: 12);
194 feedforwards_power:float (id: 13);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700195
196 // State of the estimator.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800197 estimator_state:frc971.AbsoluteEncoderEstimatorState (id: 14);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700198}
199
Ravago Jones937587c2020-12-26 17:21:09 -0800200table AbsoluteAndAbsoluteEncoderProfiledJointStatus {
201 // Is the subsystem zeroed?
202 zeroed:bool (id: 0);
203
204 // The state of the subsystem, if applicable. -1 otherwise.
205 // TODO(alex): replace with enum.
206 state:int (id: 1);
207
208 // If true, we have aborted.
209 estopped:bool (id: 2);
210
211 // Position of the joint.
212 position:float (id: 3);
213 // Velocity of the joint in units/second.
214 velocity:float (id: 4);
215 // Profiled goal position of the joint.
216 goal_position:float (id: 5);
217 // Profiled goal velocity of the joint in units/second.
218 goal_velocity:float (id: 6);
219 // Unprofiled goal position from absoulte zero of the joint.
220 unprofiled_goal_position:float (id: 7);
221 // Unprofiled goal velocity of the joint in units/second.
222 unprofiled_goal_velocity:float (id: 8);
223
224 // The estimated voltage error.
225 voltage_error:float (id: 9);
226
227 // The calculated velocity with delta x/delta t
228 calculated_velocity:float (id: 10);
229
230 // Components of the control loop output
231 position_power:float (id: 11);
232 velocity_power:float (id: 12);
233 feedforwards_power:float (id: 13);
234
235 // State of the estimator.
236 estimator_state:frc971.AbsoluteAndAbsoluteEncoderEstimatorState (id: 14);
237}
238
Tyler Chatow3c47f3c2020-01-29 20:45:23 -0800239table RelativeEncoderProfiledJointStatus {
Siddhant Kanwar0e37f592022-02-21 19:26:50 -0800240 // Is the subsystem zeroed?
241 zeroed:bool (id: 0);
242
Tyler Chatow3c47f3c2020-01-29 20:45:23 -0800243 // The state of the subsystem, if applicable. -1 otherwise.
244 // TODO(alex): replace with enum.
Siddhant Kanwar0e37f592022-02-21 19:26:50 -0800245 state:int (id: 1);
Tyler Chatow3c47f3c2020-01-29 20:45:23 -0800246
247 // If true, we have aborted.
Siddhant Kanwar0e37f592022-02-21 19:26:50 -0800248 estopped:bool (id: 2);
Tyler Chatow3c47f3c2020-01-29 20:45:23 -0800249
250 // Position of the joint.
Siddhant Kanwar0e37f592022-02-21 19:26:50 -0800251 position:float (id: 3);
Tyler Chatow3c47f3c2020-01-29 20:45:23 -0800252 // Velocity of the joint in units/second.
Siddhant Kanwar0e37f592022-02-21 19:26:50 -0800253 velocity:float (id: 4);
Tyler Chatow3c47f3c2020-01-29 20:45:23 -0800254 // Profiled goal position of the joint.
Siddhant Kanwar0e37f592022-02-21 19:26:50 -0800255 goal_position:float (id: 5);
Tyler Chatow3c47f3c2020-01-29 20:45:23 -0800256 // Profiled goal velocity of the joint in units/second.
Siddhant Kanwar0e37f592022-02-21 19:26:50 -0800257 goal_velocity:float (id: 6);
Tyler Chatow3c47f3c2020-01-29 20:45:23 -0800258 // Unprofiled goal position from absoulte zero of the joint.
Siddhant Kanwar0e37f592022-02-21 19:26:50 -0800259 unprofiled_goal_position:float (id: 7);
Tyler Chatow3c47f3c2020-01-29 20:45:23 -0800260 // Unprofiled goal velocity of the joint in units/second.
Siddhant Kanwar0e37f592022-02-21 19:26:50 -0800261 unprofiled_goal_velocity:float (id: 8);
Tyler Chatow3c47f3c2020-01-29 20:45:23 -0800262
263 // The estimated voltage error.
Siddhant Kanwar0e37f592022-02-21 19:26:50 -0800264 voltage_error:float (id: 9);
Tyler Chatow3c47f3c2020-01-29 20:45:23 -0800265
266 // The calculated velocity with delta x/delta t
Siddhant Kanwar0e37f592022-02-21 19:26:50 -0800267 calculated_velocity:float (id: 10);
Tyler Chatow3c47f3c2020-01-29 20:45:23 -0800268
269 // Components of the control loop output
Siddhant Kanwar0e37f592022-02-21 19:26:50 -0800270 position_power:float (id: 11);
271 velocity_power:float (id: 12);
272 feedforwards_power:float (id: 13);
Tyler Chatow3c47f3c2020-01-29 20:45:23 -0800273
274 // State of the estimator.
Siddhant Kanwar0e37f592022-02-21 19:26:50 -0800275 estimator_state:frc971.RelativeEncoderEstimatorState (id: 14);
Tyler Chatow3c47f3c2020-01-29 20:45:23 -0800276}
277
Alex Perrycb7da4b2019-08-28 19:35:56 -0700278table StaticZeroingSingleDOFProfiledSubsystemGoal {
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800279 unsafe_goal:double (id: 0);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700280
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800281 profile_params:frc971.ProfileParameters (id: 1);
James Kuszmaul4fb29762020-02-20 19:37:41 -0800282
283 // Sets the goal velocity of the subsystem.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800284 goal_velocity:double (id: 2);
James Kuszmaul4fb29762020-02-20 19:37:41 -0800285
286 // If set to true, then we will ignore the profiling on this joint and pass
287 // the goal + goal velocity directly to the control loop.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800288 ignore_profile:bool (id: 3);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700289}