10 #ifndef CROCODDYL_MULTIBODY_RESIDUALS_STATE_HPP_
11 #define CROCODDYL_MULTIBODY_RESIDUALS_STATE_HPP_
13 #include "crocoddyl/core/fwd.hpp"
14 #include "crocoddyl/core/residual-base.hpp"
15 #include "crocoddyl/core/state-base.hpp"
16 #include "crocoddyl/multibody/fwd.hpp"
17 #include "crocoddyl/multibody/states/multibody.hpp"
37 template <
typename _Scalar>
40 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
42 typedef _Scalar Scalar;
51 typedef typename MathBase::VectorXs VectorXs;
52 typedef typename MathBase::MatrixXs MatrixXs;
62 const VectorXs& xref,
const std::size_t nu);
73 const VectorXs& xref);
84 const std::size_t nu);
105 virtual void calc(
const boost::shared_ptr<ResidualDataAbstract>& data,
106 const Eigen::Ref<const VectorXs>& x,
107 const Eigen::Ref<const VectorXs>& u);
116 virtual void calcDiff(
const boost::shared_ptr<ResidualDataAbstract>& data,
117 const Eigen::Ref<const VectorXs>& x,
118 const Eigen::Ref<const VectorXs>& u);
134 const boost::shared_ptr<CostDataAbstract>& cdata,
135 const boost::shared_ptr<ResidualDataAbstract>& rdata,
136 const boost::shared_ptr<ActivationDataAbstract>& adata,
137 const bool update_u =
true);
154 virtual void print(std::ostream& os)
const;
164 boost::shared_ptr<typename StateMultibody::PinocchioModel>
173 #include "crocoddyl/multibody/residuals/state.hxx"
Abstract class for residual models.
boost::shared_ptr< StateAbstract > state_
State description.
std::size_t nu_
Control dimension.
std::size_t nr_
Residual vector dimension.
ResidualModelStateTpl(boost::shared_ptr< typename Base::StateAbstract > state, const std::size_t nu)
Initialize the state residual model.
ResidualModelStateTpl(boost::shared_ptr< typename Base::StateAbstract > state, const VectorXs &xref, const std::size_t nu)
Initialize the state residual model.
virtual void print(std::ostream &os) const
Print relevant information of the state residual.
virtual void calc(const boost::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)
Compute the state 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 state-cost function and store it in cost data.
ResidualModelStateTpl(boost::shared_ptr< typename Base::StateAbstract > state)
Initialize the state residual model.
void set_reference(const VectorXs &reference)
Modify the reference state.
virtual void calcDiff(const boost::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)
Compute the Jacobians of the state residual.
const VectorXs & get_reference() const
Return the reference state.
ResidualModelStateTpl(boost::shared_ptr< typename Base::StateAbstract > state, const VectorXs &xref)
Initialize the state residual model.
State multibody representation.