9#ifndef CROCODDYL_CORE_RESIDUALS_CONTROL_HPP_
10#define CROCODDYL_CORE_RESIDUALS_CONTROL_HPP_
12#include "crocoddyl/core/fwd.hpp"
13#include "crocoddyl/core/residual-base.hpp"
31template <
typename _Scalar>
34 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
36 typedef _Scalar Scalar;
41 typedef typename MathBase::VectorXs VectorXs;
42 typedef typename MathBase::MatrixXs MatrixXs;
81 virtual void calc(
const boost::shared_ptr<ResidualDataAbstract>& data,
const Eigen::Ref<const VectorXs>& x,
82 const Eigen::Ref<const VectorXs>& u);
88 virtual void calc(
const boost::shared_ptr<ResidualDataAbstract>& data,
const Eigen::Ref<const VectorXs>& x);
97 virtual void calcDiff(
const boost::shared_ptr<ResidualDataAbstract>& data,
const Eigen::Ref<const VectorXs>& x,
98 const Eigen::Ref<const VectorXs>& u);
120 virtual void print(std::ostream& os)
const;
136#include "crocoddyl/core/residuals/control.hxx"
Abstract class for residual models.
boost::shared_ptr< StateAbstract > state_
State description.
std::size_t nu_
Control dimension.
VectorXs unone_
No control vector.
Define a control residual.
virtual void calc(const boost::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x)
Compute the residual vector for nodes that depends only on the state.
virtual boost::shared_ptr< ResidualDataAbstract > createData(DataCollectorAbstract *const data)
Create the control residual data.
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.
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.