9 #ifndef CROCODDYL_CORE_ACTIONS_DIFF_LQR_HPP_
10 #define CROCODDYL_CORE_ACTIONS_DIFF_LQR_HPP_
14 #include "crocoddyl/core/diff-action-base.hpp"
15 #include "crocoddyl/core/fwd.hpp"
16 #include "crocoddyl/core/states/euclidean.hpp"
20 template <
typename _Scalar>
24 typedef _Scalar Scalar;
31 typedef typename MathBase::VectorXs VectorXs;
32 typedef typename MathBase::MatrixXs MatrixXs;
35 const bool drift_free =
true);
39 const boost::shared_ptr<DifferentialActionDataAbstract>& data,
40 const Eigen::Ref<const VectorXs>& x,
const Eigen::Ref<const VectorXs>& u);
42 const boost::shared_ptr<DifferentialActionDataAbstract>& data,
43 const Eigen::Ref<const VectorXs>& x);
45 const boost::shared_ptr<DifferentialActionDataAbstract>& data,
46 const Eigen::Ref<const VectorXs>& x,
const Eigen::Ref<const VectorXs>& u);
48 const boost::shared_ptr<DifferentialActionDataAbstract>& data,
49 const Eigen::Ref<const VectorXs>& x);
50 virtual boost::shared_ptr<DifferentialActionDataAbstract>
createData();
52 const boost::shared_ptr<DifferentialActionDataAbstract>& data);
54 const MatrixXs& get_Fq()
const;
55 const MatrixXs& get_Fv()
const;
56 const MatrixXs& get_Fu()
const;
57 const VectorXs& get_f0()
const;
58 const VectorXs& get_lx()
const;
59 const VectorXs& get_lu()
const;
60 const MatrixXs& get_Lxx()
const;
61 const MatrixXs& get_Lxu()
const;
62 const MatrixXs& get_Luu()
const;
64 void set_Fq(
const MatrixXs& Fq);
65 void set_Fv(
const MatrixXs& Fv);
66 void set_Fu(
const MatrixXs& Fu);
67 void set_f0(
const VectorXs& f0);
68 void set_lx(
const VectorXs& lx);
69 void set_lu(
const VectorXs& lu);
70 void set_Lxx(
const MatrixXs& Lxx);
71 void set_Lxu(
const MatrixXs& Lxu);
72 void set_Luu(
const MatrixXs& Luu);
79 virtual void print(std::ostream& os)
const;
98 template <
typename _Scalar>
101 typedef _Scalar Scalar;
104 typedef typename MathBase::VectorXs VectorXs;
105 typedef typename MathBase::MatrixXs MatrixXs;
107 template <
template <
typename Scalar>
class Model>
112 Fx.leftCols(model->get_state()->get_nq()) = model->get_Fq();
113 Fx.rightCols(model->get_state()->get_nv()) = model->get_Fv();
114 Fu = model->get_Fu();
115 Lxx = model->get_Lxx();
116 Luu = model->get_Luu();
117 Lxu = model->get_Lxu();
137 #include "crocoddyl/core/actions/diff-lqr.hxx"
Abstract class for differential action model.
boost::shared_ptr< StateAbstract > state_
Model of the state.
std::size_t nu_
Control dimension.
virtual void calc(const boost::shared_ptr< DifferentialActionDataAbstract > &data, const Eigen::Ref< const VectorXs > &x)
Compute the total cost value for nodes that depends only on the state.
virtual void calcDiff(const boost::shared_ptr< DifferentialActionDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)
Compute the derivatives of the dynamics and cost functions.
virtual boost::shared_ptr< DifferentialActionDataAbstract > createData()
Create the differential action data.
virtual void print(std::ostream &os) const
Print relevant information of the LQR model.
virtual void calc(const boost::shared_ptr< DifferentialActionDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)
Compute the system acceleration and cost value.
virtual bool checkData(const boost::shared_ptr< DifferentialActionDataAbstract > &data)
Checks that a specific data belongs to this model.
virtual void calcDiff(const boost::shared_ptr< DifferentialActionDataAbstract > &data, const Eigen::Ref< const VectorXs > &x)
Compute the derivatives of the cost functions with respect to the state only.
MatrixXs Fx
Jacobian of the dynamics w.r.t. the state .
MatrixXs Fu
Jacobian of the dynamics w.r.t. the control .
MatrixXs Luu
Hessian of the cost w.r.t. the control .
VectorXs Lx
Jacobian of the cost w.r.t. the state .
MatrixXs Lxx
Hessian of the cost w.r.t. the state .
VectorXs Lu
Jacobian of the cost w.r.t. the control .
VectorXs xout
evolution state
MatrixXs Fx
Jacobian of the dynamics w.r.t. the state .
MatrixXs Fu
Jacobian of the dynamics w.r.t. the control .
MatrixXs Luu
Hessian of the cost w.r.t. the control .
MatrixXs Lxx
Hessian of the cost w.r.t. the state .