Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 1 | #ifndef FRC971_CONTROL_LOOPS_STATEFEEDBACKLOOP_H_ |
| 2 | #define FRC971_CONTROL_LOOPS_STATEFEEDBACKLOOP_H_ |
| 3 | |
Austin Schuh | 849f003 | 2013-03-03 23:59:53 -0800 | [diff] [blame] | 4 | #include <assert.h> |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 5 | |
Brian Silverman | c571e05 | 2013-03-13 17:58:56 -0700 | [diff] [blame] | 6 | #include <vector> |
| 7 | |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 8 | #include "Eigen/Dense" |
| 9 | |
| 10 | template <int number_of_states, int number_of_inputs, int number_of_outputs> |
Austin Schuh | e349062 | 2013-03-13 01:24:30 -0700 | [diff] [blame] | 11 | class StateFeedbackPlantCoefficients { |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 12 | public: |
| 13 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW; |
| 14 | |
| 15 | const Eigen::Matrix<double, number_of_states, number_of_states> A; |
| 16 | const Eigen::Matrix<double, number_of_states, number_of_inputs> B; |
| 17 | const Eigen::Matrix<double, number_of_outputs, number_of_states> C; |
| 18 | const Eigen::Matrix<double, number_of_outputs, number_of_inputs> D; |
| 19 | const Eigen::Matrix<double, number_of_inputs, 1> U_min; |
| 20 | const Eigen::Matrix<double, number_of_inputs, 1> U_max; |
| 21 | |
Austin Schuh | e349062 | 2013-03-13 01:24:30 -0700 | [diff] [blame] | 22 | StateFeedbackPlantCoefficients(const StateFeedbackPlantCoefficients &other) |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 23 | : A(other.A), |
| 24 | B(other.B), |
| 25 | C(other.C), |
| 26 | D(other.D), |
| 27 | U_min(other.U_min), |
| 28 | U_max(other.U_max) { |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 29 | } |
| 30 | |
Austin Schuh | e349062 | 2013-03-13 01:24:30 -0700 | [diff] [blame] | 31 | StateFeedbackPlantCoefficients( |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 32 | const Eigen::Matrix<double, number_of_states, number_of_states> &A, |
| 33 | const Eigen::Matrix<double, number_of_states, number_of_inputs> &B, |
| 34 | const Eigen::Matrix<double, number_of_outputs, number_of_states> &C, |
| 35 | const Eigen::Matrix<double, number_of_outputs, number_of_inputs> &D, |
| 36 | const Eigen::Matrix<double, number_of_outputs, 1> &U_max, |
| 37 | const Eigen::Matrix<double, number_of_outputs, 1> &U_min) |
| 38 | : A(A), |
| 39 | B(B), |
| 40 | C(C), |
| 41 | D(D), |
| 42 | U_min(U_min), |
| 43 | U_max(U_max) { |
Austin Schuh | e349062 | 2013-03-13 01:24:30 -0700 | [diff] [blame] | 44 | } |
| 45 | |
| 46 | protected: |
| 47 | // these are accessible from non-templated subclasses |
| 48 | static const int kNumStates = number_of_states; |
| 49 | static const int kNumOutputs = number_of_outputs; |
| 50 | static const int kNumInputs = number_of_inputs; |
| 51 | }; |
| 52 | |
| 53 | template <int number_of_states, int number_of_inputs, int number_of_outputs> |
| 54 | class StateFeedbackPlant { |
| 55 | public: |
| 56 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW; |
| 57 | ::std::vector<StateFeedbackPlantCoefficients< |
| 58 | number_of_states, number_of_inputs, number_of_outputs> *> coefficients_; |
| 59 | |
| 60 | const Eigen::Matrix<double, number_of_states, number_of_states> &A() const { |
| 61 | return coefficients().A; |
| 62 | } |
| 63 | double A(int i, int j) const { return A()(i, j); } |
| 64 | const Eigen::Matrix<double, number_of_states, number_of_inputs> &B() const { |
| 65 | return coefficients().B; |
| 66 | } |
| 67 | double B(int i, int j) const { return B()(i, j); } |
| 68 | const Eigen::Matrix<double, number_of_outputs, number_of_states> &C() const { |
| 69 | return coefficients().C; |
| 70 | } |
| 71 | double C(int i, int j) const { return C()(i, j); } |
| 72 | const Eigen::Matrix<double, number_of_outputs, number_of_inputs> &D() const { |
| 73 | return coefficients().D; |
| 74 | } |
| 75 | double D(int i, int j) const { return D()(i, j); } |
| 76 | const Eigen::Matrix<double, number_of_inputs, 1> &U_min() const { |
| 77 | return coefficients().U_min; |
| 78 | } |
| 79 | double U_min(int i, int j) const { return U_min()(i, j); } |
| 80 | const Eigen::Matrix<double, number_of_inputs, 1> &U_max() const { |
| 81 | return coefficients().U_max; |
| 82 | } |
| 83 | double U_max(int i, int j) const { return U_max()(i, j); } |
| 84 | |
| 85 | const StateFeedbackPlantCoefficients< |
| 86 | number_of_states, number_of_inputs, number_of_outputs> |
| 87 | &coefficients() const { |
| 88 | return *coefficients_[plant_index_]; |
| 89 | } |
| 90 | |
| 91 | int plant_index() const { return plant_index_; } |
| 92 | void set_plant_index(int plant_index) { |
| 93 | if (plant_index < 0) { |
| 94 | plant_index_ = 0; |
| 95 | } else if (plant_index >= static_cast<int>(coefficients_.size())) { |
Brian Silverman | b8cd689 | 2013-03-17 23:36:24 -0700 | [diff] [blame] | 96 | plant_index_ = static_cast<int>(coefficients_.size()) - 1; |
Austin Schuh | e349062 | 2013-03-13 01:24:30 -0700 | [diff] [blame] | 97 | } else { |
| 98 | plant_index_ = plant_index; |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | void Reset() { |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 103 | X.setZero(); |
| 104 | Y.setZero(); |
| 105 | U.setZero(); |
| 106 | } |
| 107 | |
Austin Schuh | e349062 | 2013-03-13 01:24:30 -0700 | [diff] [blame] | 108 | Eigen::Matrix<double, number_of_states, 1> X; |
| 109 | Eigen::Matrix<double, number_of_outputs, 1> Y; |
| 110 | Eigen::Matrix<double, number_of_inputs, 1> U; |
| 111 | |
| 112 | StateFeedbackPlant( |
| 113 | const ::std::vector<StateFeedbackPlantCoefficients< |
| 114 | number_of_states, number_of_inputs, |
| 115 | number_of_outputs> *> &coefficients) |
| 116 | : coefficients_(coefficients), |
| 117 | plant_index_(0) { |
| 118 | Reset(); |
| 119 | } |
| 120 | |
| 121 | StateFeedbackPlant(StateFeedbackPlant &&other) |
| 122 | : plant_index_(0) { |
| 123 | Reset(); |
| 124 | ::std::swap(coefficients_, other.coefficients_); |
| 125 | } |
| 126 | |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 127 | virtual ~StateFeedbackPlant() {} |
| 128 | |
Austin Schuh | 849f003 | 2013-03-03 23:59:53 -0800 | [diff] [blame] | 129 | // Assert that U is within the hardware range. |
| 130 | virtual void CheckU() { |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 131 | for (int i = 0; i < kNumOutputs; ++i) { |
Austin Schuh | e349062 | 2013-03-13 01:24:30 -0700 | [diff] [blame] | 132 | assert(U(i, 0) <= U_max(i, 0)); |
| 133 | assert(U(i, 0) >= U_min(i, 0)); |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 134 | } |
| 135 | } |
Austin Schuh | 849f003 | 2013-03-03 23:59:53 -0800 | [diff] [blame] | 136 | |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 137 | // Computes the new X and Y given the control input. |
| 138 | void Update() { |
Austin Schuh | 849f003 | 2013-03-03 23:59:53 -0800 | [diff] [blame] | 139 | // Powers outside of the range are more likely controller bugs than things |
| 140 | // that the plant should deal with. |
| 141 | CheckU(); |
Austin Schuh | e349062 | 2013-03-13 01:24:30 -0700 | [diff] [blame] | 142 | X = A() * X + B() * U; |
| 143 | Y = C() * X + D() * U; |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 144 | } |
| 145 | |
| 146 | protected: |
| 147 | // these are accessible from non-templated subclasses |
Austin Schuh | b1cdb38 | 2013-03-01 22:53:52 -0800 | [diff] [blame] | 148 | static const int kNumStates = number_of_states; |
| 149 | static const int kNumOutputs = number_of_outputs; |
| 150 | static const int kNumInputs = number_of_inputs; |
Austin Schuh | e349062 | 2013-03-13 01:24:30 -0700 | [diff] [blame] | 151 | |
| 152 | private: |
| 153 | int plant_index_; |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 154 | }; |
| 155 | |
Austin Schuh | 9644e1c | 2013-03-12 00:40:36 -0700 | [diff] [blame] | 156 | // A Controller is a structure which holds a plant and the K and L matrices. |
| 157 | // This is designed such that multiple controllers can share one set of state to |
| 158 | // support gain scheduling easily. |
| 159 | template <int number_of_states, int number_of_inputs, int number_of_outputs> |
| 160 | struct StateFeedbackController { |
| 161 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW; |
| 162 | const Eigen::Matrix<double, number_of_states, number_of_outputs> L; |
| 163 | const Eigen::Matrix<double, number_of_outputs, number_of_states> K; |
Austin Schuh | e349062 | 2013-03-13 01:24:30 -0700 | [diff] [blame] | 164 | StateFeedbackPlantCoefficients<number_of_states, number_of_inputs, |
| 165 | number_of_outputs> plant; |
Austin Schuh | 9644e1c | 2013-03-12 00:40:36 -0700 | [diff] [blame] | 166 | |
| 167 | StateFeedbackController( |
| 168 | const Eigen::Matrix<double, number_of_states, number_of_outputs> &L, |
| 169 | const Eigen::Matrix<double, number_of_outputs, number_of_states> &K, |
Austin Schuh | e349062 | 2013-03-13 01:24:30 -0700 | [diff] [blame] | 170 | const StateFeedbackPlantCoefficients<number_of_states, number_of_inputs, |
| 171 | number_of_outputs> &plant) |
Austin Schuh | 9644e1c | 2013-03-12 00:40:36 -0700 | [diff] [blame] | 172 | : L(L), |
| 173 | K(K), |
| 174 | plant(plant) { |
| 175 | } |
| 176 | }; |
| 177 | |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 178 | template <int number_of_states, int number_of_inputs, int number_of_outputs> |
| 179 | class StateFeedbackLoop { |
| 180 | public: |
| 181 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW; |
| 182 | |
Austin Schuh | 9644e1c | 2013-03-12 00:40:36 -0700 | [diff] [blame] | 183 | const Eigen::Matrix<double, number_of_states, number_of_states> &A() const { |
| 184 | return controller().plant.A; |
| 185 | } |
| 186 | double A(int i, int j) const { return A()(i, j); } |
| 187 | const Eigen::Matrix<double, number_of_states, number_of_inputs> &B() const { |
| 188 | return controller().plant.B; |
| 189 | } |
| 190 | double B(int i, int j) const { return B()(i, j); } |
| 191 | const Eigen::Matrix<double, number_of_outputs, number_of_states> &C() const { |
| 192 | return controller().plant.C; |
| 193 | } |
| 194 | double C(int i, int j) const { return C()(i, j); } |
| 195 | const Eigen::Matrix<double, number_of_outputs, number_of_inputs> &D() const { |
| 196 | return controller().plant.D; |
| 197 | } |
| 198 | double D(int i, int j) const { return D()(i, j); } |
| 199 | const Eigen::Matrix<double, number_of_outputs, number_of_states> &K() const { |
| 200 | return controller().K; |
| 201 | } |
| 202 | double K(int i, int j) const { return K()(i, j); } |
| 203 | const Eigen::Matrix<double, number_of_states, number_of_outputs> &L() const { |
| 204 | return controller().L; |
| 205 | } |
| 206 | double L(int i, int j) const { return L()(i, j); } |
| 207 | const Eigen::Matrix<double, number_of_inputs, 1> &U_min() const { |
| 208 | return controller().plant.U_min; |
| 209 | } |
| 210 | double U_min(int i, int j) const { return U_min()(i, j); } |
| 211 | const Eigen::Matrix<double, number_of_inputs, 1> &U_max() const { |
| 212 | return controller().plant.U_max; |
| 213 | } |
| 214 | double U_max(int i, int j) const { return U_max()(i, j); } |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 215 | |
| 216 | Eigen::Matrix<double, number_of_states, 1> X_hat; |
| 217 | Eigen::Matrix<double, number_of_states, 1> R; |
| 218 | Eigen::Matrix<double, number_of_inputs, 1> U; |
Austin Schuh | 06ee48e | 2013-03-02 01:47:54 -0800 | [diff] [blame] | 219 | Eigen::Matrix<double, number_of_inputs, 1> U_uncapped; |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 220 | Eigen::Matrix<double, number_of_outputs, 1> U_ff; |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 221 | |
Brian Silverman | 2c590c3 | 2013-11-04 18:08:54 -0800 | [diff] [blame] | 222 | const StateFeedbackController<number_of_states, number_of_inputs, |
| 223 | number_of_outputs> &controller() const { |
Austin Schuh | e349062 | 2013-03-13 01:24:30 -0700 | [diff] [blame] | 224 | return *controllers_[controller_index_]; |
Austin Schuh | 9644e1c | 2013-03-12 00:40:36 -0700 | [diff] [blame] | 225 | } |
| 226 | |
Brian Silverman | 2c590c3 | 2013-11-04 18:08:54 -0800 | [diff] [blame] | 227 | const StateFeedbackController<number_of_states, number_of_inputs, |
| 228 | number_of_outputs> &controller( |
| 229 | int index) const { |
Austin Schuh | 2054f5f | 2013-10-27 14:54:10 -0700 | [diff] [blame] | 230 | return *controllers_[index]; |
| 231 | } |
| 232 | |
Austin Schuh | 9644e1c | 2013-03-12 00:40:36 -0700 | [diff] [blame] | 233 | void Reset() { |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 234 | X_hat.setZero(); |
| 235 | R.setZero(); |
| 236 | U.setZero(); |
Austin Schuh | 06ee48e | 2013-03-02 01:47:54 -0800 | [diff] [blame] | 237 | U_uncapped.setZero(); |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 238 | U_ff.setZero(); |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 239 | } |
Austin Schuh | 9644e1c | 2013-03-12 00:40:36 -0700 | [diff] [blame] | 240 | |
Brian Silverman | 2c590c3 | 2013-11-04 18:08:54 -0800 | [diff] [blame] | 241 | StateFeedbackLoop(const StateFeedbackController< |
| 242 | number_of_states, number_of_inputs, number_of_outputs> &controller) |
Austin Schuh | 9644e1c | 2013-03-12 00:40:36 -0700 | [diff] [blame] | 243 | : controller_index_(0) { |
Brian Silverman | 2c590c3 | 2013-11-04 18:08:54 -0800 | [diff] [blame] | 244 | controllers_.push_back(new StateFeedbackController< |
| 245 | number_of_states, number_of_inputs, number_of_outputs>(controller)); |
Austin Schuh | 9644e1c | 2013-03-12 00:40:36 -0700 | [diff] [blame] | 246 | Reset(); |
| 247 | } |
| 248 | |
Brian Silverman | 2c590c3 | 2013-11-04 18:08:54 -0800 | [diff] [blame] | 249 | StateFeedbackLoop(const ::std::vector<StateFeedbackController< |
| 250 | number_of_states, number_of_inputs, number_of_outputs> *> &controllers) |
| 251 | : controllers_(controllers), controller_index_(0) { |
Austin Schuh | 9644e1c | 2013-03-12 00:40:36 -0700 | [diff] [blame] | 252 | Reset(); |
| 253 | } |
| 254 | |
| 255 | StateFeedbackLoop( |
| 256 | const Eigen::Matrix<double, number_of_states, number_of_outputs> &L, |
| 257 | const Eigen::Matrix<double, number_of_outputs, number_of_states> &K, |
Austin Schuh | e349062 | 2013-03-13 01:24:30 -0700 | [diff] [blame] | 258 | const StateFeedbackPlantCoefficients<number_of_states, number_of_inputs, |
Austin Schuh | 9644e1c | 2013-03-12 00:40:36 -0700 | [diff] [blame] | 259 | number_of_outputs> &plant) |
| 260 | : controller_index_(0) { |
Austin Schuh | e349062 | 2013-03-13 01:24:30 -0700 | [diff] [blame] | 261 | controllers_.push_back( |
Austin Schuh | 9644e1c | 2013-03-12 00:40:36 -0700 | [diff] [blame] | 262 | new StateFeedbackController<number_of_states, number_of_inputs, |
| 263 | number_of_outputs>(L, K, plant)); |
| 264 | |
| 265 | Reset(); |
| 266 | } |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 267 | virtual ~StateFeedbackLoop() {} |
| 268 | |
| 269 | virtual void FeedForward() { |
| 270 | for (int i = 0; i < number_of_outputs; ++i) { |
| 271 | U_ff[i] = 0.0; |
| 272 | } |
| 273 | } |
| 274 | |
| 275 | // If U is outside the hardware range, limit it before the plant tries to use |
| 276 | // it. |
| 277 | virtual void CapU() { |
| 278 | for (int i = 0; i < kNumOutputs; ++i) { |
Austin Schuh | 9644e1c | 2013-03-12 00:40:36 -0700 | [diff] [blame] | 279 | if (U(i, 0) > U_max(i, 0)) { |
| 280 | U(i, 0) = U_max(i, 0); |
| 281 | } else if (U(i, 0) < U_min(i, 0)) { |
| 282 | U(i, 0) = U_min(i, 0); |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 283 | } |
| 284 | } |
| 285 | } |
| 286 | |
Austin Schuh | f9286cd | 2014-02-11 00:51:09 -0800 | [diff] [blame] | 287 | // Corrects X_hat given the observation in Y. |
| 288 | void Correct(const Eigen::Matrix<double, number_of_outputs, 1> &Y) { |
| 289 | Y_ = Y; |
| 290 | new_y_ = true; |
| 291 | } |
| 292 | |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 293 | // stop_motors is whether or not to output all 0s. |
Austin Schuh | f9286cd | 2014-02-11 00:51:09 -0800 | [diff] [blame] | 294 | void Update(bool stop_motors) { |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 295 | if (stop_motors) { |
Austin Schuh | 9644e1c | 2013-03-12 00:40:36 -0700 | [diff] [blame] | 296 | U.setZero(); |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 297 | } else { |
Austin Schuh | 9644e1c | 2013-03-12 00:40:36 -0700 | [diff] [blame] | 298 | U = U_uncapped = K() * (R - X_hat); |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 299 | CapU(); |
| 300 | } |
| 301 | |
Austin Schuh | f9286cd | 2014-02-11 00:51:09 -0800 | [diff] [blame] | 302 | if (new_y_) { |
| 303 | X_hat = (A() - L() * C()) * X_hat + L() * Y_ + B() * U; |
| 304 | new_y_ = false; |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 305 | } else { |
Austin Schuh | 9644e1c | 2013-03-12 00:40:36 -0700 | [diff] [blame] | 306 | X_hat = A() * X_hat + B() * U; |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 307 | } |
| 308 | } |
| 309 | |
Austin Schuh | 9644e1c | 2013-03-12 00:40:36 -0700 | [diff] [blame] | 310 | // Sets the current controller to be index and verifies that it isn't out of |
| 311 | // range. |
| 312 | void set_controller_index(int index) { |
Austin Schuh | e349062 | 2013-03-13 01:24:30 -0700 | [diff] [blame] | 313 | if (index < 0) { |
| 314 | controller_index_ = 0; |
| 315 | } else if (index >= static_cast<int>(controllers_.size())) { |
Brian Silverman | b8cd689 | 2013-03-17 23:36:24 -0700 | [diff] [blame] | 316 | controller_index_ = static_cast<int>(controllers_.size()) - 1; |
Austin Schuh | e349062 | 2013-03-13 01:24:30 -0700 | [diff] [blame] | 317 | } else { |
Austin Schuh | 9644e1c | 2013-03-12 00:40:36 -0700 | [diff] [blame] | 318 | controller_index_ = index; |
| 319 | } |
| 320 | } |
| 321 | |
| 322 | void controller_index() const { return controller_index_; } |
| 323 | |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 324 | protected: |
Austin Schuh | 2054f5f | 2013-10-27 14:54:10 -0700 | [diff] [blame] | 325 | ::std::vector<StateFeedbackController<number_of_states, number_of_inputs, |
| 326 | number_of_outputs> *> controllers_; |
| 327 | |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 328 | // these are accessible from non-templated subclasses |
Austin Schuh | b1cdb38 | 2013-03-01 22:53:52 -0800 | [diff] [blame] | 329 | static const int kNumStates = number_of_states; |
| 330 | static const int kNumOutputs = number_of_outputs; |
| 331 | static const int kNumInputs = number_of_inputs; |
Austin Schuh | 9644e1c | 2013-03-12 00:40:36 -0700 | [diff] [blame] | 332 | |
Austin Schuh | f9286cd | 2014-02-11 00:51:09 -0800 | [diff] [blame] | 333 | // Temporary storage for a measurement until I can figure out why I can't |
| 334 | // correct when the measurement is made. |
| 335 | Eigen::Matrix<double, number_of_outputs, 1> Y_; |
| 336 | bool new_y_ = false; |
| 337 | |
Austin Schuh | 9644e1c | 2013-03-12 00:40:36 -0700 | [diff] [blame] | 338 | int controller_index_; |
Austin Schuh | dc1c84a | 2013-02-23 16:33:10 -0800 | [diff] [blame] | 339 | }; |
| 340 | |
| 341 | #endif // FRC971_CONTROL_LOOPS_STATEFEEDBACKLOOP_H_ |