Line |
Branch |
Exec |
Source |
1 |
|
|
// |
2 |
|
|
// Copyright (c) 2018 CNRS |
3 |
|
|
// |
4 |
|
|
|
5 |
|
|
#ifndef __pinocchio_lie_group_variant_visitor_hpp__ |
6 |
|
|
#define __pinocchio_lie_group_variant_visitor_hpp__ |
7 |
|
|
|
8 |
|
|
#include "pinocchio/multibody/liegroup/fwd.hpp" |
9 |
|
|
|
10 |
|
|
namespace pinocchio |
11 |
|
|
{ |
12 |
|
|
|
13 |
|
|
/** |
14 |
|
|
* @brief Visit a LieGroupVariant to get the dimension of |
15 |
|
|
* the Lie group configuration space |
16 |
|
|
* |
17 |
|
|
* @param[in] lg the LieGroupVariant. |
18 |
|
|
* |
19 |
|
|
* @return The dimension of the Lie group configuration space |
20 |
|
|
*/ |
21 |
|
|
template<typename LieGroupCollection> |
22 |
|
|
inline int nq(const LieGroupGenericTpl<LieGroupCollection> & lg); |
23 |
|
|
|
24 |
|
|
/** |
25 |
|
|
* @brief Visit a LieGroupVariant to get the dimension of |
26 |
|
|
* the Lie group tangent space |
27 |
|
|
* |
28 |
|
|
* @param[in] lg the LieGroupVariant. |
29 |
|
|
* |
30 |
|
|
* @return The dimension of the Lie group tangent space |
31 |
|
|
*/ |
32 |
|
|
template<typename LieGroupCollection> |
33 |
|
|
inline int nv(const LieGroupGenericTpl<LieGroupCollection> & lg); |
34 |
|
|
|
35 |
|
|
/** |
36 |
|
|
* @brief Visit a LieGroupVariant to get the name of it |
37 |
|
|
* |
38 |
|
|
* @param[in] lg the LieGroupVariant. |
39 |
|
|
* |
40 |
|
|
* @return The Lie group name |
41 |
|
|
*/ |
42 |
|
|
template<typename LieGroupCollection> |
43 |
|
|
inline std::string name(const LieGroupGenericTpl<LieGroupCollection> & lg); |
44 |
|
|
|
45 |
|
|
/** |
46 |
|
|
* @brief Visit a LieGroupVariant to get the neutral element of it |
47 |
|
|
* |
48 |
|
|
* @param[in] lg the LieGroupVariant. |
49 |
|
|
* |
50 |
|
|
* @return The Lie group neutral element |
51 |
|
|
*/ |
52 |
|
|
template<typename LieGroupCollection> |
53 |
|
|
inline Eigen:: |
54 |
|
|
Matrix<typename LieGroupCollection::Scalar, Eigen::Dynamic, 1, LieGroupCollection::Options> |
55 |
|
|
neutral(const LieGroupGenericTpl<LieGroupCollection> & lg); |
56 |
|
|
|
57 |
|
|
/** |
58 |
|
|
* @brief Visit a LieGroupVariant to call its integrate method |
59 |
|
|
* |
60 |
|
|
* @param[in] lg the LieGroupVariant. |
61 |
|
|
* @param[in] q the starting configuration. |
62 |
|
|
* @param[in] v the tangent velocity. |
63 |
|
|
* |
64 |
|
|
*/ |
65 |
|
|
template<typename LieGroupCollection, class ConfigIn_t, class Tangent_t, class ConfigOut_t> |
66 |
|
|
inline void integrate( |
67 |
|
|
const LieGroupGenericTpl<LieGroupCollection> & lg, |
68 |
|
|
const Eigen::MatrixBase<ConfigIn_t> & q, |
69 |
|
|
const Eigen::MatrixBase<Tangent_t> & v, |
70 |
|
|
const Eigen::MatrixBase<ConfigOut_t> & qout); |
71 |
|
|
|
72 |
|
|
template<typename LieGroupCollection, class Config_t> |
73 |
|
|
inline void random( |
74 |
|
|
const LieGroupGenericTpl<LieGroupCollection> & lg, const Eigen::MatrixBase<Config_t> & qout); |
75 |
|
|
|
76 |
|
|
template<typename LieGroupCollection, class Config_t> |
77 |
|
|
inline void normalize( |
78 |
|
|
const LieGroupGenericTpl<LieGroupCollection> & lg, const Eigen::MatrixBase<Config_t> & qout); |
79 |
|
|
|
80 |
|
|
template<typename LieGroupCollection, class Config_t> |
81 |
|
|
inline bool isNormalized( |
82 |
|
|
const LieGroupGenericTpl<LieGroupCollection> & lg, |
83 |
|
|
const Eigen::MatrixBase<Config_t> & qin, |
84 |
|
|
const typename Config_t::Scalar & prec = |
85 |
|
|
Eigen::NumTraits<typename Config_t::Scalar>::dummy_precision()); |
86 |
|
|
|
87 |
|
|
template<typename LieGroupCollection, class ConfigL_t, class ConfigR_t> |
88 |
|
|
inline bool isSameConfiguration( |
89 |
|
|
const LieGroupGenericTpl<LieGroupCollection> & lg, |
90 |
|
|
const Eigen::MatrixBase<ConfigL_t> & q0, |
91 |
|
|
const Eigen::MatrixBase<ConfigR_t> & q1, |
92 |
|
|
const typename ConfigL_t::Scalar & prec); |
93 |
|
|
|
94 |
|
|
template<typename LieGroupCollection, class ConfigL_t, class ConfigR_t> |
95 |
|
|
inline typename ConfigL_t::Scalar squaredDistance( |
96 |
|
|
const LieGroupGenericTpl<LieGroupCollection> & lg, |
97 |
|
|
const Eigen::MatrixBase<ConfigL_t> & q0, |
98 |
|
|
const Eigen::MatrixBase<ConfigR_t> & q1); |
99 |
|
|
|
100 |
|
|
template<typename LieGroupCollection, class ConfigL_t, class ConfigR_t> |
101 |
|
✗ |
inline typename ConfigL_t::Scalar distance( |
102 |
|
|
const LieGroupGenericTpl<LieGroupCollection> & lg, |
103 |
|
|
const Eigen::MatrixBase<ConfigL_t> & q0, |
104 |
|
|
const Eigen::MatrixBase<ConfigR_t> & q1) |
105 |
|
|
{ |
106 |
|
✗ |
return std::sqrt(squaredDistance(lg, q0, q1)); |
107 |
|
|
} |
108 |
|
|
|
109 |
|
|
template<typename LieGroupCollection, class ConfigL_t, class ConfigR_t, class Tangent_t> |
110 |
|
|
inline void difference( |
111 |
|
|
const LieGroupGenericTpl<LieGroupCollection> & lg, |
112 |
|
|
const Eigen::MatrixBase<ConfigL_t> & q0, |
113 |
|
|
const Eigen::MatrixBase<ConfigR_t> & q1, |
114 |
|
|
const Eigen::MatrixBase<Tangent_t> & v); |
115 |
|
|
|
116 |
|
|
template<typename LieGroupCollection, class ConfigL_t, class ConfigR_t, class ConfigOut_t> |
117 |
|
|
inline void randomConfiguration( |
118 |
|
|
const LieGroupGenericTpl<LieGroupCollection> & lg, |
119 |
|
|
const Eigen::MatrixBase<ConfigL_t> & q0, |
120 |
|
|
const Eigen::MatrixBase<ConfigR_t> & q1, |
121 |
|
|
const Eigen::MatrixBase<ConfigOut_t> & qout); |
122 |
|
|
|
123 |
|
|
template<typename LieGroupCollection, class ConfigL_t, class ConfigR_t, class ConfigOut_t> |
124 |
|
|
inline void interpolate( |
125 |
|
|
const LieGroupGenericTpl<LieGroupCollection> & lg, |
126 |
|
|
const Eigen::MatrixBase<ConfigL_t> & q0, |
127 |
|
|
const Eigen::MatrixBase<ConfigR_t> & q1, |
128 |
|
|
const typename ConfigL_t::Scalar & u, |
129 |
|
|
const Eigen::MatrixBase<ConfigOut_t> & qout); |
130 |
|
|
|
131 |
|
|
template<typename LieGroupCollection, class Config_t, class Tangent_t, class JacobianOut_t> |
132 |
|
|
void dIntegrate( |
133 |
|
|
const LieGroupGenericTpl<LieGroupCollection> & lg, |
134 |
|
|
const Eigen::MatrixBase<Config_t> & q, |
135 |
|
|
const Eigen::MatrixBase<Tangent_t> & v, |
136 |
|
|
const Eigen::MatrixBase<JacobianOut_t> & J, |
137 |
|
|
const ArgumentPosition arg, |
138 |
|
|
const AssignmentOperatorType op = SETTO); |
139 |
|
|
|
140 |
|
|
template< |
141 |
|
|
typename LieGroupCollection, |
142 |
|
|
class Config_t, |
143 |
|
|
class Tangent_t, |
144 |
|
|
class JacobianIn_t, |
145 |
|
|
class JacobianOut_t> |
146 |
|
|
void dIntegrate( |
147 |
|
|
const LieGroupGenericTpl<LieGroupCollection> & lg, |
148 |
|
|
const Eigen::MatrixBase<Config_t> & q, |
149 |
|
|
const Eigen::MatrixBase<Tangent_t> & v, |
150 |
|
|
const Eigen::MatrixBase<JacobianIn_t> & J_in, |
151 |
|
|
int self, |
152 |
|
|
const Eigen::MatrixBase<JacobianOut_t> & J_out, |
153 |
|
|
const ArgumentPosition arg, |
154 |
|
|
const AssignmentOperatorType op = SETTO); |
155 |
|
|
|
156 |
|
|
template< |
157 |
|
|
typename LieGroupCollection, |
158 |
|
|
class Config_t, |
159 |
|
|
class Tangent_t, |
160 |
|
|
class JacobianIn_t, |
161 |
|
|
class JacobianOut_t> |
162 |
|
|
void dIntegrate( |
163 |
|
|
const LieGroupGenericTpl<LieGroupCollection> & lg, |
164 |
|
|
const Eigen::MatrixBase<Config_t> & q, |
165 |
|
|
const Eigen::MatrixBase<Tangent_t> & v, |
166 |
|
|
int self, |
167 |
|
|
const Eigen::MatrixBase<JacobianIn_t> & J_in, |
168 |
|
|
const Eigen::MatrixBase<JacobianOut_t> & J_out, |
169 |
|
|
const ArgumentPosition arg, |
170 |
|
|
const AssignmentOperatorType op = SETTO); |
171 |
|
|
|
172 |
|
|
template<typename LieGroupCollection, class ConfigL_t, class ConfigR_t, class JacobianOut_t> |
173 |
|
|
void dDifference( |
174 |
|
|
const LieGroupGenericTpl<LieGroupCollection> & lg, |
175 |
|
|
const Eigen::MatrixBase<ConfigL_t> & q0, |
176 |
|
|
const Eigen::MatrixBase<ConfigR_t> & q1, |
177 |
|
|
const Eigen::MatrixBase<JacobianOut_t> & J, |
178 |
|
|
const ArgumentPosition arg); |
179 |
|
|
|
180 |
|
|
template< |
181 |
|
|
typename LieGroupCollection, |
182 |
|
|
class ConfigL_t, |
183 |
|
|
class ConfigR_t, |
184 |
|
|
class JacobianIn_t, |
185 |
|
|
class JacobianOut_t> |
186 |
|
|
void dDifference( |
187 |
|
|
const LieGroupGenericTpl<LieGroupCollection> & lg, |
188 |
|
|
const Eigen::MatrixBase<ConfigL_t> & q0, |
189 |
|
|
const Eigen::MatrixBase<ConfigR_t> & q1, |
190 |
|
|
const Eigen::MatrixBase<JacobianIn_t> & Jin, |
191 |
|
|
int self, |
192 |
|
|
const Eigen::MatrixBase<JacobianOut_t> & Jout, |
193 |
|
|
const ArgumentPosition arg); |
194 |
|
|
|
195 |
|
|
template< |
196 |
|
|
typename LieGroupCollection, |
197 |
|
|
class ConfigL_t, |
198 |
|
|
class ConfigR_t, |
199 |
|
|
class JacobianIn_t, |
200 |
|
|
class JacobianOut_t> |
201 |
|
|
void dDifference( |
202 |
|
|
const LieGroupGenericTpl<LieGroupCollection> & lg, |
203 |
|
|
const Eigen::MatrixBase<ConfigL_t> & q0, |
204 |
|
|
const Eigen::MatrixBase<ConfigR_t> & q1, |
205 |
|
|
int self, |
206 |
|
|
const Eigen::MatrixBase<JacobianIn_t> & Jin, |
207 |
|
|
const Eigen::MatrixBase<JacobianOut_t> & Jout, |
208 |
|
|
const ArgumentPosition arg); |
209 |
|
|
|
210 |
|
|
template< |
211 |
|
|
typename LieGroupCollection, |
212 |
|
|
class Config_t, |
213 |
|
|
class Tangent_t, |
214 |
|
|
class JacobianIn_t, |
215 |
|
|
class JacobianOut_t> |
216 |
|
|
void dIntegrateTransport( |
217 |
|
|
const LieGroupGenericTpl<LieGroupCollection> & lg, |
218 |
|
|
const Eigen::MatrixBase<Config_t> & q, |
219 |
|
|
const Eigen::MatrixBase<Tangent_t> & v, |
220 |
|
|
const Eigen::MatrixBase<JacobianIn_t> & J_in, |
221 |
|
|
const Eigen::MatrixBase<JacobianOut_t> & J_out, |
222 |
|
|
const ArgumentPosition arg); |
223 |
|
|
|
224 |
|
|
template<typename LieGroupCollection, class Config_t, class Tangent_t, class JacobianOut_t> |
225 |
|
|
void dIntegrateTransport( |
226 |
|
|
const LieGroupGenericTpl<LieGroupCollection> & lg, |
227 |
|
|
const Eigen::MatrixBase<Config_t> & q, |
228 |
|
|
const Eigen::MatrixBase<Tangent_t> & v, |
229 |
|
|
const Eigen::MatrixBase<JacobianOut_t> & J, |
230 |
|
|
const ArgumentPosition arg); |
231 |
|
|
} // namespace pinocchio |
232 |
|
|
|
233 |
|
|
/// Details |
234 |
|
|
#include "pinocchio/multibody/liegroup/liegroup-variant-visitors.hxx" |
235 |
|
|
|
236 |
|
|
#endif // ifndef __pinocchio_lie_group_variant_visitor_hpp__ |
237 |
|
|
|