Ask Your Question
0

URDF with multiple root links found

asked 2019-02-19 11:15:59 -0500

kronos625 gravatar image

Hello all,

I am attempting to create a 4 wheeled vehicle with a full spring/suspension system. I have attached the URDF here, and when running my script I get an error that says I have multiple root links. I cannot see where this would be occurring, or if that it is being caused by another issue that I am missing.

Any help would be appreciated, thanks in advance.

URDF File: https://drive.google.com/file/d/1Ns3c...

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2019-02-20 01:54:32 -0500

Delb gravatar image

updated 2019-02-20 02:02:23 -0500

You have some tools available to help you debug urdf files, you can check it at the urdf wiki page. Personnally I use :

check_urdf /PATH/TO/URDF

When running this with your urdf the output is :

Error:   joint limit: no effort
         at line 146 in /build/urdfdom-UJ3kd6/urdfdom-0.4.1/urdf_parser/src/joint.cpp
Error:   Could not parse limit element for joint [steering_joint_left_1]
         at line 494 in /build/urdfdom-UJ3kd6/urdfdom-0.4.1/urdf_parser/src/joint.cpp
Error:   joint xml is not initialized correctly
         at line 207 in /build/urdfdom-UJ3kd6/urdfdom-0.4.1/urdf_parser/src/model.cpp
ERROR: Model Parsing the xml failed

Eventhough the lines are not the ones from the urdf file it can directly tells you that something is wrong with a limit tag within a joint tag. After a quick search in the file you'll see that at the lines 327 and 349 you miss the attributes effort and velocity within the limit tag.

After correcting that, the output of the previous command is now :

Error:   Failed to find root link: Two root links found: [body] and [suspension_main_right_2]
         at line 238 in /build/urdfdom-UJ3kd6/urdfdom-0.4.1/urdf_parser/src/model.cpp
ERROR: Model Parsing the xml failed

This error means that there are two links in your urdf that are not a child of any other link. You can only have one link like that : it's called the root link. The tools tells you that body and suspension_main_right_2 are defined as root links. So all you have to do is correct your urdf to set a parent to suspension_main_right_2.

Once you've done it you can print the graph of your link with :

urdf_to_graphiz /PATH/TO/URDF

Note : After I did it (by setting the parent of suspension_main_right_2 to body) your graph looks odd to me, is it intended to have suspension_left_1 being the child of suspension_holder_left_1 AND of suspension_main_left_1 (same with right and 1,2) ?


Edit : After checking again, I've found out that suspension_main_right_2 has no parents because of a typo probably. For the joint spring_right_2 the child is set to suspension_main_left_2 instead of suspension_main_right_2.

edit flag offensive delete link more

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-02-19 11:15:59 -0500

Seen: 3,077 times

Last updated: Feb 20 '19