joint-common-operations.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2019 INRIA
3 //
4 
5 #ifndef __pinocchio_multibody_joint_joint_common_operations_hpp__
6 #define __pinocchio_multibody_joint_joint_common_operations_hpp__
7 
8 #include "pinocchio/macros.hpp"
10 
11 #include <boost/type_traits.hpp>
12 
13 namespace pinocchio
14 {
15  namespace internal
16  {
20  template<typename Scalar, bool is_floating_point = pinocchio::is_floating_point<Scalar>::value>
22  {
23  template<typename M1, typename M2>
24  static EIGEN_STRONG_INLINE void
25  run(const Eigen::MatrixBase<M1> & StYS, const Eigen::MatrixBase<M2> & Dinv)
26  {
27  M2 & Dinv_ = PINOCCHIO_EIGEN_CONST_CAST(M2, Dinv);
28  Dinv_.setIdentity();
29  StYS.llt().solveInPlace(Dinv_);
30  }
31  };
32 
33  template<typename Scalar>
35  {
36  template<typename M1, typename M2>
37  static EIGEN_STRONG_INLINE void
38  run(const Eigen::MatrixBase<M1> & StYS, const Eigen::MatrixBase<M2> & Dinv)
39  {
40  M2 & Dinv_ = PINOCCHIO_EIGEN_CONST_CAST(M2, Dinv);
41  inverse(StYS, Dinv_);
42  }
43  };
44  } // namespace internal
45 
51  {
52  template<typename ConfigVectorIn, typename Scalar, typename ConfigVectorOut>
53  static void run(
54  const Eigen::MatrixBase<ConfigVectorIn> & q,
55  const Scalar & scaling,
56  const Scalar & offset,
57  const Eigen::MatrixBase<ConfigVectorOut> & dest)
58  {
59  assert(q.size() == dest.size());
60  PINOCCHIO_EIGEN_CONST_CAST(ConfigVectorOut, dest).noalias() =
61  scaling * q + ConfigVectorOut::Constant(dest.size(), offset);
62  }
63  };
64 
69  template<typename Joint>
71  {
73  };
74 
75 } // namespace pinocchio
76 
77 #endif // ifndef __pinocchio_multibody_joint_joint_common_operations_hpp__
pinocchio::internal::PerformStYSInversion
Operation called in JointModelBase<JointModel>::calc_aba.
Definition: joint-common-operations.hpp:21
pinocchio::ConfigVectorAffineTransform::Type
LinearAffineTransform Type
Definition: joint-common-operations.hpp:72
macros.hpp
PINOCCHIO_EIGEN_CONST_CAST
#define PINOCCHIO_EIGEN_CONST_CAST(TYPE, OBJ)
Macro for an automatic const_cast.
Definition: eigen-macros.hpp:51
pinocchio::internal::PerformStYSInversion::run
static EIGEN_STRONG_INLINE void run(const Eigen::MatrixBase< M1 > &StYS, const Eigen::MatrixBase< M2 > &Dinv)
Definition: joint-common-operations.hpp:25
pinocchio::internal::PerformStYSInversion< Scalar, false >::run
static EIGEN_STRONG_INLINE void run(const Eigen::MatrixBase< M1 > &StYS, const Eigen::MatrixBase< M2 > &Dinv)
Definition: joint-common-operations.hpp:38
pinocchio::python::Scalar
context::Scalar Scalar
Definition: admm-solver.cpp:29
matrix.hpp
pinocchio::LinearAffineTransform
Linear affine transformation of the configuration vector. Valide for most common joints which are evo...
Definition: joint-common-operations.hpp:50
pinocchio::ConfigVectorAffineTransform
Assign the correct configuration vector space affine transformation according to the joint type.
Definition: joint-common-operations.hpp:70
pinocchio::inverse
void inverse(const Eigen::MatrixBase< MatrixIn > &m_in, const Eigen::MatrixBase< MatrixOut > &dest)
Definition: math/matrix.hpp:273
pinocchio::LinearAffineTransform::run
static void run(const Eigen::MatrixBase< ConfigVectorIn > &q, const Scalar &scaling, const Scalar &offset, const Eigen::MatrixBase< ConfigVectorOut > &dest)
Definition: joint-common-operations.hpp:53
pinocchio::q
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > & q
Definition: joint-configuration.hpp:1083
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27


pinocchio
Author(s):
autogenerated on Sun Dec 22 2024 03:41:10