Two root links found: [arm_base] and [base_link] error even on declaring parent-child relationship

asked 2020-06-03 12:27:01 -0500

Nirhar gravatar image

Hello! I got the above two root links error on trying to run this code:

<link name="base_link"></link>
  :
   <!-- links for arm_base, bicep, , bottom_wrist, elbow, top_wrist are defined here -->
  :
 <xacro:arm_joint prefix="arm_base" parent="base_link" child="arm_base" originxyz="0.0 0.0 0.1" originrpy="0 0 0"/>
<xacro:arm_joint prefix="shoulder" parent="arm_base" child="bicep" originxyz="-0.05166 0.0 0.20271" originrpy="0 0 1.5708" >
<xacro:arm_joint prefix="bottom_wrist" parent="bicep" child="bottom_wrist" originxyz="0.0 -0.05194 0.269" originrpy="0 0 0" />
<xacro:arm_joint prefix="elbow" parent="bottom_wrist" child="elbow" originxyz="0.0 0 0.13522" originrpy="0 0 0" />
<xacro:arm_joint prefix="top_wrist" parent="elbow" child="top_wrist" originxyz="0.0 0 0.20994" originrpy="0 0 0" />

I tried to execute this code on check_urdf, where i am getting this error. As you can see I have already defined a joint that makes base_link the parent of arm_base. Even trying to run the corresponding launch file also gives me the same error Then why am I getting this error?

I am new to ROS and any help would be appreciated

edit retag flag offensive close merge delete

Comments

Hi @Nirhar,

Can you provide more information about your xacro files, maybe link the files you are using? I guess there is something wrong in you arm_joint macro but we will need the file to determine this.

Weasfas gravatar image Weasfas  ( 2020-06-05 06:36:17 -0500 )edit

Thanks for the response!! Follow this link to access the code: file1-robot_arm.urdf.xacro

file2-robot_arm_essentials.xacro, contains arm_joint definition Grateful for your help!

Nirhar gravatar image Nirhar  ( 2020-06-07 08:44:54 -0500 )edit

Are you sure that is the repository you are using?

I have cloned it, execute: check_urdf <(xacro robot_arm.urdf.xacro) to check the resultant URDF file and the output is:

---------- Successfully Parsed XML ---------------
root Link: base_link has 1 child(ren)
    child(1):  arm_base
        child(1):  bicep
            child(1):  bottom_wrist
                child(1):  elbow
                    child(1):  top_wrist

I do not know why you had that error since the robot_description is OK.

P.D.: Note that in gazebo_essentials_arm.xacro file you have bottom_wrist_joint repeated in the joint_state_publisher plugin. However, why using a gazebo plugin if you are already using ros_control? load a joint_state_controller with your controller_spawner. Have you checked this tutorial?

Weasfas gravatar image Weasfas  ( 2020-06-07 10:43:20 -0500 )edit