9 #ifndef CROCODDYL_CORE_COSTS_RESIDUAL_COST_HPP_ 10 #define CROCODDYL_CORE_COSTS_RESIDUAL_COST_HPP_ 12 #include "crocoddyl/core/fwd.hpp" 13 #include "crocoddyl/core/cost-base.hpp" 14 #include "crocoddyl/core/residual-base.hpp" 35 template <
typename _Scalar>
38 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
40 typedef _Scalar Scalar;
47 typedef typename MathBase::VectorXs VectorXs;
48 typedef typename MathBase::MatrixXs MatrixXs;
58 boost::shared_ptr<ActivationModelAbstract> activation,
59 boost::shared_ptr<ResidualModelAbstract> residual);
69 boost::shared_ptr<ResidualModelAbstract> residual);
79 virtual void calc(
const boost::shared_ptr<CostDataAbstract>& data,
const Eigen::Ref<const VectorXs>& x,
80 const Eigen::Ref<const VectorXs>& u);
89 virtual void calcDiff(
const boost::shared_ptr<CostDataAbstract>& data,
const Eigen::Ref<const VectorXs>& x,
90 const Eigen::Ref<const VectorXs>& u);
102 virtual void print(std::ostream& os)
const;
112 template <
typename _Scalar>
114 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
116 typedef _Scalar Scalar;
120 typedef typename MathBase::MatrixXs MatrixXs;
122 template <
template <
typename Scalar>
class Model>
125 Arr_Rx(model->get_residual()->get_nr(), model->get_state()->get_ndx()),
126 Arr_Ru(model->get_residual()->get_nr(), model->get_nu()) {
133 using Base::activation;
140 using Base::residual;
149 #include "crocoddyl/core/costs/residual.hxx" 151 #endif // CROCODDYL_CORE_COSTS_RESIDUAL_COST_HPP_ boost::shared_ptr< ResidualModelAbstract > residual_
Residual model.
Abstract class for cost models.
virtual void print(std::ostream &os) const
Print relevant information of the cost-residual model.
CostModelResidualTpl(boost::shared_ptr< typename Base::StateAbstract > state, boost::shared_ptr< ActivationModelAbstract > activation, boost::shared_ptr< ResidualModelAbstract > residual)
Initialize the residual cost model.
virtual boost::shared_ptr< CostDataAbstract > createData(DataCollectorAbstract *const data)
Create the residual cost data.
boost::shared_ptr< ActivationModelAbstract > activation_
Activation model.
Abstract class for residual models.
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.
VectorXs unone_
No control vector.
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.
std::size_t nu_
Control dimension.
boost::shared_ptr< StateAbstract > state_
State description.