hpp-pinocchio  4.9.1
Wrapping of the kinematic/dynamic chain Pinocchio for HPP.
joint-collection.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2018 CNRS
3 // Author: Joseph Mirabel
4 //
5 //
6 // This file is part of hpp-pinocchio
7 // hpp-pinocchio is free software: you can redistribute it
8 // and/or modify it under the terms of the GNU Lesser General Public
9 // License as published by the Free Software Foundation, either version
10 // 3 of the License, or (at your option) any later version.
11 //
12 // hpp-pinocchio is distributed in the hope that it will be
13 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
14 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Lesser Public License for more details. You should have
16 // received a copy of the GNU Lesser General Public License along with
17 // hpp-pinocchio If not, see
18 // <http://www.gnu.org/licenses/>.
19 
20 #ifndef HPP_PINOCCHIO_JOINT_COLLECTION_HH
21 #define HPP_PINOCCHIO_JOINT_COLLECTION_HH
22 
23 #include <boost/variant.hpp>
24 #include <boost/variant/recursive_wrapper.hpp>
25 
26 #include "pinocchio/multibody/joint/fwd.hpp"
27 #include "pinocchio/multibody/joint/joint-free-flyer.hpp"
28 #include "pinocchio/multibody/joint/joint-planar.hpp"
29 #include "pinocchio/multibody/joint/joint-prismatic.hpp"
30 #include "pinocchio/multibody/joint/joint-revolute-unaligned.hpp"
31 #if PINOCCHIO_VERSION_AT_LEAST(2,1,5)
32 # include "pinocchio/multibody/joint/joint-revolute-unbounded-unaligned.hpp"
33 #endif
34 #include "pinocchio/multibody/joint/joint-prismatic-unaligned.hpp"
35 #include "pinocchio/multibody/joint/joint-revolute.hpp"
36 #include "pinocchio/multibody/joint/joint-revolute-unbounded.hpp"
37 //#include "pinocchio/multibody/joint/joint-spherical-ZYX.hpp"
38 //#include "pinocchio/multibody/joint/joint-spherical.hpp"
39 #include "pinocchio/multibody/joint/joint-translation.hpp"
40 
41 namespace hpp {
42  namespace pinocchio {
43 
44  template<typename _Scalar, int _Options>
45  struct JointCollectionTpl
46  {
47  typedef _Scalar Scalar;
48  enum { Options = _Options };
49 
50  // Joint Revolute
51  typedef ::pinocchio::JointModelRevoluteTpl<Scalar,Options,0> JointModelRX;
52  typedef ::pinocchio::JointModelRevoluteTpl<Scalar,Options,1> JointModelRY;
53  typedef ::pinocchio::JointModelRevoluteTpl<Scalar,Options,2> JointModelRZ;
54 
55  // Joint Revolute Unaligned
56  typedef ::pinocchio::JointModelRevoluteUnalignedTpl<Scalar,Options> JointModelRevoluteUnaligned;
57 
58  // Joint Revolute UBounded
59  typedef ::pinocchio::JointModelRevoluteUnboundedTpl<Scalar,Options,0> JointModelRUBX;
60  typedef ::pinocchio::JointModelRevoluteUnboundedTpl<Scalar,Options,1> JointModelRUBY;
61  typedef ::pinocchio::JointModelRevoluteUnboundedTpl<Scalar,Options,2> JointModelRUBZ;
62 
63 #if PINOCCHIO_VERSION_AT_LEAST(2,1,5)
64  // Joint Revolute Unbounded Unaligned
65  typedef ::pinocchio::JointModelRevoluteUnboundedUnalignedTpl<Scalar,Options> JointModelRevoluteUnboundedUnaligned;
66 #endif
67 
68  // Joint Prismatic
69  typedef ::pinocchio::JointModelPrismaticTpl<Scalar,Options,0> JointModelPX;
70  typedef ::pinocchio::JointModelPrismaticTpl<Scalar,Options,1> JointModelPY;
71  typedef ::pinocchio::JointModelPrismaticTpl<Scalar,Options,2> JointModelPZ;
72 
73  // Joint Prismatic Unaligned
74  typedef ::pinocchio::JointModelPrismaticUnalignedTpl<Scalar,Options> JointModelPrismaticUnaligned;
75 
76  // Joint Spherical
77  typedef ::pinocchio::JointModelSphericalTpl<Scalar,Options> JointModelSpherical;
78 
79  // Joint Spherical ZYX
80  typedef ::pinocchio::JointModelSphericalZYXTpl<Scalar,Options> JointModelSphericalZYX;
81 
82  // Joint Translation
83  typedef ::pinocchio::JointModelTranslationTpl<Scalar,Options> JointModelTranslation;
84 
85  // Joint FreeFlyer
86  typedef ::pinocchio::JointModelFreeFlyerTpl<Scalar,Options> JointModelFreeFlyer;
87 
88  // Joint Planar
89  typedef ::pinocchio::JointModelPlanarTpl<Scalar,Options> JointModelPlanar;
90 
91  // Joint Composite
92  typedef ::pinocchio::JointModelCompositeTpl<Scalar,Options,pinocchio::JointCollectionTpl> JointModelComposite;
93 
94  typedef boost::variant<
95  // JointModelVoid,
98  , JointModelRevoluteUnaligned
99 #if PINOCCHIO_VERSION_AT_LEAST(2,1,5)
100  , JointModelRevoluteUnboundedUnaligned
101 #endif
105  , JointModelRUBX, JointModelRUBY, JointModelRUBZ
107 
108 
109  // Joint Revolute
110  typedef ::pinocchio::JointDataRevoluteTpl<Scalar,Options,0> JointDataRX;
111  typedef ::pinocchio::JointDataRevoluteTpl<Scalar,Options,1> JointDataRY;
112  typedef ::pinocchio::JointDataRevoluteTpl<Scalar,Options,2> JointDataRZ;
113 
114  // Joint Revolute Unaligned
115  typedef ::pinocchio::JointDataRevoluteUnalignedTpl<Scalar,Options> JointDataRevoluteUnaligned;
116 
117  // Joint Revolute UBounded
118  typedef ::pinocchio::JointDataRevoluteUnboundedTpl<Scalar,Options,0> JointDataRUBX;
119  typedef ::pinocchio::JointDataRevoluteUnboundedTpl<Scalar,Options,1> JointDataRUBY;
120  typedef ::pinocchio::JointDataRevoluteUnboundedTpl<Scalar,Options,2> JointDataRUBZ;
121 
122 #if PINOCCHIO_VERSION_AT_LEAST(2,1,5)
123  // Joint Revolute Unbounded Unaligned
124  typedef ::pinocchio::JointDataRevoluteUnboundedUnalignedTpl<Scalar,Options> JointDataRevoluteUnboundedUnaligned;
125 #endif
126 
127  // Joint Prismatic
128  typedef ::pinocchio::JointDataPrismaticTpl<Scalar,Options,0> JointDataPX;
129  typedef ::pinocchio::JointDataPrismaticTpl<Scalar,Options,1> JointDataPY;
130  typedef ::pinocchio::JointDataPrismaticTpl<Scalar,Options,2> JointDataPZ;
131 
132  // Joint Prismatic Unaligned
133  typedef ::pinocchio::JointDataPrismaticUnalignedTpl<Scalar,Options> JointDataPrismaticUnaligned;
134 
135  // Joint Spherical
136  typedef ::pinocchio::JointDataSphericalTpl<Scalar,Options> JointDataSpherical;
137 
138  // Joint Spherical ZYX
139  typedef ::pinocchio::JointDataSphericalZYXTpl<Scalar,Options> JointDataSphericalZYX;
140 
141  // Joint Translation
142  typedef ::pinocchio::JointDataTranslationTpl<Scalar,Options> JointDataTranslation;
143 
144  // Joint FreeFlyer
145  typedef ::pinocchio::JointDataFreeFlyerTpl<Scalar,Options> JointDataFreeFlyer;
146 
147  // Joint Planar
148  typedef ::pinocchio::JointDataPlanarTpl<Scalar,Options> JointDataPlanar;
149 
150  // Joint Composite
151  typedef ::pinocchio::JointDataCompositeTpl<Scalar,Options,pinocchio::JointCollectionTpl> JointDataComposite;
152 
153  typedef boost::variant<
154  // JointDataVoid
157  , JointDataRevoluteUnaligned
158 #if PINOCCHIO_VERSION_AT_LEAST(2,1,5)
159  , JointDataRevoluteUnboundedUnaligned
160 #endif
164  , JointDataRUBX, JointDataRUBY, JointDataRUBZ
166 
167  };
168 
171 
172  } // namespace pinocchio
173 } // namespace hpp
174 
175 #endif // HPP_PINOCCHIO_JOINT_COLLECTION_HH
::pinocchio::JointModelSphericalTpl< Scalar, Options > JointModelSpherical
Definition: joint-collection.hh:77
::pinocchio::JointDataTranslationTpl< Scalar, Options > JointDataTranslation
Definition: joint-collection.hh:142
::pinocchio::JointModelPrismaticTpl< Scalar, Options, 1 > JointModelPY
Definition: joint-collection.hh:70
::pinocchio::JointModelPlanarTpl< Scalar, Options > JointModelPlanar
Definition: joint-collection.hh:89
::pinocchio::JointDataPlanarTpl< Scalar, Options > JointDataPlanar
Definition: joint-collection.hh:148
::pinocchio::JointDataRevoluteUnboundedTpl< Scalar, Options, 0 > JointDataRUBX
Definition: joint-collection.hh:118
::pinocchio::JointDataCompositeTpl< Scalar, Options, pinocchio::JointCollectionTpl > JointDataComposite
Definition: joint-collection.hh:151
Utility functions.
::pinocchio::JointDataRevoluteUnboundedTpl< Scalar, Options, 2 > JointDataRUBZ
Definition: joint-collection.hh:120
::pinocchio::JointModelPrismaticUnalignedTpl< Scalar, Options > JointModelPrismaticUnaligned
Definition: joint-collection.hh:74
::pinocchio::JointModelCompositeTpl< Scalar, Options, pinocchio::JointCollectionTpl > JointModelComposite
Definition: joint-collection.hh:92
boost::variant< JointDataRX, JointDataRY, JointDataRZ, JointDataFreeFlyer, JointDataPlanar, JointDataRevoluteUnaligned, JointDataPX, JointDataPY, JointDataPZ, JointDataPrismaticUnaligned, JointDataTranslation, JointDataRUBX, JointDataRUBY, JointDataRUBZ > JointDataVariant
Definition: joint-collection.hh:165
::pinocchio::JointModelRevoluteTpl< Scalar, Options, 1 > JointModelRY
Definition: joint-collection.hh:52
::pinocchio::JointModelRevoluteUnboundedTpl< Scalar, Options, 0 > JointModelRUBX
Definition: joint-collection.hh:59
::pinocchio::JointModelFreeFlyerTpl< Scalar, Options > JointModelFreeFlyer
Definition: joint-collection.hh:86
::pinocchio::JointModelSphericalZYXTpl< Scalar, Options > JointModelSphericalZYX
Definition: joint-collection.hh:80
::pinocchio::JointModelRevoluteTpl< Scalar, Options, 0 > JointModelRX
Definition: joint-collection.hh:51
boost::variant< JointModelRX, JointModelRY, JointModelRZ, JointModelFreeFlyer, JointModelPlanar, JointModelRevoluteUnaligned, JointModelPX, JointModelPY, JointModelPZ, JointModelPrismaticUnaligned, JointModelTranslation, JointModelRUBX, JointModelRUBY, JointModelRUBZ > JointModelVariant
Definition: joint-collection.hh:106
::pinocchio::JointDataSphericalTpl< Scalar, Options > JointDataSpherical
Definition: joint-collection.hh:136
::pinocchio::JointModelPrismaticTpl< Scalar, Options, 2 > JointModelPZ
Definition: joint-collection.hh:71
::pinocchio::JointDataSphericalZYXTpl< Scalar, Options > JointDataSphericalZYX
Definition: joint-collection.hh:139
_Scalar Scalar
Definition: joint-collection.hh:47
::pinocchio::JointModelRevoluteUnalignedTpl< Scalar, Options > JointModelRevoluteUnaligned
Definition: joint-collection.hh:56
::pinocchio::JointModelRevoluteUnboundedTpl< Scalar, Options, 1 > JointModelRUBY
Definition: joint-collection.hh:60
::pinocchio::JointDataRevoluteTpl< Scalar, Options, 2 > JointDataRZ
Definition: joint-collection.hh:112
::pinocchio::JointDataRevoluteUnalignedTpl< Scalar, Options > JointDataRevoluteUnaligned
Definition: joint-collection.hh:115
::pinocchio::JointDataRevoluteUnboundedTpl< Scalar, Options, 1 > JointDataRUBY
Definition: joint-collection.hh:119
::pinocchio::JointDataFreeFlyerTpl< Scalar, Options > JointDataFreeFlyer
Definition: joint-collection.hh:145
::pinocchio::JointDataPrismaticTpl< Scalar, Options, 1 > JointDataPY
Definition: joint-collection.hh:129
::pinocchio::JointDataPrismaticUnalignedTpl< Scalar, Options > JointDataPrismaticUnaligned
Definition: joint-collection.hh:133
::pinocchio::JointModelPrismaticTpl< Scalar, Options, 0 > JointModelPX
Definition: joint-collection.hh:69
::pinocchio::JointDataPrismaticTpl< Scalar, Options, 0 > JointDataPX
Definition: joint-collection.hh:128
::pinocchio::JointModelRevoluteUnboundedTpl< Scalar, Options, 2 > JointModelRUBZ
Definition: joint-collection.hh:61
::pinocchio::JointModelRevoluteTpl< Scalar, Options, 2 > JointModelRZ
Definition: joint-collection.hh:53
::pinocchio::JointDataRevoluteTpl< Scalar, Options, 0 > JointDataRX
Definition: joint-collection.hh:110
Definition: joint-collection.hh:48
::pinocchio::JointModelTranslationTpl< Scalar, Options > JointModelTranslation
Definition: joint-collection.hh:83
::pinocchio::JointDataRevoluteTpl< Scalar, Options, 1 > JointDataRY
Definition: joint-collection.hh:111
::pinocchio::JointDataPrismaticTpl< Scalar, Options, 2 > JointDataPZ
Definition: joint-collection.hh:130