9 #ifndef CROCODDYL_CORE_COSTS_RESIDUAL_COST_HPP_
10 #define CROCODDYL_CORE_COSTS_RESIDUAL_COST_HPP_
12 #include "crocoddyl/core/cost-base.hpp"
13 #include "crocoddyl/core/fwd.hpp"
14 #include "crocoddyl/core/residual-base.hpp"
38 template <
typename _Scalar>
41 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
43 typedef _Scalar Scalar;
51 typedef typename MathBase::VectorXs VectorXs;
52 typedef typename MathBase::MatrixXs MatrixXs;
62 boost::shared_ptr<ActivationModelAbstract> activation,
63 boost::shared_ptr<ResidualModelAbstract> residual);
74 boost::shared_ptr<ResidualModelAbstract> residual);
84 virtual void calc(
const boost::shared_ptr<CostDataAbstract>& data,
85 const Eigen::Ref<const VectorXs>& x,
86 const Eigen::Ref<const VectorXs>& u);
97 virtual void calc(
const boost::shared_ptr<CostDataAbstract>& data,
98 const Eigen::Ref<const VectorXs>& x);
107 virtual void calcDiff(
const boost::shared_ptr<CostDataAbstract>& data,
108 const Eigen::Ref<const VectorXs>& x,
109 const Eigen::Ref<const VectorXs>& u);
122 virtual void calcDiff(
const boost::shared_ptr<CostDataAbstract>& data,
123 const Eigen::Ref<const VectorXs>& x);
136 virtual void print(std::ostream& os)
const;
146 template <
typename _Scalar>
148 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
150 typedef _Scalar Scalar;
155 template <
template <
typename Scalar>
class Model>
158 :
Base(model, data) {}
160 using Base::activation;
167 using Base::residual;
176 #include "crocoddyl/core/costs/residual.hxx"
Abstract class for cost models.
boost::shared_ptr< ActivationModelAbstract > activation_
Activation model.
boost::shared_ptr< StateAbstract > state_
State description.
std::size_t nu_
Control dimension.
VectorXs unone_
No control vector.
boost::shared_ptr< ResidualModelAbstract > residual_
Residual model.
virtual boost::shared_ptr< CostDataAbstract > createData(DataCollectorAbstract *const data)
Create the residual cost data.
CostModelResidualTpl(boost::shared_ptr< typename Base::StateAbstract > state, boost::shared_ptr< ResidualModelAbstract > residual)
Initialize the residual cost model.
virtual void calcDiff(const boost::shared_ptr< CostDataAbstract > &data, const Eigen::Ref< const VectorXs > &x)
Compute the derivatives of the residual cost with respect to the state only.
virtual void print(std::ostream &os) const
Print relevant information of the cost-residual model.
virtual void calc(const boost::shared_ptr< CostDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)
Compute the residual cost.
virtual void calcDiff(const boost::shared_ptr< CostDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)
Compute the derivatives of the residual cost.
CostModelResidualTpl(boost::shared_ptr< typename Base::StateAbstract > state, boost::shared_ptr< ActivationModelAbstract > activation, boost::shared_ptr< ResidualModelAbstract > residual)
Initialize the residual cost model.
virtual void calc(const boost::shared_ptr< CostDataAbstract > &data, const Eigen::Ref< const VectorXs > &x)
Compute the residual cost based on state only.
Abstract class for residual models.