Skip to content

Commit

Permalink
icub manual: fixed build
Browse files Browse the repository at this point in the history
  • Loading branch information
pattacini committed Jul 26, 2020
1 parent b4632ed commit b76383e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
20 changes: 19 additions & 1 deletion 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,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
Expand Down
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 b76383e

Please sign in to comment.