Skip to content

Commit

Permalink
Merge pull request #43 from robotology/fix/icub-manual-build
Browse files Browse the repository at this point in the history
iCub Manual Models used from build
  • Loading branch information
traversaro authored Jul 27, 2020
2 parents b4632ed + 5bc520e commit 1508bf4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
23 changes: 19 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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")

Expand Down Expand Up @@ -92,12 +98,21 @@ 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
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/iCub DESTINATION share)

# Install the whole iCub_manual directory within share/iCub
# Please do not remove the trailing '/' in 'iCub_manual/'
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/iCub_manual/ DESTINATION share/iCub)
2 changes: 1 addition & 1 deletion iCub_manual/robots/iCubGazeboV2_5_visuomanip/model.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<model>
<name>iCubGazeboV2_5_visuomanip</name>
<version>1.0</version>
<sdf version='1.5'>model.urdf</sdf>
<sdf version='@ICUB_MODELS_SDF_VERSION@'>model.urdf</sdf>
<description>Model for the iCub humanoid robot. For more information check icub.org</description>
</model>
2 changes: 1 addition & 1 deletion model.config.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<model>
<name>@ROBOT_NAME_CONFIG@</name>
<version>1.0</version>
<sdf version='1.5'>@ROBOT_MODEL_CONFIG@</sdf>
<sdf version='@ICUB_MODELS_SDF_VERSION@'>@ROBOT_MODEL_CONFIG@</sdf>
<author>
<name>Silvio Traversaro</name>
<email>silvio.traversaro@iit.it</email>
Expand Down

0 comments on commit 1508bf4

Please # to comment.