9 #ifndef CROCODDYL_CORE_RESIDUALS_JOINT_ACCELERATION_HPP_
10 #define CROCODDYL_CORE_RESIDUALS_JOINT_ACCELERATION_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"
36 template <
typename _Scalar>
40 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
43 typedef _Scalar Scalar;
51 typedef typename MathBase::VectorXs VectorXs;
52 typedef typename MathBase::MatrixXs MatrixXs;
62 const VectorXs& aref,
const std::size_t nu);
73 const VectorXs& aref);
85 const std::size_t nu);
107 virtual void calc(
const std::shared_ptr<ResidualDataAbstract>& data,
108 const Eigen::Ref<const VectorXs>& x,
109 const Eigen::Ref<const VectorXs>& u)
override;
115 virtual void calc(
const std::shared_ptr<ResidualDataAbstract>& data,
116 const Eigen::Ref<const VectorXs>& x)
override;
125 virtual void calcDiff(
const std::shared_ptr<ResidualDataAbstract>& data,
126 const Eigen::Ref<const VectorXs>& x,
127 const Eigen::Ref<const VectorXs>& u)
override;
145 template <
typename NewScalar>
163 virtual void print(std::ostream& os)
const override;
174 template <
typename _Scalar>
177 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
179 typedef _Scalar Scalar;
184 template <
template <
typename Scalar>
class Model>
187 :
Base(model, data) {
193 "Invalid argument: the shared data should be derived from "
194 "DataCollectorJoint");
200 std::shared_ptr<JointDataAbstractTpl<Scalar> >
joint;
212 #include "crocoddyl/core/residuals/joint-acceleration.hxx"
214 CROCODDYL_DECLARE_EXTERN_TEMPLATE_CLASS(
216 CROCODDYL_DECLARE_EXTERN_TEMPLATE_STRUCT(
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-acceleration residual.
ResidualModelJointAccelerationTpl(std::shared_ptr< StateAbstract > state, const std::size_t nu)
Initialize the joint-acceleration residual model.
ResidualModelJointAccelerationTpl(std::shared_ptr< StateAbstract > state)
Initialize the joint-acceleration residual model.
ResidualModelJointAccelerationTpl(std::shared_ptr< StateAbstract > state, const VectorXs &aref)
Initialize the joint-acceleration residual model.
virtual void calc(const std::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x) override
virtual void calcDiff(const std::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u) override
Compute the derivatives of the joint-acceleration residual.
ResidualModelJointAccelerationTpl< NewScalar > cast() const
Cast the joint-acceleration residual model to a different scalar type.
void set_reference(const VectorXs &reference)
Modify the reference joint-acceleration vector.
const VectorXs & get_reference() const
Return the reference joint-acceleration vector.
ResidualModelJointAccelerationTpl(std::shared_ptr< StateAbstract > state, const VectorXs &aref, const std::size_t nu)
Initialize the joint-acceleration residual model.
virtual void calc(const std::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u) override
Compute the joint-acceleration residual.
virtual void print(std::ostream &os) const override
Print relevant information of the joint-acceleration residual.
virtual std::shared_ptr< ResidualDataAbstract > createData(DataCollectorAbstract *const data) override
Create the joint-acceleration residual data.
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.