pinocchio  3.3.1
A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
generic.hpp
1 //
2 // Copyright (c) 2022 INRIA
3 //
4 
5 #ifndef __pinocchio_context_generic_hpp__
6 #define __pinocchio_context_generic_hpp__
7 
8 #include <Eigen/Core>
9 #include "pinocchio/container/aligned-vector.hpp"
10 
11 namespace pinocchio
12 {
13 
14  template<typename _Scalar, int _Options>
15  struct JointCollectionDefaultTpl;
16  template<
17  typename _Scalar,
18  int _Options = 0,
19  template<typename S, int O> class JointCollectionTpl = JointCollectionDefaultTpl>
20  struct ModelTpl;
21  template<
22  typename _Scalar,
23  int _Options = 0,
24  template<typename S, int O> class JointCollectionTpl = JointCollectionDefaultTpl>
25  struct DataTpl;
26  template<typename _Scalar, int _Options = 0>
27  class MotionTpl;
28  template<typename _Scalar, int _Options = 0>
29  class ForceTpl;
30  template<typename _Scalar, int _Options>
31  struct RigidConstraintModelTpl;
32  template<typename _Scalar, int _Options>
33  struct RigidConstraintDataTpl;
34 
35  template<typename _Scalar>
36  struct CoulombFrictionConeTpl;
37  template<typename _Scalar>
38  struct DualCoulombFrictionConeTpl;
39 
40  namespace context
41  {
42  typedef PINOCCHIO_SCALAR_TYPE Scalar;
43  enum
44  {
45  Options = 0
46  };
47  typedef Eigen::Matrix<Scalar, Eigen::Dynamic, 1, Options> VectorXs;
48  typedef Eigen::Matrix<Scalar, 6, Eigen::Dynamic, Options> Matrix6xs;
49  typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic, Options> MatrixXs;
50  typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor | Options>
51  RowMatrixXs;
52  typedef Eigen::Matrix<Scalar, 3, Eigen::Dynamic, Options> Matrix3x;
53  typedef Eigen::Matrix<Scalar, 3, 1, Options> Vector3;
54  typedef Eigen::Matrix<Scalar, 6, 10, Options> BodyRegressorType;
55 
56  typedef ModelTpl<Scalar, Options> Model;
57  typedef DataTpl<Scalar, Options> Data;
58 
59  typedef CoulombFrictionConeTpl<Scalar> CoulombFrictionCone;
60  typedef DualCoulombFrictionConeTpl<Scalar> DualCoulombFrictionCone;
61 
62  typedef RigidConstraintModelTpl<Scalar, Options> RigidConstraintModel;
63  typedef RigidConstraintDataTpl<Scalar, Options> RigidConstraintData;
64 
65  typedef PINOCCHIO_STD_VECTOR_WITH_EIGEN_ALLOCATOR(CoulombFrictionCone)
66  CoulombFrictionConeVector;
67  typedef PINOCCHIO_STD_VECTOR_WITH_EIGEN_ALLOCATOR(DualCoulombFrictionCone)
68  DualCoulombFrictionConeVector;
69  typedef PINOCCHIO_STD_VECTOR_WITH_EIGEN_ALLOCATOR(RigidConstraintModel)
70  RigidConstraintModelVector;
71  typedef PINOCCHIO_STD_VECTOR_WITH_EIGEN_ALLOCATOR(RigidConstraintData)
72  RigidConstraintDataVector;
73 
74  typedef MotionTpl<Scalar, Options> Motion;
75  typedef ForceTpl<Scalar, Options> Force;
76 
77  } // namespace context
78 
79  // Read and write
80  template<typename Derived>
81  Eigen::Ref<typename Derived::PlainObject> make_ref(const Eigen::MatrixBase<Derived> & x)
82  {
83  return Eigen::Ref<typename Derived::PlainObject>(x.const_cast_derived());
84  }
85 
86  // Read-only
87  template<typename M>
88  auto make_const_ref(Eigen::MatrixBase<M> const & m) -> Eigen::Ref<typename M::PlainObject const>
89  {
90  return m;
91  }
92 
93 } // namespace pinocchio
94 
95 #endif // #ifndef __pinocchio_context_generic_hpp__
x
— Training
Definition: continuous.py:177
Main pinocchio namespace.
Definition: treeview.dox:11