From 0b8d0327c9258acef11101d7626ff39e18a3d2b6 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Wed, 18 Sep 2024 17:39:19 +0200 Subject: [PATCH 1/3] Enable python bindings compilation for human-dynamics-estimation --- cmake/BuildHumanDynamicsEstimation.cmake | 22 +++++++++++++++++++++- cmake/BuildiDynTree.cmake | 2 +- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/cmake/BuildHumanDynamicsEstimation.cmake b/cmake/BuildHumanDynamicsEstimation.cmake index 58a70cbec..cb5dd29e9 100644 --- a/cmake/BuildHumanDynamicsEstimation.cmake +++ b/cmake/BuildHumanDynamicsEstimation.cmake @@ -11,13 +11,28 @@ find_or_build_package(wearables QUIET) find_or_build_package(osqp QUIET) find_or_build_package(OsqpEigen QUIET) +# For what regards Python installation, the options changes depending +# on whether we are installing HDE in the superbuild, or generating a +# conda package +# See https://github.com/robotology/robotology-superbuild/issues/641 +set(HDE_OPTIONAL_CMAKE_ARGS "") +if(ROBOTOLOGY_USES_PYTHON) + if (NOT ROBOTOLOGY_GENERATE_CONDA_RECIPES) + // If we are not generating a conda recipe, the bindings need to go in the ROBOTOLOGY_SUPERBUILD_PYTHON_INSTALL_DIR + list(APPEND HDE_OPTIONAL_CMAKE_ARGS "-DHDE_PYTHON_INSTALL_DIR=${ROBOTOLOGY_SUPERBUILD_PYTHON_INSTALL_DIR}") + else() + // If we are building a conda package, the active environment is the correct place were to install the python bindings + list(APPEND HDE_OPTIONAL_CMAKE_ARGS "-DHDE_DETECT_ACTIVE_PYTHON_SITEPACKAGES:BOOL=ON") + endif() +endif() + ycm_ep_helper(HumanDynamicsEstimation TYPE GIT STYLE GITHUB REPOSITORY robotology/human-dynamics-estimation.git TAG master COMPONENT human_dynamics FOLDER src - CMAKE_ARGS -DHUMANSTATEPROVIDER_ENABLE_VISUALIZER:BOOL=ON + CMAKE_ARGS -DHUMANSTATEPROVIDER_ENABLE_VISUALIZER:BOOL=ON -DHDE_COMPILE_PYTHON_BINDINGS:BOOL=${ROBOTOLOGY_USES_PYTHON} ${HDE_OPTIONAL_CMAKE_ARGS} DEPENDS iDynTree YARP wearables @@ -26,3 +41,8 @@ ycm_ep_helper(HumanDynamicsEstimation TYPE GIT ICUB) set(HumanDynamicsEstimation_CONDA_DEPENDENCIES eigen) + +if(ROBOTOLOGY_USES_PYTHON) + list(APPEND HumanDynamicsEstimation_CONDA_DEPENDENCIES python) + list(APPEND HumanDynamicsEstimation_CONDA_DEPENDENCIES pybind11) +endif() diff --git a/cmake/BuildiDynTree.cmake b/cmake/BuildiDynTree.cmake index d06edaeb0..11d25727e 100644 --- a/cmake/BuildiDynTree.cmake +++ b/cmake/BuildiDynTree.cmake @@ -11,7 +11,7 @@ set(iDynTree_DEPENDS "") list(APPEND iDynTree_DEPENDS OsqpEigen) # For what regards Python installation, the options changes depending -# on whether we are installing YARP from source, or generating a +# on whether we are installing iDynTree from source, or generating a # conda package on Windows as in that case the installation location # will need to be outside of CMAKE_INSTALL_PREFIX # See https://github.com/robotology/robotology-superbuild/issues/641 From 5c9e56d68142fa3a8be11ff995a4c37c2b862179 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Mon, 23 Sep 2024 10:41:12 +0200 Subject: [PATCH 2/3] Update BuildHumanDynamicsEstimation.cmake --- cmake/BuildHumanDynamicsEstimation.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/BuildHumanDynamicsEstimation.cmake b/cmake/BuildHumanDynamicsEstimation.cmake index cb5dd29e9..c3662cc58 100644 --- a/cmake/BuildHumanDynamicsEstimation.cmake +++ b/cmake/BuildHumanDynamicsEstimation.cmake @@ -18,10 +18,10 @@ find_or_build_package(OsqpEigen QUIET) set(HDE_OPTIONAL_CMAKE_ARGS "") if(ROBOTOLOGY_USES_PYTHON) if (NOT ROBOTOLOGY_GENERATE_CONDA_RECIPES) - // If we are not generating a conda recipe, the bindings need to go in the ROBOTOLOGY_SUPERBUILD_PYTHON_INSTALL_DIR + # If we are not generating a conda recipe, the bindings need to go in the ROBOTOLOGY_SUPERBUILD_PYTHON_INSTALL_DIR list(APPEND HDE_OPTIONAL_CMAKE_ARGS "-DHDE_PYTHON_INSTALL_DIR=${ROBOTOLOGY_SUPERBUILD_PYTHON_INSTALL_DIR}") else() - // If we are building a conda package, the active environment is the correct place were to install the python bindings + # If we are building a conda package, the active environment is the correct place were to install the python bindings list(APPEND HDE_OPTIONAL_CMAKE_ARGS "-DHDE_DETECT_ACTIVE_PYTHON_SITEPACKAGES:BOOL=ON") endif() endif() From 28fe4136c6583bc423fc347c6e8bcfbdf45423e5 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 26 Sep 2024 10:29:55 +0200 Subject: [PATCH 3/3] Bump hde to 4.0.1 --- releases/latest.releases.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/releases/latest.releases.yaml b/releases/latest.releases.yaml index d0719eb7d..416abe717 100644 --- a/releases/latest.releases.yaml +++ b/releases/latest.releases.yaml @@ -122,7 +122,7 @@ repositories: HumanDynamicsEstimation: type: git url: https://github.com/robotology/human-dynamics-estimation.git - version: v4.0.0 + version: v4.0.1 human-gazebo: type: git url: https://github.com/robotology/human-gazebo.git