blob: d1356dac9e1d2ea2569ff77bdad3d80f895a0197 [file] [log] [blame]
Austin Schuh00be3a82017-02-05 19:01:40 -08001package frc971.control_loops;
2
3import "frc971/control_loops/control_loops.q";
4
5struct ProfiledJointStatus {
Adam Snaider79900c22017-02-08 20:23:15 -08006 // Is the subsystem zeroed?
Austin Schuh00be3a82017-02-05 19:01:40 -08007 bool zeroed;
8
9 // The state of the subsystem, if applicable. -1 otherwise.
10 int32_t state;
11
12 // If true, we have aborted.
13 bool estopped;
14
15 // Position of the joint.
16 float position;
17 // Velocity of the joint in units/second.
18 float velocity;
19 // Profiled goal position of the joint.
20 float goal_position;
21 // Profiled goal velocity of the joint in units/second.
22 float goal_velocity;
23 // Unprofiled goal position from absoulte zero of the joint.
24 float unprofiled_goal_position;
25 // Unprofiled goal velocity of the joint in units/second.
26 float unprofiled_goal_velocity;
27
28 // The estimated voltage error.
29 float voltage_error;
30
31 // The calculated velocity with delta x/delta t
32 float calculated_velocity;
33
34 // Components of the control loop output
35 float position_power;
36 float velocity_power;
37 float feedforwards_power;
38
39 // State of the estimator.
40 .frc971.EstimatorState estimator_state;
41};
Adam Snaider79900c22017-02-08 20:23:15 -080042
Lee Mracek03485572019-01-04 02:27:26 -080043struct HallProfiledJointStatus {
44 // Is the subsystem zeroed?
45 bool zeroed;
46
47 // The state of the subsystem, if applicable. -1 otherwise.
48 int32_t state;
49
50 // If true, we have aborted.
51 bool estopped;
52
53 // Position of the joint.
54 float position;
55 // Velocity of the joint in units/second.
56 float velocity;
57 // Profiled goal position of the joint.
58 float goal_position;
59 // Profiled goal velocity of the joint in units/second.
60 float goal_velocity;
61 // Unprofiled goal position from absoulte zero of the joint.
62 float unprofiled_goal_position;
63 // Unprofiled goal velocity of the joint in units/second.
64 float unprofiled_goal_velocity;
65
66 // The estimated voltage error.
67 float voltage_error;
68
69 // The calculated velocity with delta x/delta t
70 float calculated_velocity;
71
72 // Components of the control loop output
73 float position_power;
74 float velocity_power;
75 float feedforwards_power;
76
77 // State of the estimator.
78 .frc971.HallEffectAndPositionEstimatorState estimator_state;
79};
80
Adam Snaider79900c22017-02-08 20:23:15 -080081struct AbsoluteProfiledJointStatus {
82 // Is the subsystem zeroed?
83 bool zeroed;
84
85 // The state of the subsystem, if applicable. -1 otherwise.
86 int32_t state;
87
88 // If true, we have aborted.
89 bool estopped;
90
91 // Position of the joint.
92 float position;
93 // Velocity of the joint in units/second.
94 float velocity;
95 // Profiled goal position of the joint.
96 float goal_position;
97 // Profiled goal velocity of the joint in units/second.
98 float goal_velocity;
99 // Unprofiled goal position from absoulte zero of the joint.
100 float unprofiled_goal_position;
101 // Unprofiled goal velocity of the joint in units/second.
102 float unprofiled_goal_velocity;
103
104 // The estimated voltage error.
105 float voltage_error;
106
107 // The calculated velocity with delta x/delta t
108 float calculated_velocity;
109
110 // Components of the control loop output
111 float position_power;
112 float velocity_power;
113 float feedforwards_power;
114
115 // State of the estimator.
Austin Schuh72db9a12019-01-21 18:02:51 -0800116 .frc971.PotAndAbsoluteEncoderEstimatorState estimator_state;
Adam Snaider79900c22017-02-08 20:23:15 -0800117};
Austin Schuh6a90cd92017-02-19 20:55:33 -0800118
119struct IndexProfiledJointStatus {
120 // Is the subsystem zeroed?
121 bool zeroed;
122
123 // The state of the subsystem, if applicable. -1 otherwise.
124 int32_t state;
125
126 // If true, we have aborted.
127 bool estopped;
128
129 // Position of the joint.
130 float position;
131 // Velocity of the joint in units/second.
132 float velocity;
133 // Profiled goal position of the joint.
134 float goal_position;
135 // Profiled goal velocity of the joint in units/second.
136 float goal_velocity;
137 // Unprofiled goal position from absoulte zero of the joint.
138 float unprofiled_goal_position;
139 // Unprofiled goal velocity of the joint in units/second.
140 float unprofiled_goal_velocity;
141
142 // The estimated voltage error.
143 float voltage_error;
144
145 // The calculated velocity with delta x/delta t
146 float calculated_velocity;
147
148 // Components of the control loop output
149 float position_power;
150 float velocity_power;
151 float feedforwards_power;
152
153 // State of the estimator.
154 .frc971.IndexEstimatorState estimator_state;
155};