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

Added fixed models. #27

Merged
merged 2 commits into from
Mar 15, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/build*/
*.user
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,27 @@ SUBDIRLIST(ROBOTS_NAMES ${CMAKE_CURRENT_BINARY_DIR}/iCub/robots)
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")
set(ROBOT_FIXED_MODEL_FOLDER "${CMAKE_CURRENT_BINARY_DIR}/iCub/robots/${ROBOT_NAME}_fixed")
set(ROBOT_FIXED_MODEL_CONFIG_FILE "${ROBOT_FIXED_MODEL_FOLDER}/model.config")
set(ROBOT_FIXED_MODEL_SDF_FILE "${ROBOT_FIXED_MODEL_FOLDER}/${ROBOT_NAME}_fixed.sdf")

if(ROBOT_NAME IN_LIST GAZEBO_SUPPORTED_MODELS OR ICUB_MODELS_INSTALL_ALL_GAZEBO_MODELS)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/model.config.in
${ROBOT_MODEL_CONFIG_FILE}
@ONLY)

file(MAKE_DIRECTORY ${ROBOT_FIXED_MODEL_FOLDER})

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fixed_model.config.in
${ROBOT_FIXED_MODEL_CONFIG_FILE}
@ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fixed_model.sdf.in
${ROBOT_FIXED_MODEL_SDF_FILE}
@ONLY)
else()
# Cleanup is before ICUB_MODELS_INSTALL_ALL_GAZEBO_MODELS was set to ON
file(REMOVE ${ROBOT_MODEL_CONFIG_FILE})
file(REMOVE_RECURSE ${ROBOT_FIXED_MODEL_FOLDER})
endif()

endforeach()
Expand Down
11 changes: 11 additions & 0 deletions fixed_model.config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<model>
<name>@ROBOT_NAME@_fixed (no hands)</name>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That (no hands) is not ideal, but I see that you got it from the existing model.config.in, so if we remove it we will remove it from both.

<version>1.0</version>
<sdf version='1.5'>@ROBOT_NAME@_fixed.sdf</sdf>
<author>
<name>Stefano Dafarra</name>
<email>stefano.dafarra@iit.it</email>
</author>
<description>Model for the iCub humanoid robot, fixed on the air. For more information check icub.org</description>
</model>
14 changes: 14 additions & 0 deletions fixed_model.sdf.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version='1.0'?>
<sdf version='1.5'>
<model name="iCub_fixed_no_hands">
<include>
<uri>model://@ROBOT_NAME@</uri>
<pose>0.0 0 1.0 0 0 3.14</pose>
</include>

<joint name="fixed" type="fixed">
<parent>world</parent>
<child>iCub::base_link</child>
</joint>
</model>
</sdf>