bindings/python/algorithm/constraints/coulomb-friction-cone.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2022 INRIA
3 //
4 
5 #ifndef __pinocchio_python_algorithm_constraints_coulomb_friction_cone_hpp__
6 #define __pinocchio_python_algorithm_constraints_coulomb_friction_cone_hpp__
7 
9 
12 
13 namespace pinocchio
14 {
15  namespace python
16  {
17  namespace bp = boost::python;
18 
19  template<typename CoulombFrictionCone>
21  : public boost::python::def_visitor<CoulombFrictionConePythonVisitor<CoulombFrictionCone>>
22  {
25 
26  template<class PyClass>
27  void visit(PyClass & cl) const
28  {
29  cl.def(bp::init<const Scalar &>(bp::args("self", "mu"), "Default constructor"))
30  .def(bp::init<const Self &>(bp::args("self", "other"), "Copy constructor"))
31 
32  .def_readwrite("mu", &Self::mu, "Friction coefficient.")
33 
34  .def(
35  "isInside", &Self::template isInside<context::Vector3s>, bp::args("self", "f"),
36  "Check whether a vector x lies within the cone.")
37 
38  .def(
39  "project", &Self::template project<context::Vector3s>, bp::args("self", "f"),
40  "Normal projection of a vector f onto the cone.")
41  .def(
42  "weightedProject", &Self::template weightedProject<context::Vector3s>,
43  bp::args("self", "f", "R"), "Weighted projection of a vector f onto the cone.")
44  .def(
45  "computeNormalCorrection", &Self::template computeNormalCorrection<context::Vector3s>,
46  bp::args("self", "v"),
47  "Compute the complementary shift associted to the Coulomb friction cone for "
48  "complementarity satisfaction in complementary problems.")
49  .def(
50  "computeRadialProjection", &Self::template computeRadialProjection<context::Vector3s>,
51  bp::args("self", "f"),
52  "Compute the radial projection associted to the Coulomb friction cone.")
53 
54  .def("dual", &Self::dual, bp::arg("self"), "Returns the dual cone associated to this")
55 
56  .def("dim", Self::dim, "Returns the dimension of the cone.")
57  .staticmethod("dim")
58 
59 #ifndef PINOCCHIO_PYTHON_SKIP_COMPARISON_OPERATIONS
60  .def(bp::self == bp::self)
61  .def(bp::self != bp::self)
62 #endif
63  ;
64  }
65 
66  static void expose()
67  {
68  bp::class_<CoulombFrictionCone>(
69  "CoulombFrictionCone", "3d Coulomb friction cone.\n", bp::no_init)
71  // .def(CastVisitor<CoulombFrictionCone>())
72  // .def(ExposeConstructorByCastVisitor<CoulombFrictionCone,::pinocchio::CoulombFrictionCone>())
74  }
75  };
76 
77  template<typename DualCoulombFrictionCone>
79  : public boost::python::def_visitor<
80  DualCoulombFrictionConePythonVisitor<DualCoulombFrictionCone>>
81  {
84 
85  template<class PyClass>
86  void visit(PyClass & cl) const
87  {
88  cl.def(bp::init<const Scalar &>(bp::args("self", "mu"), "Default constructor"))
89  .def(bp::init<const Self &>(bp::args("self", "other"), "Copy constructor"))
90 
91  .def_readwrite("mu", &Self::mu, "Friction coefficient.")
92 
93  .def(
94  "isInside", &Self::template isInside<context::Vector3s>, bp::args("self", "v"),
95  "Check whether a vector x lies within the cone.")
96 
97  .def(
98  "project", &Self::template project<context::Vector3s>, bp::args("self", "v"),
99  "Project a vector v onto the cone.")
100 
101  .def("dual", &Self::dual, bp::arg("self"), "Returns the dual cone associated to this.")
102 
103  .def("dim", Self::dim, "Returns the dimension of the cone.")
104  .staticmethod("dim")
105 
106 #ifndef PINOCCHIO_PYTHON_SKIP_COMPARISON_OPERATIONS
107  .def(bp::self == bp::self)
108  .def(bp::self != bp::self)
109 #endif
110  ;
111  }
112 
113  static void expose()
114  {
115  bp::class_<DualCoulombFrictionCone>(
116  "DualCoulombFrictionCone", "Dual cone of the 3d Coulomb friction cone.\n", bp::no_init)
118  // .def(CastVisitor<DualCoulombFrictionCone>())
119  // .def(ExposeConstructorByCastVisitor<DualCoulombFrictionCone,::pinocchio::DualCoulombFrictionCone>())
121  }
122  };
123 
124  } // namespace python
125 } // namespace pinocchio
126 
127 #endif // ifndef __pinocchio_python_algorithm_constraints_coulomb_friction_cone_hpp__
boost::python
pinocchio::python::CoulombFrictionConePythonVisitor::Scalar
CoulombFrictionCone::Scalar Scalar
Definition: bindings/python/algorithm/constraints/coulomb-friction-cone.hpp:23
pinocchio::CoulombFrictionConeTpl
&#160;
Definition: algorithm/constraints/coulomb-friction-cone.hpp:20
pinocchio::python::DualCoulombFrictionConePythonVisitor
Definition: bindings/python/algorithm/constraints/coulomb-friction-cone.hpp:78
pinocchio::python::DualCoulombFrictionConePythonVisitor::Scalar
DualCoulombFrictionCone::Scalar Scalar
Definition: bindings/python/algorithm/constraints/coulomb-friction-cone.hpp:82
pinocchio::python::DualCoulombFrictionConePythonVisitor::visit
void visit(PyClass &cl) const
Definition: bindings/python/algorithm/constraints/coulomb-friction-cone.hpp:86
pinocchio::python::CoulombFrictionConePythonVisitor
Definition: bindings/python/algorithm/constraints/coulomb-friction-cone.hpp:20
pinocchio::python::CoulombFrictionConePythonVisitor::expose
static void expose()
Definition: bindings/python/algorithm/constraints/coulomb-friction-cone.hpp:66
pinocchio::DualCoulombFrictionConeTpl::mu
Scalar mu
Definition: algorithm/constraints/coulomb-friction-cone.hpp:290
coulomb-friction-cone.hpp
pinocchio::python::CoulombFrictionConePythonVisitor::Self
CoulombFrictionCone Self
Definition: bindings/python/algorithm/constraints/coulomb-friction-cone.hpp:24
pinocchio::DualCoulombFrictionConeTpl
&#160;
Definition: algorithm/constraints/coulomb-friction-cone.hpp:16
pinocchio::python::DualCoulombFrictionConePythonVisitor::expose
static void expose()
Definition: bindings/python/algorithm/constraints/coulomb-friction-cone.hpp:113
pinocchio::DualCoulombFrictionConeTpl::dual
DualCone dual() const
Returns the dual cone associated to this. ///.
Definition: algorithm/constraints/coulomb-friction-cone.hpp:284
cast.hpp
pinocchio::CoulombFrictionConeTpl::mu
Scalar mu
Definition: algorithm/constraints/coulomb-friction-cone.hpp:197
python
pinocchio::python::CopyableVisitor
Add the Python method copy to allow a copy of this by calling the copy constructor.
Definition: copyable.hpp:21
pinocchio::python::CoulombFrictionConePythonVisitor::visit
void visit(PyClass &cl) const
Definition: bindings/python/algorithm/constraints/coulomb-friction-cone.hpp:27
copyable.hpp
cl
cl
pinocchio::python::DualCoulombFrictionConePythonVisitor::Self
DualCoulombFrictionCone Self
Definition: bindings/python/algorithm/constraints/coulomb-friction-cone.hpp:83
pinocchio::DualCoulombFrictionConeTpl::Scalar
_Scalar Scalar
Definition: algorithm/constraints/coulomb-friction-cone.hpp:204
pinocchio::CoulombFrictionConeTpl::Scalar
_Scalar Scalar
Definition: algorithm/constraints/coulomb-friction-cone.hpp:22
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27


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