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