From b76383ea83bdb1c7ad797c62b871f3985d0070bd Mon Sep 17 00:00:00 2001 From: Ugo Pattacini Date: Sun, 26 Jul 2020 13:37:07 +0200 Subject: [PATCH] icub manual: fixed build --- CMakeLists.txt | 20 ++++++++++++++++++- .../iCubGazeboV2_5_visuomanip/model.config | 2 +- model.config.in | 2 +- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c99ae1f..1159872 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,12 @@ endmacro() # Copy the iCub folder in the build tree file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/iCub DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) +# Copy the iCub_manual folder in the build tree +SUBDIRLIST(subdirs ${CMAKE_CURRENT_SOURCE_DIR}/iCub_manual) +foreach(subdir ${subdirs}) + file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/iCub_manual/${subdir}/ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/iCub/${subdir}) +endforeach() + # Copy the ros folder file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/ros DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/iCub) @@ -44,7 +50,7 @@ list(APPEND GAZEBO_SUPPORTED_MODELS "iCubGazeboV2_5") list(APPEND GAZEBO_SUPPORTED_MODELS "iCubGazeboV2_5_plus") SUBDIRLIST(ROBOTS_NAMES ${CMAKE_CURRENT_BINARY_DIR}/iCub/robots) -foreach (ROBOT_DIRNAME ${ROBOTS_NAMES}) +foreach(ROBOT_DIRNAME ${ROBOTS_NAMES}) set(ROBOT_NAME ${ROBOT_DIRNAME}) set(ROBOT_MODEL_CONFIG_FILE "${CMAKE_CURRENT_BINARY_DIR}/iCub/robots/${ROBOT_NAME}/model.config") @@ -92,7 +98,19 @@ foreach (ROBOT_DIRNAME ${ROBOTS_NAMES}) file(REMOVE_RECURSE ${ROBOT_FIXED_MODEL_FOLDER}) file(REMOVE_RECURSE ${ROBOT_FEET_FIXED_MODEL_FOLDER}) endif() +endforeach() +# Deal with manually generated models +set(GAZEBO_SUPPORTED_MODELS "") +list(APPEND GAZEBO_SUPPORTED_MODELS "iCubGazeboV2_5_visuomanip") + +SUBDIRLIST(ROBOTS_NAMES ${CMAKE_CURRENT_SOURCE_DIR}/iCub_manual/robots) +foreach(ROBOT_NAME ${ROBOTS_NAMES}) + if(ROBOT_NAME IN_LIST GAZEBO_SUPPORTED_MODELS) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/iCub_manual/robots/${ROBOT_NAME}/model.config + ${CMAKE_CURRENT_BINARY_DIR}/iCub/robots/${ROBOT_NAME}/model.config + @ONLY) + endif() endforeach() # Install the whole iCub directory diff --git a/iCub_manual/robots/iCubGazeboV2_5_visuomanip/model.config b/iCub_manual/robots/iCubGazeboV2_5_visuomanip/model.config index aeb8a44..40d758c 100644 --- a/iCub_manual/robots/iCubGazeboV2_5_visuomanip/model.config +++ b/iCub_manual/robots/iCubGazeboV2_5_visuomanip/model.config @@ -2,6 +2,6 @@ iCubGazeboV2_5_visuomanip 1.0 - model.urdf + model.urdf Model for the iCub humanoid robot. For more information check icub.org diff --git a/model.config.in b/model.config.in index 412aaaa..07c9144 100644 --- a/model.config.in +++ b/model.config.in @@ -2,7 +2,7 @@ @ROBOT_NAME_CONFIG@ 1.0 - @ROBOT_MODEL_CONFIG@ + @ROBOT_MODEL_CONFIG@ Silvio Traversaro silvio.traversaro@iit.it