0
$\begingroup$

Rosanswers logo

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 = "flange"/>
 <joint name= "tool0_to_flange" type = "fixed">  
  <parent name = "tool0"/>
  <child name = "robot_flange"/>
   <origin xyz = "0 0 0" rpy = "0 ${pi/2} 0"/>
 </joint>


 <joint name = "flange_to_seallant_tool " type = "fixed">   
  <parent name = "flange"/>
  <child name  = "tool_base_link"/>
  <origin xyz = "-0.0425 0 0" rpy = "${pi} ${-pi/2} 0"/>
  </joint>


  <link name = "world"/>
 <joint name= "world_joint" type = "fixed">  
  <parent name = "world"/>
  <child name = "base_link"/>
   <origin xyz = "0.0 0.0 0.0" rpy = "0.0 0.0 0.0"/>
 </joint>



</robot>

Originally posted by stefvanlierop on ROS Answers with karma: 37 on 2019-07-15

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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).


Originally posted by gvdhoorn with karma: 86574 on 2019-07-15

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by stefvanlierop on 2019-07-15:
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

Comment by gvdhoorn on 2019-07-15:
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.

Comment by stefvanlierop on 2019-07-16:
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

Comment by gvdhoorn on 2019-07-16:
I also don't know what you are doing wrong. Unless you show me your current .xacros. You could append them to your question.

$\endgroup$

Your Answer

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