27template <
int States,
int Inputs>
39 template <
int Outputs>
43 plantRef.A(), plantRef.B()) {}
74 m_A = -B.householderQr().solve(A - Aref);
75 m_B = B.householderQr().solve(Bref);
94 double U(
int i)
const {
return m_u(i); }
108 m_u = m_A * x + m_B * u;
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:180
Contains the controller coefficients and logic for an implicit model follower.
Definition: ImplicitModelFollower.h:28
const InputVector & U() const
Returns the control input vector u.
Definition: ImplicitModelFollower.h:85
Vectord< Inputs > InputVector
Definition: ImplicitModelFollower.h:31
double U(int i) const
Returns an element of the control input vector u.
Definition: ImplicitModelFollower.h:94
void Reset()
Resets the controller.
Definition: ImplicitModelFollower.h:99
Vectord< States > StateVector
Definition: ImplicitModelFollower.h:30
InputVector Calculate(const StateVector &x, const InputVector &u)
Returns the next output of the controller.
Definition: ImplicitModelFollower.h:107
ImplicitModelFollower(const LinearSystem< States, Inputs, Outputs > &plant, const LinearSystem< States, Inputs, Outputs > &plantRef)
Constructs a controller with the given coefficients and plant.
Definition: ImplicitModelFollower.h:40
ImplicitModelFollower(const Matrixd< States, States > &A, const Matrixd< States, Inputs > &B, const Matrixd< States, States > &Aref, const Matrixd< States, Inputs > &Bref)
Constructs a controller with the given coefficients and plant.
Definition: ImplicitModelFollower.h:53
A plant defined using state-space notation.
Definition: LinearSystem.h:31
Definition: AprilTagFieldLayout.h:22
Eigen::Vector< double, Size > Vectord
Definition: EigenCore.h:12