ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

How to overwrite the default finger pad links of the Robotiq 2F-85 gripper without editing the original URDF file?

asked 2019-12-09 06:38:18 -0500

krablander gravatar image

updated 2019-12-09 07:44:25 -0500

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:

This is the macro of the 'replacing' finger pad link:

<?xml version="1.0"?>
<robot name="custom_finger_pad_macro" xmlns: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">
        <origin xyz="0 0.0035 0.0045" rpy="0 ${-pi/2} ${pi}" />
          <mesh filename="package://robot_description/meshes/gripper_interface/visual/gripper_interface.dae" scale="0.001 0.001 0.001" />
        <material name="">
          <color rgba="0.9 0.9 0.9 1" />
        <origin xyz="0 0.0035 0.0045" rpy="0 ${-pi/2} ${pi}" />
          <mesh filename="package://robot_description/meshes/gripper_interface/collision/gripper_interface.stl" scale="0.001 0.001 0.001" />
        <material name="">
          <color rgba="0.9 0.0 0.0 1" />

This is my macro that merges the UR5, gripper (and pads):

<?xml version="1.0"?>
<robot name="gripperized_robot_macro" xmlns: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"
    <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 ...
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-12-09 07:07:33 -0500

gvdhoorn gravatar image

updated 2019-12-09 07:08:00 -0500

Is there any proper way to overwrite links in ROS without the need of editing the original URDF from, for example, the gripper?

First, a nuance: this is not something "in ROS", as URDF is not necessarily tied to ROS, but has uses outside of it.

Having written that: no, there is no support for "overriding" or "replacing" links (or any part of a URDF actually) from other URDFs (or .xacros) right now. Unless the .xacro your looking to update has special support for this.

That would be great functionality to have, as it would indeed avoid duplicating files.

One work-around I could think of is placing replacement links in the "same location" as the links you're looking to replace. I haven't tested it, and it would only work if the replacements you've printed are larger than the ones present in the default model.

In essence, you'd add your replacement link(s) to your .xacro and then place them in the correct location using an additional joint, making sure to set the parent of your new joint to the link you're looking to replace. By configuring the correct values for the origin element, you should be able to maneuver everything into place.

Your new link (or really: geometry) would overlap the old ones, which should make algorithms like collision checkers consider the replacements only, as they are larger.

But again, this would only work in case you're replacing geometry smaller than what is already there.

edit flag offensive delete link more


PS: there are scene description / mesh formats which do support this, such as Pixar's USD. This is not supported in any ROS software I'm aware of though.

gvdhoorn gravatar image gvdhoorn  ( 2019-12-09 07:09:02 -0500 )edit

My custom pads do not cover the full geometry of the default pads. Unfortunately I have to use a modified copy of the gripper macro.

krablander gravatar image krablander  ( 2019-12-09 07:34:35 -0500 )edit

You could suggest upstream to make parts of the gripper parameterisable.

xacro has received support for some pretty impressive modularity the last few years.

robotiq_arg2f_85_model_macro could be extended with a param that contains the name of the macro to instantiate for the fingers fi. You could then provide your own macro for that, and update the macro invocation with the name of your macro.

But that would require the maintainer of robotiq_arg2f_85_model_macro to go along with this.

gvdhoorn gravatar image gvdhoorn  ( 2019-12-09 07:42:09 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2019-12-09 06:38:18 -0500

Seen: 389 times

Last updated: Dec 09 '19