원클릭으로
urdf-to-mjcf
Use when bringing a URDF robot, hand, or CAD-generated model into MuJoCo MJCF and no hand-tuned upstream MJCF exists.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Use when bringing a URDF robot, hand, or CAD-generated model into MuJoCo MJCF and no hand-tuned upstream MJCF exists.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Mount an end-effector (parallel-jaw gripper, dexterous hand, suction tool, etc.) on a robot arm by attaching its MJCF to the arm's `attachment_site` via MuJoCo's MjSpec API. Use when combining an arm MJCF and an end-effector MJCF into a single combined model. Handles known gotchas the underlying script doesn't: mesh collisions, wrong mount poses, empty-prefix failures, skipped meshes, and tendon-driven hands.
Convert an MJCF (MuJoCo's XML format) to URDF for downstream consumers that don't speak MJCF (RViz, pinocchio, ROS-based motion planning, etc.). The conversion is lossy — `<equality>` constraints, position actuators, contact excludes, and keyframes are all dropped. Use this skill ONLY when a URDF-only consumer needs the kinematic tree; do not use the converted URDF for dynamics.
| name | urdf-to-mjcf |
| description | Use when bringing a URDF robot, hand, or CAD-generated model into MuJoCo MJCF and no hand-tuned upstream MJCF exists. |
Wrap scripts/convert_urdf_to_mjcf.py, which prefers K-Scale Labs
urdf2mjcf and falls back to MuJoCo's built-in URDF loader when that
package is unavailable. Then post-tune the output because raw
conversion is rarely usable as-is.
Treat this skill as a Level 0/1/1.5 generator, not a calibrated digital-twin generator:
The wrapper prints simulation_level, actuator_source, and
calibration_source. If those say generic_defaults,
template_estimate, or manual_override, the model is a starting
point for simulation, not a validated physical model.
The script gets the kinematic tree right but does not handle:
<mimic> semantics. All mimic'd joints become
independent free joints; the underlying coupling is lost.urdf2mjcf outputs can put
scale on <geom> instead of <mesh>, add a fixed-arm
<freejoint>, omit required inertial pos, and keep non-portable
file:// paths.autolimits, no implicitfast integrator. Defaults that
matter for stable dexterous-hand sim aren't set.Strong preference: check mujoco_menagerie first. If your robot
or hand already lives in
https://github.com/google-deepmind/mujoco_menagerie, adopt that
MJCF verbatim — the MuJoCo team has already tuned it, and re-running
the converter on a URDF will produce a strictly worse result.
These post-tune fixes are documented in references/gotchas.md and
the step-by-step is in references/workflow.md.
mujoco_menagerie or the manufacturer's
repo — adopt it instead. Re-tuning is wasted work.attach-end-effector and only that combined model needs to
simulate — convert the components individually first.mujoco_menagerie first. If the robot is there, copy
its MJCF into robots/<robot>/<robot>.xml and stop. Don't run
the converter.$(find pkg) and
machine-local file:///home/... mesh paths with relative paths
before conversion.pos,
fixed-base freejoints, compiler/option defaults, and basic joint
dynamics.references/gotchas.md: mimics→<equality>, inertias,
actuators, contact excludes, mesh-origin problems, and tuned
dynamics.Run from the bundle root with the bundle-local venv. The wrapped script ships with this skill. Pass an explicit output path:
cd robot-assets-skills/
./.venv/bin/python .claude/skills/urdf-to-mjcf/scripts/convert_urdf_to_mjcf.py \
robots/<robot>/<robot>.urdf \
robots/<robot>/<robot>.xml
For an SO101-style arm using STS3215-class servos as a starter template, use the explicit profile. It is still an estimate:
./.venv/bin/python .claude/skills/urdf-to-mjcf/scripts/convert_urdf_to_mjcf.py \
robots/<robot>/<robot>.urdf \
robots/<robot>/<robot>.xml \
--control-profile so101-sts3215
For a new CAD arm with unknown hardware, stay with the generic profile or override parameters explicitly:
./.venv/bin/python .claude/skills/urdf-to-mjcf/scripts/convert_urdf_to_mjcf.py \
robots/<robot>/<robot>.urdf \
robots/<robot>/<robot>.xml \
--position-kp 15 \
--position-force 3.35 \
--joint-damping 0.6 \
--joint-armature 0.028 \
--joint-frictionloss 0.052
If using the vendored converter from pathonai_diy_pipeline without
installing it into .venv, the wrapper checks this default path:
/home/aidy/Projects/pathonai_diy_pipeline/scripts/urdf2mjcf
Override it when needed:
URDF2MJCF_VENDOR_PATH=/path/to/scripts/urdf2mjcf \
./.venv/bin/python .claude/skills/urdf-to-mjcf/scripts/convert_urdf_to_mjcf.py \
robots/<robot>/<robot>.urdf \
robots/<robot>/<robot>.xml
Verify the converted MJCF compiles:
./.venv/bin/python -c "
import mujoco
m = mujoco.MjModel.from_xml_path('robots/<robot>/<robot>.xml')
print('nq=', m.nq, 'nu=', m.nu, 'nbody=', m.nbody)
"
If the wrapper falls back to MuJoCo's built-in loader, raw conversion
would produce nu = 0; the postprocess step adds starter position
actuators where possible. If K-Scale urdf2mjcf runs, generated
motors are converted to position actuators by default unless
--keep-motors is passed.
View interactively to drive the sliders (set $DISPLAY first if headless — see AGENTS.md):
./.venv/bin/python -m mujoco.viewer \
--mjcf robots/<robot>/<robot>.xml
If .venv/ is missing or broken, bootstrap per AGENTS.md's "Python
environment" section, then install this skill's requirements.
references/workflow.mdreferences/gotchas.md