URDF → MJCF conversion for complex models #3176
Unanswered
AntonioViscomi
asked this question in
Asking for Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Intro
Hi!
I am a robotics engineer working on simulations of the iCub humanoid robot using MuJoCo. Specifically, I am trying to transition from a well-validated URDF model to an MJCF model.
My setup
My question
I tried several URDF-to-MJCF converters, but none of them successfully handled this conversion.
Our model is large and complex (many rigid bodies, frames, meshes, etc.), which makes the converter output difficult to navigate and compare against the original model to diagnose what went wrong.
I therefore decided to write a custom conversion script based on
dm_controlthat replicates the URDF structure as closely as possible, aiming for a near one-to-one mapping. As a result, the output MJCF retains the URDF convention of having two meshes per body:conaffinity/contypeset to 0);conaffinity/contypevalues).I am aware this approach deviates from idiomatic MJCF conventions, however, I am still early in my MuJoCo journey and my priority was correctness first. The visual-only meshes can later be removed either manually or programmatically, relying solely on the collision meshes for both purposes.
So, my questions are the following:
Does keeping separate visualization and collision meshes per body introduce meaningful overhead in simulation performance?
What is the recommended, reliable, and sustainable way to programmatically convert URDF models to MJCF, especially for large models (e.g. humanoids)?
As a starting point, the attached XML was obtained via the
compileprebuilt binary. Two known issues arise immediately:damping="10"). I believe this is caused by inter-mesh collisions (i.e., adjacent or overlapping collision meshes) generating large contact forces at initialization. This makes me think that a correct URDF → MJCF conversion pipeline should also include an explicit collision integrity check step (e.g., verifying no meshes overlap in the default pose). Is this assumption correct, and if so, what tooling or methodology do you recommend for this?To reproduce my issue, the required meshes can be found at:
robotology/icub-models @ 0772c7Minimal model and/or code that explain my question
Model:
minimal XML
Confirmations
Beta Was this translation helpful? Give feedback.
All reactions