constraint-data-generic.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2023 INRIA
3 //
4 
5 #ifndef __pinocchio_algorithm_constraint_data_generic_hpp__
6 #define __pinocchio_algorithm_constraint_data_generic_hpp__
7 
12 
13 namespace pinocchio
14 {
15 
16  template<
17  typename _Scalar,
18  int _Options,
19  template<typename S, int O> class ConstraintCollectionTpl>
20  struct traits<ConstraintDataTpl<_Scalar, _Options, ConstraintCollectionTpl>>
21  {
22  typedef _Scalar Scalar;
23  enum
24  {
25  Options = _Options
26  };
28  };
29 
30  template<
31  typename _Scalar,
32  int _Options,
33  template<typename S, int O> class ConstraintCollectionTpl>
35  : ConstraintDataBase<ConstraintDataTpl<_Scalar, _Options, ConstraintCollectionTpl>>
37  {
39  typedef _Scalar Scalar;
40  enum
41  {
42  Options = _Options
43  };
44 
48 
51  {
52  }
53 
55  : ConstraintDataVariant(cdata_variant)
56  {
57  }
58 
59  template<typename ContraintDataDerived>
62  {
63  BOOST_MPL_ASSERT(
64  (boost::mpl::contains<typename ConstraintDataVariant::types, ContraintDataDerived>));
65  }
66 
68  {
69  return static_cast<ConstraintDataVariant &>(*this);
70  }
71 
73  {
74  return static_cast<const ConstraintDataVariant &>(*this);
75  }
76 
77  template<typename ConstraintDataDerived>
79  {
80  return ::pinocchio::isEqual(*this, other.derived());
81  }
82 
83  bool isEqual(const ConstraintDataTpl & other) const
84  {
85  return /*Base::isEqual(other) &&*/ toVariant() == other.toVariant();
86  }
87 
88  bool operator==(const ConstraintDataTpl & other) const
89  {
90  return isEqual(other);
91  }
92 
93  bool operator!=(const ConstraintDataTpl & other) const
94  {
95  return !(*this == other);
96  }
97  };
98 
99  template<
100  typename ConstraintDataDerived,
101  typename Scalar,
102  int Options,
103  template<typename S, int O> class ConstraintCollectionTpl>
107  {
108  return data2 == data1.derived();
109  }
110 
111 } // namespace pinocchio
112 
113 #endif // ifndef __pinocchio_algorithm_constraint_data_generic_hpp__
pinocchio::ConstraintCollectionTpl
Definition: algorithm/constraints/fwd.hpp:19
pinocchio::ConstraintDataTpl::ConstraintDataTpl
ConstraintDataTpl(const ConstraintDataVariant &cdata_variant)
Definition: constraint-data-generic.hpp:54
pinocchio::ConstraintDataTpl::ConstraintCollection
ConstraintCollectionTpl< Scalar, Options > ConstraintCollection
Definition: constraint-data-generic.hpp:45
pinocchio::ConstraintCollectionTpl::ConstraintDataVariant
boost::variant< RigidConstraintData > ConstraintDataVariant
Definition: algorithm/constraints/fwd.hpp:31
pinocchio::Options
Options
Definition: joint-configuration.hpp:1082
pinocchio::operator==
bool operator==(const ConstraintDataBase< ConstraintDataDerived > &data1, const ConstraintDataTpl< Scalar, Options, ConstraintCollectionTpl > &data2)
Definition: constraint-data-generic.hpp:104
pinocchio::ConstraintDataTpl::isEqual
bool isEqual(const ConstraintDataBase< ConstraintDataDerived > &other) const
Definition: constraint-data-generic.hpp:78
pinocchio::ConstraintDataTpl::ConstraintModelVariant
ConstraintCollection::ConstraintModelVariant ConstraintModelVariant
Definition: constraint-data-generic.hpp:47
pinocchio::python::Scalar
context::Scalar Scalar
Definition: admm-solver.cpp:29
pinocchio::ConstraintDataTpl::Base
ConstraintDataBase< ConstraintModelTpl< _Scalar, _Options, ConstraintCollectionTpl > > Base
Definition: constraint-data-generic.hpp:38
pinocchio::ConstraintDataTpl::operator==
bool operator==(const ConstraintDataTpl &other) const
Definition: constraint-data-generic.hpp:88
pinocchio::ConstraintDataTpl::Scalar
_Scalar Scalar
Definition: constraint-data-generic.hpp:39
pinocchio::traits< ConstraintDataTpl< _Scalar, _Options, ConstraintCollectionTpl > >::Scalar
_Scalar Scalar
Definition: constraint-data-generic.hpp:22
pinocchio::ConstraintDataTpl::ConstraintDataTpl
ConstraintDataTpl(const ConstraintDataBase< ContraintDataDerived > &cdata)
Definition: constraint-data-generic.hpp:60
pinocchio::ConstraintDataTpl
Definition: constraint-data-generic.hpp:34
constraint-model-visitor.hpp
pinocchio::ConstraintDataBase< ConstraintDataTpl< _Scalar, _Options, ConstraintCollectionTpl > >::derived
ConstraintDataTpl< _Scalar, _Options, ConstraintCollectionTpl > & derived()
Definition: constraint-data-base.hpp:19
pinocchio::traits< ConstraintDataTpl< _Scalar, _Options, ConstraintCollectionTpl > >::ConstraintModel
ConstraintModelTpl< Scalar, Options, ConstraintCollectionTpl > ConstraintModel
Definition: constraint-data-generic.hpp:27
pinocchio::ConstraintDataTpl::ConstraintDataTpl
ConstraintDataTpl()
Definition: constraint-data-generic.hpp:49
pinocchio::ConstraintDataTpl::toVariant
ConstraintDataVariant & toVariant()
Definition: constraint-data-generic.hpp:67
pinocchio::ConstraintModelTpl
Definition: constraint-model-generic.hpp:34
pinocchio::ConstraintDataTpl::toVariant
const ConstraintDataVariant & toVariant() const
Definition: constraint-data-generic.hpp:72
pinocchio::ConstraintDataTpl::operator!=
bool operator!=(const ConstraintDataTpl &other) const
Definition: constraint-data-generic.hpp:93
fwd.hpp
pinocchio::ConstraintCollectionTpl::ConstraintModelVariant
boost::variant< RigidConstraintModel > ConstraintModelVariant
Definition: algorithm/constraints/fwd.hpp:30
constraint-model-base.hpp
pinocchio::traits
Common traits structure to fully define base classes for CRTP.
Definition: fwd.hpp:71
pinocchio::ConstraintDataTpl::Options
@ Options
Definition: constraint-data-generic.hpp:42
pinocchio::ConstraintDataTpl::ConstraintDataVariant
ConstraintCollection::ConstraintDataVariant ConstraintDataVariant
Definition: constraint-data-generic.hpp:46
isEqual
virtual bool isEqual(const CollisionGeometry &other) const=0
pinocchio::ConstraintDataBase
Definition: constraint-data-base.hpp:14
pinocchio::ConstraintDataTpl::isEqual
bool isEqual(const ConstraintDataTpl &other) const
Definition: constraint-data-generic.hpp:83
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27
constraint-data-base.hpp


pinocchio
Author(s):
autogenerated on Mon Dec 16 2024 03:41:00