Failed to build tree: child link of joint not found
I wrote an xacro file with the UR10 robotic arm, and after checking with check_urdf, I got such an error.
Failed to build tree: child link [laserlink] of joint [laserjoint] not found at line 226 in /build/urdfdom-UJ3kd6/urdfdom-0.4.1/urdf_parser/src/model.cpp ERROR: Model Parsing the xml failed
Here is the content of my XACRO file. Is there something wrong?
<?xml version="1.0"?>
<robot xmlns:xacro="http://wiki.ros.org/xacro" name="transforrobotdxp" >
<xacro:include filename="$(find ur_description)/urdf/common.gazebo.xacro" />
<xacro:include filename="$(find ur_description)/urdf/ur10.urdf.xacro" />
<xacro:include filename="$(find laser_dxp)/urdf/laserdxp.xacro" />
<xacro:ur10_robot prefix="" joint_limited="false"/>
<link name="world" />
<joint name="world_joint" type="fixed">
<parent link="world" />
<child link = "base_link" />
<origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0" />
</joint>
<joint name="laser_joint" type="fixed">
<parent link="wrist_3_link" />
<child link = "laserlink" />
<origin xyz="0.07 0.17 -0.03" rpy="1.57079633 0.0 0.0" />
</joint>
</robot>
thank you very much!
Here is the laserdxp file.Base_link
is defined in the ur10.urdf.xacro file.
<?xml version="1.0"?>
<robot name="laser_dxp_robot" xmlns:xacro="http://wiki.ros.org/xacro">
<link name="laserlink">
<inertial>
<origin xyz="-0.024229 0.03372 0.042379" rpy="0 0 0" />
<mass value="0.44314" />
<inertia
ixx="0.00073152"
ixy="-1.4067E-05"
ixz="0.00022716"
iyy="0.00097117"
iyz="-5.6484E-05"
izz="0.00084677" />
</inertial>
<visual>
<origin xyz="0 0 0" rpy="1.5707963267949 0 0" />
<geometry>
<mesh filename="package://laser_dxp/meshes/laser_dxp.STL" />
</geometry>
<material name="">
<color rgba="0.98824 0.98431 1 1" />
<!--texture filename="package://laser_dxp/textures/" /-->
</material>
</visual>
<collision>
<origin xyz="0 0 0" rpy="1.5707963267949 0 0" />
<geometry>
<mesh filename="package://laser_dxp/meshes/laser_dxp.STL" />
</geometry>
</collision>
</link>
</robot>
Asked by dxp397@foxmail.com on 2020-03-31 09:46:51 UTC
Answers
How does xacro:laserdxp
use the prefix
parameter?
You refer to a link called laser_link
(child
of your laser_joint
), but you only specify the prefix laser
(note: no _
in prefix="laser"
).
So if xacro:laserdxp
does something like this:
<link name="${prefix}link" />
then the name of the link in the end will be laserlink
, not laser_link
(note the _
again).
Edit: based on this:
<?xml version="1.0"?>
<robot name="laser_dxp_robot" xmlns:xacro="http://wiki.ros.org/xacro">
<link name="laserlink">
[..]
</link>
</robot>
it looks like laserdxp.xacro
doesn't actually contain a xacro:macro
.
You also seem to have removed the <xacro:laserdxp prefix="laser"/>
instantation from your top-level xacro.
Could you please confirm whether this is an accurate representation of the files you have?
Asked by gvdhoorn on 2020-03-31 10:25:23 UTC
Comments
I have shown my laserdxp.xacro file.Is there anything wrong? Thank you.
Asked by dxp397@foxmail.com on 2020-03-31 18:16:53 UTC
As gvdhoorn has mentioned, can you check if "laser_link" has been defined anywhere? I could only find "laserlink" in your xacro file and hence your error message. Can you confirm if your error message is exactly the same or has it changed?
Asked by hashirzahir on 2020-04-13 06:37:42 UTC
Comments
Hi could you share the laserdxp.xacro and ur10.xacro to help you with the debugging? The base_link child was probably defined in the ur10_robot but the laser_link may not have been defined in the laserdxp.xacro.
Asked by hashirzahir on 2020-03-31 10:29:05 UTC
I have shown my laserdxp.xacro file. Thank you.
Asked by dxp397@foxmail.com on 2020-03-31 18:16:31 UTC