3#include "math/eigen_interface.h"
5#include "math/systems/linear_system.h"
6#include "math/systems/discretization.h"
27 template <
int OUTPUTS>
39 : A_(A), B_(B), m_dt(dt) {
40 auto [Ad, Bd] = discretize_AB(A, B, dt);
53 EVec<INPUTS>
calculate(
const EVec<STATES> &r,
const EVec<STATES> &next_r) {
58 uff_ = Bd_.householderQr().solve(next_r - (Ad_ * r));
85 EVec<INPUTS>
calculate(
const EVec<STATES> &r,
const EVec<STATES> &next_r,
const double &dt) {
86 auto [Ad, Bd] = discretize_AB(A_, B_, dt);
92 uff_ = Bd.householderQr().solve(next_r - (Ad * r));
108 EVec<INPUTS>
calculate(
const EVec<STATES> &next_r,
const double &dt) {
return calculate(r_, next_r, dt); }
115 void reset(
const EVec<STATES> &initial_state) {
133 void set_r(
const EVec<STATES> &r) { r_ = r; }
137 EMat<STATES, STATES> A_;
138 EMat<STATES, INPUTS> B_;
141 EMat<STATES, STATES> Ad_;
142 EMat<STATES, INPUTS> Bd_;
LinearPlantInversionFeedforward(LinearSystem< STATES, INPUTS, OUTPUTS > &plant, const double &dt)
Definition linear_plant_inversion_feedforward.h:28
EVec< INPUTS > calculate(const EVec< STATES > &r, const EVec< STATES > &next_r)
Definition linear_plant_inversion_feedforward.h:53
EVec< INPUTS > calculate(const EVec< STATES > &next_r, const double &dt)
Definition linear_plant_inversion_feedforward.h:108
void set_r(const EVec< STATES > &r)
Definition linear_plant_inversion_feedforward.h:133
EVec< INPUTS > calculate(const EVec< STATES > &next_r)
Definition linear_plant_inversion_feedforward.h:70
void reset()
Definition linear_plant_inversion_feedforward.h:123
LinearPlantInversionFeedforward(const EMat< STATES, STATES > &A, const EMat< STATES, INPUTS > &B, const double &dt)
Definition linear_plant_inversion_feedforward.h:38
EVec< INPUTS > calculate(const EVec< STATES > &r, const EVec< STATES > &next_r, const double &dt)
Definition linear_plant_inversion_feedforward.h:85
void reset(const EVec< STATES > &initial_state)
Definition linear_plant_inversion_feedforward.h:115
Definition linear_system.h:17