Skip to content

URDF decoding error with MuJoCo 3.4 #3003

@adamheins

Description

@adamheins

Intro

Hi!

I am a postdoc at the University of Toronto; I use MuJoCo for my research on robot manipulation and in particular as an output format for my xacro file conversion tool xacrodoc.

My setup

I'm using MuJoCo via Python 3.12 on Ubuntu 24.04, and I'm noticing a difference between MuJoCo v3.3.7 and v3.4.0.

What's happening? What did you expect?

Creating an MjSpec from a URDF file with extension .urdf fails with error mujoco.FatalError: Could not find decoder for resource when using MuJoCo v3.4.0, but it succeeds with v3.3.7. I'm not sure if this was an expected change, but I did not see it in the changelog.

Note that this can be easily fixed by changing the file extension to .xml instead, but I noticed the issue because the behaviour changed between versions.

Steps for reproduction

  1. Create the minimal URDF file below (any valid URDF will do).
  2. Run the Python code below to load the URDF as a MjSpec.
  3. Observe the error noted above when using MuJoCo v3.4 (but not v3.3.7 or below).

Minimal model for reproduction

Save the URDF model below as test.urdf:

minimal URDF
<?xml version="1.0" ?>
<robot name="tool">
  <link name="tool"/>
</robot>

Code required for reproduction

import mujoco

# assuming you saved the URDF above as 'test.urdf'
spec = mujoco.MjSpec.from_file("test.urdf")

Confirmations

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions