Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 1 | include "frc971/control_loops/control_loops.fbs"; |
| 2 | |
| 3 | namespace y2016.control_loops.superstructure; |
| 4 | |
| 5 | table JointState { |
| 6 | // Angle of the joint in radians. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 7 | angle:float (id: 0); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 8 | // Angular velocity of the joint in radians/second. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 9 | angular_velocity:float (id: 1); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 10 | // Profiled goal angle of the joint in radians. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 11 | goal_angle:float (id: 2); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 12 | // Profiled goal angular velocity of the joint in radians/second. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 13 | goal_angular_velocity:float (id: 3); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 14 | // Unprofiled goal angle of the joint in radians. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 15 | unprofiled_goal_angle:float (id: 4); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 16 | // Unprofiled goal angular velocity of the joint in radians/second. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 17 | unprofiled_goal_angular_velocity:float (id: 5); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 18 | |
| 19 | // The estimated voltage error. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 20 | voltage_error:float (id: 6); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 21 | |
| 22 | // The calculated velocity with delta x/delta t |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 23 | calculated_velocity:float (id: 7); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 24 | |
| 25 | // Components of the control loop output |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 26 | position_power:float (id: 8); |
| 27 | velocity_power:float (id: 9); |
| 28 | feedforwards_power:float (id: 10); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 29 | |
| 30 | // State of the estimator. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 31 | estimator_state:frc971.EstimatorState (id: 11); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 32 | } |
| 33 | |
| 34 | table Status { |
| 35 | // Are the superstructure subsystems zeroed? |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 36 | zeroed:bool (id: 0); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 37 | |
| 38 | // If true, we have aborted. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 39 | estopped:bool (id: 1); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 40 | |
| 41 | // The internal state of the state machine. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 42 | state:int (id: 2); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 43 | |
| 44 | |
| 45 | // Estimated angles and angular velocities of the superstructure subsystems. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 46 | intake:JointState (id: 3); |
| 47 | shoulder:JointState (id: 4); |
| 48 | wrist:JointState (id: 5); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 49 | |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 50 | shoulder_controller_index:int (id: 6); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 51 | |
| 52 | // Is the superstructure collided? |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 53 | is_collided:bool (id: 7); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 54 | } |
| 55 | |
| 56 | root_type Status; |