Skip to content

Commit

Permalink
Enable python bindings compilation for human-dynamics-estimation if R…
Browse files Browse the repository at this point in the history
…OBOTOLOGY_USES_PYTHON is enabled (#1717)

* Enable python bindings compilation for human-dynamics-estimation

* Update BuildHumanDynamicsEstimation.cmake

* Bump hde to 4.0.1
  • Loading branch information
traversaro authored Sep 26, 2024
1 parent 2e1d27e commit adf3f1f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
25 changes: 23 additions & 2 deletions cmake/BuildHumanDynamicsEstimation.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,24 @@ find_or_build_package(osqp QUIET)
find_or_build_package(OsqpEigen QUIET)
find_or_build_package(robometry 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()


if(WIN32)
list(APPEND HDE_CMAKE_ARGS -DXSENS_MVN_USE_SDK:BOOL=${ROBOTOLOGY_USES_XSENS_MVN_SDK} -DENABLE_XsensSuit:BOOL=${ROBOTOLOGY_USES_XSENS_MVN_SDK} )
list(APPEND HDE_OPTIONAL_CMAKE_ARGS -DXSENS_MVN_USE_SDK:BOOL=${ROBOTOLOGY_USES_XSENS_MVN_SDK} -DENABLE_XsensSuit:BOOL=${ROBOTOLOGY_USES_XSENS_MVN_SDK} )
endif()

ycm_ep_helper(HumanDynamicsEstimation TYPE GIT
Expand All @@ -21,7 +37,7 @@ ycm_ep_helper(HumanDynamicsEstimation TYPE GIT
TAG master
COMPONENT human_dynamics
FOLDER src
CMAKE_ARGS -DHUMANSTATEPROVIDER_ENABLE_VISUALIZER:BOOL=ON ${HDE_CMAKE_ARGS}
CMAKE_ARGS -DHUMANSTATEPROVIDER_ENABLE_VISUALIZER:BOOL=ON -DHDE_COMPILE_PYTHON_BINDINGS:BOOL=${ROBOTOLOGY_USES_PYTHON} ${HDE_OPTIONAL_CMAKE_ARGS}
DEPENDS iDynTree
YARP
osqp
Expand All @@ -30,3 +46,8 @@ ycm_ep_helper(HumanDynamicsEstimation TYPE GIT
robometry)

set(HumanDynamicsEstimation_CONDA_DEPENDENCIES eigen)

if(ROBOTOLOGY_USES_PYTHON)
list(APPEND HumanDynamicsEstimation_CONDA_DEPENDENCIES python)
list(APPEND HumanDynamicsEstimation_CONDA_DEPENDENCIES pybind11)
endif()
2 changes: 1 addition & 1 deletion cmake/BuildiDynTree.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion releases/latest.releases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit adf3f1f

Please sign in to comment.