ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Arm does not appear when using xacro to attach UR5 to Robotiq Gripper

asked 2018-12-09 19:09:05 -0500

ceres gravatar image

updated 2018-12-10 00:04:24 -0500

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.

edit retag flag offensive close merge delete

Comments

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?

gvdhoorn gravatar image gvdhoorn  ( 2018-12-10 00:37:06 -0500 )edit

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.

ceres gravatar image ceres  ( 2018-12-10 00:54:48 -0500 )edit

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]

ceres gravatar image ceres  ( 2018-12-10 00:56:23 -0500 )edit

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

ceres gravatar image ceres  ( 2018-12-10 01:13:35 -0500 )edit

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.

gvdhoorn gravatar image gvdhoorn  ( 2018-12-10 01:17:18 -0500 )edit

Finally: please post how you resolved this as an answer and accept your own answer.

gvdhoorn gravatar image gvdhoorn  ( 2018-12-10 01:17:41 -0500 )edit

Thanks. I've already posted the answer, but I don't have enough reputation to accept it yet.

ceres gravatar image ceres  ( 2018-12-10 01:21:22 -0500 )edit

I was trying to create the planning group in the MoveIt Setup Assistant.

ceres gravatar image ceres  ( 2018-12-10 01:22:03 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-12-10 01:18:22 -0500

ceres gravatar image

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>
edit flag offensive delete link more

Comments

1

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?

madhav gravatar image madhav  ( 2022-05-11 16:31:11 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2018-12-09 19:05:05 -0500

Seen: 1,278 times

Last updated: Dec 10 '18