bindings/python/collision/pool/geometry.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2021-2022 INRIA
3 //
4 
5 #ifndef __pinocchio_python_collision_pool_geometry_hpp__
6 #define __pinocchio_python_collision_pool_geometry_hpp__
7 
8 #include <boost/python/overloads.hpp>
9 
11 #include <eigenpy/memory.hpp>
12 #include <eigenpy/exception.hpp>
13 
16 
19 
20 #if EIGENPY_VERSION_AT_MOST(2, 8, 1)
22 #endif
23 
24 namespace pinocchio
25 {
26  namespace python
27  {
28  namespace bp = boost::python;
29 
30  template<typename GeometryPool>
32  : public bp::def_visitor<GeometryPoolPythonVisitor<GeometryPool>>
33  {
34 
35  typedef typename GeometryPool::Base Base;
36  typedef typename GeometryPool::Model Model;
41 
42  /* --- Exposing C++ API to python through the handler ----------------- */
43  template<class PyClass>
44  void visit(PyClass & cl) const
45  {
46  cl.def(bp::init<const Model &, const GeometryModel &, bp::optional<size_t>>(
47  bp::args("self", "model", "geometry_model", "size"), "Default constructor."))
48  .def(bp::init<const GeometryPool &>(bp::args("self", "other"), "Copy constructor."))
49 
50  .def(
51  "getGeometryModel",
53  bp::args("self", "index"), "Return a specific geometry model.",
54  bp::return_internal_reference<>())
55  .def(
56  "getGeometryModels",
58  bp::arg("self"), "Returns the geometry model vector.",
59  bp::return_internal_reference<>())
60 
61  .def(
62  "getGeometryData",
64  bp::args("self", "index"), "Return a specific geometry data.",
65  bp::return_internal_reference<>())
66  .def(
67  "getGeometryDatas",
69  bp::arg("self"), "Returns the geometry data vector.", bp::return_internal_reference<>())
70 
71  .def(
72  "sync", &GeometryPool::sync, bp::args("geometry_model", "geometry_indexes"),
73  "Synchronize the internal geometry models with the input geometry for all given "
74  "geometry indexes.")
75 
76  .def(
77  "update", (void(GeometryPool::*)(const GeometryData &)) & GeometryPool::update,
78  bp::args("self", "geometry_data"),
79  "Update all the geometry datas with the input geometry data value.");
80  }
81 
82  static void expose()
83  {
84 
85  bp::class_<GeometryPool, bp::bases<Base>>(
86  "GeometryPool",
87  "Pool containing a model + a geometry_model and several datas for parallel computations",
88  bp::no_init)
91 
94  }
95  };
96  } // namespace python
97 } // namespace pinocchio
98 
99 #endif // ifnded __pinocchio_python_collision_pool_geometry_hpp__
init
void init(bool compute_local_aabb=true)
pinocchio::GeometryPoolTpl::getGeometryModels
const GeometryModelVector & getGeometryModels() const
Returns the vector of Geometry Model.
Definition: multibody/pool/geometry.hpp:129
pinocchio::GeometryPoolTpl::getGeometryData
const GeometryData & getGeometryData(const size_t index) const
Returns the geometry_data at given index.
Definition: multibody/pool/geometry.hpp:99
boost::python
pinocchio::python::GeometryPoolPythonVisitor::GeometryModelVector
GeometryPool::GeometryModelVector GeometryModelVector
Definition: bindings/python/collision/pool/geometry.hpp:39
pinocchio::python::GeometryPoolPythonVisitor::GeometryDataVector
GeometryPool::GeometryDataVector GeometryDataVector
Definition: bindings/python/collision/pool/geometry.hpp:40
pinocchio::GeometryPoolTpl::GeometryModelVector
std::vector< GeometryModel, Eigen::aligned_allocator< GeometryModel > > GeometryModelVector
Definition: multibody/pool/geometry.hpp:33
pinocchio::python::GeometryPoolPythonVisitor::expose
static void expose()
Definition: bindings/python/collision/pool/geometry.hpp:82
pinocchio::python::GeometryPoolPythonVisitor::Model
GeometryPool::Model Model
Definition: bindings/python/collision/pool/geometry.hpp:36
geometry.hpp
eigen-to-python.hpp
exception.hpp
pinocchio::GeometryData
Definition: multibody/geometry.hpp:233
def
void def(const char *name, Func func)
pinocchio::GeometryPoolTpl::update
virtual void update(const GeometryData &geometry_data_to_copy)
Update the geometry datas with the new value.
Definition: multibody/pool/geometry.hpp:164
pinocchio::python::GeometryPoolPythonVisitor::GeometryModel
GeometryPool::GeometryModel GeometryModel
Definition: bindings/python/collision/pool/geometry.hpp:37
EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION
#define EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION(...)
pinocchio::GeometryPoolTpl::Model
Base::Model Model
Definition: multibody/pool/geometry.hpp:26
pinocchio::python::GeometryPoolPythonVisitor::GeometryData
GeometryPool::GeometryData GeometryData
Definition: bindings/python/collision/pool/geometry.hpp:38
python
pinocchio::GeometryPoolTpl::Base
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef ModelPoolTpl< _Scalar, _Options, JointCollectionTpl > Base
Definition: multibody/pool/geometry.hpp:19
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::GeometryPoolPythonVisitor::Base
GeometryPool::Base Base
Definition: bindings/python/collision/pool/geometry.hpp:35
pinocchio::GeometryPoolTpl::getGeometryModel
const GeometryModel & getGeometryModel(const size_t index) const
Returns the geometry_model at given index.
Definition: multibody/pool/geometry.hpp:81
copyable.hpp
pinocchio::GeometryPoolTpl::GeometryDataVector
std::vector< GeometryData, Eigen::aligned_allocator< GeometryData > > GeometryDataVector
Definition: multibody/pool/geometry.hpp:34
pinocchio::GeometryPoolTpl::getGeometryDatas
const GeometryDataVector & getGeometryDatas() const
Returns the vector of Geometry Data.
Definition: multibody/pool/geometry.hpp:117
pinocchio::python::GeometryPoolPythonVisitor::visit
void visit(PyClass &cl) const
Definition: bindings/python/collision/pool/geometry.hpp:44
eigenpy::StdVectorPythonVisitor::expose
static void expose(const std::string &class_name, const bp::def_visitor< DerivedVisitor > &visitor)
check.hpp
cl
cl
memory.hpp
pinocchio::GeometryModel
Definition: multibody/geometry.hpp:50
pinocchio::GeometryPoolTpl::sync
void sync(const GeometryModel &geometry_model, const std::vector< GeomIndex > &geometry_indexes)
Synchronize the internal geometry models with the input geometry for all given geometry indexes by cl...
Definition: multibody/pool/geometry.hpp:145
std-vector.hpp
pinocchio::python::GeometryPoolPythonVisitor
Definition: bindings/python/collision/pool/geometry.hpp:31
pinocchio::GeometryPoolTpl
Definition: multibody/pool/fwd.hpp:24
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27


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