Ask Your Question
0

Connecting tool to UR10 URDF

asked 2019-07-15 07:37:37 -0500

stefvanlierop gravatar image

updated 2019-07-19 07:02:36 -0500

HI, i am working on an seallant application with an UR10 robot but cannot seem to get the URDF files connected. The code below describes my seallant tool that i would connect to the UR with the base_fit link. The base_fit link is the link that has to be attached to the flange link of the UR10. The flange link is defined in the top level file and is attached to the tool0 link of the UR10, but it is rotated over the y axis.

i cannnot seem to get it connected in this way because i keep getting this error

Failed to build tree: Joint [flange_to_seallant_tool] is missing a parent and/or child link specification.

i cannot seem find why this keeps happening because when the seallant_tool description is only in urdf (so not with xacro macro's) it seems to generate all elements in rviz. What am i missing?

urdf description of my tool

edit: I changed the prefix to "" and added joint and functionalities found in the top level xacro of the UR10

 <robot xmlns:xacro="http://wiki.ros.org/xacro" name="seallant_tool">

  <xacro:macro name="seallant_tool" params="prefix">
   <link name="${prefix}base_link">
    <visual>
     <geometry>
      <box size = "0.065 0.085 0.10"/>
     </geometry>
    </visual>
    <collision>
     <geometry>
      <box size = "0.080 0.090 0.105"/> 
     </geometry>
    </collision>     
   </link>
   <link name = "${prefix}seallant_cylinder">
 <visual>
  <geometry>
    <cylinder length = "0.27" radius = "0.025"/>
  </geometry>
  <material name="LightGrey">
    <color rgba="0.7 0.7 0.7 1.0"/>
  </material>
  <origin rpy="0 0 0" xyz="0 0.015 -0.019"/>
 </visual>
 <collision>
  <geometry>
    <cylinder length = "0.27" radius = "0.0275"/>
  </geometry>
  <origin rpy="0 0 0" xyz="0 0.015 -0.019"/>
</collision>    
</link>
 <joint name = "${prefix}tube_to_block" type = "fixed">
   <origin xyz="0.0 0 0" rpy="0 0 0"/>
   <parent link = "${prefix}base_link"/>
   <child link = "${prefix}seallant_cylinder"/> 
</joint>  
<link name ="${prefix}tcp"/>
 <joint name="${prefix}cylinder_to_tool0" type="fixed">
  <origin xyz="0 0.015 -0.154" rpy="0 0 0"/>
  <parent link="${prefix}seallant_cylinder"/>
  <child link="${prefix}tcp"/>
 </joint>
  <link name ="${prefix}base_fit"/>
    <joint name="${prefix}base_link_to_fit" type="fixed">
      <origin xyz="0 -0.0425 0" rpy="0 0 0"/>
      <parent link="${prefix}base_link"/>
      <child link="${prefix}base_fit"/>
    </joint>
  </xacro:macro>  
</robot>

Top level description

<?xml version="1.0"?>
<robot xmlns:xacro="http://wiki.ros.org/xacro" name="seallant_robot">
<xacro:arg name= "transmission_hw_interface" default = "hardeware_interface/PositionJointInterface"/>



<xacro:include filename="$(find ur_description)/urdf/ur10_robot.urdf.xacro"/>   
<xacro:include filename="$(find seallant_tool_support)/seallanttool.urdf.xacro"/>

 <xacro:ur10_robot prefix = "" joint_limited="True" 
shoulder_pan_lower_limit="${-pi}" shoulder_pan_upper_limit = "${pi}" shoulder_lift_lower_limit="${-pi}"  shoulder_lift_upper_limit="${pi}" elbow_joint_lower_limit="${-pi}" elbow_joint_upper_limit="${pi}" wrist_1_lower_limit="${-pi}" wrist_1_upper_limit="${pi}" wrist_2_lower_limit="${-pi}" wrist_2_upper_limit="${pi}" wrist_3_lower_limit="${-pi}" wrist_3_upper_limit="${pi}" transmission_hw_interface="$(arg transmission_hw_interface)" />

 <xacro:seallant_tool prefix = "tool_"/>    

 <link name ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-07-15 07:54:31 -0500

gvdhoorn gravatar image

updated 2019-07-15 11:44:10 -0500

Edit: the main problem here was that the name of the attribute that encodes the parent or child link for a joint is link, not name.

Having fixed that in the tool0_to_flange and flange_to_seallant_tool joint specs made things almost work.

Remaining issue was that tool_base_fit is already a child of tool_base_link, so you cannot make it a child of robot_flange as well (that is not allowed in urdf).

After changing flange_to_seallant_tool to have tool_base_link as its child the .xacro could successfully be converted and it loaded into RViz:

image description


Original answer: I believe the problem is that in your top-level .xacro file, you are setting the prefix of the seallant_tool to tool_:

 <xacro:seallant_tool prefix = "tool_"/>

but then in the flange_to_seallant_tool joint spec you are not using that prefix, but simply use base_fit as the name of the child link.

It should probably be tool_base_fit.

Same with tool0 in the tool0_to_flange joint. It should probably be robot_tool0.

And for consistency you might want to prefix flange with robot_ as well (so it becomes robot_flange).

edit flag offensive delete link more

Comments

i edited the elements with all the prefixes form the components they originated. flange became robot_flange and base fit became tool_base_fit. But is is giving the same error. It seems that Rviz says that the URDF failed model parse

stefvanlierop gravatar imagestefvanlierop ( 2019-07-15 08:26:25 -0500 )edit

Just noticed this btw:

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

that's not the correct file.

You should include the ur10.urdf.xacro.

gvdhoorn gravatar imagegvdhoorn ( 2019-07-15 09:00:03 -0500 )edit

i do not know what i am doing wrong, but it only seems to work when i change the UR prefix to "" instead of robot. Otherwise it does parse all the element but rviz keeps given the error that base_link does not exist. This obviously has something to do that a prefix is not on the right place but i cannot seem to find it. I used the ur10_robot.urdf.xacro to verify this because that is where i got the fix from. When i changed the prefix in that file it gave the same error. It does work now

stefvanlierop gravatar imagestefvanlierop ( 2019-07-16 03:17:36 -0500 )edit

I also don't know what you are doing wrong. Unless you show me your current .xacros. You could append them to your question.

gvdhoorn gravatar imagegvdhoorn ( 2019-07-16 06:19:34 -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

1 follower

Stats

Asked: 2019-07-15 07:37:37 -0500

Seen: 63 times

Last updated: Jul 19