Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable python bindings compilation for human-dynamics-estimation if ROBOTOLOGY_USES_PYTHON is enabled #1717

Merged
merged 4 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading