-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add iCub 2.5+ models #83
Changes from 11 commits
32397ca
417b170
d98e1ed
fd32f8f
bb53c29
2fea458
19be960
165f521
6be5bdd
340f43d
3526a17
89da04b
4b728a0
b18859b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,8 @@ find_package(PythonInterp REQUIRED) | |
# Generate URDF models for | ||
# v2.5 robots using the simmechanics-to-urdf script | ||
macro(generate_icub_simmechanics) | ||
set(options NO_BACKPACK BOGUS INCREASE_INERTIA_FOR_GAZEBO) | ||
set(oneValueArgs YARP_ROBOT_NAME SIMMECHANICS_XML YAML_TEMPLATE CSV) | ||
set(options NO_BACKPACK BOGUS INCREASE_INERTIA_FOR_GAZEBO ICUB_PLUS) | ||
set(oneValueArgs YARP_ROBOT_NAME SIMMECHANICS_XML YAML_TEMPLATE CSV_TEMPLATE) | ||
set(multiValueArgs) | ||
cmake_parse_arguments(GIVTWO "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) | ||
|
||
|
@@ -93,28 +93,96 @@ macro(generate_icub_simmechanics) | |
else() | ||
set(GAZEBO_ASSIGNED_INERTIAS "") | ||
endif() | ||
|
||
# If we are generating the icub2.5+ model we need to add the xsens IMU, change the mesh folder | ||
# and change the rotation axis list that need to be reversed. | ||
if(GIVTWO_ICUB_PLUS) | ||
set(MESH_FOLDER "filenameformatchangeext: \"package://iCub/meshes/simmechanics/2-5_plus/%s-binary.stl\"") | ||
set(ANKLE_PITCH_ROM "-50,20") | ||
set(CUSTOM_EPSILON "epsilon: 2e-7") | ||
set(XSENS_IMU_FRAME | ||
" - frameName: SCSYS_ROOT_LINK_XSENS_IMU | ||
frameReferenceLink: root_link | ||
exportedFrameName: root_link_imu_frame | ||
") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we now have 2 IMUs, could we rename the previous "imu_frame" in the head to "head_imu_frame"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, we can do it. I am not sure if then we need to update also some other configuration files (e.g. wbd). If you think that is easy and quick we can change the name of the head imu as you suggest. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think there a small impact in iDynTree, quite easy to implement, I let @traversaro confirm... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We would need to either have different wbd configuration files for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would also affect all our controllers that should be updated accordingly @gabrielenava There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @diegoferigo, as suggested by @traversaro we don't change the imu name in this PR. We can open a new one. |
||
set(XSENS_IMU_SENSOR | ||
" - frameName: SCSYS_ROOT_LINK_XSENS_IMU | ||
linkName: root_link | ||
exportFrameInURDF: No | ||
sensorName: root_link_xsens_imu | ||
sensorType: \"imu\" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, while the additional frame (
was already there and was intended to provide information on the accelerometers embedded in the head IMU. those information were used for the sensor measurement prediction computation in iDynTree. This said, we should have for the root_link IMU:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree with nuno on this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated! |
||
updateRate: \"400\" | ||
sensorBlobs: | ||
- | | ||
<plugin name=\"root_link_xsens_imu_plugin\" filename=\"libgazebo_yarp_imu.so\"> | ||
<yarpConfigurationFile>model://iCub/conf/gazebo_icub_inertial.ini</yarpConfigurationFile> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nunoguedelha do we need also an additional configuration file for the new IMU? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, good catch. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, considering that the parameters will be different:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, updated! |
||
</plugin> | ||
") | ||
set(REVERSE_ROTATION_AXIS | ||
"reverseRotationAxis: | ||
l_shoulder_roll | ||
l_elbow | ||
l_hip_yaw | ||
l_knee | ||
l_ankle_pitch | ||
l_hip_pitch | ||
r_ankle_roll | ||
r_shoulder_pitch | ||
r_shoulder_yaw | ||
r_elbow | ||
r_wrist_prosup | ||
torso_pitch | ||
neck_roll | ||
") | ||
else() | ||
set(MESH_FOLDER "filenameformatchangeext: \"package://iCub/meshes/simmechanics/%s-binary.stl\"") | ||
set(ANKLE_PITCH_ROM "-35,35") | ||
set(CUSTOM_EPSILON "") | ||
set(XSENS_IMU_FRAME "") | ||
set(XSENS_IMU_SENSOR "") | ||
set(REVERSE_ROTATION_AXIS | ||
"reverseRotationAxis: | ||
l_shoulder_roll | ||
l_elbow | ||
l_hip_yaw | ||
l_knee | ||
l_ankle_pitch | ||
r_hip_pitch | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The axis that are inverted are magically changing whenever we change the Creo model. 😕 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comes from the CAD model. In theory, it is possible to control the orientation of the axis but is not practical. It is easier to perform the change in the YAML file. Probably, since the upper body is the same for the iCub2.5 and iCub2.5+ we can change only the leg axis. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok. |
||
r_ankle_roll | ||
r_shoulder_pitch | ||
r_shoulder_yaw | ||
r_elbow | ||
r_wrist_prosup | ||
torso_pitch | ||
neck_roll | ||
") | ||
endif() | ||
|
||
set(GENERATED_YAML_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/${GIVTWO_YARP_ROBOT_NAME}.yaml) | ||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/${GIVTWO_YAML_TEMPLATE} | ||
${GENERATED_YAML_LOCATION} | ||
@ONLY) | ||
set(GENERATED_CSV_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/${GIVTWO_YARP_ROBOT_NAME}.csv) | ||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/${GIVTWO_CSV_TEMPLATE} | ||
${GENERATED_CSV_LOCATION} | ||
@ONLY) | ||
|
||
add_custom_command(OUTPUT ${GIVTWO_YARP_ROBOT_NAME}.urdf | ||
COMMAND simmechanics_to_urdf | ||
ARGS ${CMAKE_CURRENT_SOURCE_DIR}/data/${GIVTWO_SIMMECHANICS_XML} | ||
--output xml | ||
--yaml ${GENERATED_YAML_LOCATION} | ||
--csv-joints ${CMAKE_CURRENT_SOURCE_DIR}/data/${GIVTWO_CSV} | ||
--csv-joints ${GENERATED_CSV_LOCATION} | ||
--outputfile ${GIVTWO_YARP_ROBOT_NAME}.urdf | ||
MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/data/${GIVTWO_SIMMECHANICS_XML}" | ||
DEPENDS "${GENERATED_YAML_LOCATION}" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/data/${GIVTWO_CSV}") | ||
"${GENERATED_CSV_LOCATION}") | ||
|
||
|
||
|
||
# If we are generating a model without backpack, we need to tweack the COM of the chest link, | ||
# and we have a custon python script for this | ||
# If we are generating a model without backpack, we need to tweak the COM of the chest link, | ||
# and we have a custom python script for this | ||
if(${GIVTWO_NO_BACKPACK}) | ||
# instead of just copyng, we also modify the com on the fly | ||
# instead of just copying, we also modify the com on the fly | ||
add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/${BUILD_PREFIX}/robots/${GIVTWO_YARP_ROBOT_NAME}/model.urdf" | ||
MAIN_DEPENDENCY "${GIVTWO_YARP_ROBOT_NAME}.urdf" | ||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/data/icub2_5/adjust_com_for_model_without_backpack.py | ||
|
@@ -134,29 +202,41 @@ set(model-simmechanics-generated-models "") | |
generate_icub_simmechanics(YARP_ROBOT_NAME iCubGazeboV2_5 | ||
SIMMECHANICS_XML "icub2_5/ICUB_2-5_BB_SIM_MODEL.xml" | ||
YAML_TEMPLATE "icub2_5/ICUB_2-5_BB_simmechanics_options.yaml.in" | ||
CSV "icub2_5/ICUB_2-5_BB_joint_parameters.csv" | ||
CSV_TEMPLATE "icub2_5/ICUB_2-5_BB_joint_parameters.csv.in" | ||
INCREASE_INERTIA_FOR_GAZEBO) | ||
|
||
generate_icub_simmechanics(YARP_ROBOT_NAME iCubGazeboV2_5_plus | ||
SIMMECHANICS_XML "icub2_5/ICUB_2-5_plus_BB_SIM_MODEL.xml" | ||
YAML_TEMPLATE "icub2_5/ICUB_2-5_BB_simmechanics_options.yaml.in" | ||
CSV_TEMPLATE "icub2_5/ICUB_2-5_BB_joint_parameters.csv.in" | ||
INCREASE_INERTIA_FOR_GAZEBO ICUB_PLUS) | ||
|
||
generate_icub_simmechanics(YARP_ROBOT_NAME iCubGenova02_plus | ||
SIMMECHANICS_XML "icub2_5/ICUB_2-5_plus_BB_SIM_MODEL.xml" | ||
YAML_TEMPLATE "icub2_5/ICUB_2-5_BB_simmechanics_options.yaml.in" | ||
CSV_TEMPLATE "icub2_5/ICUB_2-5_BB_joint_parameters.csv.in" | ||
ICUB_PLUS) | ||
|
||
generate_icub_simmechanics(YARP_ROBOT_NAME iCubGenova02 | ||
SIMMECHANICS_XML "icub2_5/ICUB_2-5_BB_SIM_MODEL.xml" | ||
YAML_TEMPLATE "icub2_5/ICUB_2-5_BB_simmechanics_options.yaml.in" | ||
CSV "icub2_5/ICUB_2-5_BB_joint_parameters.csv") | ||
CSV_TEMPLATE "icub2_5/ICUB_2-5_BB_joint_parameters.csv.in") | ||
|
||
generate_icub_simmechanics(YARP_ROBOT_NAME iCubGenova04 | ||
SIMMECHANICS_XML "icub2_5/ICUB_2-5_BB_SIM_MODEL.xml" | ||
YAML_TEMPLATE "icub2_5/ICUB_2-5_BB_simmechanics_options.yaml.in" | ||
CSV "icub2_5/ICUB_2-5_BB_joint_parameters.csv") | ||
CSV_TEMPLATE "icub2_5/ICUB_2-5_BB_joint_parameters.csv.in") | ||
|
||
generate_icub_simmechanics(YARP_ROBOT_NAME iCubDarmstadt01 | ||
SIMMECHANICS_XML "icub2_5/ICUB_2-5_BB_SIM_MODEL.xml" | ||
YAML_TEMPLATE "icub2_5/ICUB_2-5_BB_simmechanics_options.yaml.in" | ||
CSV "icub2_5/ICUB_2-5_BB_joint_parameters.csv" | ||
CSV_TEMPLATE "icub2_5/ICUB_2-5_BB_joint_parameters.csv.in" | ||
NO_BACKPACK) | ||
|
||
generate_icub_simmechanics(YARP_ROBOT_NAME iCubGenova01 | ||
SIMMECHANICS_XML "icub2_5/ICUB_2-5_BB_SIM_MODEL.xml" | ||
YAML_TEMPLATE "icub2_5/ICUB_2-5_BB_simmechanics_options.yaml.in" | ||
CSV "icub2_5/ICUB_2-5_BB_joint_parameters.csv" | ||
CSV_TEMPLATE "icub2_5/ICUB_2-5_BB_joint_parameters.csv.in" | ||
NO_BACKPACK) | ||
|
||
add_custom_target(generate-models-simmechanics | ||
|
@@ -169,8 +249,3 @@ add_custom_command(TARGET generate-models-simmechanics | |
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/data/icub2_5/meshes" "${CMAKE_BINARY_DIR}/${BUILD_PREFIX}/meshes" | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/data/icub2_5/conf" "${CMAKE_BINARY_DIR}/${BUILD_PREFIX}/conf" | ||
COMMENT "Copying Simmechanics meshes") | ||
|
||
|
||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,10 @@ originRPY: [0.0,0.0,3.14] | |
# Meshes options | ||
scale: "0.001 0.001 0.001" | ||
forcelowercase: Yes | ||
filenameformatchangeext: "package://iCub/meshes/simmechanics/%s-binary.stl" | ||
@MESH_FOLDER@ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would actually call this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, better! |
||
|
||
# Custom epsilon for testing whether a number is close to zero | ||
@CUSTOM_EPSILON@ | ||
|
||
# Rename options (map Creo names to URDF names) | ||
rename: | ||
|
@@ -393,7 +396,7 @@ exportedFrames: | |
- frameName: SCSYS_R_LOWER_LEG_SKIN_21 | ||
frameReferenceLink: r_lower_leg | ||
exportedFrameName: r_lower_leg_skin_21 | ||
|
||
@XSENS_IMU_FRAME@ | ||
|
||
|
||
linkFrames: | ||
|
@@ -768,23 +771,11 @@ sensors: | |
linkName: l_foot | ||
sensorName: l_foot_mtb_acc_10b13 | ||
sensorType: "accelerometer" | ||
@XSENS_IMU_SENSOR@ | ||
|
||
|
||
# Workaround options | ||
reverseRotationAxis: | ||
l_shoulder_roll | ||
l_elbow | ||
l_hip_yaw | ||
l_knee | ||
l_ankle_pitch | ||
r_hip_pitch | ||
r_ankle_roll | ||
r_shoulder_pitch | ||
r_shoulder_yaw | ||
r_elbow | ||
r_wrist_prosup | ||
torso_pitch | ||
neck_roll | ||
@REVERSE_ROTATION_AXIS@ | ||
|
||
|
||
assignedMasses: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that "plus" variant has been implemented only on iCubGenova04, would it make sense to have
iCubGenova04_plus
instead ofiCubGenova02_plus
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected. Thanks!