context/generic.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2022-2025 INRIA
3 //
4 
5 #ifndef __pinocchio_context_generic_hpp__
6 #define __pinocchio_context_generic_hpp__
7 
8 #include <Eigen/Core>
10 
11 namespace pinocchio
12 {
13 
14  template<typename _Scalar, int _Options>
16  template<
17  typename _Scalar,
18  int _Options = PINOCCHIO_OPTIONS_DEFAULT,
19  template<typename S, int O> class JointCollectionTpl = JointCollectionDefaultTpl>
20  struct ModelTpl;
21  template<
22  typename _Scalar,
23  int _Options = PINOCCHIO_OPTIONS_DEFAULT,
24  template<typename S, int O> class JointCollectionTpl = JointCollectionDefaultTpl>
25  struct DataTpl;
26  template<typename _Scalar, int _Options = PINOCCHIO_OPTIONS_DEFAULT>
27  struct SE3Tpl;
28  template<typename _Scalar, int _Options = PINOCCHIO_OPTIONS_DEFAULT>
29  class MotionTpl;
30  template<typename _Scalar, int _Options = PINOCCHIO_OPTIONS_DEFAULT>
31  class ForceTpl;
32  template<typename _Scalar, int _Options = PINOCCHIO_OPTIONS_DEFAULT>
33  struct InertiaTpl;
34  template<typename _Scalar, int _Options>
36  template<typename _Scalar, int _Options>
38 
39  template<typename _Scalar>
41  template<typename _Scalar>
43 
44 #define PINOCCHIO_COMMON_TYPEDEF(Scalar, Options) \
45  typedef Eigen::Matrix<Scalar, Eigen::Dynamic, 1, Options> VectorXs; \
46  typedef Eigen::Matrix<Scalar, 6, Eigen::Dynamic, Options> Matrix6xs; \
47  typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic, Options> MatrixXs; \
48  typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor | Options> \
49  RowMatrixXs; \
50  typedef Eigen::Matrix<Scalar, 3, Eigen::Dynamic, Options> Matrix3x; \
51  typedef Eigen::Matrix<Scalar, 3, 1, Options> Vector3; \
52  typedef Eigen::Matrix<Scalar, 6, 10, Options> BodyRegressorType; \
53  \
54  typedef ModelTpl<Scalar, Options> Model; \
55  typedef DataTpl<Scalar, Options> Data; \
56  \
57  typedef CoulombFrictionConeTpl<Scalar> CoulombFrictionCone; \
58  typedef DualCoulombFrictionConeTpl<Scalar> DualCoulombFrictionCone; \
59  \
60  typedef RigidConstraintModelTpl<Scalar, Options> RigidConstraintModel; \
61  typedef RigidConstraintDataTpl<Scalar, Options> RigidConstraintData; \
62  \
63  typedef PINOCCHIO_STD_VECTOR_WITH_EIGEN_ALLOCATOR(CoulombFrictionCone) \
64  CoulombFrictionConeVector; \
65  typedef PINOCCHIO_STD_VECTOR_WITH_EIGEN_ALLOCATOR(DualCoulombFrictionCone) \
66  DualCoulombFrictionConeVector; \
67  typedef PINOCCHIO_STD_VECTOR_WITH_EIGEN_ALLOCATOR(RigidConstraintModel) \
68  RigidConstraintModelVector; \
69  typedef PINOCCHIO_STD_VECTOR_WITH_EIGEN_ALLOCATOR(RigidConstraintData) \
70  RigidConstraintDataVector; \
71  \
72  typedef SE3Tpl<Scalar, Options> SE3; \
73  typedef MotionTpl<Scalar, Options> Motion; \
74  typedef ForceTpl<Scalar, Options> Force; \
75  typedef InertiaTpl<Scalar, Options> Inertia;
76 
77  namespace context
78  {
80  enum
81  {
83  };
84 
86 
87  } // namespace context
88 
89  // Read and write
90  template<typename Derived>
91  Eigen::Ref<typename Derived::PlainObject> make_ref(const Eigen::MatrixBase<Derived> & x)
92  {
93  return Eigen::Ref<typename Derived::PlainObject>(x.const_cast_derived());
94  }
95 
96  // Read-only
97  template<typename M>
98  auto make_const_ref(Eigen::MatrixBase<M> const & m) -> Eigen::Ref<typename M::PlainObject const>
99  {
100  return m;
101  }
102 
103 } // namespace pinocchio
104 
105 #endif // #ifndef __pinocchio_context_generic_hpp__
pinocchio::InertiaTpl
Definition: context/generic.hpp:33
test-cpp2pybind11.m
m
Definition: test-cpp2pybind11.py:25
PINOCCHIO_SCALAR_TYPE
#define PINOCCHIO_SCALAR_TYPE
Definition: context/casadi.hpp:54
pinocchio::DataTpl
Definition: context/generic.hpp:25
pinocchio::CoulombFrictionConeTpl
&#160;
Definition: algorithm/constraints/coulomb-friction-cone.hpp:20
pinocchio::make_const_ref
auto make_const_ref(Eigen::MatrixBase< M > const &m) -> Eigen::Ref< typename M::PlainObject const >
Definition: context/generic.hpp:98
aligned-vector.hpp
pinocchio::SE3Tpl
Definition: context/casadi.hpp:30
pinocchio::DualCoulombFrictionConeTpl
&#160;
Definition: algorithm/constraints/coulomb-friction-cone.hpp:16
pinocchio::RigidConstraintModelTpl
Definition: algorithm/constraints/fwd.hpp:14
pinocchio::RigidConstraintDataTpl
Definition: algorithm/constraints/fwd.hpp:16
pinocchio::ForceTpl
Definition: context/casadi.hpp:26
x
x
pinocchio::context::Options
@ Options
Definition: context/generic.hpp:82
PINOCCHIO_OPTIONS_DEFAULT
#define PINOCCHIO_OPTIONS_DEFAULT
Definition: context.hpp:9
pinocchio::make_ref
Eigen::Ref< typename Derived::PlainObject > make_ref(const Eigen::MatrixBase< Derived > &x)
Definition: context/generic.hpp:91
PINOCCHIO_COMMON_TYPEDEF
#define PINOCCHIO_COMMON_TYPEDEF(Scalar, Options)
Definition: context/generic.hpp:44
pinocchio::JointCollectionDefaultTpl
Definition: context/generic.hpp:15
pinocchio::MotionTpl
Definition: context/casadi.hpp:28
Scalar
double Scalar
Definition: timings-cppad-jit.cpp:37
pinocchio::ModelTpl
Definition: context/generic.hpp:20
pinocchio::context::Scalar
PINOCCHIO_SCALAR_TYPE Scalar
Definition: context/generic.hpp:79
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:33


pinocchio
Author(s):
autogenerated on Mon Apr 7 2025 02:41:41