From f2f6237c3cd4417dabac29d3d42654080d8791e0 Mon Sep 17 00:00:00 2001 From: Giulio Romualdi Date: Sat, 6 Nov 2021 14:50:26 +0100 Subject: [PATCH] Implement pybind11 type_caster for iDynTree core types --- bindings/pybind11/CMakeLists.txt | 3 +- bindings/pybind11/idyntree_type_caster.h | 224 +++++++++++++++++++++++ 2 files changed, 226 insertions(+), 1 deletion(-) create mode 100644 bindings/pybind11/idyntree_type_caster.h diff --git a/bindings/pybind11/CMakeLists.txt b/bindings/pybind11/CMakeLists.txt index 898021d2364..ba500d7dec7 100644 --- a/bindings/pybind11/CMakeLists.txt +++ b/bindings/pybind11/CMakeLists.txt @@ -4,7 +4,8 @@ pybind11_add_module(pybind11_idyntree SYSTEM idyntree.cpp error_utilities.h error_utilities.cpp idyntree_model.h idyntree_model.cpp idyntree_sensors.h idyntree_sensors.cpp - idyntree_modelio_urdf.h idyntree_modelio_urdf.cpp) + idyntree_modelio_urdf.h idyntree_modelio_urdf.cpp + idyntree_type_caster.h) target_link_libraries(pybind11_idyntree PUBLIC idyntree-core idyntree-model diff --git a/bindings/pybind11/idyntree_type_caster.h b/bindings/pybind11/idyntree_type_caster.h new file mode 100644 index 00000000000..5be9cb1330a --- /dev/null +++ b/bindings/pybind11/idyntree_type_caster.h @@ -0,0 +1,224 @@ +#ifndef IDYNTREE_PYBIND11_IDYNTREE_TYPE_CASTER_H +#define IDYNTREE_PYBIND11_IDYNTREE_TYPE_CASTER_H + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +namespace pybind11 +{ +namespace detail +{ +template