google-deepmind / google-deepmind/mujoco
URDF <mimic> is dropped silently, while <dynamics> and <limit effort> in the same parser are honoured
- Dominant language
- C++
- Stars
- 15.2k
- Forks
- 1.8k
- Avg merge
- 10d 16h
- Merged PRs (30d)
- 25
Description
`src/xml/xml_urdf.cc` contains no handling for `` -- `grep -ci mimic`
over the file returns 0, and a repo-wide search under `src/` finds it only in
two unrelated USD schema files.
The consequence is quiet. A parallel-jaw gripper URDF -- Robotiq 2F85/2F140,
Franka Hand, Schunk, and most multi-finger hands -- declares its coupled finger
joints with ``, loads without error, and comes back with those joints as
independent uncontrolled DOFs. Nothing warns, so the first symptom is a gripper
that will not close symmetrically, or an `nq` that does not match expectations.
I want to be careful about what I am claiming, because "URDF is intentionally a
subset of MJCF" is a reasonable position and I would not argue with it in
general. What makes this one look like an inconsistency rather than a policy is
its immediate neighbours in the same file: `xml_urdf.cc:463` reads
``, and `:485-490` maps `` onto `actfrcrange`. Those are
physical joint properties honoured a few lines from one that is discarded in
silence.
MuJoCo also already has the target construct -- `` with
`polycoef` -- so a linear `` is representable. Genesis performs exactly
that translation in its URDF importer, which is at least an existence proof that
the mapping is workable.
**The ask I would actually make is the smaller one: warn.** A single line naming
the dropped `` joints at parse time removes the silence, costs nothing in
behaviour, and does not commit the parser to supporting a construct you may not
want. Translating to an equality is the larger option and I would not press for
it.
Happy to send either as a PR if there is appetite -- warning-only, or
warning plus the `polycoef` translation with tests. If the answer is "URDF is a
subset and that is deliberate", a note to that effect in the URDF extensions
section of `doc/modeling.rst` would still save the next person the debugging;
`mimic` currently appears nowhere in that document.
Context: found while importing gripper URDFs into another simulator, where the
same omission on our side produced a gripper whose fingers drifted apart under
asymmetric load. Ours warns now.
Contributor guide
Research direction
Start in src/xml/xml_urdf.cc, inspecting the existing handling around line 463 and mapping around lines 485-490, then trace how unsupported URDF elements are reported. Confirm the warning-only scope and make completion mean that dropped joints are named at parse time without changing joint behavior; document the deliberate subset in doc/modeling.rst only if that is the chosen resolution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- robotics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100