Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 1 | include "frc971/control_loops/control_loops.fbs"; |
James Kuszmaul | eeb98e9 | 2024-01-14 22:15:32 -0800 | [diff] [blame] | 2 | include "frc971/control_loops/state_feedback_loop.fbs"; |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 3 | |
| 4 | namespace frc971.control_loops; |
| 5 | |
| 6 | table ProfiledJointStatus { |
| 7 | // Is the subsystem zeroed? |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 8 | zeroed:bool (id: 0); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 9 | |
| 10 | // The state of the subsystem, if applicable. -1 otherwise. |
| 11 | // TODO(alex): replace with enum. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 12 | state:int (id: 1); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 13 | |
| 14 | // If true, we have aborted. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 15 | estopped:bool (id: 2); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 16 | |
| 17 | // Position of the joint. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 18 | position:float (id: 3); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 19 | // Velocity of the joint in units/second. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 20 | velocity:float (id: 4); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 21 | // Profiled goal position of the joint. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 22 | goal_position:float (id: 5); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 23 | // Profiled goal velocity of the joint in units/second. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 24 | goal_velocity:float (id: 6); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 25 | // Unprofiled goal position from absoulte zero of the joint. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 26 | unprofiled_goal_position:float (id: 7); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 27 | // Unprofiled goal velocity of the joint in units/second. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 28 | unprofiled_goal_velocity:float (id: 8); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 29 | |
| 30 | // The estimated voltage error. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 31 | voltage_error:float (id: 9); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 32 | |
| 33 | // The calculated velocity with delta x/delta t |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 34 | calculated_velocity:float (id: 10); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 35 | |
| 36 | // Components of the control loop output |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 37 | position_power:float (id: 11); |
| 38 | velocity_power:float (id: 12); |
| 39 | feedforwards_power:float (id: 13); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 40 | |
| 41 | // State of the estimator. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 42 | estimator_state:frc971.EstimatorState (id: 14); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 43 | } |
| 44 | |
| 45 | table HallProfiledJointStatus { |
| 46 | // Is the subsystem zeroed? |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 47 | zeroed:bool (id: 0); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 48 | |
| 49 | // The state of the subsystem, if applicable. -1 otherwise. |
| 50 | // TODO(alex): replace with enum. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 51 | state:int (id: 1); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 52 | |
| 53 | // If true, we have aborted. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 54 | estopped:bool (id: 2); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 55 | |
| 56 | // Position of the joint. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 57 | position:float (id: 3); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 58 | // Velocity of the joint in units/second. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 59 | velocity:float (id: 4); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 60 | // Profiled goal position of the joint. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 61 | goal_position:float (id: 5); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 62 | // Profiled goal velocity of the joint in units/second. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 63 | goal_velocity:float (id: 6); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 64 | // Unprofiled goal position from absoulte zero of the joint. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 65 | unprofiled_goal_position:float (id: 7); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 66 | // Unprofiled goal velocity of the joint in units/second. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 67 | unprofiled_goal_velocity:float (id: 8); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 68 | |
| 69 | // The estimated voltage error. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 70 | voltage_error:float (id: 9); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 71 | |
| 72 | // The calculated velocity with delta x/delta t |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 73 | calculated_velocity:float (id: 10); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 74 | |
| 75 | // Components of the control loop output |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 76 | position_power:float (id: 11); |
| 77 | velocity_power:float (id: 12); |
| 78 | feedforwards_power:float (id: 13); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 79 | |
| 80 | // State of the estimator. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 81 | estimator_state:frc971.HallEffectAndPositionEstimatorState (id: 14); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 82 | } |
| 83 | |
| 84 | table PotAndAbsoluteEncoderProfiledJointStatus { |
| 85 | // Is the subsystem zeroed? |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 86 | zeroed:bool (id: 0); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 87 | |
| 88 | // The state of the subsystem, if applicable. -1 otherwise. |
| 89 | // TODO(alex): replace with enum. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 90 | state:int (id: 1); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 91 | |
| 92 | // If true, we have aborted. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 93 | estopped:bool (id: 2); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 94 | |
| 95 | // Position of the joint. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 96 | position:float (id: 3); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 97 | // Velocity of the joint in units/second. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 98 | velocity:float (id: 4); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 99 | // Profiled goal position of the joint. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 100 | goal_position:float (id: 5); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 101 | // Profiled goal velocity of the joint in units/second. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 102 | goal_velocity:float (id: 6); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 103 | // Unprofiled goal position from absoulte zero of the joint. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 104 | unprofiled_goal_position:float (id: 7); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 105 | // Unprofiled goal velocity of the joint in units/second. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 106 | unprofiled_goal_velocity:float (id: 8); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 107 | |
| 108 | // The estimated voltage error. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 109 | voltage_error:float (id: 9); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 110 | |
| 111 | // The calculated velocity with delta x/delta t |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 112 | calculated_velocity:float (id: 10); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 113 | |
| 114 | // Components of the control loop output |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 115 | position_power:float (id: 11); |
| 116 | velocity_power:float (id: 12); |
| 117 | feedforwards_power:float (id: 13); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 118 | |
| 119 | // State of the estimator. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 120 | estimator_state:frc971.PotAndAbsoluteEncoderEstimatorState (id: 14); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 121 | } |
| 122 | |
| 123 | table IndexProfiledJointStatus { |
| 124 | // Is the subsystem zeroed? |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 125 | zeroed:bool (id: 0); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 126 | |
| 127 | // The state of the subsystem, if applicable. -1 otherwise. |
| 128 | // TODO(alex): replace with enum. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 129 | state:int (id: 1); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 130 | |
| 131 | // If true, we have aborted. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 132 | estopped:bool (id: 2); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 133 | |
| 134 | // Position of the joint. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 135 | position:float (id: 3); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 136 | // Velocity of the joint in units/second. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 137 | velocity:float (id: 4); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 138 | // Profiled goal position of the joint. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 139 | goal_position:float (id: 5); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 140 | // Profiled goal velocity of the joint in units/second. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 141 | goal_velocity:float (id: 6); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 142 | // Unprofiled goal position from absoulte zero of the joint. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 143 | unprofiled_goal_position:float (id: 7); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 144 | // Unprofiled goal velocity of the joint in units/second. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 145 | unprofiled_goal_velocity:float (id: 8); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 146 | |
| 147 | // The estimated voltage error. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 148 | voltage_error:float (id: 9); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 149 | |
| 150 | // The calculated velocity with delta x/delta t |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 151 | calculated_velocity:float (id: 10); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 152 | |
| 153 | // Components of the control loop output |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 154 | position_power:float (id: 11); |
| 155 | velocity_power:float (id: 12); |
| 156 | feedforwards_power:float (id: 13); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 157 | |
| 158 | // State of the estimator. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 159 | estimator_state:frc971.IndexEstimatorState (id: 14); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 160 | } |
| 161 | |
| 162 | table AbsoluteEncoderProfiledJointStatus { |
| 163 | // Is the subsystem zeroed? |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 164 | zeroed:bool (id: 0); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 165 | |
| 166 | // The state of the subsystem, if applicable. -1 otherwise. |
| 167 | // TODO(alex): replace with enum. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 168 | state:int (id: 1); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 169 | |
| 170 | // If true, we have aborted. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 171 | estopped:bool (id: 2); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 172 | |
| 173 | // Position of the joint. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 174 | position:float (id: 3); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 175 | // Velocity of the joint in units/second. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 176 | velocity:float (id: 4); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 177 | // Profiled goal position of the joint. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 178 | goal_position:float (id: 5); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 179 | // Profiled goal velocity of the joint in units/second. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 180 | goal_velocity:float (id: 6); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 181 | // Unprofiled goal position from absoulte zero of the joint. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 182 | unprofiled_goal_position:float (id: 7); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 183 | // Unprofiled goal velocity of the joint in units/second. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 184 | unprofiled_goal_velocity:float (id: 8); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 185 | |
| 186 | // The estimated voltage error. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 187 | voltage_error:float (id: 9); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 188 | |
| 189 | // The calculated velocity with delta x/delta t |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 190 | calculated_velocity:float (id: 10); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 191 | |
| 192 | // Components of the control loop output |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 193 | position_power:float (id: 11); |
| 194 | velocity_power:float (id: 12); |
| 195 | feedforwards_power:float (id: 13); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 196 | |
| 197 | // State of the estimator. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 198 | estimator_state:frc971.AbsoluteEncoderEstimatorState (id: 14); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 199 | } |
| 200 | |
Ravago Jones | 937587c | 2020-12-26 17:21:09 -0800 | [diff] [blame] | 201 | table AbsoluteAndAbsoluteEncoderProfiledJointStatus { |
| 202 | // Is the subsystem zeroed? |
| 203 | zeroed:bool (id: 0); |
| 204 | |
| 205 | // The state of the subsystem, if applicable. -1 otherwise. |
| 206 | // TODO(alex): replace with enum. |
| 207 | state:int (id: 1); |
| 208 | |
| 209 | // If true, we have aborted. |
| 210 | estopped:bool (id: 2); |
| 211 | |
| 212 | // Position of the joint. |
| 213 | position:float (id: 3); |
| 214 | // Velocity of the joint in units/second. |
| 215 | velocity:float (id: 4); |
| 216 | // Profiled goal position of the joint. |
| 217 | goal_position:float (id: 5); |
| 218 | // Profiled goal velocity of the joint in units/second. |
| 219 | goal_velocity:float (id: 6); |
| 220 | // Unprofiled goal position from absoulte zero of the joint. |
| 221 | unprofiled_goal_position:float (id: 7); |
| 222 | // Unprofiled goal velocity of the joint in units/second. |
| 223 | unprofiled_goal_velocity:float (id: 8); |
| 224 | |
| 225 | // The estimated voltage error. |
| 226 | voltage_error:float (id: 9); |
| 227 | |
| 228 | // The calculated velocity with delta x/delta t |
| 229 | calculated_velocity:float (id: 10); |
| 230 | |
| 231 | // Components of the control loop output |
| 232 | position_power:float (id: 11); |
| 233 | velocity_power:float (id: 12); |
| 234 | feedforwards_power:float (id: 13); |
| 235 | |
| 236 | // State of the estimator. |
| 237 | estimator_state:frc971.AbsoluteAndAbsoluteEncoderEstimatorState (id: 14); |
| 238 | } |
| 239 | |
Tyler Chatow | 3c47f3c | 2020-01-29 20:45:23 -0800 | [diff] [blame] | 240 | table RelativeEncoderProfiledJointStatus { |
Siddhant Kanwar | 0e37f59 | 2022-02-21 19:26:50 -0800 | [diff] [blame] | 241 | // Is the subsystem zeroed? |
| 242 | zeroed:bool (id: 0); |
| 243 | |
Tyler Chatow | 3c47f3c | 2020-01-29 20:45:23 -0800 | [diff] [blame] | 244 | // The state of the subsystem, if applicable. -1 otherwise. |
| 245 | // TODO(alex): replace with enum. |
Siddhant Kanwar | 0e37f59 | 2022-02-21 19:26:50 -0800 | [diff] [blame] | 246 | state:int (id: 1); |
Tyler Chatow | 3c47f3c | 2020-01-29 20:45:23 -0800 | [diff] [blame] | 247 | |
| 248 | // If true, we have aborted. |
Siddhant Kanwar | 0e37f59 | 2022-02-21 19:26:50 -0800 | [diff] [blame] | 249 | estopped:bool (id: 2); |
Tyler Chatow | 3c47f3c | 2020-01-29 20:45:23 -0800 | [diff] [blame] | 250 | |
| 251 | // Position of the joint. |
Siddhant Kanwar | 0e37f59 | 2022-02-21 19:26:50 -0800 | [diff] [blame] | 252 | position:float (id: 3); |
Tyler Chatow | 3c47f3c | 2020-01-29 20:45:23 -0800 | [diff] [blame] | 253 | // Velocity of the joint in units/second. |
Siddhant Kanwar | 0e37f59 | 2022-02-21 19:26:50 -0800 | [diff] [blame] | 254 | velocity:float (id: 4); |
Tyler Chatow | 3c47f3c | 2020-01-29 20:45:23 -0800 | [diff] [blame] | 255 | // Profiled goal position of the joint. |
Siddhant Kanwar | 0e37f59 | 2022-02-21 19:26:50 -0800 | [diff] [blame] | 256 | goal_position:float (id: 5); |
Tyler Chatow | 3c47f3c | 2020-01-29 20:45:23 -0800 | [diff] [blame] | 257 | // Profiled goal velocity of the joint in units/second. |
Siddhant Kanwar | 0e37f59 | 2022-02-21 19:26:50 -0800 | [diff] [blame] | 258 | goal_velocity:float (id: 6); |
Tyler Chatow | 3c47f3c | 2020-01-29 20:45:23 -0800 | [diff] [blame] | 259 | // Unprofiled goal position from absoulte zero of the joint. |
Siddhant Kanwar | 0e37f59 | 2022-02-21 19:26:50 -0800 | [diff] [blame] | 260 | unprofiled_goal_position:float (id: 7); |
Tyler Chatow | 3c47f3c | 2020-01-29 20:45:23 -0800 | [diff] [blame] | 261 | // Unprofiled goal velocity of the joint in units/second. |
Siddhant Kanwar | 0e37f59 | 2022-02-21 19:26:50 -0800 | [diff] [blame] | 262 | unprofiled_goal_velocity:float (id: 8); |
Tyler Chatow | 3c47f3c | 2020-01-29 20:45:23 -0800 | [diff] [blame] | 263 | |
| 264 | // The estimated voltage error. |
Siddhant Kanwar | 0e37f59 | 2022-02-21 19:26:50 -0800 | [diff] [blame] | 265 | voltage_error:float (id: 9); |
Tyler Chatow | 3c47f3c | 2020-01-29 20:45:23 -0800 | [diff] [blame] | 266 | |
| 267 | // The calculated velocity with delta x/delta t |
Siddhant Kanwar | 0e37f59 | 2022-02-21 19:26:50 -0800 | [diff] [blame] | 268 | calculated_velocity:float (id: 10); |
Tyler Chatow | 3c47f3c | 2020-01-29 20:45:23 -0800 | [diff] [blame] | 269 | |
| 270 | // Components of the control loop output |
Siddhant Kanwar | 0e37f59 | 2022-02-21 19:26:50 -0800 | [diff] [blame] | 271 | position_power:float (id: 11); |
| 272 | velocity_power:float (id: 12); |
| 273 | feedforwards_power:float (id: 13); |
Tyler Chatow | 3c47f3c | 2020-01-29 20:45:23 -0800 | [diff] [blame] | 274 | |
| 275 | // State of the estimator. |
Siddhant Kanwar | 0e37f59 | 2022-02-21 19:26:50 -0800 | [diff] [blame] | 276 | estimator_state:frc971.RelativeEncoderEstimatorState (id: 14); |
Tyler Chatow | 3c47f3c | 2020-01-29 20:45:23 -0800 | [diff] [blame] | 277 | } |
| 278 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 279 | table StaticZeroingSingleDOFProfiledSubsystemGoal { |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 280 | unsafe_goal:double (id: 0); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 281 | |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 282 | profile_params:frc971.ProfileParameters (id: 1); |
James Kuszmaul | 4fb2976 | 2020-02-20 19:37:41 -0800 | [diff] [blame] | 283 | |
| 284 | // Sets the goal velocity of the subsystem. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 285 | goal_velocity:double (id: 2); |
James Kuszmaul | 4fb2976 | 2020-02-20 19:37:41 -0800 | [diff] [blame] | 286 | |
| 287 | // If set to true, then we will ignore the profiling on this joint and pass |
| 288 | // the goal + goal velocity directly to the control loop. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 289 | ignore_profile:bool (id: 3); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 290 | } |
James Kuszmaul | eeb98e9 | 2024-01-14 22:15:32 -0800 | [diff] [blame] | 291 | |
| 292 | // Stores everything but the zeroing information for a single-dof subsystem. |
| 293 | // Because the subsystem will be templated on the zeroing information, it is |
| 294 | // passed in separately (see types in //frc971/zeroing:constants.fbs). |
| 295 | table StaticZeroingSingleDOFProfiledSubsystemCommonParams { |
| 296 | zeroing_voltage:double (id: 0); |
| 297 | operating_voltage:double (id: 1); |
| 298 | zeroing_profile_params:frc971.ProfileParameters (id: 2); |
| 299 | default_profile_params:frc971.ProfileParameters (id: 3); |
| 300 | range:frc971.Range (id: 4); |
| 301 | loop:[frc971.control_loops.fbs.StateFeedbackLoopCoefficients] (id: 5); |
| 302 | } |