Tools for generating MuJoCo models and Gym-style environments for isoperimetric truss robots.
Project description
mujoco-truss-gen
mujoco-truss-gen is a Python package for generating MuJoCo models and
Gymnasium-style environments for triangle-based isoperimetric truss robots.
The package is intended for members of the isoperimetric robot research workflow who need a shared, installable source of MuJoCo robot models instead of copying model-generation code between reinforcement learning, planning, simulation, and optimization projects.
Status
This repository is an internal lab prototype. It has a working installable package, built-in structure presets, a small public API, and tests that verify basic model generation and environment stepping. The API may still change before the package is treated as stable research infrastructure.
Supported workflows include:
- Generate MuJoCo
MjSpecmodels for triangle-based truss structures. - Use built-in
"octahedron","icosahedron","solar_array", and"tetrahedron"presets. - Build abstract slide-joint models or realistic triangle-body models.
- Save generated MuJoCo XML.
- Wrap generated models in Gymnasium-compatible environments.
- Convert STL meshes into experimental routed-tube shape dictionaries.
Installation
After a release has been published to PyPI:
python -m pip install mujoco-truss-gen
For local development from a clone:
git clone https://github.com/isaa-sudweeks/mujoco-truss-gen.git
cd mujoco-truss-gen
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e ".[dev]"
The package requires Python 3.10 or newer and installs these runtime dependencies:
gymnasiummujoconumpyscipy
Quick Start
Generate the built-in octahedron model:
from mujoco_truss_gen import get_mujoco_spec
spec = get_mujoco_spec("octahedron", realistic=False)
model = spec.compile()
Save generated XML:
from mujoco_truss_gen import get_mujoco_spec, save_xml
spec = get_mujoco_spec("octahedron", realistic=False)
xml_path = save_xml(spec, "octahedron.xml")
Run one Gymnasium step:
import numpy as np
from mujoco_truss_gen import MujocoRelativeObsEnv, TrussEnvConfig, get_mujoco_spec
spec = get_mujoco_spec("octahedron", realistic=False)
env = MujocoRelativeObsEnv(
TrussEnvConfig(
model_source=spec,
max_steps=1_000,
nsubsteps=4,
speed=0.01,
)
)
obs, info = env.reset(seed=0)
action = np.zeros(env.action_space.shape, dtype=np.float32)
obs, reward, terminated, truncated, info = env.step(action)
env.close()
Open the built-in octahedron model from the command line:
python -m mujoco_truss_gen.generate_mujoco_model
On macOS, MuJoCo's passive viewer may require running viewer scripts with
mjpython instead of the standard python executable.
Routed continuous-tube presets such as tetrahedron are unconstrained
all-edge-actuated models. They also support realistic=True, which clones
shared routed node occurrences and connects them through in-plane bisector rods.
Use MujocoNodeVelocityCommandEnv for node-level scalar velocity commands that
are mapped through the route incidence matrix to edge actuator commands. For
manual testing, view_node_velocity_terminal(spec) opens the MuJoCo viewer and
accepts terminal commands such as set node_2 0.01, show, zero, and quit.
Documentation
- Model generation: custom trusses, routed shape dictionaries, model modes, and generation helper contracts.
- Environments: environment constructors, actions,
observations, rewards, rendering, and
TrussEnvConfig. - STL import: optional STL-to-routed-tube conversion and preview behavior.
- GNN utilities: extracting graph features and edge indices for PyTorch Geometric workflows.
- Development: local setup, tests, linting, formatting, and package builds.
- Releasing: automated and manual PyPI release steps.
- Roadmap: known limitations and planned work.
Example
Start from the included custom-truss example:
python examples/custom_truss.py
Citation
There is no formal citation for this package yet.
License
This project is distributed under the BSD-3-Clause license. See LICENSE for
the full license text.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mujoco_truss_gen-0.7.4.tar.gz.
File metadata
- Download URL: mujoco_truss_gen-0.7.4.tar.gz
- Upload date:
- Size: 65.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ce8ebde369aaf54dd796886babe55d2d1d42a5e1639f690e06825d042ac1b9c
|
|
| MD5 |
99fb036e29c8ee5eda26bd0643750464
|
|
| BLAKE2b-256 |
80f6b44dcd2027e45c260b67a577f3489c606379b313b1d4fead364315beca71
|
Provenance
The following attestation bundles were made for mujoco_truss_gen-0.7.4.tar.gz:
Publisher:
publish.yml on isaa-sudweeks/mujoco-truss-gen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mujoco_truss_gen-0.7.4.tar.gz -
Subject digest:
0ce8ebde369aaf54dd796886babe55d2d1d42a5e1639f690e06825d042ac1b9c - Sigstore transparency entry: 1712070314
- Sigstore integration time:
-
Permalink:
isaa-sudweeks/mujoco-truss-gen@973ee764f44fe2ff8cfdc1c31db9789281544434 -
Branch / Tag:
refs/tags/v0.7.4 - Owner: https://github.com/isaa-sudweeks
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@973ee764f44fe2ff8cfdc1c31db9789281544434 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mujoco_truss_gen-0.7.4-py3-none-any.whl.
File metadata
- Download URL: mujoco_truss_gen-0.7.4-py3-none-any.whl
- Upload date:
- Size: 59.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0cac94f11dc30aec4ff18a2269f8a8312326ddbd276efef533249322930d54e
|
|
| MD5 |
59193d09fed62592290cf4efd8d2c7d7
|
|
| BLAKE2b-256 |
670f74e8c0215db1cb37bef559f43bb5a965c912967798af8c068ca38c610ecc
|
Provenance
The following attestation bundles were made for mujoco_truss_gen-0.7.4-py3-none-any.whl:
Publisher:
publish.yml on isaa-sudweeks/mujoco-truss-gen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mujoco_truss_gen-0.7.4-py3-none-any.whl -
Subject digest:
a0cac94f11dc30aec4ff18a2269f8a8312326ddbd276efef533249322930d54e - Sigstore transparency entry: 1712070381
- Sigstore integration time:
-
Permalink:
isaa-sudweeks/mujoco-truss-gen@973ee764f44fe2ff8cfdc1c31db9789281544434 -
Branch / Tag:
refs/tags/v0.7.4 - Owner: https://github.com/isaa-sudweeks
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@973ee764f44fe2ff8cfdc1c31db9789281544434 -
Trigger Event:
release
-
Statement type: