4 #include <pybind11/pybind11.h> 6 #include <boost/python.hpp> 10 #define JOINT_MODEL_COLLECTION ::pinocchio::JointCollectionDefaultTpl 15 std::cout <<
"make_model: " <<
reinterpret_cast<intptr_t
>(
model) << std::endl;
28 std::cout << &m <<
'\n' << m << std::endl;
29 return reinterpret_cast<intptr_t
>(&m);
32 void test1(
int i) { std::cout <<
"no conversion: " <<
' ' << i << std::endl; }
34 std::cout <<
"testModel1: " << &model << std::endl;
35 model.
name =
"testModel1: I modified the model name";
38 std::cout <<
"testModel2: " << &model <<
' ' << i << std::endl;
39 model.
name =
"testModel2: I modified the model name";
40 return reinterpret_cast<intptr_t
>(&
model);
43 std::cout <<
"testModel3: " << &model <<
' ' << i << std::endl;
44 return reinterpret_cast<intptr_t
>(&
model);
48 testModel1(pinocchio::python::from<pinocchio::Model&>(model));
54 using namespace pybind11::literals;
56 pybind11::module::import(
"pinocchio");
63 pybind11::return_value_policy::reference);
65 pybind11::return_value_policy::reference);
77 pybind11::module no_wrapper =
m.def_submodule(
"no_wrapper");
PYBIND11_MODULE(cpp2pybind11, m)
internal::function_wrapper< R(*)(Args...)> make_pybind11_function(R(*func)(Args...))
Creates a function wrapper.
pinocchio::SE3 multiply_se3(pinocchio::SE3 const &a, pinocchio::SE3 const &b)
pinocchio::Model * make_model()
pinocchio::Model * return_same_model_nocopy(pinocchio::Model &m)
intptr_t testModel2(pinocchio::Model &model, int i)
std::string name
Model name;.
pinocchio::Model & return_same_model_copy(pinocchio::Model &m)
intptr_t testModel3(pinocchio::Model const &model, int i)
void testModel1(pinocchio::Model &model)
void testModel_manual(pybind11::object model)
py::object default_arg(T t)