crocoddyl
1.7.0
Contact RObot COntrol by Differential DYnamic programming Library (Crocoddyl)
|
|
9 #ifndef CROCODDYL_CORE_ACTIONS_LQR_HPP_
10 #define CROCODDYL_CORE_ACTIONS_LQR_HPP_
14 #include "crocoddyl/core/fwd.hpp"
15 #include "crocoddyl/core/action-base.hpp"
16 #include "crocoddyl/core/states/euclidean.hpp"
20 template <
typename _Scalar>
23 typedef _Scalar Scalar;
29 typedef typename MathBase::VectorXs VectorXs;
30 typedef typename MathBase::MatrixXs MatrixXs;
32 ActionModelLQRTpl(
const std::size_t nx,
const std::size_t nu,
const bool drift_free =
true);
35 virtual void calc(
const boost::shared_ptr<ActionDataAbstract>& data,
const Eigen::Ref<const VectorXs>& x,
36 const Eigen::Ref<const VectorXs>& u);
37 virtual void calcDiff(
const boost::shared_ptr<ActionDataAbstract>& data,
const Eigen::Ref<const VectorXs>& x,
38 const Eigen::Ref<const VectorXs>& u);
39 virtual boost::shared_ptr<ActionDataAbstract>
createData();
40 virtual bool checkData(
const boost::shared_ptr<ActionDataAbstract>& data);
42 const MatrixXs& get_Fx()
const;
43 const MatrixXs& get_Fu()
const;
44 const VectorXs& get_f0()
const;
45 const VectorXs& get_lx()
const;
46 const VectorXs& get_lu()
const;
47 const MatrixXs& get_Lxx()
const;
48 const MatrixXs& get_Lxu()
const;
49 const MatrixXs& get_Luu()
const;
51 void set_Fx(
const MatrixXs& Fx);
52 void set_Fu(
const MatrixXs& Fu);
53 void set_f0(
const VectorXs& f0);
54 void set_lx(
const VectorXs& lx);
55 void set_lu(
const VectorXs& lu);
56 void set_Lxx(
const MatrixXs& Lxx);
57 void set_Lxu(
const MatrixXs& Lxu);
58 void set_Luu(
const MatrixXs& Luu);
81 template <
typename _Scalar>
83 typedef _Scalar Scalar;
87 template <
template <
typename Scalar>
class Model>
92 Lxx = model->get_Lxx();
93 Luu = model->get_Luu();
94 Lxu = model->get_Lxu();
114 #include "crocoddyl/core/actions/lqr.hxx"
116 #endif // CROCODDYL_CORE_ACTIONS_LQR_HPP_
bool has_control_limits_
Indicates whether any of the control limits is finite.
MatrixXs Lxu
Hessian of the cost function.
virtual bool checkData(const boost::shared_ptr< ActionDataAbstract > &data)
Checks that a specific data belongs to this model.
virtual void calc(const boost::shared_ptr< ActionDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)
Compute the next state and cost value.
std::size_t nu_
Control dimension.
VectorXs Lx
Jacobian of the cost function.
virtual void calcDiff(const boost::shared_ptr< ActionDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)
Compute the derivatives of the dynamics and cost functions.
VectorXs xnext
evolution state
Abstract class for action model.
virtual boost::shared_ptr< ActionDataAbstract > createData()
Create the action data.
boost::shared_ptr< StateAbstract > state_
Model of the state.
VectorXs unone_
Neutral state.
MatrixXs Fx
Jacobian of the dynamics.
VectorXs u_lb_
Lower control limits.
VectorXs u_ub_
Upper control limits.
VectorXs Lu
Jacobian of the cost function.
MatrixXs Lxx
Hessian of the cost function.
MatrixXs Fu
Jacobian of the dynamics.
std::size_t nr_
Dimension of the cost residual.
MatrixXs Luu
Hessian of the cost function.