blob: 9f53a82de8aaa75e9b6a581226c96dde1dbd5249 [file] [log] [blame]
Alex Perrycb7da4b2019-08-28 19:35:56 -07001include "frc971/control_loops/control_loops.fbs";
2
3namespace y2018.control_loops.superstructure;
4
5table IntakeSideStatus {
6 // Is the subsystem zeroed?
Austin Schuhd7851b02020-11-14 13:46:27 -08007 zeroed:bool (id: 0);
Alex Perrycb7da4b2019-08-28 19:35:56 -07008
9 // The state of the subsystem, if applicable.
Austin Schuhd7851b02020-11-14 13:46:27 -080010 state:int32 (id: 1);
Alex Perrycb7da4b2019-08-28 19:35:56 -070011
12 // If true, we have aborted.
Austin Schuhd7851b02020-11-14 13:46:27 -080013 estopped:bool (id: 2);
Alex Perrycb7da4b2019-08-28 19:35:56 -070014
15 // Estimated position of the spring.
Austin Schuhd7851b02020-11-14 13:46:27 -080016 spring_position:float (id: 3);
Alex Perrycb7da4b2019-08-28 19:35:56 -070017 // Estimated velocity of the spring in units/second.
Austin Schuhd7851b02020-11-14 13:46:27 -080018 spring_velocity:float (id: 4);
Stephan Massalta769ca22019-01-09 05:29:13 +000019 // Reported wrapping of the spring
Austin Schuhd7851b02020-11-14 13:46:27 -080020 spring_wrapped:int (id: 5);
Alex Perrycb7da4b2019-08-28 19:35:56 -070021
22 // Estimated position of the joint.
Austin Schuhd7851b02020-11-14 13:46:27 -080023 motor_position:float (id: 6);
Alex Perrycb7da4b2019-08-28 19:35:56 -070024 // Estimated velocity of the joint in units/second.
Austin Schuhd7851b02020-11-14 13:46:27 -080025 motor_velocity:float (id: 7);
Alex Perrycb7da4b2019-08-28 19:35:56 -070026
27 // Goal position of the joint.
Austin Schuhd7851b02020-11-14 13:46:27 -080028 goal_position:float (id: 8);
Alex Perrycb7da4b2019-08-28 19:35:56 -070029 // Goal velocity of the joint in units/second.
Austin Schuhd7851b02020-11-14 13:46:27 -080030 goal_velocity:float (id: 9);
Alex Perrycb7da4b2019-08-28 19:35:56 -070031
32 // The calculated velocity with delta x/delta t
Austin Schuhd7851b02020-11-14 13:46:27 -080033 calculated_velocity:float (id: 10);
Alex Perrycb7da4b2019-08-28 19:35:56 -070034
35 // The voltage given last cycle;
Austin Schuhd7851b02020-11-14 13:46:27 -080036 delayed_voltage:float (id: 11);
Alex Perrycb7da4b2019-08-28 19:35:56 -070037
38 // State of the estimator.
Austin Schuhd7851b02020-11-14 13:46:27 -080039 estimator_state:frc971.PotAndAbsoluteEncoderEstimatorState (id: 12);
Alex Perrycb7da4b2019-08-28 19:35:56 -070040}
41
42table ArmStatus {
43 // State of the estimators.
Austin Schuhd7851b02020-11-14 13:46:27 -080044 proximal_estimator_state:frc971.PotAndAbsoluteEncoderEstimatorState (id: 0);
45 distal_estimator_state:frc971.PotAndAbsoluteEncoderEstimatorState (id: 1);
Alex Perrycb7da4b2019-08-28 19:35:56 -070046
47 // The node we are currently going to.
Austin Schuhd7851b02020-11-14 13:46:27 -080048 current_node:uint32 (id: 2);
Alex Perrycb7da4b2019-08-28 19:35:56 -070049 // Distance (in radians) to the end of the path.
Austin Schuhd7851b02020-11-14 13:46:27 -080050 path_distance_to_go:float (id: 3);
Alex Perrycb7da4b2019-08-28 19:35:56 -070051 // Goal position and velocity (radians)
Austin Schuhd7851b02020-11-14 13:46:27 -080052 goal_theta0:float (id: 4);
53 goal_theta1:float (id: 5);
54 goal_omega0:float (id: 6);
55 goal_omega1:float (id: 7);
Alex Perrycb7da4b2019-08-28 19:35:56 -070056
57 // Current position and velocity (radians)
Austin Schuhd7851b02020-11-14 13:46:27 -080058 theta0:float (id: 8);
59 theta1:float (id: 9);
Alex Perrycb7da4b2019-08-28 19:35:56 -070060
Austin Schuhd7851b02020-11-14 13:46:27 -080061 omega0:float (id: 10);
62 omega1:float (id: 11);
Alex Perrycb7da4b2019-08-28 19:35:56 -070063
64 // Estimated voltage error for the two joints.
Austin Schuhd7851b02020-11-14 13:46:27 -080065 voltage_error0:float (id: 12);
66 voltage_error1:float (id: 13);
Alex Perrycb7da4b2019-08-28 19:35:56 -070067
68 // True if we are zeroed.
Austin Schuhd7851b02020-11-14 13:46:27 -080069 zeroed:bool (id: 14);
Alex Perrycb7da4b2019-08-28 19:35:56 -070070
71 // True if the arm is zeroed.
Austin Schuhd7851b02020-11-14 13:46:27 -080072 estopped:bool (id: 15);
Alex Perrycb7da4b2019-08-28 19:35:56 -070073
74 // The current state machine state.
Austin Schuhd7851b02020-11-14 13:46:27 -080075 state:uint32 (id: 16);
Alex Perrycb7da4b2019-08-28 19:35:56 -070076
Austin Schuhd7851b02020-11-14 13:46:27 -080077 grab_state:uint32 (id: 17);
Alex Perrycb7da4b2019-08-28 19:35:56 -070078
79 // The number of times the LQR solver failed.
Austin Schuhd7851b02020-11-14 13:46:27 -080080 failed_solutions:uint32 (id: 18);
Alex Perrycb7da4b2019-08-28 19:35:56 -070081}
82
83table Status {
84 // Are all the subsystems zeroed?
Austin Schuhd7851b02020-11-14 13:46:27 -080085 zeroed:bool (id: 0);
Alex Perrycb7da4b2019-08-28 19:35:56 -070086
87 // If true, any of the subsystems have aborted.
Austin Schuhd7851b02020-11-14 13:46:27 -080088 estopped:bool (id: 1);
Alex Perrycb7da4b2019-08-28 19:35:56 -070089
90 // Status of both intake sides.
Austin Schuhd7851b02020-11-14 13:46:27 -080091 left_intake:IntakeSideStatus (id: 2);
92 right_intake:IntakeSideStatus (id: 3);
Alex Perrycb7da4b2019-08-28 19:35:56 -070093
Austin Schuhd7851b02020-11-14 13:46:27 -080094 arm:ArmStatus (id: 4);
Alex Perrycb7da4b2019-08-28 19:35:56 -070095
Austin Schuhd7851b02020-11-14 13:46:27 -080096 filtered_box_velocity:double (id: 5);
97 rotation_state:uint (id: 6);
Alex Perrycb7da4b2019-08-28 19:35:56 -070098}
99
100root_type Status;