10 #ifndef CROCODDYL_CORE_RESIDUALS_CONTROL_HPP_
11 #define CROCODDYL_CORE_RESIDUALS_CONTROL_HPP_
13 #include "crocoddyl/core/fwd.hpp"
14 #include "crocoddyl/core/residual-base.hpp"
34 template <
typename _Scalar>
37 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
39 typedef _Scalar Scalar;
44 typedef typename MathBase::VectorXs VectorXs;
45 typedef typename MathBase::MatrixXs MatrixXs;
56 const VectorXs& uref);
67 const std::size_t nu);
78 boost::shared_ptr<typename Base::StateAbstract> state);
88 virtual void calc(
const boost::shared_ptr<ResidualDataAbstract>& data,
89 const Eigen::Ref<const VectorXs>& x,
90 const Eigen::Ref<const VectorXs>& u);
96 virtual void calc(
const boost::shared_ptr<ResidualDataAbstract>& data,
97 const Eigen::Ref<const VectorXs>& x);
106 virtual void calcDiff(
const boost::shared_ptr<ResidualDataAbstract>& data,
107 const Eigen::Ref<const VectorXs>& x,
108 const Eigen::Ref<const VectorXs>& u);
129 const boost::shared_ptr<CostDataAbstract>& cdata,
130 const boost::shared_ptr<ResidualDataAbstract>& rdata,
131 const boost::shared_ptr<ActivationDataAbstract>& adata,
132 const bool update_u =
true);
149 virtual void print(std::ostream& os)
const;
164 #include "crocoddyl/core/residuals/control.hxx"
Abstract class for residual models.
boost::shared_ptr< StateAbstract > state_
State description.
std::size_t nu_
Control dimension.
Define a control residual.
virtual void calc(const boost::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x)
ResidualModelControlTpl(boost::shared_ptr< typename Base::StateAbstract > state, const VectorXs &uref)
Initialize the control residual model.
virtual void print(std::ostream &os) const
Print relevant information of the control residual.
ResidualModelControlTpl(boost::shared_ptr< typename Base::StateAbstract > state)
Initialize the control residual model.
ResidualModelControlTpl(boost::shared_ptr< typename Base::StateAbstract > state, const std::size_t nu)
Initialize the control residual model.
virtual void calc(const boost::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)
Compute the control residual.
virtual void calcCostDiff(const boost::shared_ptr< CostDataAbstract > &cdata, const boost::shared_ptr< ResidualDataAbstract > &rdata, const boost::shared_ptr< ActivationDataAbstract > &adata, const bool update_u=true)
Compute the derivative of the control-cost function.
void set_reference(const VectorXs &reference)
Modify the reference control vector.
virtual void calcDiff(const boost::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)
Compute the derivatives of the control residual.
const VectorXs & get_reference() const
Return the reference control vector.
virtual boost::shared_ptr< ResidualDataAbstract > createData(DataCollectorAbstract *const data)
Create the control residual data.