5 #ifndef __pinocchio_algorithm_constraint_model_base_hpp__
6 #define __pinocchio_algorithm_constraint_model_base_hpp__
8 #include "pinocchio/multibody/model.hpp"
9 #include "pinocchio/algorithm/fwd.hpp"
14 template<
class Derived>
24 typedef Eigen::Matrix<bool, Eigen::Dynamic, 1, Options> BooleanVector;
26 typedef std::vector<Eigen::DenseIndex> IndexVector;
30 return static_cast<Derived &
>(*this);
32 const Derived & derived()
const
34 return static_cast<const Derived &
>(*this);
37 template<
typename NewScalar>
40 return derived().template cast<NewScalar>();
45 template<
int Options,
template<
typename,
int>
class JointCollectionTpl>
49 ConstraintData & cdata)
const
51 derived().calc(model, data, cdata);
54 template<
typename JacobianMatrix,
int Options,
template<
typename,
int>
class JointCollectionTpl>
59 const Eigen::MatrixBase<JacobianMatrix> & jacobian_matrix)
const
61 derived().jacobian(model, data, cdata, jacobian_matrix.const_cast_derived());
75 template<
typename OtherDerived>
82 template<
typename OtherDerived>
92 ConstraintData createData()
const
94 return derived().createData();
98 template<
int Options,
template<
typename,
int>
class JointCollectionTpl>
102 static const bool default_sparsity_value =
false;
Main pinocchio namespace.
int nv(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through JointNvVisitor to get the dimension of the joint tangent space.
Type of the cast of a class C templated by Scalar and Options, to a new NewScalar type....
BooleanVector colwise_sparsity
Sparsity pattern associated to the constraint;.
IndexVector colwise_span_indexes
Indexes of the columns spanned by the constraints.
std::string name
Name of the constraint.
void calc(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const DataTpl< Scalar, Options, JointCollectionTpl > &data, ConstraintData &cdata) const
Evaluate the constraint values at the current state given by data and store the results in cdata.
ConstraintModelBase()
Default constructor.
Common traits structure to fully define base classes for CRTP.