hpp-pinocchio 6.0.0
Wrapping of the kinematic/dynamic chain Pinocchio for HPP.
Loading...
Searching...
No Matches
liegroup.hh
Go to the documentation of this file.
1// Copyright (c) 2017, Joseph Mirabel
2// Authors: Joseph Mirabel (joseph.mirabel@laas.fr)
3//
4
5// Redistribution and use in source and binary forms, with or without
6// modification, are permitted provided that the following conditions are
7// met:
8//
9// 1. Redistributions of source code must retain the above copyright
10// notice, this list of conditions and the following disclaimer.
11//
12// 2. Redistributions in binary form must reproduce the above copyright
13// notice, this list of conditions and the following disclaimer in the
14// documentation and/or other materials provided with the distribution.
15//
16// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
27// DAMAGE.
28
29#ifndef HPP_PINOCCHIO_LIEGROUP_HH
30#define HPP_PINOCCHIO_LIEGROUP_HH
31
37#include <pinocchio/multibody/joint/joints.hpp>
38
39namespace hpp {
40namespace pinocchio {
41
49 template <typename JointModel>
50 struct operation {};
51};
52
60 template <typename JointModel>
61 struct operation {};
62};
63
65//---------------- RnxSOnLieGroupMap -------------------------------//
66// JointModelRevolute, JointModelRevoluteUnbounded, JointModelRevoluteUnaligned,
67// JointModelRevoluteUnboundedUnaligned
68template <typename Scalar, int Options, int Axis>
70 ::pinocchio::JointModelRevoluteTpl<Scalar, Options, Axis>> {
72};
73template <typename Scalar, int Options, int Axis>
74struct RnxSOnLieGroupMap::operation<
75 ::pinocchio::JointModelRevoluteUnboundedTpl<Scalar, Options, Axis>> {
76 typedef liegroup::SpecialOrthogonalOperation<2> type;
77};
78template <typename Scalar, int Options>
79struct RnxSOnLieGroupMap::operation<
80 ::pinocchio::JointModelRevoluteUnalignedTpl<Scalar, Options>> {
81 typedef liegroup::VectorSpaceOperation<1, true> type;
82};
83template <typename Scalar, int Options>
84struct RnxSOnLieGroupMap::operation<
85 ::pinocchio::JointModelRevoluteUnboundedUnalignedTpl<Scalar, Options>> {
86 typedef liegroup::SpecialOrthogonalOperation<2> type;
87};
88
89// JointModelPrismaticTpl, JointModelPrismaticUnaligned, JointModelTranslation
90template <typename Scalar, int Options, int Axis>
91struct RnxSOnLieGroupMap::operation<
92 ::pinocchio::JointModelPrismaticTpl<Scalar, Options, Axis>> {
93 typedef liegroup::VectorSpaceOperation<1, false> type;
94};
95template <typename Scalar, int Options>
96struct RnxSOnLieGroupMap::operation<
97 ::pinocchio::JointModelPrismaticUnalignedTpl<Scalar, Options>> {
98 typedef liegroup::VectorSpaceOperation<1, false> type;
99};
100template <typename Scalar, int Options>
101struct RnxSOnLieGroupMap::operation<
102 ::pinocchio::JointModelTranslationTpl<Scalar, Options>> {
103 typedef liegroup::VectorSpaceOperation<3, false> type;
104};
105
106// JointModelSpherical, JointModelSphericalZYX,
107template <typename Scalar, int Options>
108struct RnxSOnLieGroupMap::operation<
109 ::pinocchio::JointModelSphericalTpl<Scalar, Options>> {
110 typedef liegroup::SpecialOrthogonalOperation<3> type;
111};
112template <typename Scalar, int Options>
113struct RnxSOnLieGroupMap::operation<
114 ::pinocchio::JointModelSphericalZYXTpl<Scalar, Options>> {
115 typedef liegroup::VectorSpaceOperation<3, true> type;
116};
117
118// JointModelFreeFlyer, JointModelPlanar
119template <typename Scalar, int Options>
120struct RnxSOnLieGroupMap::operation<
121 ::pinocchio::JointModelFreeFlyerTpl<Scalar, Options>> {
122 typedef liegroup::CartesianProductOperation<
123 liegroup::VectorSpaceOperation<3, false>,
124 liegroup::SpecialOrthogonalOperation<3>>
125 type;
126};
127template <typename Scalar, int Options>
128struct RnxSOnLieGroupMap::operation<
129 ::pinocchio::JointModelPlanarTpl<Scalar, Options>> {
130 typedef liegroup::CartesianProductOperation<
131 liegroup::VectorSpaceOperation<2, false>,
132 liegroup::SpecialOrthogonalOperation<2>>
133 type;
134};
135
136// New in pinocchio 3
137#if PINOCCHIO_VERSION_AT_LEAST(3, 4, 1)
138// JointModelMimic
139// Not yet supported: this code is here only to make compilation pass.
140template <typename Scalar, int Options>
141struct RnxSOnLieGroupMap::operation<
142 ::pinocchio::JointModelMimicTpl<Scalar, Options>> {
143 typedef liegroup::VectorSpaceOperation<1, true> type;
144};
145#else
146// JointModelMimic
147// Not yet supported: this code is here only to make compilation pass.
148template <typename OtherJointType>
149struct RnxSOnLieGroupMap::operation<
150 ::pinocchio::JointModelMimic<OtherJointType>> {
151 typedef typename RnxSOnLieGroupMap::operation<OtherJointType>::type type;
152};
153#endif
154// JointModelHelical
155// Not yet supported: this code is here only to make compilation pass.
156template <typename Scalar, int Options, int _axis>
157struct RnxSOnLieGroupMap::operation<
158 ::pinocchio::JointModelHelicalTpl<Scalar, Options, _axis>> {
159 typedef liegroup::VectorSpaceOperation<1, true> type;
160};
161
162// JointModelHelicalUnaligned
163template <typename Scalar, int Options>
164struct RnxSOnLieGroupMap::operation<
165 ::pinocchio::JointModelHelicalUnalignedTpl<Scalar, Options>> {
166 typedef liegroup::VectorSpaceOperation<1, true> type;
167};
168
169// JointModelUniversal
170template <typename Scalar, int Options>
171struct RnxSOnLieGroupMap::operation<
172 ::pinocchio::JointModelUniversalTpl<Scalar, Options>> {
173 typedef liegroup::VectorSpaceOperation<
174 ::pinocchio::JointModelUniversalTpl<Scalar, Options>::NQ, false>
175 type;
176};
177
178// JointModelComposite (not implemented returns vector space of variable
179// dimension)
180template <typename Scalar, int Options,
181 template <typename S, int O> class JointCollectionTpl>
182struct RnxSOnLieGroupMap::operation<
183 ::pinocchio::JointModelCompositeTpl<Scalar, Options, JointCollectionTpl>> {
184 typedef liegroup::VectorSpaceOperation<Eigen::Dynamic, false> type;
185};
186
187//---------------- DefaultLieGroupMap ------------------------------------//
188
189// JointModelRevolute, JointModelRevoluteUnbounded, JointModelRevoluteUnaligned,
190// JointModelRevoluteUnboundedUnaligned
191template <typename Scalar, int Options, int Axis>
192struct DefaultLieGroupMap::operation<
193 ::pinocchio::JointModelRevoluteTpl<Scalar, Options, Axis>> {
194 typedef liegroup::VectorSpaceOperation<1, true> type;
195};
196template <typename Scalar, int Options, int Axis>
197struct DefaultLieGroupMap::operation<
198 ::pinocchio::JointModelRevoluteUnboundedTpl<Scalar, Options, Axis>> {
199 typedef liegroup::SpecialOrthogonalOperation<2> type;
200};
201template <typename Scalar, int Options>
202struct DefaultLieGroupMap::operation<
203 ::pinocchio::JointModelRevoluteUnalignedTpl<Scalar, Options>> {
204 typedef liegroup::VectorSpaceOperation<1, true> type;
205};
206template <typename Scalar, int Options>
207struct DefaultLieGroupMap::operation<
208 ::pinocchio::JointModelRevoluteUnboundedUnalignedTpl<Scalar, Options>> {
209 typedef liegroup::SpecialOrthogonalOperation<2> type;
210};
211
212// JointModelPrismaticTpl, JointModelPrismaticUnaligned, JointModelTranslation
213template <typename Scalar, int Options, int Axis>
214struct DefaultLieGroupMap::operation<
215 ::pinocchio::JointModelPrismaticTpl<Scalar, Options, Axis>> {
216 typedef liegroup::VectorSpaceOperation<1, false> type;
217};
218template <typename Scalar, int Options>
219struct DefaultLieGroupMap::operation<
220 ::pinocchio::JointModelPrismaticUnalignedTpl<Scalar, Options>> {
221 typedef liegroup::VectorSpaceOperation<1, false> type;
222};
223template <typename Scalar, int Options>
224struct DefaultLieGroupMap::operation<
225 ::pinocchio::JointModelTranslationTpl<Scalar, Options>> {
226 typedef liegroup::VectorSpaceOperation<3, false> type;
227};
228
229// JointModelSpherical, JointModelSphericalZYX,
230template <typename Scalar, int Options>
231struct DefaultLieGroupMap::operation<
232 ::pinocchio::JointModelSphericalTpl<Scalar, Options>> {
233 typedef liegroup::SpecialOrthogonalOperation<3> type;
234};
235template <typename Scalar, int Options>
236struct DefaultLieGroupMap::operation<
237 ::pinocchio::JointModelSphericalZYXTpl<Scalar, Options>> {
238 typedef liegroup::VectorSpaceOperation<3, true> type;
239};
240
241// JointModelFreeFlyer, JointModelPlanar
242template <typename Scalar, int Options>
243struct DefaultLieGroupMap::operation<
244 ::pinocchio::JointModelFreeFlyerTpl<Scalar, Options>> {
245 typedef liegroup::SpecialEuclideanOperation<3> type;
246};
247template <typename Scalar, int Options>
248struct DefaultLieGroupMap::operation<
249 ::pinocchio::JointModelPlanarTpl<Scalar, Options>> {
250 typedef liegroup::SpecialEuclideanOperation<2> type;
251};
252
253// New in pinocchio 3
254#if PINOCCHIO_VERSION_AT_LEAST(3, 4, 1)
255// JointModelMimic
256template <typename Scalar, int Options>
257struct DefaultLieGroupMap::operation<
258 ::pinocchio::JointModelMimicTpl<Scalar, Options>> {
259 typedef liegroup::VectorSpaceOperation<1, true> type;
260};
261#else
262// JointModelMimic
263template <typename OtherJointType>
264struct DefaultLieGroupMap::operation<
265 ::pinocchio::JointModelMimic<OtherJointType>> {
266 typedef typename DefaultLieGroupMap::operation<OtherJointType>::type type;
267};
268#endif
269// JointModelHelical
270template <typename Scalar, int Options, int _axis>
271struct DefaultLieGroupMap::operation<
272 ::pinocchio::JointModelHelicalTpl<Scalar, Options, _axis>> {
273 typedef liegroup::VectorSpaceOperation<1, true> type;
274};
275
276// JointModelHelicalUnaligned
277template <typename Scalar, int Options>
278struct DefaultLieGroupMap::operation<
279 ::pinocchio::JointModelHelicalUnalignedTpl<Scalar, Options>> {
280 typedef liegroup::VectorSpaceOperation<1, true> type;
281};
282
283// JointModelUniversal
284template <typename Scalar, int Options>
285struct DefaultLieGroupMap::operation<
286 ::pinocchio::JointModelUniversalTpl<Scalar, Options>> {
287 typedef liegroup::VectorSpaceOperation<
288 ::pinocchio::JointModelUniversalTpl<Scalar, Options>::NQ, false>
289 type;
290};
291
292// JointModelComposite (not implemented returns vector space of variable
293// dimension)
294template <typename Scalar, int Options,
295 template <typename S, int O> class JointCollectionTpl>
296struct DefaultLieGroupMap::operation<
297 ::pinocchio::JointModelCompositeTpl<Scalar, Options, JointCollectionTpl>> {
298 typedef liegroup::VectorSpaceOperation<Eigen::Dynamic, false> type;
299};
300
302} // namespace pinocchio
303} // namespace hpp
304
305#endif // HPP_PINOCCHIO_LIEGROUP_HH
Utility functions.
Definition body.hh:39
Definition collision-object.hh:40
Definition liegroup.hh:59
Definition liegroup.hh:48