Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kevinzakka/obj2mjcf
A CLI for processing composite Wavefront OBJ files for use in MuJoCo.
https://github.com/kevinzakka/obj2mjcf
mujoco robotics simulation wavefront-obj
Last synced: 3 days ago
JSON representation
A CLI for processing composite Wavefront OBJ files for use in MuJoCo.
- Host: GitHub
- URL: https://github.com/kevinzakka/obj2mjcf
- Owner: kevinzakka
- License: mit
- Created: 2022-06-07T17:58:38.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-15T16:56:20.000Z (3 months ago)
- Last Synced: 2024-12-29T16:09:17.431Z (10 days ago)
- Topics: mujoco, robotics, simulation, wavefront-obj
- Language: Python
- Homepage:
- Size: 7.24 MB
- Stars: 196
- Watchers: 6
- Forks: 22
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# obj2mjcf
[![PyPI Python Version][pypi-versions-badge]][pypi]
[![PyPI version][pypi-badge]][pypi][pypi-versions-badge]: https://img.shields.io/pypi/pyversions/obj2mjcf
[pypi-badge]: https://badge.fury.io/py/obj2mjcf.svg
[pypi]: https://pypi.org/project/obj2mjcf/`obj2mjcf` is a CLI for proccessing composite Wavefront [OBJ] files for use in [MuJoCo]. It automatically:
* Splits an OBJ file into sub-meshes that are grouped by the materials referenced in the OBJ's MTL file
* Generates an MJCF XML file that is pre-filled with materials, meshes and geom elements referencing these OBJ files
* Optionally generates a collision mesh by performing a convex decomposition of the OBJ using [CoACD]`obj2mjcf` was used to process model meshes for [MuJoCo Menagerie]:
## Motivation
As of June 2022, MuJoCo does not support composite OBJ files consisting of groups or objects (`o` or `g` OBJ tags) and only 1 material can be assigned per mesh. This means that you have to manually split your OBJ file into sub-meshes, a process that is tedious and error-prone. This tool is meant to automate this process.
## Installation
**Important.** MuJoCo support for OBJ files is only available in versions 2.1.2 and above. Make sure you upgrade to the latest version via the [Releases page](https://github.com/deepmind/mujoco/releases).
The recommended way to install this package is via [PyPI](https://pypi.org/project/obj2mjcf/):
```bash
pip install --upgrade obj2mjcf
```## Usage
Type the following at the command line for a detailed description of available options:
```bash
obj2mjcf --help
```[OBJ]: https://en.wikipedia.org/wiki/Wavefront_.obj_file
[MuJoCo]: https://github.com/deepmind/mujoco
[CoACD]: https://github.com/SarahWeiii/CoACD
[MuJoCo Menagerie]: https://github.com/deepmind/mujoco_menagerie