Robotics StackExchange | Archived questions

Error converting Collada to URDF

I have a .dae file from which I am trying to convert to extract a URDF format description of the kinematic structure to use in simulation. When i try the collada_urdf package i get this error:

$ rosrun collada_urdf collada_to_urdf *.dae *.urdf ;; Input file is: *.dae Error: 
Error document empty. at line 72 in /build/urdfdom-UJ3kd6/urdfdom-0.4.1/urdf_parser/src/model.cpp ERROR: Model Parsing the xml failed 

I am unable to locate this model.cpp file anywhere.

I get the same error when i try to run the test provided along with the package.Same error and same line number which leads me to believe I've made some error building the package.I cloned the package into my workspace and ran a catkin_make to install it, which didn't throw any errors. What am I missing?

Should i edit the colladatourdf.cpp? and if so what do i edit?

Asked by curi_ROS on 2018-09-25 02:44:44 UTC

Comments

Is your command line literally rosrun collada_urdf collada_to_urdf *.dae *.urdf? If so, that is most likely the problem: collada_to_urdf does not support specifying multiple inputs and multiple outputs in one command.

If you're not doing that, please clarify.

Asked by gvdhoorn on 2018-09-25 03:01:59 UTC

I tried rosrun collada_urdf collada_to_urdf filename.dae and I get the same error:

Error: Error document empty. at line 72 in /build/urdfdom-UJ3kd6/urdfdom-0.4.1/urdf_parser/src/model.cpp ERROR: Model Parsing the xml failed

Asked by curi_ROS on 2018-09-25 03:05:57 UTC

i specified filenames for both the .dae file and the .urdf file and it still shows me the same error

Asked by curi_ROS on 2018-09-25 03:57:17 UTC

Is your Collada file just a mesh? Or does it contain other entities?

Asked by gvdhoorn on 2018-09-25 04:00:27 UTC

I'm unclear what you mean by entities.I can tell you that i had a .stp file that i wanted to convert to URDF.When i found out that conversion was not possible directly i exported a .dae version of that file in order to use the collada_to_urdf converter.

Asked by curi_ROS on 2018-09-25 05:12:40 UTC

Collada files can contain just meshes (ie: triangles and vertices) or actual robot kinematic structure, or both, or none of that.

Btw: "convert to URDF" is a bit of a strange statement: URDF is a description format, text based, with references to meshes. It's not a mesh format itself.

Asked by gvdhoorn on 2018-09-25 05:52:39 UTC

Ok.My Collada file contains the mesh and also the kinematic structure. Does collada_to_urdf only support describing of the mesh in the final URDF file from the .dae file? If i then want a similar description of the kinematic structure is there a similar package i can use?

Asked by curi_ROS on 2018-09-25 06:11:52 UTC

Answers