How to overwrite the default finger pad links of the Robotiq 2F-85 gripper without editing the original URDF file?
Hello, I am new here,
I made a custom URDF file where I included the URDF macros of the UR5 robot and the Robotiq 2F-85 gripper. The Robotiq 2F-85 URDF describes by default the inner finger pads. However, I am using custom 3D printed finger pads on my gripper. My goal is to replace the default finger pad link with my own custom finger pad link. I know I could simply modify the original URDF, but I feel that is not the right way to do this as it results in duplicate code. Also I don't prefer to make changes in other packages.
I have tried to overwrite the link called ${fingerprefix}_inner_finger_pad
(where ${fingerprefix}
is left
or right
)
While launching the URDF in rviz I get the following error:
[ERROR] [1575891768.696675295]: link 'left_inner_finger_pad' is not unique.
Is there any proper way to overwrite links in ROS without the need of editing the original URDF from, for example, the gripper?
I am running ROS Kinetic on Ubuntu 16.04.10 LTS. I am including URDF files from the following packages:
- ur5.urdf.xacro, from universal_robots metapackage (version 1.2.5)
- robotiq_arg2f_85_model_macro.xacro, from robotiq metapackage (version 1.0.0)
This is the macro of the 'replacing' finger pad link:
<?xml version="1.0"?>
<robot name="custom_finger_pad_macro" xmlns:xacro="http://wiki.ros.org/xacro">
<!-- 'overwrite' default finger pad with custom 3D printed gripper interace finger pad -->
<xacro:macro name="inner_finger_pad" params="prefix fingerprefix">
<link name="${prefix}${fingerprefix}_inner_finger_pad">
<visual>
<origin xyz="0 0.0035 0.0045" rpy="0 ${-pi/2} ${pi}" />
<geometry>
<mesh filename="package://robot_description/meshes/gripper_interface/visual/gripper_interface.dae" scale="0.001 0.001 0.001" />
</geometry>
<material name="">
<color rgba="0.9 0.9 0.9 1" />
</material>
</visual>
<collision>
<origin xyz="0 0.0035 0.0045" rpy="0 ${-pi/2} ${pi}" />
<geometry>
<mesh filename="package://robot_description/meshes/gripper_interface/collision/gripper_interface.stl" scale="0.001 0.001 0.001" />
</geometry>
<material name="">
<color rgba="0.9 0.0 0.0 1" />
</material>
</collision>
</link>
</xacro:macro>
</robot>
This is my macro that merges the UR5, gripper (and pads):
<?xml version="1.0"?>
<robot name="gripperized_robot_macro" xmlns:xacro="http://wiki.ros.org/xacro">
<!-- include UR5, Robotiq 2F-85 and custom finger pad URDF macros -->
<xacro:include filename="$(find ur_description)/urdf/ur5.urdf.xacro" />
<xacro:include filename="$(find robotiq_2f_85_gripper_visualization)/urdf/robotiq_arg2f_85_model_macro.xacro" />
<xacro:include filename="$(find robot_description)/urdf/custom_finger_pad_macro.xacro" />
<!-- create custom macro for robot + gripper combo -->
<xacro:macro name="ur5_robotiq" params="prefix">
<xacro:ur5_robot prefix="${prefix}" joint_limited="false"
transmission_hw_interface="hardware_interface/PositionJointInterface"/>
<xacro:robotiq_arg2f_85 prefix="${prefix}" />
<!-- overwrite the 'inner_finger_pad' links -->
<xacro:inner_finger_pad prefix="${prefix}" fingerprefix="left" />
<xacro:inner_finger_pad prefix="${prefix}" fingerprefix="right" />
<!-- attach robot with gripper through connection joint-->
<joint name="${prefix}gripper_joint" type="fixed">
<origin ...