blob: 9ecb98c71417c58742f1e5b7fe03fc4332a29a5e [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
Tyler Chatow3c47f3c2020-01-29 20:45:23 -0800200table RelativeEncoderProfiledJointStatus {
201 // The state of the subsystem, if applicable. -1 otherwise.
202 // TODO(alex): replace with enum.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800203 state:int (id: 0);
Tyler Chatow3c47f3c2020-01-29 20:45:23 -0800204
205 // If true, we have aborted.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800206 estopped:bool (id: 1);
Tyler Chatow3c47f3c2020-01-29 20:45:23 -0800207
208 // Position of the joint.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800209 position:float (id: 2);
Tyler Chatow3c47f3c2020-01-29 20:45:23 -0800210 // Velocity of the joint in units/second.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800211 velocity:float (id: 3);
Tyler Chatow3c47f3c2020-01-29 20:45:23 -0800212 // Profiled goal position of the joint.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800213 goal_position:float (id: 4);
Tyler Chatow3c47f3c2020-01-29 20:45:23 -0800214 // Profiled goal velocity of the joint in units/second.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800215 goal_velocity:float (id: 5);
Tyler Chatow3c47f3c2020-01-29 20:45:23 -0800216 // Unprofiled goal position from absoulte zero of the joint.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800217 unprofiled_goal_position:float (id: 6);
Tyler Chatow3c47f3c2020-01-29 20:45:23 -0800218 // Unprofiled goal velocity of the joint in units/second.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800219 unprofiled_goal_velocity:float (id: 7);
Tyler Chatow3c47f3c2020-01-29 20:45:23 -0800220
221 // The estimated voltage error.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800222 voltage_error:float (id: 8);
Tyler Chatow3c47f3c2020-01-29 20:45:23 -0800223
224 // The calculated velocity with delta x/delta t
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800225 calculated_velocity:float (id: 9);
Tyler Chatow3c47f3c2020-01-29 20:45:23 -0800226
227 // Components of the control loop output
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800228 position_power:float (id: 10);
229 velocity_power:float (id: 11);
230 feedforwards_power:float (id: 12);
Tyler Chatow3c47f3c2020-01-29 20:45:23 -0800231
232 // State of the estimator.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800233 estimator_state:frc971.RelativeEncoderEstimatorState (id: 13);
Tyler Chatow3c47f3c2020-01-29 20:45:23 -0800234}
235
Alex Perrycb7da4b2019-08-28 19:35:56 -0700236table StaticZeroingSingleDOFProfiledSubsystemGoal {
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800237 unsafe_goal:double (id: 0);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700238
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800239 profile_params:frc971.ProfileParameters (id: 1);
James Kuszmaul4fb29762020-02-20 19:37:41 -0800240
241 // Sets the goal velocity of the subsystem.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800242 goal_velocity:double (id: 2);
James Kuszmaul4fb29762020-02-20 19:37:41 -0800243
244 // If set to true, then we will ignore the profiling on this joint and pass
245 // the goal + goal velocity directly to the control loop.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -0800246 ignore_profile:bool (id: 3);
Alex Perrycb7da4b2019-08-28 19:35:56 -0700247}