---
name: urdf2mjcf-ad2264ed5f7b
description: Convert URDF robot descriptions to MJCF format for MuJoCo simulation. Handles meshes, joints, actuators, and collision geometries.
version: 1.0.0
category: robotics-tools
author: K-Scale Labs
source: kscalelabs/urdf2mjcf
license: MIT
trit: -1
trit_label: MINUS
color: "#4615B7"
verified: false
featured: false
---

# URDF2MJCF Skill

**Trit**: -1 (MINUS - analysis/transformation)
**Color**: #4615B7 (Deep Violet)
**URI**: skill://urdf2mjcf#4615B7

## Overview

Convert URDF (Unified Robot Description Format) files to MJCF (MuJoCo XML Format) for simulation in MuJoCo and MJX. Handles meshes, joints, actuators, and collision geometries.

## Usage

```bash
# CLI conversion
urdf2mjcf robot.urdf --output robot.mjcf

# With options
urdf2mjcf robot.urdf \
    --output robot.mjcf \
    --mesh-dir ./meshes \
    --add-actuators \
    --collision-margin 0.001
```

```python
from urdf2mjcf import convert

# Programmatic conversion
mjcf_xml = convert(
    urdf_path="robot.urdf",
    mesh_dir="./meshes",
    add_actuators=True,
    collision_margin=0.001,
)

# Save to file
with open("robot.mjcf", "w") as f:
    f.write(mjcf_xml)
```

## Features

- **Mesh Handling**: Converts STL/OBJ meshes, scales appropriately
- **Joint Mapping**: URDF revolute/prismatic → MJCF hinge/slide
- **Actuator Generation**: Auto-generates position/velocity actuators
- **Collision Geometry**: Convex decomposition, margin adjustment
- **Inertia Cleanup**: Fixes common URDF inertia issues

## Pipeline

```
┌─────────────┐    ┌─────────────┐    ┌─────────────┐
│  URDF File  │───▶│  urdf2mjcf  │───▶│  MJCF File  │
│  (ROS/SDF)  │    │  Converter  │    │  (MuJoCo)   │
└─────────────┘    └─────────────┘    └─────────────┘
       │                  │                  │
       ▼                  ▼                  ▼
   Meshes STL        Link transforms     Physics props
   Joint limits      Mass/inertia        Actuator defs
   Visual geom       Collision geom      Sensor defs
```

## GF(3) Triads

```
urdf2mjcf (-1) ⊗ kos-firmware (+1) ⊗ mujoco-scenes (0) = 0 ✓
```

## Related Skills

- `ksim-rl` (-1): Uses converted MJCF for training
- `kos-firmware` (+1): Robot firmware
- `mujoco-scenes` (0): Scene composition
- `kbot-humanoid` (-1): K-Bot robot model

## References

```bibtex
@misc{urdf2mjcf2024,
  title={URDF to MJCF Converter},
  author={K-Scale Labs},
  year={2024},
  url={https://github.com/kscalelabs/urdf2mjcf}
}
```


---
Source attribution: plurigrid
Original project: https://github.com/plurigrid/asi/blob/293ce9f76e3abcd5ba18db284688bc0d9ac6691d/plugins/asi/skills/urdf2mjcf/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2025 SkillCreator.ai

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: plurigrid
Original project: https://github.com/plurigrid/asi/blob/293ce9f76e3abcd5ba18db284688bc0d9ac6691d/plugins/asi/skills/urdf2mjcf/SKILL.md
Attribution basis: Source repository record

Fields of work: Development & Engineering
Roles: Backend Developer, Data Engineer, ML / AI Engineer
Specialties: API
Tools: Mujoco
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: e0b067a4c5839eecb3ea5f4d59ba5360fb461a4ac992103ac06be974de72d151
