pinocchio 4.1.0
A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
Loading...
Searching...
No Matches
broadphase-manager-base.hpp
1//
2// Copyright (c) 2022 INRIA
3//
4
5#pragma once
6
7#include "pinocchio/collision/broadphase-manager-base.hpp"
8
9#include <eigenpy/eigen-to-python.hpp>
10
11namespace pinocchio
12{
13 namespace python
14 {
15 namespace bp = boost::python;
16
17 template<typename Derived>
19 : public bp::def_visitor<BroadPhaseManagerBasePythonVisitor<Derived>>
20 {
21 typedef Derived Self;
22
23 typedef typename Derived::GeometryModel GeometryModel;
24 typedef typename Derived::Model Model;
25
26 static Model & getModel(const Self & self)
27 {
28 return const_cast<Model &>(self.getModel());
29 }
30
31 static GeometryModel & getGeometryModel(const Self & self)
32 {
33 return const_cast<GeometryModel &>(self.getGeometryModel());
34 }
35
36 /* --- Exposing C++ API to python through the handler ----------------- */
37 template<class PyClass>
38 void visit(PyClass & cl) const
39 {
40
41 cl.def(
42 "getModel", getModel, bp::arg("self"), "Returns the related model.",
43 bp::return_internal_reference<>())
44 .def(
45 "getGeometryModel", getGeometryModel, bp::arg("self"),
46 "Returns the related geometry model.", bp::return_internal_reference<>())
47 .def(
48 "getGeometryData", (GeometryData & (Self::*)()) & Self::getGeometryData,
49 bp::arg("self"), "Returns the related geometry data.",
50 bp::return_internal_reference<>())
51
52 .def(
53 "check", (bool (Self::*)() const) & Self::check, bp::arg("self"),
54 "Check whether the base broad phase manager is aligned with the current "
55 "collision_objects.")
56 .def(
57 "check", (bool (Self::*)(CollisionCallBackBase *) const) & Self::check,
58 bp::args("self", "callback"), "Check whether the callback is inline with *this.")
59
60 .def(
61 "update", (void (Self::*)(const bool))&Self::update,
62 (bp::arg("self"), bp::arg("compute_local_aabb") = false),
63 "Update the manager from the current geometry positions and update the underlying "
64 "coal broad phase manager.")
65 .def(
66 "update", (void (Self::*)(GeometryData * geom_data_new))&Self::update,
67 (bp::arg("self"), bp::arg("geom_data_new")),
68 "Update the manager with a new geometry data.", bp::with_custodian_and_ward<1, 2>())
69
70 .def(
71 "collide",
72 (bool (Self::*)(CollisionObject &, CollisionCallBackBase *) const) & Self::collide,
73 bp::args("self", "collision_object", "callback"),
74 "Performs collision test between one object and all the objects belonging to the "
75 "manager.")
76 .def(
77 "collide", (bool (Self::*)(CollisionCallBackBase *) const) & Self::collide,
78 bp::args("self", "callback"),
79 "Performs collision test for the objects belonging to the manager.")
80 .def(
81 "collide", (bool (Self::*)(Self &, CollisionCallBackBase *) const) & Self::collide,
82 bp::args("self", "other_manager", "callback"),
83 "Performs collision test with objects belonging to another manager.");
84 }
85 };
86
87 } // namespace python
88} // namespace pinocchio
Main pinocchio namespace.
Definition treeview.dox:11