pinocchio  3.7.0
A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
 
Loading...
Searching...
No Matches
geometry-functors.hpp
1//
2// Copyright (c) 2021 INRIA
3//
4
5#ifndef __pinocchio_python_collision_geometry_functors_hpp__
6#define __pinocchio_python_collision_geometry_functors_hpp__
7
8#include "pinocchio/bindings/python/utils/registration.hpp"
9
10#include "pinocchio/multibody/geometry.hpp"
11
12namespace pinocchio
13{
14 namespace python
15 {
16 namespace bp = boost::python;
17
18 template<typename GeometryFunctor>
19 struct GeometryFunctorPythonVisitor
20 : public boost::python::def_visitor<GeometryFunctorPythonVisitor<GeometryFunctor>>
21 {
22
23 template<class PyClass>
24 void visit(PyClass & cl) const
25 {
26 const std::string class_name = bp::type_id<GeometryFunctor>().name();
27
28 cl.def(bp::init<const GeometryObject &, const GeometryObject &>(
29 bp::args("self", "geometry_object1", "geometry_object2"),
30 (std::string("Constructor of a ") + class_name).c_str()))
31 .def(
32 "run", &GeometryFunctor::run, bp::args("self", "tf1", "tf2", "request", "result"),
33 "Call the function and return the result")
34
35 .def(
36 "getGeometryObject1", &GeometryFunctor::getGeometryObject1,
37 bp::return_value_policy<bp::copy_const_reference>())
38 .def(
39 "getGeometryObject2", &GeometryFunctor::getGeometryObject2,
40 bp::return_value_policy<bp::copy_const_reference>())
41
42 .def("print", &print);
43 }
44
45 static void print(const GeometryFunctor & self)
46 {
47 std::cout << "address #1: " << &self.getGeometryObject1() << std::endl;
48 std::cout << "address #2: " << &self.getGeometryObject2() << std::endl;
49 }
50 };
51
52 } // namespace python
53} // namespace pinocchio
54
55#endif // ifndef __pinocchio_python_collision_geometry_functors_hpp__
Main pinocchio namespace.
Definition treeview.dox:11