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 std::shared_ptr<ActuationModelAbstract> actuation,
63 const VectorXs& uref,
const std::size_t nu,
64 const bool fwddyn =
false);
76 std::shared_ptr<ActuationModelAbstract> actuation,
77 const VectorXs& uref);
90 std::shared_ptr<ActuationModelAbstract> actuation,
91 const std::size_t nu);
104 std::shared_ptr<StateAbstract> state,
105 std::shared_ptr<ActuationModelAbstract> actuation);
116 virtual void calc(
const std::shared_ptr<ResidualDataAbstract>& data,
117 const Eigen::Ref<const VectorXs>& x,
118 const Eigen::Ref<const VectorXs>& u);
124 virtual void calc(
const std::shared_ptr<ResidualDataAbstract>& data,
125 const Eigen::Ref<const VectorXs>& x);
134 virtual void calcDiff(
const std::shared_ptr<ResidualDataAbstract>& data,
135 const Eigen::Ref<const VectorXs>& x,
136 const Eigen::Ref<const VectorXs>& u);
143 virtual void calcDiff(
const std::shared_ptr<ResidualDataAbstract>& data,
144 const Eigen::Ref<const VectorXs>& x);
167 virtual void print(std::ostream& os)
const;
181 template <
typename _Scalar>
183 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
185 typedef _Scalar Scalar;
190 template <
template <
typename Scalar>
class Model>
193 :
Base(model, data) {
199 "Invalid argument: the shared data should be derived from "
200 "DataCollectorJoint");
205 std::shared_ptr<JointDataAbstractTpl<Scalar> >
joint;
217 #include "crocoddyl/core/residuals/joint-effort.hxx"
Abstract class for the actuation-mapping model.
Abstract class for residual models.
std::shared_ptr< StateAbstract > state_
State description.
std::size_t nu_
Control dimension.
std::size_t nr_
Residual vector dimension.
Define a joint-effort residual.
virtual void calcDiff(const std::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)
Compute the derivatives of the joint-effort residual.
ResidualModelJointEffortTpl(std::shared_ptr< StateAbstract > state, std::shared_ptr< ActuationModelAbstract > actuation, const VectorXs &uref)
Initialize the joint-effort residual model.
virtual void print(std::ostream &os) const
Print relevant information of the joint-effort residual.
virtual void calcDiff(const std::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x)
ResidualModelJointEffortTpl(std::shared_ptr< StateAbstract > state, std::shared_ptr< ActuationModelAbstract > actuation)
Initialize the joint-effort residual model.
virtual void calc(const std::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)
Compute the joint-effort residual.
virtual void calc(const std::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x)
void set_reference(const VectorXs &reference)
Modify the reference joint-effort vector.
virtual std::shared_ptr< ResidualDataAbstract > createData(DataCollectorAbstract *const data)
Create the joint-effort residual data.
const VectorXs & get_reference() const
Return the reference joint-effort vector.
ResidualModelJointEffortTpl(std::shared_ptr< StateAbstract > state, std::shared_ptr< ActuationModelAbstract > actuation, const std::size_t nu)
Initialize the joint-effort residual model.
ResidualModelJointEffortTpl(std::shared_ptr< StateAbstract > state, std::shared_ptr< ActuationModelAbstract > actuation, const VectorXs &uref, const std::size_t nu, const bool fwddyn=false)
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.
std::shared_ptr< JointDataAbstractTpl< Scalar > > joint
Joint data.
DataCollectorAbstract * shared
Shared data allocated by the action model.