From 53c5ed9258b19edd4f1b0f4936eb68cfef45d3b8 Mon Sep 17 00:00:00 2001 From: Dominic Reber Date: Fri, 8 Apr 2022 13:10:01 +0200 Subject: [PATCH 1/3] Import modules from state representation correctly --- python/source/controllers/bind_cartesian_controllers.cpp | 3 ++- python/source/controllers/bind_joint_controllers.cpp | 3 ++- python/source/controllers/controllers_bindings.cpp | 2 ++ python/source/dynamical_systems/bind_cartesian.cpp | 3 ++- python/source/dynamical_systems/bind_joint.cpp | 3 ++- python/source/dynamical_systems/dynamical_systems_bindings.cpp | 2 ++ 6 files changed, 12 insertions(+), 4 deletions(-) diff --git a/python/source/controllers/bind_cartesian_controllers.cpp b/python/source/controllers/bind_cartesian_controllers.cpp index 174ef7bb8..74b5583c3 100644 --- a/python/source/controllers/bind_cartesian_controllers.cpp +++ b/python/source/controllers/bind_cartesian_controllers.cpp @@ -14,7 +14,8 @@ using namespace state_representation; using namespace py_parameter; void cartesian_controller(py::module_& m) { - py::class_, std::shared_ptr>, ParameterMap, PyController> c(m, "ICartesianController"); + py::object parameter_map = py::module_::import("state_representation").attr("ParameterMap"); + py::class_, std::shared_ptr>, PyController> c(m, "ICartesianController", parameter_map); c.def( "compute_command", py::overload_cast(&IController::compute_command), diff --git a/python/source/controllers/bind_joint_controllers.cpp b/python/source/controllers/bind_joint_controllers.cpp index de59fd6ea..253259a30 100644 --- a/python/source/controllers/bind_joint_controllers.cpp +++ b/python/source/controllers/bind_joint_controllers.cpp @@ -11,7 +11,8 @@ using namespace state_representation; using namespace py_parameter; void joint_controller(py::module_& m) { - py::class_, std::shared_ptr>, ParameterMap, PyController> c(m, "IJointController"); + py::object parameter_map = py::module_::import("state_representation").attr("ParameterMap"); + py::class_, std::shared_ptr>, PyController> c(m, "IJointController", parameter_map); c.def( "compute_command", py::overload_cast(&IController::compute_command), diff --git a/python/source/controllers/controllers_bindings.cpp b/python/source/controllers/controllers_bindings.cpp index 1cafd0ff2..40841efe1 100644 --- a/python/source/controllers/controllers_bindings.cpp +++ b/python/source/controllers/controllers_bindings.cpp @@ -12,6 +12,8 @@ PYBIND11_MODULE(controllers, m) { m.attr("__version__") = "dev"; #endif + py::module_::import("state_representation"); + bind_type(m); bind_computational_space(m); bind_cartesian_controllers(m); diff --git a/python/source/dynamical_systems/bind_cartesian.cpp b/python/source/dynamical_systems/bind_cartesian.cpp index 27b9e3f66..8c0c1d300 100644 --- a/python/source/dynamical_systems/bind_cartesian.cpp +++ b/python/source/dynamical_systems/bind_cartesian.cpp @@ -13,7 +13,8 @@ using namespace state_representation; void cartesian(py::module_& m) { - py::class_, std::shared_ptr>, ParameterMap, PyDynamicalSystem> c(m, "ICartesianDS"); + py::object parameter_map = py::module_::import("state_representation").attr("ParameterMap"); + py::class_, std::shared_ptr>, PyDynamicalSystem> c(m, "ICartesianDS", parameter_map); c.def(py::init<>()); diff --git a/python/source/dynamical_systems/bind_joint.cpp b/python/source/dynamical_systems/bind_joint.cpp index 43090118d..5283235b1 100644 --- a/python/source/dynamical_systems/bind_joint.cpp +++ b/python/source/dynamical_systems/bind_joint.cpp @@ -11,7 +11,8 @@ using namespace state_representation; void joint(py::module_& m) { - py::class_, std::shared_ptr>, ParameterMap, PyDynamicalSystem> c(m, "IJointDS"); + py::object parameter_map = py::module_::import("state_representation").attr("ParameterMap"); + py::class_, std::shared_ptr>, PyDynamicalSystem> c(m, "IJointDS", parameter_map); c.def(py::init<>()); diff --git a/python/source/dynamical_systems/dynamical_systems_bindings.cpp b/python/source/dynamical_systems/dynamical_systems_bindings.cpp index 3ebf786c7..5b852bba6 100644 --- a/python/source/dynamical_systems/dynamical_systems_bindings.cpp +++ b/python/source/dynamical_systems/dynamical_systems_bindings.cpp @@ -12,6 +12,8 @@ PYBIND11_MODULE(dynamical_systems, m) { m.attr("__version__") = "dev"; #endif + py::module_::import("state_representation"); + bind_type(m); bind_cartesian(m); bind_joint(m); From f6c387fb66845c797cdc80a1c0bb62af7720a70f Mon Sep 17 00:00:00 2001 From: Dominic Reber Date: Fri, 8 Apr 2022 13:11:33 +0200 Subject: [PATCH 2/3] 5.1.4 -> 5.1.5 --- VERSION | 2 +- doxygen/doxygen.conf | 2 +- protocol/clproto_cpp/CMakeLists.txt | 2 +- python/setup.py | 2 +- source/CMakeLists.txt | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index 76e9e619d..220d8e0a4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.1.4 +5.1.5 diff --git a/doxygen/doxygen.conf b/doxygen/doxygen.conf index 49047c382..82fe0b145 100644 --- a/doxygen/doxygen.conf +++ b/doxygen/doxygen.conf @@ -38,7 +38,7 @@ PROJECT_NAME = "Control Libraries" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 5.1.4 +PROJECT_NUMBER = 5.1.5 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/protocol/clproto_cpp/CMakeLists.txt b/protocol/clproto_cpp/CMakeLists.txt index 4b1ed81a3..80856b732 100644 --- a/protocol/clproto_cpp/CMakeLists.txt +++ b/protocol/clproto_cpp/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.9) -project(clproto VERSION 5.1.4) +project(clproto VERSION 5.1.5) set(CMAKE_CXX_STANDARD 17) diff --git a/python/setup.py b/python/setup.py index 231b7bc86..27bd82706 100644 --- a/python/setup.py +++ b/python/setup.py @@ -10,7 +10,7 @@ osqp_path_var = 'OSQP_INCLUDE_DIR' openrobots_path_var = 'OPENROBOTS_INCLUDE_DIR' -__version__ = "5.1.4" +__version__ = "5.1.5" __libraries__ = ['state_representation', 'clproto', 'controllers', 'dynamical_systems', 'robot_model'] __include_dirs__ = ['include'] diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 48a102d5b..db5d71c6a 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.15) -project(control_libraries VERSION 5.1.4) +project(control_libraries VERSION 5.1.5) # Build options option(BUILD_TESTING "Build all tests." OFF) From 22988d12f25c4eaae5d81c4addefb186ccac5c24 Mon Sep 17 00:00:00 2001 From: Dominic Reber Date: Fri, 8 Apr 2022 14:08:06 +0200 Subject: [PATCH 3/3] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2263c2791..d6c10d9fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ Release Versions: - Improve installation script and python installation guide (#274) - Fix path in protocol installation guide (#275) - Add force limit parameter to Impedance controller (#276) +- Fix python bindings import issues (#279) ## 5.1.0