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.
nbatchandnthreadworker control.- Python API modeled after MuJoCoUni's
BatchEnvPooldirection. - 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.
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 drake_uni-0.1.0.tar.gz.
File metadata
- Download URL: drake_uni-0.1.0.tar.gz
- Upload date:
- Size: 36.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46875ba06685ab73ab9b77a955f04c441c2aef21f8e15a9199a2d2c0ebb328f3
|
|
| MD5 |
e2977ee59e38ee1ba7999a203cf62746
|
|
| BLAKE2b-256 |
953a248c89902111de84dd8bbaa947da87f80a4ec6e251197f4b82f6636eb0fc
|
File details
Details for the file drake_uni-0.1.0-py3-none-any.whl.
File metadata
- Download URL: drake_uni-0.1.0-py3-none-any.whl
- Upload date:
- Size: 34.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7acb6c39b5c343c6875137cc2589d7708f1d9afd5ed5da1cc93b7647e09ef5f0
|
|
| MD5 |
f4f7ba8d98cb7dbeb4af5ba22b31d6ea
|
|
| BLAKE2b-256 |
a058ac1b25a33b34965c3ef0a414fa595cea21cb2c9b6d18fe10da0da67a23d3
|