9#ifndef CROCODDYL_CORE_ACTIONS_DIFF_LQR_HPP_
10#define CROCODDYL_CORE_ACTIONS_DIFF_LQR_HPP_
14#include "crocoddyl/core/fwd.hpp"
15#include "crocoddyl/core/diff-action-base.hpp"
16#include "crocoddyl/core/states/euclidean.hpp"
20template <
typename _Scalar>
23 typedef _Scalar Scalar;
29 typedef typename MathBase::VectorXs VectorXs;
30 typedef typename MathBase::MatrixXs MatrixXs;
35 virtual void calc(
const boost::shared_ptr<DifferentialActionDataAbstract>& data,
const Eigen::Ref<const VectorXs>& x,
36 const Eigen::Ref<const VectorXs>& u);
37 virtual void calc(
const boost::shared_ptr<DifferentialActionDataAbstract>& data,
38 const Eigen::Ref<const VectorXs>& x);
39 virtual void calcDiff(
const boost::shared_ptr<DifferentialActionDataAbstract>& data,
40 const Eigen::Ref<const VectorXs>& x,
const Eigen::Ref<const VectorXs>& u);
41 virtual void calcDiff(
const boost::shared_ptr<DifferentialActionDataAbstract>& data,
42 const Eigen::Ref<const VectorXs>& x);
43 virtual boost::shared_ptr<DifferentialActionDataAbstract>
createData();
44 virtual bool checkData(
const boost::shared_ptr<DifferentialActionDataAbstract>& data);
46 const MatrixXs& get_Fq()
const;
47 const MatrixXs& get_Fv()
const;
48 const MatrixXs& get_Fu()
const;
49 const VectorXs& get_f0()
const;
50 const VectorXs& get_lx()
const;
51 const VectorXs& get_lu()
const;
52 const MatrixXs& get_Lxx()
const;
53 const MatrixXs& get_Lxu()
const;
54 const MatrixXs& get_Luu()
const;
56 void set_Fq(
const MatrixXs& Fq);
57 void set_Fv(
const MatrixXs& Fv);
58 void set_Fu(
const MatrixXs& Fu);
59 void set_f0(
const VectorXs& f0);
60 void set_lx(
const VectorXs& lx);
61 void set_lu(
const VectorXs& lu);
62 void set_Lxx(
const MatrixXs& Lxx);
63 void set_Lxu(
const MatrixXs& Lxu);
64 void set_Luu(
const MatrixXs& Luu);
71 virtual void print(std::ostream& os)
const;
90template <
typename _Scalar>
92 typedef _Scalar Scalar;
95 typedef typename MathBase::VectorXs VectorXs;
96 typedef typename MathBase::MatrixXs MatrixXs;
98 template <
template <
typename Scalar>
class Model>
101 Fx.leftCols(model->get_state()->get_nq()) = model->get_Fq();
102 Fx.rightCols(model->get_state()->get_nv()) = model->get_Fv();
103 Fu = model->get_Fu();
104 Lxx = model->get_Lxx();
105 Luu = model->get_Luu();
106 Lxu = model->get_Lxu();
126#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 boost::shared_ptr< DifferentialActionDataAbstract > createData()
Create the differential action data.
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 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.
MatrixXs Fu
Jacobian of the dynamics.
MatrixXs Luu
Hessian of the cost function.
VectorXs Lx
Jacobian of the cost function.
MatrixXs Lxx
Hessian of the cost function.
VectorXs Lu
Jacobian of the cost function.
VectorXs xout
evolution state
MatrixXs Lxu
Hessian of the cost function.
MatrixXs Fx
Jacobian of the dynamics.
MatrixXs Fu
Jacobian of the dynamics.
MatrixXs Luu
Hessian of the cost function.
MatrixXs Lxx
Hessian of the cost function.
MatrixXs Lxu
Hessian of the cost function.