40template <
int States,
int Inputs>
60 m_B = NumericalJacobianU<States, States, Inputs>(f, StateVector::Zero(),
105 double Uff(
int i)
const {
return m_uff(i); }
121 double R(
int i)
const {
return m_r(i); }
172 m_uff = m_B.householderQr().solve(rDot - m_f(r, InputVector::Zero()));
181 units::second_t m_dt;
Constructs a control-affine plant inversion model-based feedforward from given model dynamics.
Definition: ControlAffinePlantInversionFeedforward.h:41
const InputVector & Uff() const
Returns the previously calculated feedforward as an input vector.
Definition: ControlAffinePlantInversionFeedforward.h:96
InputVector Calculate(const StateVector &nextR)
Calculate the feedforward with only the desired future reference.
Definition: ControlAffinePlantInversionFeedforward.h:154
Vectord< Inputs > InputVector
Definition: ControlAffinePlantInversionFeedforward.h:44
double R(int i) const
Returns an element of the reference vector r.
Definition: ControlAffinePlantInversionFeedforward.h:121
InputVector Calculate(const StateVector &r, const StateVector &nextR)
Calculate the feedforward with current and future reference vectors.
Definition: ControlAffinePlantInversionFeedforward.h:166
void Reset()
Resets the feedforward with a zero initial state vector.
Definition: ControlAffinePlantInversionFeedforward.h:136
Vectord< States > StateVector
Definition: ControlAffinePlantInversionFeedforward.h:43
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:56
void Reset(const StateVector &initialState)
Resets the feedforward with a specified initial state vector.
Definition: ControlAffinePlantInversionFeedforward.h:128
const StateVector & R() const
Returns the current reference vector r.
Definition: ControlAffinePlantInversionFeedforward.h:112
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:75
double Uff(int i) const
Returns an element of the previously calculated feedforward.
Definition: ControlAffinePlantInversionFeedforward.h:105
ControlAffinePlantInversionFeedforward(ControlAffinePlantInversionFeedforward &&)=default
ControlAffinePlantInversionFeedforward & operator=(ControlAffinePlantInversionFeedforward &&)=default
Definition: AprilTagPoseEstimator.h:15
Eigen::Matrix< double, Rows, Cols, Options, MaxRows, MaxCols > Matrixd
Definition: EigenCore.h:21
Eigen::Vector< double, Size > Vectord
Definition: EigenCore.h:12