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

iCubGazeboV2_*: fix r_wrist_yaw direction #220

Merged
merged 1 commit into from
Jun 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
20 changes: 11 additions & 9 deletions simmechanics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ find_package(PythonInterp REQUIRED)
# v2.5 robots using the simmechanics-to-urdf script
macro(generate_icub_simmechanics)
set(options NO_BACKPACK
BOGUS
BOGUS
INCREASE_INERTIA_FOR_GAZEBO
ICUB_PLUS
ICUB_2_6
ICUB_2_7
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick for future PRs: removing trailing whitespace is great, but try to keep it in a different dedicated commit, otherwise it will complicate reading the history in the future.

ICUB_PLUS
ICUB_2_6
ICUB_2_7
ICUB_3_COLLISION_GEOM_MOD)
set(oneValueArgs YARP_ROBOT_NAME SIMMECHANICS_XML YAML_TEMPLATE CSV_TEMPLATE)
set(multiValueArgs)
cmake_parse_arguments(GIVTWO "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

# Fallback if no assigned collision geometry is requested
set(ASSIGNED_COLLISION_GEOMETRIES "")

Expand Down Expand Up @@ -202,6 +202,7 @@ macro(generate_icub_simmechanics)
r_wrist_prosup
torso_pitch
neck_roll
r_wrist_yaw
")
else()
set(MESH_FILE_FORMAT "filenameformatchangeext: \"package://iCub/meshes/simmechanics/%s-binary.stl\"")
Expand Down Expand Up @@ -266,6 +267,7 @@ macro(generate_icub_simmechanics)
r_wrist_prosup
torso_pitch
neck_roll
r_wrist_yaw
")
endif()
# The ICUB_2_6 option is used to modify the iCub 2.5.5 model to
Expand All @@ -277,8 +279,8 @@ macro(generate_icub_simmechanics)
"additionalTransformation: [0.0323779, -0.0139537, 0.072, -3.14159265358979, 0, -1.5707963267949]")

endif()
# The ICUB_2_7 option is used to modify the iCub 2.5.5 model to
# add some details of the iCub 2.7 until a proper iCub 2.7 model
# The ICUB_2_7 option is used to modify the iCub 2.5.5 model to
# add some details of the iCub 2.7 until a proper iCub 2.7 model
# is produced
set(ADDITIONAL_XML_BLOBS "")
if(GIVTWO_ICUB_2_7)
Expand Down Expand Up @@ -369,12 +371,12 @@ generate_icub_simmechanics(YARP_ROBOT_NAME iCubGazeboV3
YAML_TEMPLATE "icub3/ICUB_3_all_options_gazebo.yaml.in"
CSV_TEMPLATE "icub3/ICUB_3_joint_all_parameters.csv"
ICUB_3_COLLISION_GEOM_MOD)

generate_icub_simmechanics(YARP_ROBOT_NAME left_hand_mk3
SIMMECHANICS_XML "components/left_hand_mk3/SIM_LEFT_HAND.xml"
YAML_TEMPLATE "components/left_hand_mk3/simmechanics2urdf_configfile.yaml"
CSV_TEMPLATE "components/left_hand_mk3/simmechanics2urdf_joints_configfile.csv")

generate_icub_simmechanics(YARP_ROBOT_NAME left_wrist_mk2
SIMMECHANICS_XML "components/left_wrist_mk2/SIM_L_WRIST.xml"
YAML_TEMPLATE "components/left_wrist_mk2/simmechanics2urdf_configfile.yaml"
Expand Down
6 changes: 5 additions & 1 deletion tests/icub-model-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ bool checkAxisDirectionsV2(iDynTree::KinDynComputations & comp)
expectedDirectionInRootLink.push_back(iDynTree::Direction(1.0,0.0,0.0));
axisNames.push_back("torso_yaw");
expectedDirectionInRootLink.push_back(iDynTree::Direction(0.0,0.0,-1.0));
axisNames.push_back("l_wrist_yaw");
expectedDirectionInRootLink.push_back(iDynTree::Direction(0.0,-1.0,0.0));
axisNames.push_back("r_wrist_yaw");
expectedDirectionInRootLink.push_back(iDynTree::Direction(0.0,-1.0,0.0));

for(int i=0; i < axisNames.size(); i++)
{
Expand Down Expand Up @@ -478,7 +482,7 @@ bool checkFTSensorsAreCorrectlyOrientedV3(iDynTree::KinDynComputations & comp)
-0.866025, -0.5, 0,
0, 0, 1);

iDynTree::Rotation rootLink_R_sensorFrameExpectedLeg =
iDynTree::Rotation rootLink_R_sensorFrameExpectedLeg =
iDynTree::Rotation(-0.866025, -0.5, 0,
-0.5, 0.866025, 0,
0, 0, -1);
Expand Down