44 #ifndef ILQGAMES_DYNAMICS_FLAT_SYSTEM_H 45 #define ILQGAMES_DYNAMICS_FLAT_SYSTEM_H 47 #include <ilqgames/utils/types.h> 56 virtual VectorXf Evaluate(
const VectorXf& x,
const VectorXf& u)
const = 0;
59 virtual void LinearizedSystem(Eigen::Ref<MatrixXf> A,
60 Eigen::Ref<MatrixXf> B)
const = 0;
63 virtual MatrixXf InverseDecouplingMatrix(
const VectorXf& x)
const = 0;
64 virtual VectorXf AffineTerm(
const VectorXf& x)
const = 0;
65 VectorXf LinearizingControl(
const VectorXf& x,
const VectorXf& v)
const {
66 return InverseDecouplingMatrix(x) * (v - AffineTerm(x));
68 virtual VectorXf ToLinearSystemState(
const VectorXf& x)
const = 0;
69 virtual VectorXf FromLinearSystemState(
const VectorXf& xi)
const = 0;
70 virtual bool IsLinearSystemStateSingular(
const VectorXf& xi)
const = 0;
73 virtual void Partial(
const VectorXf& xi, std::vector<VectorXf>* grads,
74 std::vector<MatrixXf>* hesses)
const = 0;
77 virtual float DistanceBetween(
const VectorXf& x0,
const VectorXf& x1)
const {
78 return (x0 - x1).squaredNorm();
82 Dimension XDim()
const {
return xdim_; }
83 Dimension UDim()
const {
return udim_; }
84 virtual std::vector<Dimension> PositionDimensions()
const = 0;
88 : xdim_(xdim), udim_(udim) {}
91 const Dimension xdim_;
92 const Dimension udim_;