9 #ifndef CROCODDYL_CORE_RESIDUALS_JOINT_TORQUE_HPP_
10 #define CROCODDYL_CORE_RESIDUALS_JOINT_TORQUE_HPP_
12 #include "crocoddyl/core/actuation-base.hpp"
13 #include "crocoddyl/core/data/joint.hpp"
14 #include "crocoddyl/core/fwd.hpp"
15 #include "crocoddyl/core/residual-base.hpp"
35 template <
typename _Scalar>
38 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
40 typedef _Scalar Scalar;
48 typedef typename MathBase::VectorXs VectorXs;
49 typedef typename MathBase::MatrixXs MatrixXs;
62 boost::shared_ptr<StateAbstract> state,
63 boost::shared_ptr<ActuationModelAbstract> actuation,
const VectorXs& uref,
64 const std::size_t nu,
const bool fwddyn =
false);
76 boost::shared_ptr<StateAbstract> state,
77 boost::shared_ptr<ActuationModelAbstract> actuation,
78 const VectorXs& uref);
91 boost::shared_ptr<StateAbstract> state,
92 boost::shared_ptr<ActuationModelAbstract> actuation,
93 const std::size_t nu);
106 boost::shared_ptr<StateAbstract> state,
107 boost::shared_ptr<ActuationModelAbstract> actuation);
118 virtual void calc(
const boost::shared_ptr<ResidualDataAbstract>& data,
119 const Eigen::Ref<const VectorXs>& x,
120 const Eigen::Ref<const VectorXs>& u);
126 virtual void calc(
const boost::shared_ptr<ResidualDataAbstract>& data,
127 const Eigen::Ref<const VectorXs>& x);
136 virtual void calcDiff(
const boost::shared_ptr<ResidualDataAbstract>& data,
137 const Eigen::Ref<const VectorXs>& x,
138 const Eigen::Ref<const VectorXs>& u);
145 virtual void calcDiff(
const boost::shared_ptr<ResidualDataAbstract>& data,
146 const Eigen::Ref<const VectorXs>& x);
169 virtual void print(std::ostream& os)
const;
183 template <
typename _Scalar>
185 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
187 typedef _Scalar Scalar;
192 template <
template <
typename Scalar>
class Model>
195 :
Base(model, data) {
201 "Invalid argument: the shared data should be derived from "
202 "DataCollectorJoint");
207 boost::shared_ptr<JointDataAbstractTpl<Scalar> >
joint;
219 #include "crocoddyl/core/residuals/joint-effort.hxx"
Abstract class for the actuation-mapping model.
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.
Define a joint-effort residual.
ResidualModelJointEffortTpl(boost::shared_ptr< StateAbstract > state, boost::shared_ptr< ActuationModelAbstract > actuation, const VectorXs &uref, const std::size_t nu, const bool fwddyn=false)
Initialize the joint-effort residual model.
virtual void calc(const boost::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x)
virtual void calcDiff(const boost::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x)
virtual void print(std::ostream &os) const
Print relevant information of the joint-effort residual.
ResidualModelJointEffortTpl(boost::shared_ptr< StateAbstract > state, boost::shared_ptr< ActuationModelAbstract > actuation, const VectorXs &uref)
Initialize the joint-effort 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 joint-effort residual.
ResidualModelJointEffortTpl(boost::shared_ptr< StateAbstract > state, boost::shared_ptr< ActuationModelAbstract > actuation)
Initialize the joint-effort residual model.
void set_reference(const VectorXs &reference)
Modify the reference joint-effort 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 joint-effort residual.
const VectorXs & get_reference() const
Return the reference joint-effort vector.
virtual boost::shared_ptr< ResidualDataAbstract > createData(DataCollectorAbstract *const data)
Create the joint-effort residual data.
ResidualModelJointEffortTpl(boost::shared_ptr< StateAbstract > state, boost::shared_ptr< ActuationModelAbstract > actuation, const std::size_t nu)
Initialize the joint-effort residual model.
Abstract class for the state representation.
MatrixXs Ru
Jacobian of the residual vector with respect the control.
MatrixXs Rx
Jacobian of the residual vector with respect the state.
DataCollectorAbstract * shared
Shared data allocated by the action model.
VectorXs r
Residual vector.
DataCollectorAbstract * shared
Shared data allocated by the action model.
boost::shared_ptr< JointDataAbstractTpl< Scalar > > joint
Joint data.