39template <
int States,
int Inputs>
59 m_B = NumericalJacobianU<States, States, Inputs>(f, StateVector::Zero(),
104 double Uff(
int i)
const {
return m_uff(i); }
120 double R(
int i)
const {
return m_r(i); }
168 m_uff = m_B.householderQr().solve(rDot - m_f(r, InputVector::Zero()));
177 units::second_t m_dt;
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:180
Constructs a control-affine plant inversion model-based feedforward from given model dynamics.
Definition: ControlAffinePlantInversionFeedforward.h:40
const InputVector & Uff() const
Returns the previously calculated feedforward as an input vector.
Definition: ControlAffinePlantInversionFeedforward.h:95
InputVector Calculate(const StateVector &nextR)
Calculate the feedforward with only the desired future reference.
Definition: ControlAffinePlantInversionFeedforward.h:153
Vectord< Inputs > InputVector
Definition: ControlAffinePlantInversionFeedforward.h:43
double R(int i) const
Returns an element of the reference vector r.
Definition: ControlAffinePlantInversionFeedforward.h:120
InputVector Calculate(const StateVector &r, const StateVector &nextR)
Calculate the feedforward with current and future reference vectors.
Definition: ControlAffinePlantInversionFeedforward.h:165
void Reset()
Resets the feedforward with a zero initial state vector.
Definition: ControlAffinePlantInversionFeedforward.h:135
Vectord< States > StateVector
Definition: ControlAffinePlantInversionFeedforward.h:42
ControlAffinePlantInversionFeedforward(std::function< StateVector(const StateVector &, const InputVector &)> f, units::second_t dt)
Constructs a feedforward with given model dynamics as a function of state and input.
Definition: ControlAffinePlantInversionFeedforward.h:55
void Reset(const StateVector &initialState)
Resets the feedforward with a specified initial state vector.
Definition: ControlAffinePlantInversionFeedforward.h:127
const StateVector & R() const
Returns the current reference vector r.
Definition: ControlAffinePlantInversionFeedforward.h:111
ControlAffinePlantInversionFeedforward(std::function< StateVector(const StateVector &)> f, const Matrixd< States, Inputs > &B, units::second_t dt)
Constructs a feedforward with given model dynamics as a function of state, and the plant's B matrix(c...
Definition: ControlAffinePlantInversionFeedforward.h:74
double Uff(int i) const
Returns an element of the previously calculated feedforward.
Definition: ControlAffinePlantInversionFeedforward.h:104
ControlAffinePlantInversionFeedforward(ControlAffinePlantInversionFeedforward &&)=default
ControlAffinePlantInversionFeedforward & operator=(ControlAffinePlantInversionFeedforward &&)=default
Definition: AprilTagFieldLayout.h:22
Eigen::Vector< double, Size > Vectord
Definition: EigenCore.h:12