12#include "wpi/units/time.hpp"
29template <
int States,
int Inputs>
42 template <
int Outputs>
45 wpi::units::second_t dt)
57 wpi::units::second_t dt)
77 double Uff(
int i)
const {
return m_uff(i); }
93 double R(
int i)
const {
return m_r(i); }
142 m_uff = m_B.householderQr().solve(nextR - (m_A * r));
151 wpi::units::second_t m_dt;
Vectord< Inputs > InputVector
Definition LinearPlantInversionFeedforward.hpp:33
void Reset(const StateVector &initialState)
Resets the feedforward with a specified initial state vector.
Definition LinearPlantInversionFeedforward.hpp:100
InputVector Calculate(const StateVector &nextR)
Calculate the feedforward with only the desired future reference.
Definition LinearPlantInversionFeedforward.hpp:126
Vectord< States > StateVector
Definition LinearPlantInversionFeedforward.hpp:32
double R(int i) const
Returns an element of the reference vector r.
Definition LinearPlantInversionFeedforward.hpp:93
double Uff(int i) const
Returns an element of the previously calculated feedforward.
Definition LinearPlantInversionFeedforward.hpp:77
const InputVector & Uff() const
Returns the previously calculated feedforward as an input vector.
Definition LinearPlantInversionFeedforward.hpp:68
void Reset()
Resets the feedforward with a zero initial state vector.
Definition LinearPlantInversionFeedforward.hpp:108
LinearPlantInversionFeedforward(const Matrixd< States, States > &A, const Matrixd< States, Inputs > &B, wpi::units::second_t dt)
Constructs a feedforward with the given coefficients.
Definition LinearPlantInversionFeedforward.hpp:55
InputVector Calculate(const StateVector &r, const StateVector &nextR)
Calculate the feedforward with current and future reference vectors.
Definition LinearPlantInversionFeedforward.hpp:138
const StateVector & R() const
Returns the current reference vector r.
Definition LinearPlantInversionFeedforward.hpp:84
LinearPlantInversionFeedforward(const LinearSystem< States, Inputs, Outputs > &plant, wpi::units::second_t dt)
Constructs a feedforward with the given plant.
Definition LinearPlantInversionFeedforward.hpp:43
A plant defined using state-space notation.
Definition LinearSystem.hpp:35
Definition LinearSystem.hpp:20
Eigen::Matrix< double, Rows, Cols, Options, MaxRows, MaxCols > Matrixd
Definition EigenCore.hpp:21
void DiscretizeAB(const Matrixd< States, States > &contA, const Matrixd< States, Inputs > &contB, wpi::units::second_t dt, Matrixd< States, States > *discA, Matrixd< States, Inputs > *discB)
Discretizes the given continuous A and B matrices.
Definition Discretization.hpp:41
Eigen::Vector< double, Size > Vectord
Definition EigenCore.hpp:12