Skip to main content

DrakeUni

简体中文

Experimental Drake batch simulation runtime for UniLab's Drake backend adapter.

Current scope:

  • Compiled C++/pybind batch pool driven by parsed MJCF model contracts.
  • nbatch and nthread worker control.
  • Python API modeled after MuJoCoUni's BatchEnvPool direction.
  • Intended to be consumed by UniLab's Drake backend adapter.

This is not a full Drake backend yet. The current runtime expects a model file, environment count, simulation step size, and worker count. Task semantics such as base-body meaning, named sensor views, rewards, and observations belong to the consuming UniLab backend/task layer.

The input model is the original UniLab MJCF scene, for example scene_flat.xml. DrakeUni materializes a temporary Drake-compatible copy at runtime by expanding MJCF defaults and converting unsupported mesh formats when needed. Callers should not commit or pass pre-generated files such as *_drake.xml or converted OBJ asset directories.

Directory Roles

src/drake_uni/runtime/ is the Python-facing runtime interface. It owns the public config/data contracts, MJCF contract parsing, Drake-compatible MJCF materialization, runtime construction, and the reset/step/sensor API used by UniLab.

src/drake_uni/compiled/ is the native extension layer. It contains the C++ Drake batch pool source and the built pybind extension that performs batched physics stepping.

The intended call path is:

UniLab DrakeBackend
  -> drake_uni.runtime
      -> drake_uni.compiled.DrakeEnvPool
          -> Drake C++ simulation

Build Batch Extension

uv run python scripts/build_drake_batch.py --drake-home /Users/huanghaochen/solver/drake/install

The extension is written to src/drake_uni/compiled/_drake_env_pool*.so. The Drake prefix must provide include/drake, include/pybind11, and the Drake shared library. The generated extension is local build output and is not committed.

Development

The repository uses uv for reproducible local development:

make sync
make install
make check
make build DRAKE_HOME=/path/to/drake/install

make check runs Ruff and pytest. Parser tests that depend on a sibling UniLab checkout skip themselves when its assets are unavailable. See AGENTS.md for the native build contract, scope boundaries, and release workflow.

Install Editable

From a consuming project:

uv pip install -e /Users/huanghaochen/solver/drake_uni

Runtime API

from drake_uni.runtime import DrakeBatchConfig, create_runtime

runtime = create_runtime(
    DrakeBatchConfig(
        model_file="/path/to/scene_flat.xml",
        num_envs=32,
        sim_dt=0.002,
        nthread=8,
    )
)

The preferred integration point is drake_uni.runtime. DrakeEnvPool and the compiled extension are lower-level implementation details.

Metadata

Release files for drake-uni 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for drake-uni 0.1.0
File Size Uploaded Provenance
drake_uni-0.1.0.tar.gz 36.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for drake-uni 0.1.0
File Interpreter ABI Platform
drake_uni-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 71.8 kB

Release files / drake_uni-0.1.0.tar.gz

Download URL drake_uni-0.1.0.tar.gz
Size 36.8 kB
Tags Source
SHA-256 checksum
How to use checksums
46875ba06685ab73ab9b77a955f04c441c2aef21f8e15a9199a2d2c0ebb328f3
BLAKE2b-256 checksum
How to use checksums
953a248c89902111de84dd8bbaa947da87f80a4ec6e251197f4b82f6636eb0fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / drake_uni-0.1.0-py3-none-any.whl

Download URL drake_uni-0.1.0-py3-none-any.whl
Size 34.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7acb6c39b5c343c6875137cc2589d7708f1d9afd5ed5da1cc93b7647e09ef5f0
BLAKE2b-256 checksum
How to use checksums
a058ac1b25a33b34965c3ef0a414fa595cea21cb2c9b6d18fe10da0da67a23d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for drake-uni 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page