How to load URDF files with .dae models into MeshCat?

I’m trying to use the JuliaRobotics ecosystem with UR robotic arms and can not find a way to open the official URDF-s. My problem is, that .dae files are not supported, and if I convert those files to .obj, then the model is placed wrongly into the scene:

My question is that, is there a way to load these “original files” without modification? Or I have to modify/build my own URDF-s? I decided to post this question, because that’s the first time I use this format, so I’m not confident with it (yet).

Unfortunately, MeshIO.jl doesn’t support native loading of .dae files yet (see, so conversion to .obj is necessary for now. MechanismGeometries.jl does automatically replace the .dae extension with .obj though, so you shouldn’t have to edit the URDF, but it prints a warning. If you want to get rid of that warning, you could do

using Logging # from stdlib
with_logger(ConsoleLogger(stderr, Base.CoreLogging.Error)) do
    # load the URDF

Some questions to get started:

  • exactly which xacro file are you using?
  • how are you calling xacro?
  • which tool are you using to convert to .obj?
1 Like

In addition to what Twan said, I do have an experimental branch of MeshIO that adds .dae file support, and you’re welcome to try it out. You can add my branch with: pkg> add .

Since this branch is still experimental, you’ll also need to tell FileIO that the .dae format exists and that MeshIO can handle it:

julia> FileIO.add_format(format"DAE", (), ".dae")

julia> FileIO.add_loader(format"DAE", :MeshIO)
1-element Array{Symbol,1}:

I’d be really curious to hear if that works well enough to load your UR10 model. If not, we can either try to fix the .dae loader or figure out what went wrong with your conversion to .obj.


@rdeits, I’ve rebased your MeshIO branch and added LightXML to the REQUIRE file: I’ve also rebased the accompanying dae-geometry branch of MechanismGeometries onto master and removed dead code: Furthermore, we’ll need

I created a git repo with my setup (contains URDF, DAE meshes, toml files, and a script):

It’s not working quite yet:

Error encountered while loading "ur_description/meshes/ur10/visual/shoulder.dae".
Fatal error:
ERROR: LoadError: MethodError: no method matching read_polylist(::Nothing)
Closest candidates are:
  read_polylist(::LightXML.XMLElement) at /Users/tkoolen/.julia/packages/MeshIO/SVI0R/src/io/dae.jl:28

Converting to .obj works fine for me by the way:

I used MeshLab to do the conversion. Run

for file in *.dae; do
    meshlabserver -i "$file" -o "${file%.*}.obj" # -om vc

in the visuals directory.

Note: on OSX, following, I needed to run

cd /Applications/
install_name_tool -add_rpath "@executable_path/../Frameworks” meshlabserver

and I added the directory containing meshlabserver (/Applications/ for me) to my PATH.


I cloned the repo, then

$ cd universal_robot/ur_description/urdf
$ xacro --inorder u10_robot.urdf.xacro > ur10_original.urdf

(I have a feeling that is not the way that it should be done, but does the trick. Probably I should use ROS’s package environment variable or something like that.)

For converting the files, I used the first online tool I found: I know it’s not an ideal solution, I will definitely will check MeshLab!
I assume that this converter hacked the coordinate frames which caused my issue.
(I will check later your other responses too!)

I couldn’t get it working. Maybe it’s the issue with the LightXML dependency.
I got the “same” warning as before:

┌ Warning: Could not find the mesh file: package://ur_description/meshes/ur10/visual/wrist2.obj. I t
ried substituting the following folders for the 'package://' prefix: ["C:\\Users\\cstamas\\Documents
\\SZTAKI\\juhulia\\Julia-Mesh-Test"]. Note that I replaced the file's original extension with .obj t
o try to find a mesh in a format I can actually load.

If it’s not problem I wouldn’t go into debugging this on my installation as @tkoolen merged the “issue” into one repo.

To be clear, the repo I created is set up for debugging the native .dae file support (not working yet), not for loading the .objs.

Does the file C:\Users\cstamas\Documents\SZTAKI\juhulia\Julia-Mesh-Test\ur_description\meshes\ur10\visual\wrist2.obj exist?

You may have to use the package_path keyword argument for URDFVisuals (see, which defaults to ros_package_path() = split(get(ENV, "ROS_PACKAGE_PATH", ""), ':') (an empty string array if the ROS_PACKAGE_PATH environment variable isn’t set). But then again you were apparently able to load meshes (even if they weren’t the right ones) before, so not sure what’s going wrong now.

1 Like

To be clear, the repo I created is set up for debugging the native .dae file support (not working yet), not for loading the .obj s.

Yes, I’m aware of it, I was just going through every answer and checked them with my configuration.

Does the file C:\Users\cstamas\Documents\SZTAKI\juhulia\Julia-Mesh-Test\ur_description\meshes\ur10\visual\wrist2.obj exist?

No, it doesn’t, I was trying to parse the .dae files with @rdeits MeshIO branch.

After that, I tried your repo:

I created a git repo with my setup (contains URDF, DAE meshes, toml files, and a script):

As expected I got the same MethodError as you.
I had some troubles with MeshLab, but now it’s working fine and the converted .obj-s are also perfect.

I appreciate your help and detailed answers!
Also thank your for the JuliaRobotics ecosystem, these packages are very helpful for my work!

Ah, I thought you meant the .obj route wasn’t working.

Thanks, and glad to hear! I hope we can get the native .dae support working soonish. I’m afraid I’m stretched a little thin, so for anybody watching this thread, this would be a great way to contribute.

1 Like

We’ve made some progress on loading other file formats, also reflected in The collision geometry for the UR10 (STL files) now loads natively with various experimental branches of packages (be sure to ] instantiate), but there still seems to be an issue with the visual geometry (DAE files), see

1 Like

Thank you!
I’ll definitely test it, but I have to finish my semester before…