expose-broadphase-callbacks.cpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2022 INRIA
3 //
4 
5 #include <eigenpy/eigenpy.hpp>
6 
8 
9 namespace bp = boost::python;
10 
11 namespace pinocchio
12 {
13  namespace python
14  {
15 
18  , bp::wrapper<CollisionCallBackBase>
19  {
21 
22  bool stop() const
23  {
24  return this->get_override("stop")();
25  }
26  void done()
27  {
28  if (bp::override done = this->get_override("done"))
29  done();
30  Base::done();
31  }
32 
33  void done_default()
34  {
35  return this->Base::done();
36  }
37 
38  static void expose()
39  {
40  bp::class_<
41  CollisionCallBackBaseWrapper, bp::bases<hpp::fcl::CollisionCallBackBase>,
42  boost::noncopyable>("CollisionCallBackBase", bp::no_init)
43  .def(
44  "getGeometryModel", &CollisionCallBackDefault::getGeometryModel, bp::arg("self"),
45  bp::return_value_policy<bp::copy_const_reference>())
46  .def(
47  "getGeometryData",
50  bp::arg("self"), bp::return_internal_reference<>())
51 
52  .def_readonly(
54  "Whether there is a collision or not.")
55  .def_readonly(
57  "Whether the callback is used in an accumulate mode where several collide "
58  "methods are called successively.")
59 
60  .def(
61  "stop", bp::pure_virtual(&Base::stop), bp::arg("self"),
62  "If true, the stopping criteria related to the collision callback has been met and "
63  "one can stop.")
64  .def(
66  "Callback method called after the termination of a collisition detection algorithm.");
67  }
68  };
69 
71  {
73 
74  bp::class_<CollisionCallBackDefault, bp::bases<CollisionCallBackBase>>(
75  "CollisionCallBackDefault", bp::no_init)
76  .def(bp::init<const GeometryModel &, GeometryData &, bp::optional<bool>>(
77  bp::args("self", "geometry_model", "geometry_data", "stopAtFirstCollision"),
78  "Default constructor from a given GeometryModel and a GeometryData")
79  [bp::with_custodian_and_ward<1, 2>(), bp::with_custodian_and_ward<1, 3>()])
80 
81  .def_readwrite(
82  "stopAtFirstCollision", &CollisionCallBackDefault::stopAtFirstCollision,
83  "Whether to stop or not when localizing a first collision")
84  .def_readonly(
85  "collisionPairIndex", &CollisionCallBackDefault::collisionPairIndex,
86  "The collision index of the first pair in collision")
87  .def_readonly(
88  "count", &CollisionCallBackDefault::count, "Number of visits of the collide method");
89  }
90 
91  } // namespace python
92 } // namespace pinocchio
init
void init(bool compute_local_aabb=true)
pinocchio::CollisionCallBackDefault::stopAtFirstCollision
bool stopAtFirstCollision
Whether to stop or not when localizing a first collision.
Definition: broadphase-callbacks.hpp:185
boost::python
pinocchio::python::CollisionCallBackBaseWrapper
Definition: expose-broadphase-callbacks.cpp:16
eigenpy.hpp
pinocchio::CollisionCallBackBase::accumulate
bool accumulate
Whether the callback is used in an accumulate mode where several collide methods are called successiv...
Definition: broadphase-callbacks.hpp:63
pinocchio::python::CollisionCallBackBaseWrapper::Base
CollisionCallBackBase Base
Definition: expose-broadphase-callbacks.cpp:20
pinocchio::python::exposeBroadphaseCallbacks
void exposeBroadphaseCallbacks()
Definition: expose-broadphase-callbacks.cpp:70
broadphase-callbacks.hpp
pinocchio::CollisionCallBackDefault
Definition: broadphase-callbacks.hpp:66
pinocchio::CollisionCallBackBase::getGeometryModel
const GeometryModel & getGeometryModel() const
Definition: broadphase-callbacks.hpp:29
pinocchio::python::CollisionCallBackBaseWrapper::done
void done()
Callback method called after the termination of a collisition detection algorithm....
Definition: expose-broadphase-callbacks.cpp:26
pinocchio::GeometryData
Definition: multibody/geometry.hpp:233
def
void def(const char *name, Func func)
pinocchio::CollisionCallBackBase
Interface for Pinocchio collision callback functors.
Definition: broadphase-callbacks.hpp:19
pinocchio::python::CollisionCallBackBaseWrapper::done_default
void done_default()
Definition: expose-broadphase-callbacks.cpp:33
pinocchio::CollisionCallBackBase::stop
virtual bool stop() const =0
If true, the stopping criteria related to the collision callback has been met and one can stop.
python
pinocchio::CollisionCallBackDefault::count
size_t count
Number of visits of the collide method.
Definition: broadphase-callbacks.hpp:191
pinocchio::CollisionCallBackDefault::collisionPairIndex
PairIndex collisionPairIndex
The collision index of the first pair in collision.
Definition: broadphase-callbacks.hpp:188
pinocchio::python::CollisionCallBackBaseWrapper::expose
static void expose()
Definition: expose-broadphase-callbacks.cpp:38
pinocchio::GeometryModel
Definition: multibody/geometry.hpp:50
pinocchio::CollisionCallBackBase::collision
bool collision
Whether there is a collision or not.
Definition: broadphase-callbacks.hpp:59
pinocchio::CollisionCallBackBase::getGeometryData
const GeometryData & getGeometryData() const
Definition: broadphase-callbacks.hpp:33
pinocchio::CollisionCallBackBase::done
virtual void done()
Callback method called after the termination of a collisition detection algorithm....
Definition: broadphase-callbacks.hpp:48
pinocchio::python::CollisionCallBackBaseWrapper::stop
bool stop() const
If true, the stopping criteria related to the collision callback has been met and one can stop.
Definition: expose-broadphase-callbacks.cpp:22
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27


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