Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 1 | include "frc971/control_loops/control_loops.fbs"; |
| 2 | include "frc971/control_loops/profiled_subsystem.fbs"; |
| 3 | |
| 4 | namespace y2023.control_loops.superstructure; |
| 5 | |
milind-u | 3738518 | 2023-02-20 15:07:28 -0800 | [diff] [blame^] | 6 | enum ArmState : ubyte { |
| 7 | UNINITIALIZED = 0, |
| 8 | ZEROING = 1, |
| 9 | DISABLED = 2, |
| 10 | GOTO_PATH = 3, |
| 11 | RUNNING = 4, |
| 12 | ESTOP = 5, |
| 13 | } |
| 14 | |
| 15 | table ArmStatus { |
| 16 | // State of the estimators. |
| 17 | proximal_estimator_state:frc971.PotAndAbsoluteEncoderEstimatorState (id: 0); |
| 18 | distal_estimator_state:frc971.PotAndAbsoluteEncoderEstimatorState (id: 1); |
| 19 | |
| 20 | // The node we are currently going to. |
| 21 | current_node:uint32 (id: 2); |
| 22 | // Distance (in radians) to the end of the path. |
| 23 | path_distance_to_go:float (id: 3); |
| 24 | // Goal position and velocity (radians) |
| 25 | goal_theta0:float (id: 4); |
| 26 | goal_theta1:float (id: 5); |
| 27 | goal_omega0:float (id: 6); |
| 28 | goal_omega1:float (id: 7); |
| 29 | |
| 30 | // Current position and velocity (radians) |
| 31 | theta0:float (id: 8); |
| 32 | theta1:float (id: 9); |
| 33 | |
| 34 | omega0:float (id: 10); |
| 35 | omega1:float (id: 11); |
| 36 | |
| 37 | // Estimated voltage error for the two joints. |
| 38 | voltage_error0:float (id: 12); |
| 39 | voltage_error1:float (id: 13); |
| 40 | |
| 41 | // True if we are zeroed. |
| 42 | zeroed:bool (id: 14); |
| 43 | |
| 44 | // True if the arm is zeroed. |
| 45 | estopped:bool (id: 15); |
| 46 | |
| 47 | // The current state machine state. |
| 48 | state:ArmState (id: 16); |
| 49 | |
| 50 | // The number of times the LQR solver failed. |
| 51 | failed_solutions:uint32 (id: 17); |
| 52 | } |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 53 | |
| 54 | table Status { |
| 55 | // All subsystems know their location. |
| 56 | zeroed:bool (id: 0); |
| 57 | |
| 58 | // If true, we have aborted. This is the or of all subsystem estops. |
| 59 | estopped:bool (id: 1); |
Nikita Narang | 27610fc | 2023-02-08 19:40:31 -0800 | [diff] [blame] | 60 | |
milind-u | 3738518 | 2023-02-20 15:07:28 -0800 | [diff] [blame^] | 61 | arm:ArmStatus (id: 2); |
Nikita Narang | 27610fc | 2023-02-08 19:40:31 -0800 | [diff] [blame] | 62 | |
milind-u | 3738518 | 2023-02-20 15:07:28 -0800 | [diff] [blame^] | 63 | roll_joint:frc971.PotAndAbsoluteEncoderEstimatorState (id: 3); |
Nikita Narang | 27610fc | 2023-02-08 19:40:31 -0800 | [diff] [blame] | 64 | |
milind-u | 3738518 | 2023-02-20 15:07:28 -0800 | [diff] [blame^] | 65 | wrist:frc971.control_loops.PotAndAbsoluteEncoderProfiledJointStatus (id: 4); |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 66 | } |
| 67 | |
| 68 | root_type Status; |