0
$\begingroup$

Rosanswers logo

I am trying to attach a Robotiq 2f gripper to a UR5 arm, but cannot get the two components to properly connect to one another. Following the tutorial here, I created the xacro file below, but only the gripper appears when I launch the MoveIt Setup Assistant and load the xacro. I don't see any errors.

How do I properly attach the gripper to the arm for simulation?

<?xml version="1.0"?>
<robot name="ur5_robotiq" xmlns:xacro="http://wiki.ros.org/xacro">
<!-- include macros for UR5 and the 2f gripper -->

<xacro:include filename="$(find ur_description)/urdf/ur5.urdf.xacro" />
<xacro:include filename="$(find robotiq_2f_140_gripper_visualization)/urdf/robotiq_arg2f_140_model.xacro" />

<!-- create the robot + eef combo itself as a macro -->
<xacro:macro name="ee_robot" params="prefix">

<!-- instantiate UR5 and 2f gripper -->
  <xacro:ur5_robot prefix="${prefix}robot_" joint_limited="true"/>
  <xacro:robotiq_arg2f_140 prefix="${prefix}gripper_" />

  <!-- attach gripper -->
  <joint name="${prefix}robot_tool0-${prefix}gripper_robotiq_arg2f_base_link" type="fixed">
    <origin xyz="0 0 0" rpy="${pi/2} -${pi/2} 0" />
    <parent link="${prefix}robot_tool0" />
    <child link="${prefix}gripper_robotiq_arg2f_base_link" />
  </joint>

 </xacro:macro>
</robot>

I have cloned the most recent industrial packages for Universal Robots and Robotiq and am running Ubuntu 18.04.


Originally posted by ceres on ROS Answers with karma: 86 on 2018-12-09

Post score: 0


Original comments

Comment by gvdhoorn on 2018-12-10:
Can you please check whether you're running into ros/urdfdom_headers#41?

Also: if you don't create the joint, nor instantiate the robotiq_arg2f_140 macro, does the robot model appear?

Comment by ceres on 2018-12-10:
I don't think the urdfdom_headers issue is the problem here, and I've tried changing the pi/2 values to 0 with no effect. Also, yes the robot model appears if I remove the joint and the robotiq_arg2f_140.

Comment by ceres on 2018-12-10:
Also, I added <xacro:ee_robot prefix=""/> below the macro to create the arm + gripper combo, and the resulting error is now as follows:

[ERROR] [1544424525.498517311]: Failed to find root link: Two root links found: [robot_base_link] and [robotiq_arg2f_base_link]

Comment by ceres on 2018-12-10:
I was able to fix arm not showing up by using robotiq_arg2f_140_model_macro.xacro instead of robotiq_arg2f_140_model.xacro. However, the planning group for gripper only shows 1 of the 8 gripper finger joints. I don't know if this is a related issue or if I should create a new question for t

Comment by gvdhoorn on 2018-12-10:
Ah:

  1. I assumed you were instantiating your xacro macro somewhere else
  2. I also assumed you were using the correct files (the one with the macro definition, not the top-level one)

re: planning group: did you create that yourself?

In any case: yes, that would be a new question.

Comment by gvdhoorn on 2018-12-10:
Finally: please post how you resolved this as an answer and accept your own answer.

Comment by ceres on 2018-12-10:
Thanks. I've already posted the answer, but I don't have enough reputation to accept it yet.

Comment by ceres on 2018-12-10:
I was trying to create the planning group in the MoveIt Setup Assistant.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The fix for this was to add <xacro:ee_robot prefix=""/> after the macro for the gripper attachment, and to use robotiq_arg2f_140_model_macro.xacro instead of robotiq_arg2f_140_model.xacro. The working macro looks like this:

<?xml version="1.0"?>
<robot name="ur5_robotiq" xmlns:xacro="http://wiki.ros.org/xacro">
<!-- include macros for UR5 and the 2f gripper -->

<xacro:include filename="$(find ur_description)/urdf/ur5.urdf.xacro" />
<xacro:include filename="$(find robotiq_2f_140_gripper_visualization)/urdf/robotiq_arg2f_140_model_macro.xacro" />

<!-- create the robot + eef combo itself as a macro -->
<xacro:macro name="ee_robot" params="prefix">

<!-- instantiate UR5 and 2f gripper -->
  <xacro:ur5_robot prefix="${prefix}robot_" joint_limited="true"/>
  <xacro:robotiq_arg2f_140 prefix="${prefix}gripper_" />

  <!-- attach gripper -->
  <joint name="${prefix}robot_tool0-${prefix}gripper_robotiq_arg2f_base_link" type="fixed">
    <origin xyz="0 0 0" rpy="${pi/2} -${pi/2} 0" />
    <parent link="${prefix}robot_tool0" />
    <child link="${prefix}gripper_robotiq_arg2f_base_link" />
  </joint>

 </xacro:macro>
<xacro:ee_robot prefix=""/>
</robot>

Originally posted by ceres with karma: 86 on 2018-12-10

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by madhav on 2022-05-11:
Failed to find root link: Two root links found: [base_link] and [robot_base_link] I am always getting this, how can it be solved?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.