cartesian-product-variant.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2018 CNRS
3 //
4 
5 #ifndef __pinocchio_cartesian_product_variant_hpp__
6 #define __pinocchio_cartesian_product_variant_hpp__
7 
10 
12 
13 namespace pinocchio
14 {
15 
16  template<
17  typename Scalar,
19  template<typename, int> class LieGroupCollectionTpl = LieGroupCollectionDefaultTpl>
26 
27  template<typename _Scalar, int _Options, template<typename, int> class LieGroupCollectionTpl>
28  struct traits<CartesianProductOperationVariantTpl<_Scalar, _Options, LieGroupCollectionTpl>>
29  {
30  typedef _Scalar Scalar;
31  enum
32  {
33  Options = _Options,
36  };
37  };
38 
42  template<typename _Scalar, int _Options, template<typename, int> class LieGroupCollectionTpl>
43  struct CartesianProductOperationVariantTpl
44  : public LieGroupBase<
45  CartesianProductOperationVariantTpl<_Scalar, _Options, LieGroupCollectionTpl>>
46  {
47  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
48 
50 
51  typedef LieGroupCollectionTpl<Scalar, Options> LieGroupCollection;
52  typedef typename LieGroupCollection::LieGroupVariant LieGroupVariant;
54 
57  : m_nq(0)
58  , m_nv(0)
59  , lg_nqs(0)
60  , lg_nvs(0)
61  , m_neutral(0) {};
62 
69  : m_nq(0)
70  , m_nv(0)
71  , lg_nqs(0)
72  , lg_nvs(0)
73  , m_neutral(0)
74  {
75  append(lg);
76  };
77 
85  : m_nq(0)
86  , m_nv(0)
87  , lg_nqs(0)
88  , lg_nvs(0)
89  , m_neutral(0)
90  {
91  append(lg1);
92  append(lg2);
93  };
94 
100  void append(const LieGroupGeneric & lg);
101 
107  template<typename LieGroupDerived>
109  {
110  LieGroupGeneric lgGeneric(lg);
111  append(lgGeneric);
112  }
113 
122  operator*(const CartesianProductOperationVariantTpl & other) const;
123 
131 
138  {
139  append(lg);
140  return *this;
141  }
142 
148  template<typename LieGroupDerived>
151  {
152  append<LieGroupDerived>(lg);
153  return *this;
154  }
155 
156  int nq() const
157  {
158  return m_nq;
159  }
160  int nv() const
161  {
162  return m_nv;
163  }
164 
165  std::string name() const
166  {
167  return m_name;
168  }
169 
170  ConfigVector_t neutral() const
171  {
172  return m_neutral;
173  }
174 
175  template<class ConfigL_t, class ConfigR_t, class Tangent_t>
176  void difference_impl(
177  const Eigen::MatrixBase<ConfigL_t> & q0,
178  const Eigen::MatrixBase<ConfigR_t> & q1,
179  const Eigen::MatrixBase<Tangent_t> & d) const;
180 
181  template<ArgumentPosition arg, class ConfigL_t, class ConfigR_t, class JacobianOut_t>
182  void dDifference_impl(
183  const Eigen::MatrixBase<ConfigL_t> & q0,
184  const Eigen::MatrixBase<ConfigR_t> & q1,
185  const Eigen::MatrixBase<JacobianOut_t> & J) const;
186 
187  template<
188  ArgumentPosition arg,
189  class ConfigL_t,
190  class ConfigR_t,
191  class JacobianIn_t,
192  class JacobianOut_t>
194  const ConfigL_t & q0,
195  const ConfigR_t & q1,
196  const JacobianIn_t & Jin,
197  JacobianOut_t & Jout,
198  bool dDifferenceOnTheLeft,
199  const AssignmentOperatorType op) const;
200 
201  template<class ConfigIn_t, class Velocity_t, class ConfigOut_t>
202  void integrate_impl(
203  const Eigen::MatrixBase<ConfigIn_t> & q,
204  const Eigen::MatrixBase<Velocity_t> & v,
205  const Eigen::MatrixBase<ConfigOut_t> & qout) const;
206 
207  template<class Config_t, class Jacobian_t>
209  const Eigen::MatrixBase<Config_t> & q, const Eigen::MatrixBase<Jacobian_t> & J) const;
210 
211  template<class Config_t, class Tangent_t, class JacobianOut_t>
212  void dIntegrate_dq_impl(
213  const Eigen::MatrixBase<Config_t> & q,
214  const Eigen::MatrixBase<Tangent_t> & v,
215  const Eigen::MatrixBase<JacobianOut_t> & J,
216  const AssignmentOperatorType op = SETTO) const;
217 
218  template<class Config_t, class Tangent_t, class JacobianOut_t>
219  void dIntegrate_dv_impl(
220  const Eigen::MatrixBase<Config_t> & q,
221  const Eigen::MatrixBase<Tangent_t> & v,
222  const Eigen::MatrixBase<JacobianOut_t> & J,
223  const AssignmentOperatorType op = SETTO) const;
224 
225  template<class Config_t, class Tangent_t, class JacobianIn_t, class JacobianOut_t>
227  const Config_t & q,
228  const Tangent_t & v,
229  const JacobianIn_t & Jin,
230  JacobianOut_t & Jout,
231  bool dIntegrateOnTheLeft,
232  const ArgumentPosition arg,
233  const AssignmentOperatorType op) const;
234 
235  template<class Config_t, class Tangent_t, class JacobianIn_t, class JacobianOut_t>
237  const Eigen::MatrixBase<Config_t> & q,
238  const Eigen::MatrixBase<Tangent_t> & v,
239  const Eigen::MatrixBase<JacobianIn_t> & J_in,
240  const Eigen::MatrixBase<JacobianOut_t> & J_out) const;
241 
242  template<class Config_t, class Tangent_t, class JacobianIn_t, class JacobianOut_t>
244  const Eigen::MatrixBase<Config_t> & q,
245  const Eigen::MatrixBase<Tangent_t> & v,
246  const Eigen::MatrixBase<JacobianIn_t> & J_in,
247  const Eigen::MatrixBase<JacobianOut_t> & J_out) const;
248 
249  template<class Config_t, class Tangent_t, class JacobianOut_t>
251  const Eigen::MatrixBase<Config_t> & q,
252  const Eigen::MatrixBase<Tangent_t> & v,
253  const Eigen::MatrixBase<JacobianOut_t> & J) const;
254 
255  template<class Config_t, class Tangent_t, class JacobianOut_t>
257  const Eigen::MatrixBase<Config_t> & q,
258  const Eigen::MatrixBase<Tangent_t> & v,
259  const Eigen::MatrixBase<JacobianOut_t> & J) const;
260 
261  template<class ConfigL_t, class ConfigR_t>
263  const Eigen::MatrixBase<ConfigL_t> & q0, const Eigen::MatrixBase<ConfigR_t> & q1) const;
264 
265  template<class Config_t>
266  void normalize_impl(const Eigen::MatrixBase<Config_t> & qout) const;
267 
268  template<class Config_t>
269  bool isNormalized_impl(const Eigen::MatrixBase<Config_t> & qout, const Scalar & prec) const;
270 
271  template<class Config_t>
272  void random_impl(const Eigen::MatrixBase<Config_t> & qout) const;
273 
274  template<class ConfigL_t, class ConfigR_t, class ConfigOut_t>
276  const Eigen::MatrixBase<ConfigL_t> & lower,
277  const Eigen::MatrixBase<ConfigR_t> & upper,
278  const Eigen::MatrixBase<ConfigOut_t> & qout) const;
279 
280  template<class ConfigL_t, class ConfigR_t>
282  const Eigen::MatrixBase<ConfigL_t> & q0,
283  const Eigen::MatrixBase<ConfigR_t> & q1,
284  const Scalar & prec) const;
285 
286  bool isEqual_impl(const CartesianProductOperationVariantTpl & other) const;
287 
288  template<typename LieGroup1, typename LieGroup2>
290 
291  protected:
294  std::vector<Index> lg_nqs, lg_nvs;
295  std::string m_name;
296 
297  ConfigVector_t m_neutral;
298  };
299 
300 } // namespace pinocchio
301 
302 #include <pinocchio/multibody/liegroup/cartesian-product-variant.hxx>
303 
304 #endif // ifndef __pinocchio_cartesian_product_variant_hpp__
pinocchio::CartesianProductOperation
Definition: cartesian-product.hpp:40
cassie-simulation.qout
def qout
Definition: cassie-simulation.py:251
pinocchio::LieGroupGenericTpl
Definition: multibody/liegroup/fwd.hpp:13
pinocchio::CartesianProductOperationVariantTpl::append
void append(const LieGroupGeneric &lg)
Append a Lie group to the Cartesian product.
pinocchio::CartesianProductOperationVariantTpl::PINOCCHIO_LIE_GROUP_TPL_PUBLIC_INTERFACE
EIGEN_MAKE_ALIGNED_OPERATOR_NEW PINOCCHIO_LIE_GROUP_TPL_PUBLIC_INTERFACE(CartesianProductOperationVariantTpl)
pinocchio::CartesianProductOperationVariantTpl::isEqual_impl
bool isEqual_impl(const CartesianProductOperationVariantTpl &other) const
pinocchio::CartesianProductOperationVariantTpl::random_impl
void random_impl(const Eigen::MatrixBase< Config_t > &qout) const
pinocchio::SETTO
@ SETTO
Definition: fwd.hpp:132
pinocchio::LieGroupCollectionDefaultTpl
Definition: liegroup-collection.hpp:18
pinocchio::CartesianProductOperationVariantTpl::nv
int nv() const
Definition: cartesian-product-variant.hpp:160
aligned-vector.hpp
pinocchio::CartesianProductOperationVariantTpl::integrate_impl
void integrate_impl(const Eigen::MatrixBase< ConfigIn_t > &q, const Eigen::MatrixBase< Velocity_t > &v, const Eigen::MatrixBase< ConfigOut_t > &qout) const
pinocchio::Options
Options
Definition: joint-configuration.hpp:1082
pinocchio::CartesianProductOperationVariantTpl::dDifference_impl
void dDifference_impl(const Eigen::MatrixBase< ConfigL_t > &q0, const Eigen::MatrixBase< ConfigR_t > &q1, const Eigen::MatrixBase< JacobianOut_t > &J) const
pinocchio::CartesianProductOperationVariantTpl::operator*
CartesianProductOperationVariantTpl operator*(const CartesianProductOperationVariantTpl &other) const
Cartesian product between *this and other.
pinocchio::CartesianProductOperationVariantTpl::lg_nqs
std::vector< Index > lg_nqs
Definition: cartesian-product-variant.hpp:294
pinocchio::CartesianProductOperationVariantTpl
Dynamic Cartesian product composed of elementary Lie groups defined in LieGroupVariant.
Definition: cartesian-product-variant.hpp:20
pinocchio::python::Scalar
context::Scalar Scalar
Definition: admm-solver.cpp:29
pinocchio::CartesianProductOperationVariantTpl::operator*=
CartesianProductOperationVariantTpl & operator*=(const LieGroupBase< LieGroupDerived > &lg)
Append a Lie group to *this.
Definition: cartesian-product-variant.hpp:150
inverse-kinematics-3d.J
J
Definition: inverse-kinematics-3d.py:28
pinocchio::ArgumentPosition
ArgumentPosition
Argument position. Used as template parameter to refer to an argument.
Definition: fwd.hpp:121
pinocchio::CartesianProductOperationVariantTpl::operator*=
CartesianProductOperationVariantTpl & operator*=(const CartesianProductOperationVariantTpl &other)
Append other to *this.
pinocchio::CartesianProductOperationVariantTpl::nq
int nq() const
Definition: cartesian-product-variant.hpp:156
pinocchio::CartesianProductOperationVariantTpl::dIntegrate_dv_impl
void dIntegrate_dv_impl(const Eigen::MatrixBase< Config_t > &q, const Eigen::MatrixBase< Tangent_t > &v, const Eigen::MatrixBase< JacobianOut_t > &J, const AssignmentOperatorType op=SETTO) const
pinocchio::CartesianProductOperationVariantTpl::dIntegrateTransport_dv_impl
void dIntegrateTransport_dv_impl(const Eigen::MatrixBase< Config_t > &q, const Eigen::MatrixBase< Tangent_t > &v, const Eigen::MatrixBase< JacobianIn_t > &J_in, const Eigen::MatrixBase< JacobianOut_t > &J_out) const
pinocchio::Index
PINOCCHIO_COMPILER_DIAGNOSTIC_POP typedef std::size_t Index
Definition: multibody/fwd.hpp:22
pinocchio::CartesianProductOperationVariantTpl::isEqual
bool isEqual(const CartesianProductOperation< LieGroup1, LieGroup2 > &other) const
pinocchio::CartesianProductOperationVariantTpl::dDifference_product_impl
void dDifference_product_impl(const ConfigL_t &q0, const ConfigR_t &q1, const JacobianIn_t &Jin, JacobianOut_t &Jout, bool dDifferenceOnTheLeft, const AssignmentOperatorType op) const
pinocchio::CartesianProductOperationVariantTpl::CartesianProductOperationVariantTpl
CartesianProductOperationVariantTpl()
Default constructor.
Definition: cartesian-product-variant.hpp:56
pinocchio::CartesianProductOperationVariantTpl::append
void append(const LieGroupBase< LieGroupDerived > &lg)
Append a Lie group to the Cartesian product.
Definition: cartesian-product-variant.hpp:108
pinocchio::CartesianProductOperationVariantTpl::randomConfiguration_impl
void randomConfiguration_impl(const Eigen::MatrixBase< ConfigL_t > &lower, const Eigen::MatrixBase< ConfigR_t > &upper, const Eigen::MatrixBase< ConfigOut_t > &qout) const
pinocchio::CartesianProductOperationVariantTpl::normalize_impl
void normalize_impl(const Eigen::MatrixBase< Config_t > &qout) const
pinocchio::Dynamic
const int Dynamic
Definition: fwd.hpp:140
pinocchio::q0
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorIn1 > & q0
Definition: joint-configuration.hpp:1137
pinocchio::CartesianProductOperationVariantTpl::PINOCCHIO_ALIGNED_STD_VECTOR
PINOCCHIO_ALIGNED_STD_VECTOR(LieGroupGeneric) liegroups
pinocchio::AssignmentOperatorType
AssignmentOperatorType
Definition: fwd.hpp:130
pinocchio::CartesianProductOperationVariantTpl::m_nv
Index m_nv
Definition: cartesian-product-variant.hpp:293
pinocchio::CartesianProductOperationVariantTpl::integrateCoeffWiseJacobian_impl
void integrateCoeffWiseJacobian_impl(const Eigen::MatrixBase< Config_t > &q, const Eigen::MatrixBase< Jacobian_t > &J) const
pinocchio::CartesianProductOperationVariantTpl::lg_nvs
std::vector< Index > lg_nvs
Definition: cartesian-product-variant.hpp:294
pinocchio::CartesianProductOperationVariantTpl::neutral
ConfigVector_t neutral() const
Definition: cartesian-product-variant.hpp:170
pinocchio::CartesianProductOperationVariantTpl::CartesianProductOperationVariantTpl
CartesianProductOperationVariantTpl(const LieGroupGeneric &lg1, const LieGroupGeneric &lg2)
Constructor with two Lie groups.
Definition: cartesian-product-variant.hpp:84
pinocchio::LieGroupBase
Definition: liegroup-base.hpp:44
pinocchio::q
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > & q
Definition: joint-configuration.hpp:1083
pinocchio::CartesianProductOperationVariantTpl::CartesianProductOperationVariantTpl
CartesianProductOperationVariantTpl(const LieGroupGeneric &lg)
Constructor with one single Lie group.
Definition: cartesian-product-variant.hpp:68
pinocchio::v
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > const Eigen::MatrixBase< TangentVectorType > & v
Definition: joint-configuration.hpp:1084
pinocchio::context::Options
@ Options
Definition: context/generic.hpp:45
pinocchio::CartesianProductOperationVariantTpl::operator*=
CartesianProductOperationVariantTpl & operator*=(const LieGroupGeneric &lg)
Append a Lie group to *this.
Definition: cartesian-product-variant.hpp:137
pinocchio::CartesianProductOperationVariantTpl::squaredDistance_impl
Scalar squaredDistance_impl(const Eigen::MatrixBase< ConfigL_t > &q0, const Eigen::MatrixBase< ConfigR_t > &q1) const
pinocchio::traits< CartesianProductOperationVariantTpl< _Scalar, _Options, LieGroupCollectionTpl > >::Scalar
_Scalar Scalar
Definition: cartesian-product-variant.hpp:30
pinocchio::CartesianProductOperationVariantTpl::m_neutral
ConfigVector_t m_neutral
Definition: cartesian-product-variant.hpp:297
pinocchio::CartesianProductOperationVariantTpl::isSameConfiguration_impl
bool isSameConfiguration_impl(const Eigen::MatrixBase< ConfigL_t > &q0, const Eigen::MatrixBase< ConfigR_t > &q1, const Scalar &prec) const
pinocchio::CartesianProductOperationVariantTpl::difference_impl
void difference_impl(const Eigen::MatrixBase< ConfigL_t > &q0, const Eigen::MatrixBase< ConfigR_t > &q1, const Eigen::MatrixBase< Tangent_t > &d) const
pinocchio::CartesianProductOperationVariant
CartesianProductOperationVariantTpl< context::Scalar, context::Options, LieGroupCollectionDefaultTpl > CartesianProductOperationVariant
Definition: cartesian-product-variant.hpp:20
pinocchio::CartesianProductOperationVariantTpl::LieGroupGeneric
LieGroupGenericTpl< LieGroupCollection > LieGroupGeneric
Definition: cartesian-product-variant.hpp:53
pinocchio::q1
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorIn1 > const Eigen::MatrixBase< ConfigVectorIn2 > & q1
Definition: joint-configuration.hpp:1138
pinocchio::CartesianProductOperationVariantTpl::dIntegrate_dq_impl
void dIntegrate_dq_impl(const Eigen::MatrixBase< Config_t > &q, const Eigen::MatrixBase< Tangent_t > &v, const Eigen::MatrixBase< JacobianOut_t > &J, const AssignmentOperatorType op=SETTO) const
pinocchio::CartesianProductOperationVariantTpl::name
std::string name() const
Definition: cartesian-product-variant.hpp:165
pinocchio::CartesianProductOperationVariantTpl::dIntegrateTransport_dq_impl
void dIntegrateTransport_dq_impl(const Eigen::MatrixBase< Config_t > &q, const Eigen::MatrixBase< Tangent_t > &v, const Eigen::MatrixBase< JacobianIn_t > &J_in, const Eigen::MatrixBase< JacobianOut_t > &J_out) const
pinocchio::traits
Common traits structure to fully define base classes for CRTP.
Definition: fwd.hpp:71
pinocchio::CartesianProductOperationVariantTpl::dIntegrate_product_impl
void dIntegrate_product_impl(const Config_t &q, const Tangent_t &v, const JacobianIn_t &Jin, JacobianOut_t &Jout, bool dIntegrateOnTheLeft, const ArgumentPosition arg, const AssignmentOperatorType op) const
liegroup-collection.hpp
pinocchio::CartesianProductOperationVariantTpl::m_name
std::string m_name
Definition: cartesian-product-variant.hpp:295
pinocchio::CartesianProductOperationVariantTpl::LieGroupVariant
LieGroupCollection::LieGroupVariant LieGroupVariant
Definition: cartesian-product-variant.hpp:52
dcrba.NV
NV
Definition: dcrba.py:536
dpendulum.NQ
int NQ
Definition: dpendulum.py:9
pinocchio::CartesianProductOperationVariantTpl::m_nq
Index m_nq
Definition: cartesian-product-variant.hpp:293
liegroup-base.hpp
d
FCL_REAL d
pinocchio::context::Scalar
PINOCCHIO_SCALAR_TYPE Scalar
Definition: context/generic.hpp:42
pinocchio::CartesianProductOperationVariantTpl::LieGroupCollection
LieGroupCollectionTpl< Scalar, Options > LieGroupCollection
Definition: cartesian-product-variant.hpp:51
pinocchio::CartesianProductOperationVariantTpl::isNormalized_impl
bool isNormalized_impl(const Eigen::MatrixBase< Config_t > &qout, const Scalar &prec) const
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27


pinocchio
Author(s):
autogenerated on Sun Dec 22 2024 03:41:06