bindings/python/collision/broadphase-manager-base.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2022 INRIA
3 //
4 
5 #ifndef __pinocchio_python_collision_broadphase_manager_base_hpp__
6 #define __pinocchio_python_collision_broadphase_manager_base_hpp__
7 
9 
11 
12 namespace pinocchio
13 {
14  namespace python
15  {
16  namespace bp = boost::python;
17 
18  template<typename Derived>
20  : public bp::def_visitor<BroadPhaseManagerBasePythonVisitor<Derived>>
21  {
22  typedef Derived Self;
23 
24  typedef typename Derived::GeometryModel GeometryModel;
25  typedef typename Derived::Model Model;
26 
27  static Model & getModel(const Self & self)
28  {
29  return const_cast<Model &>(self.getModel());
30  }
31 
32  static GeometryModel & getGeometryModel(const Self & self)
33  {
34  return const_cast<GeometryModel &>(self.getGeometryModel());
35  }
36 
37  /* --- Exposing C++ API to python through the handler ----------------- */
38  template<class PyClass>
39  void visit(PyClass & cl) const
40  {
41 
42  cl.def(
43  "getModel", getModel, bp::arg("self"), "Returns the related model.",
44  bp::return_internal_reference<>())
45  .def(
46  "getGeometryModel", getGeometryModel, bp::arg("self"),
47  "Returns the related geometry model.", bp::return_internal_reference<>())
48  .def(
49  "getGeometryData", (GeometryData & (Self::*)()) & Self::getGeometryData,
50  bp::arg("self"), "Returns the related geometry data.",
51  bp::return_internal_reference<>())
52 
53  .def(
54  "check", (bool(Self::*)() const) & Self::check, bp::arg("self"),
55  "Check whether the base broad phase manager is aligned with the current "
56  "collision_objects.")
57  .def(
58  "check", (bool(Self::*)(CollisionCallBackBase *) const) & Self::check,
59  bp::args("self", "callback"), "Check whether the callback is inline with *this.")
60 
61  .def(
62  "update", (void(Self::*)(const bool)) & Self::update,
63  (bp::arg("self"), bp::arg("compute_local_aabb") = false),
64  "Update the manager from the current geometry positions and update the underlying "
65  "FCL broad phase manager.")
66  .def(
67  "update", (void(Self::*)(GeometryData * geom_data_new)) & Self::update,
68  (bp::arg("self"), bp::arg("geom_data_new")),
69  "Update the manager with a new geometry data.", bp::with_custodian_and_ward<1, 2>())
70 
71  .def(
72  "collide",
73  (bool(Self::*)(CollisionObject &, CollisionCallBackBase *) const) & Self::collide,
74  bp::args("self", "collision_object", "callback"),
75  "Performs collision test between one object and all the objects belonging to the "
76  "manager.")
77  .def(
78  "collide", (bool(Self::*)(CollisionCallBackBase *) const) & Self::collide,
79  bp::args("self", "callback"),
80  "Performs collision test for the objects belonging to the manager.")
81  .def(
82  "collide", (bool(Self::*)(Self &, CollisionCallBackBase *) const) & Self::collide,
83  bp::args("self", "other_manager", "callback"),
84  "Performs collision test with objects belonging to another manager.");
85  }
86  };
87 
88  } // namespace python
89 } // namespace pinocchio
90 
91 #endif // ifndef __pinocchio_python_collision_broadphase_manager_base_hpp__
boost::python
pinocchio::python::BroadPhaseManagerBasePythonVisitor::getModel
static Model & getModel(const Self &self)
Definition: bindings/python/collision/broadphase-manager-base.hpp:27
pinocchio::python::BroadPhaseManagerBasePythonVisitor
Definition: bindings/python/collision/broadphase-manager-base.hpp:19
CollisionObject
CollisionObject(const shared_ptr< CollisionGeometry > &cgeom_, bool compute_local_aabb=true)
pinocchio::python::BroadPhaseManagerBasePythonVisitor::visit
void visit(PyClass &cl) const
Definition: bindings/python/collision/broadphase-manager-base.hpp:39
eigen-to-python.hpp
pinocchio::GeometryData
Definition: multibody/geometry.hpp:233
pinocchio::python::context::Model
ModelTpl< Scalar, Options > Model
Definition: bindings/python/context/generic.hpp:63
pinocchio::CollisionCallBackBase
Interface for Pinocchio collision callback functors.
Definition: broadphase-callbacks.hpp:19
pinocchio::python::BroadPhaseManagerBasePythonVisitor::Self
Derived Self
Definition: bindings/python/collision/broadphase-manager-base.hpp:22
pinocchio::python::BroadPhaseManagerBasePythonVisitor::Model
Derived::Model Model
Definition: bindings/python/collision/broadphase-manager-base.hpp:25
python
pinocchio::python::BroadPhaseManagerBasePythonVisitor::getGeometryModel
static GeometryModel & getGeometryModel(const Self &self)
Definition: bindings/python/collision/broadphase-manager-base.hpp:32
pinocchio::python::BroadPhaseManagerBasePythonVisitor::GeometryModel
Derived::GeometryModel GeometryModel
Definition: bindings/python/collision/broadphase-manager-base.hpp:24
update
AABB & update(const Vec3f &a, const Vec3f &b)
broadphase-manager-base.hpp
cl
cl
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27


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