5 #ifndef __pinocchio_joint_revolute_unbounded_hpp__ 6 #define __pinocchio_joint_revolute_unbounded_hpp__ 8 #include "pinocchio/math/fwd.hpp" 9 #include "pinocchio/math/sincos.hpp" 10 #include "pinocchio/spatial/inertia.hpp" 11 #include "pinocchio/multibody/joint/joint-base.hpp" 12 #include "pinocchio/multibody/joint/joint-revolute.hpp" 19 template<
typename _Scalar,
int _Options,
int axis>
26 typedef _Scalar Scalar;
27 enum { Options = _Options };
34 typedef Eigen::Matrix<Scalar,6,NV,Options> F_t;
37 typedef Eigen::Matrix<Scalar,6,NV,Options> U_t;
38 typedef Eigen::Matrix<Scalar,NV,NV,Options> D_t;
39 typedef Eigen::Matrix<Scalar,6,NV,Options> UD_t;
41 PINOCCHIO_JOINT_DATA_BASE_ACCESSOR_DEFAULT_RETURN_TYPE
43 typedef Eigen::Matrix<Scalar,NQ,1,Options> ConfigVector_t;
44 typedef Eigen::Matrix<Scalar,NV,1,Options> TangentVector_t;
47 template<
typename Scalar,
int Options,
int axis>
51 template<
typename Scalar,
int Options,
int axis>
55 template<
typename _Scalar,
int _Options,
int axis>
58 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
60 PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE;
61 PINOCCHIO_JOINT_DATA_BASE_DEFAULT_ACCESSOR
76 static std::string classname() {
return std::string(
"JointDataRevoluteUnbounded"); }
77 std::string
shortname()
const {
return classname(); }
81 template<
typename NewScalar,
typename Scalar,
int Options,
int axis>
87 template<
typename _Scalar,
int _Options,
int axis>
89 :
public JointModelBase< JointModelRevoluteUnboundedTpl<_Scalar,_Options,axis> >
91 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
93 PINOCCHIO_JOINT_TYPEDEF_TEMPLATE;
100 using Base::setIndexes;
102 JointDataDerived
createData()
const {
return JointDataDerived(); }
104 template<
typename ConfigVector>
105 void calc(JointDataDerived & data,
106 const typename Eigen::MatrixBase<ConfigVector> & qs)
const 108 typedef typename ConfigVector::Scalar OtherScalar;
109 typename ConfigVector::template ConstFixedSegmentReturnType<NQ>::Type
110 & q = qs.template segment<NQ> (
idx_q());
112 const OtherScalar & ca = q(0);
113 const OtherScalar & sa = q(1);
115 data.M.setValues(sa,ca);
118 template<
typename ConfigVector,
typename TangentVector>
119 void calc(JointDataDerived & data,
120 const typename Eigen::MatrixBase<ConfigVector> & qs,
121 const typename Eigen::MatrixBase<TangentVector> & vs)
const 123 calc(data,qs.derived());
125 data.v.w = (Scalar)vs[
idx_v()];
128 template<
typename Matrix6Like>
129 void calc_aba(JointDataDerived & data,
const Eigen::MatrixBase<Matrix6Like> & I,
const bool update_I)
const 131 data.U = I.col(Inertia::ANGULAR + axis);
132 data.Dinv[0] = (Scalar)(1)/I(Inertia::ANGULAR + axis,Inertia::ANGULAR + axis);
133 data.UDinv.noalias() = data.U * data.Dinv[0];
136 PINOCCHIO_EIGEN_CONST_CAST(Matrix6Like,I) -= data.UDinv * data.U.transpose();
142 return 2.*sqrt(sqrt(Eigen::NumTraits<Scalar>::epsilon()));
145 static std::string classname()
147 return std::string(
"JointModelRUB") + axisLabel<axis>();
149 std::string
shortname()
const {
return classname(); }
152 template<
typename NewScalar>
178 #include <boost/type_traits.hpp> 182 template<
typename Scalar,
int Options,
int axis>
184 :
public integral_constant<bool,true> {};
186 template<
typename Scalar,
int Options,
int axis>
188 :
public integral_constant<bool,true> {};
190 template<
typename Scalar,
int Options,
int axis>
192 :
public integral_constant<bool,true> {};
194 template<
typename Scalar,
int Options,
int axis>
196 :
public integral_constant<bool,true> {};
199 #endif // ifndef __pinocchio_joint_revolute_unbounded_hpp__
int idx_q(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through JointIdxQVisitor to get the index in the full model configuration space...
int idx_v(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through JointIdxVVisitor to get the index in the full model tangent space corre...
JointDataTpl< Scalar, Options, JointCollectionTpl > createData(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through CreateData visitor to create a JointDataTpl.
ModelTpl< Scalar, Options, JointCollectionTpl >::TangentVectorType finiteDifferenceIncrement(const ModelTpl< Scalar, Options, JointCollectionTpl > &model)
Computes the finite difference increments for each degree of freedom according to the current joint c...
std::string shortname(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through JointShortnameVisitor to get the shortname of the derived joint model...
JointModelRevoluteUnboundedTpl< NewScalar, Options, axis > cast() const
Main pinocchio namespace.
Common traits structure to fully define base classes for CRTP.
Type of the cast of a class C templated by Scalar and Options, to a new NewScalar type...
void calc_aba(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel, JointDataTpl< Scalar, Options, JointCollectionTpl > &jdata, const Eigen::MatrixBase< Matrix6Type > &I, const bool update_I)
Visit a JointModelTpl and the corresponding JointDataTpl through JointCalcAbaVisitor to...