simrig 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- simrig-0.2.2/LICENSE +21 -0
- simrig-0.2.2/PKG-INFO +238 -0
- simrig-0.2.2/README.md +208 -0
- simrig-0.2.2/pyproject.toml +45 -0
- simrig-0.2.2/setup.cfg +4 -0
- simrig-0.2.2/simrig/__init__.py +82 -0
- simrig-0.2.2/simrig/_version.py +3 -0
- simrig-0.2.2/simrig/browser_render.py +145 -0
- simrig-0.2.2/simrig/browser_shell.py +130 -0
- simrig-0.2.2/simrig/cli.py +412 -0
- simrig-0.2.2/simrig/core.py +144 -0
- simrig-0.2.2/simrig/custom_env.py +109 -0
- simrig-0.2.2/simrig/huggingface.py +78 -0
- simrig-0.2.2/simrig/io.py +49 -0
- simrig-0.2.2/simrig/live_view.py +553 -0
- simrig-0.2.2/simrig/model_view.py +944 -0
- simrig-0.2.2/simrig/mujoco_backend.py +197 -0
- simrig-0.2.2/simrig/paths.py +54 -0
- simrig-0.2.2/simrig/playground_backend.py +603 -0
- simrig-0.2.2/simrig/presets.py +93 -0
- simrig-0.2.2/simrig/preview.py +956 -0
- simrig-0.2.2/simrig/rendering.py +127 -0
- simrig-0.2.2/simrig/scaffold.py +127 -0
- simrig-0.2.2/simrig/three_scene.py +107 -0
- simrig-0.2.2/simrig/validate_env.py +211 -0
- simrig-0.2.2/simrig.egg-info/PKG-INFO +238 -0
- simrig-0.2.2/simrig.egg-info/SOURCES.txt +43 -0
- simrig-0.2.2/simrig.egg-info/dependency_links.txt +1 -0
- simrig-0.2.2/simrig.egg-info/entry_points.txt +2 -0
- simrig-0.2.2/simrig.egg-info/requires.txt +19 -0
- simrig-0.2.2/simrig.egg-info/top_level.txt +1 -0
- simrig-0.2.2/tests/test_cli.py +221 -0
- simrig-0.2.2/tests/test_core.py +60 -0
- simrig-0.2.2/tests/test_custom_env.py +129 -0
- simrig-0.2.2/tests/test_demo_reach.py +34 -0
- simrig-0.2.2/tests/test_huggingface.py +36 -0
- simrig-0.2.2/tests/test_jax_compat.py +23 -0
- simrig-0.2.2/tests/test_live_view.py +68 -0
- simrig-0.2.2/tests/test_model_view.py +133 -0
- simrig-0.2.2/tests/test_mujoco_integration.py +41 -0
- simrig-0.2.2/tests/test_paths.py +53 -0
- simrig-0.2.2/tests/test_playground_backend.py +65 -0
- simrig-0.2.2/tests/test_presets.py +34 -0
- simrig-0.2.2/tests/test_rendering.py +90 -0
- simrig-0.2.2/tests/test_scaffold.py +67 -0
simrig-0.2.2/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 SimRig contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
simrig-0.2.2/PKG-INFO
ADDED
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: simrig
|
|
3
|
+
Version: 0.2.2
|
|
4
|
+
Summary: Agent- and human-friendly workflows for MuJoCo Playground training and evaluation.
|
|
5
|
+
Author: SimRig contributors
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Su1eym4n/simrig
|
|
8
|
+
Project-URL: Repository, https://github.com/Su1eym4n/simrig
|
|
9
|
+
Project-URL: Issues, https://github.com/Su1eym4n/simrig/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/Su1eym4n/simrig/blob/main/CHANGELOG.md
|
|
11
|
+
Requires-Python: >=3.10
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Provides-Extra: mujoco
|
|
15
|
+
Requires-Dist: mujoco; extra == "mujoco"
|
|
16
|
+
Provides-Extra: hf
|
|
17
|
+
Requires-Dist: huggingface_hub; extra == "hf"
|
|
18
|
+
Provides-Extra: playground
|
|
19
|
+
Requires-Dist: gymnasium[mujoco]; extra == "playground"
|
|
20
|
+
Requires-Dist: mujoco; extra == "playground"
|
|
21
|
+
Requires-Dist: jax; extra == "playground"
|
|
22
|
+
Requires-Dist: brax; extra == "playground"
|
|
23
|
+
Requires-Dist: playground; extra == "playground"
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: build; extra == "dev"
|
|
26
|
+
Requires-Dist: numpy; extra == "dev"
|
|
27
|
+
Requires-Dist: pytest; extra == "dev"
|
|
28
|
+
Requires-Dist: twine; extra == "dev"
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
|
|
31
|
+
# SimRig
|
|
32
|
+
|
|
33
|
+
Turn MuJoCo robots into trained policies with agent-guided task design, PPO
|
|
34
|
+
training, evaluation, and interactive previews.
|
|
35
|
+
|
|
36
|
+
SimRig combines:
|
|
37
|
+
|
|
38
|
+
- a Python CLI that inspects models, runs MuJoCo Playground environments,
|
|
39
|
+
trains Brax PPO policies, evaluates checkpoints, and serves previews;
|
|
40
|
+
- an agent skill that teaches Codex, Claude Code, and Cursor how to use that
|
|
41
|
+
pipeline safely.
|
|
42
|
+
|
|
43
|
+
Raw robot XML is not automatically a training task. SimRig helps the agent move
|
|
44
|
+
from a model and a requested behavior to explicit observations, actions,
|
|
45
|
+
rewards, resets, termination conditions, validation, training, and evaluation.
|
|
46
|
+
|
|
47
|
+
## What SimRig can do
|
|
48
|
+
|
|
49
|
+
| Goal | SimRig workflow |
|
|
50
|
+
|---|---|
|
|
51
|
+
| Train a known Playground robot | Inspect the environment, smoke-test it, train, evaluate, and preview |
|
|
52
|
+
| Use a custom MJCF/XML robot | Inspect the model, define the task, create an editable environment, then validate and train |
|
|
53
|
+
| Build locomotion or posture behaviors | Design command tracking, contacts, rewards, failures, and evaluation scenarios |
|
|
54
|
+
| Build custom scenes | Add terrain, props, targets, sensors, cameras, or contact rules in ordinary MJCF and Python |
|
|
55
|
+
| Evaluate an existing policy | Run reproducible headless rollouts and open a browser or native MuJoCo preview |
|
|
56
|
+
|
|
57
|
+
SimRig v0 uses MuJoCo and MuJoCo Playground. Isaac Lab is not currently a
|
|
58
|
+
supported backend.
|
|
59
|
+
|
|
60
|
+
## Installation
|
|
61
|
+
|
|
62
|
+
SimRig requires Python 3.10 or newer. Install the Playground training stack
|
|
63
|
+
from PyPI:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
python3.12 -m venv .venv
|
|
67
|
+
source .venv/bin/activate
|
|
68
|
+
python -m pip install --upgrade pip
|
|
69
|
+
python -m pip install "simrig[playground]"
|
|
70
|
+
|
|
71
|
+
simrig --version
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
For an editable source installation, clone the repository and install from its
|
|
75
|
+
root instead:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
git clone https://github.com/Su1eym4n/simrig.git
|
|
79
|
+
cd simrig
|
|
80
|
+
python3.12 -m venv .venv
|
|
81
|
+
source .venv/bin/activate
|
|
82
|
+
python -m pip install --upgrade pip
|
|
83
|
+
python -m pip install -e ".[playground]"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Development dependencies, tests, and contribution checks are documented in
|
|
87
|
+
[CONTRIBUTING.md](CONTRIBUTING.md).
|
|
88
|
+
|
|
89
|
+
## Install the agent skill
|
|
90
|
+
|
|
91
|
+
Inside this repository, Codex discovers the SimRig skill automatically through
|
|
92
|
+
`.agents/skills/simrig`.
|
|
93
|
+
|
|
94
|
+
To make the skill available from any project, install it globally with the
|
|
95
|
+
Skills CLI:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
npx skills add Su1eym4n/simrig --skill simrig --global
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
The installer supports Codex, Claude Code, Cursor, and other agents. Restart the
|
|
102
|
+
agent after installation. See
|
|
103
|
+
[Agent skill installation](docs/skill-installation.md) for provider-specific
|
|
104
|
+
commands, manual installation, and troubleshooting.
|
|
105
|
+
|
|
106
|
+
## Use SimRig
|
|
107
|
+
|
|
108
|
+
Open a project containing a MuJoCo robot or scene and ask the agent naturally:
|
|
109
|
+
|
|
110
|
+
> Train this MuJoCo robot to walk forward.
|
|
111
|
+
|
|
112
|
+
> Create a crouching task for this robot, smoke-test it, and start a small
|
|
113
|
+
> training run.
|
|
114
|
+
|
|
115
|
+
> Evaluate this checkpoint across five seeds and preview the policy.
|
|
116
|
+
|
|
117
|
+
You can invoke the workflow explicitly with `$simrig`, but the skill can also
|
|
118
|
+
activate automatically when the request matches its description.
|
|
119
|
+
|
|
120
|
+
### Existing Playground environment
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
simrig list-envs --backend mujoco-playground
|
|
124
|
+
simrig inspect-env Go1JoystickFlatTerrain
|
|
125
|
+
simrig smoke Go1JoystickFlatTerrain --steps 10
|
|
126
|
+
simrig train Go1JoystickFlatTerrain --preset smoke
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Use the `smoke` preset before a longer `local` or `cloud` configuration.
|
|
130
|
+
|
|
131
|
+
### Custom robot or scene
|
|
132
|
+
|
|
133
|
+
Inspect the model before designing a task:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
simrig inspect-model path/to/robot.xml --save-report
|
|
137
|
+
simrig view-model path/to/robot.xml --port 8766
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Open `http://127.0.0.1:8766/` to inspect the compiled model, orbit/zoom/pan the
|
|
141
|
+
camera, and adjust named joints. The default `threejs` renderer sends MuJoCo's
|
|
142
|
+
visual meshes and primitives to a GPU-accelerated WebGL scene, so camera motion
|
|
143
|
+
stays smooth without streaming image frames from Python. If the MJCF defines a
|
|
144
|
+
keyframe, the viewer starts from its first authored pose and **Reset Joints**
|
|
145
|
+
restores it.
|
|
146
|
+
|
|
147
|
+
The Three.js modules are pinned and loaded from jsDelivr, so the default viewer
|
|
148
|
+
needs an internet connection when the page first loads. For an entirely local
|
|
149
|
+
MuJoCo-rendered image stream, use:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
simrig view-model path/to/robot.xml --render-mode mujoco --port 8766
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Use `--render-mode topdown` only for the schematic debugging fallback.
|
|
156
|
+
|
|
157
|
+
### View a running MuJoCo script
|
|
158
|
+
|
|
159
|
+
Standalone controllers can publish the `MjModel` and `MjData` they already own
|
|
160
|
+
to the same Three.js viewer. SimRig does not step, pause, or replay the script:
|
|
161
|
+
|
|
162
|
+
```python
|
|
163
|
+
from simrig import LiveWebViewer
|
|
164
|
+
|
|
165
|
+
with LiveWebViewer(
|
|
166
|
+
model,
|
|
167
|
+
data,
|
|
168
|
+
name="my controller",
|
|
169
|
+
tracking_body="end_effector",
|
|
170
|
+
) as web:
|
|
171
|
+
while running:
|
|
172
|
+
with web.lock:
|
|
173
|
+
data.ctrl[:] = controller(data)
|
|
174
|
+
mujoco.mj_step(model, data)
|
|
175
|
+
web.sync(phase="moving")
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Open the printed `http://127.0.0.1:8767/` URL. The page receives lightweight
|
|
179
|
+
geom transforms while the Python script retains full control of simulation
|
|
180
|
+
timing and state. A named `tracking_body` also draws its live path. Use
|
|
181
|
+
`wait_for_client()` when motion should begin only after the page is ready.
|
|
182
|
+
|
|
183
|
+
After defining the task, scaffold and validate an editable environment:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
simrig new-env my_task --model path/to/scene.xml --template mjx
|
|
187
|
+
simrig validate-env envs/my_task.py
|
|
188
|
+
simrig validate-env envs/my_task.py --runtime
|
|
189
|
+
simrig smoke envs/my_task.py --steps 10
|
|
190
|
+
simrig train envs/my_task.py --preset smoke
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
The generated environment is a starter, not an invented task definition. The
|
|
194
|
+
reward, observations, actions, resets, and termination logic remain explicit
|
|
195
|
+
and editable in Python.
|
|
196
|
+
|
|
197
|
+
### Evaluate and preview
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
simrig eval runs/<run-dir>/policy.params \
|
|
201
|
+
--env Go1JoystickFlatTerrain \
|
|
202
|
+
--steps 500 \
|
|
203
|
+
--seed 0 \
|
|
204
|
+
--command 0.5 0.0 0.0
|
|
205
|
+
|
|
206
|
+
simrig preview runs/<run-dir>/policy.params \
|
|
207
|
+
--env Go1JoystickFlatTerrain \
|
|
208
|
+
--command 0.5 0.0 0.0 \
|
|
209
|
+
--port 8765
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Open `http://127.0.0.1:8765/` to orbit, zoom, pan, change commands, pause, and
|
|
213
|
+
inspect the live rollout. Preview uses the Three.js renderer by default: the
|
|
214
|
+
policy advances on a server-side rollout clock while lightweight MuJoCo geom
|
|
215
|
+
transforms update the browser scene. The camera follows the robot without
|
|
216
|
+
streaming rendered image frames. Use `--render-mode mujoco` for the older local
|
|
217
|
+
image-stream preview or `--render-mode topdown` for the schematic fallback.
|
|
218
|
+
|
|
219
|
+
## Documentation
|
|
220
|
+
|
|
221
|
+
- [Examples](examples/README.md)
|
|
222
|
+
- [Agent workflow](docs/agent_workflow.md)
|
|
223
|
+
- [Agent skill installation](docs/skill-installation.md)
|
|
224
|
+
- [Contributing](CONTRIBUTING.md)
|
|
225
|
+
- [SimRig skill source](skills/simrig/SKILL.md)
|
|
226
|
+
|
|
227
|
+
## Outputs
|
|
228
|
+
|
|
229
|
+
SimRig writes project-local artifacts:
|
|
230
|
+
|
|
231
|
+
- `reports/` — model, environment, and evaluation reports
|
|
232
|
+
- `runs/` — training configuration, metrics, checkpoints, and policy parameters
|
|
233
|
+
- `envs/` — editable custom environment modules
|
|
234
|
+
- `artifacts/` and `configs/` — user-managed outputs and configuration
|
|
235
|
+
|
|
236
|
+
## License
|
|
237
|
+
|
|
238
|
+
[MIT](LICENSE)
|
simrig-0.2.2/README.md
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
# SimRig
|
|
2
|
+
|
|
3
|
+
Turn MuJoCo robots into trained policies with agent-guided task design, PPO
|
|
4
|
+
training, evaluation, and interactive previews.
|
|
5
|
+
|
|
6
|
+
SimRig combines:
|
|
7
|
+
|
|
8
|
+
- a Python CLI that inspects models, runs MuJoCo Playground environments,
|
|
9
|
+
trains Brax PPO policies, evaluates checkpoints, and serves previews;
|
|
10
|
+
- an agent skill that teaches Codex, Claude Code, and Cursor how to use that
|
|
11
|
+
pipeline safely.
|
|
12
|
+
|
|
13
|
+
Raw robot XML is not automatically a training task. SimRig helps the agent move
|
|
14
|
+
from a model and a requested behavior to explicit observations, actions,
|
|
15
|
+
rewards, resets, termination conditions, validation, training, and evaluation.
|
|
16
|
+
|
|
17
|
+
## What SimRig can do
|
|
18
|
+
|
|
19
|
+
| Goal | SimRig workflow |
|
|
20
|
+
|---|---|
|
|
21
|
+
| Train a known Playground robot | Inspect the environment, smoke-test it, train, evaluate, and preview |
|
|
22
|
+
| Use a custom MJCF/XML robot | Inspect the model, define the task, create an editable environment, then validate and train |
|
|
23
|
+
| Build locomotion or posture behaviors | Design command tracking, contacts, rewards, failures, and evaluation scenarios |
|
|
24
|
+
| Build custom scenes | Add terrain, props, targets, sensors, cameras, or contact rules in ordinary MJCF and Python |
|
|
25
|
+
| Evaluate an existing policy | Run reproducible headless rollouts and open a browser or native MuJoCo preview |
|
|
26
|
+
|
|
27
|
+
SimRig v0 uses MuJoCo and MuJoCo Playground. Isaac Lab is not currently a
|
|
28
|
+
supported backend.
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
SimRig requires Python 3.10 or newer. Install the Playground training stack
|
|
33
|
+
from PyPI:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
python3.12 -m venv .venv
|
|
37
|
+
source .venv/bin/activate
|
|
38
|
+
python -m pip install --upgrade pip
|
|
39
|
+
python -m pip install "simrig[playground]"
|
|
40
|
+
|
|
41
|
+
simrig --version
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
For an editable source installation, clone the repository and install from its
|
|
45
|
+
root instead:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
git clone https://github.com/Su1eym4n/simrig.git
|
|
49
|
+
cd simrig
|
|
50
|
+
python3.12 -m venv .venv
|
|
51
|
+
source .venv/bin/activate
|
|
52
|
+
python -m pip install --upgrade pip
|
|
53
|
+
python -m pip install -e ".[playground]"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Development dependencies, tests, and contribution checks are documented in
|
|
57
|
+
[CONTRIBUTING.md](CONTRIBUTING.md).
|
|
58
|
+
|
|
59
|
+
## Install the agent skill
|
|
60
|
+
|
|
61
|
+
Inside this repository, Codex discovers the SimRig skill automatically through
|
|
62
|
+
`.agents/skills/simrig`.
|
|
63
|
+
|
|
64
|
+
To make the skill available from any project, install it globally with the
|
|
65
|
+
Skills CLI:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npx skills add Su1eym4n/simrig --skill simrig --global
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
The installer supports Codex, Claude Code, Cursor, and other agents. Restart the
|
|
72
|
+
agent after installation. See
|
|
73
|
+
[Agent skill installation](docs/skill-installation.md) for provider-specific
|
|
74
|
+
commands, manual installation, and troubleshooting.
|
|
75
|
+
|
|
76
|
+
## Use SimRig
|
|
77
|
+
|
|
78
|
+
Open a project containing a MuJoCo robot or scene and ask the agent naturally:
|
|
79
|
+
|
|
80
|
+
> Train this MuJoCo robot to walk forward.
|
|
81
|
+
|
|
82
|
+
> Create a crouching task for this robot, smoke-test it, and start a small
|
|
83
|
+
> training run.
|
|
84
|
+
|
|
85
|
+
> Evaluate this checkpoint across five seeds and preview the policy.
|
|
86
|
+
|
|
87
|
+
You can invoke the workflow explicitly with `$simrig`, but the skill can also
|
|
88
|
+
activate automatically when the request matches its description.
|
|
89
|
+
|
|
90
|
+
### Existing Playground environment
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
simrig list-envs --backend mujoco-playground
|
|
94
|
+
simrig inspect-env Go1JoystickFlatTerrain
|
|
95
|
+
simrig smoke Go1JoystickFlatTerrain --steps 10
|
|
96
|
+
simrig train Go1JoystickFlatTerrain --preset smoke
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Use the `smoke` preset before a longer `local` or `cloud` configuration.
|
|
100
|
+
|
|
101
|
+
### Custom robot or scene
|
|
102
|
+
|
|
103
|
+
Inspect the model before designing a task:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
simrig inspect-model path/to/robot.xml --save-report
|
|
107
|
+
simrig view-model path/to/robot.xml --port 8766
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Open `http://127.0.0.1:8766/` to inspect the compiled model, orbit/zoom/pan the
|
|
111
|
+
camera, and adjust named joints. The default `threejs` renderer sends MuJoCo's
|
|
112
|
+
visual meshes and primitives to a GPU-accelerated WebGL scene, so camera motion
|
|
113
|
+
stays smooth without streaming image frames from Python. If the MJCF defines a
|
|
114
|
+
keyframe, the viewer starts from its first authored pose and **Reset Joints**
|
|
115
|
+
restores it.
|
|
116
|
+
|
|
117
|
+
The Three.js modules are pinned and loaded from jsDelivr, so the default viewer
|
|
118
|
+
needs an internet connection when the page first loads. For an entirely local
|
|
119
|
+
MuJoCo-rendered image stream, use:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
simrig view-model path/to/robot.xml --render-mode mujoco --port 8766
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Use `--render-mode topdown` only for the schematic debugging fallback.
|
|
126
|
+
|
|
127
|
+
### View a running MuJoCo script
|
|
128
|
+
|
|
129
|
+
Standalone controllers can publish the `MjModel` and `MjData` they already own
|
|
130
|
+
to the same Three.js viewer. SimRig does not step, pause, or replay the script:
|
|
131
|
+
|
|
132
|
+
```python
|
|
133
|
+
from simrig import LiveWebViewer
|
|
134
|
+
|
|
135
|
+
with LiveWebViewer(
|
|
136
|
+
model,
|
|
137
|
+
data,
|
|
138
|
+
name="my controller",
|
|
139
|
+
tracking_body="end_effector",
|
|
140
|
+
) as web:
|
|
141
|
+
while running:
|
|
142
|
+
with web.lock:
|
|
143
|
+
data.ctrl[:] = controller(data)
|
|
144
|
+
mujoco.mj_step(model, data)
|
|
145
|
+
web.sync(phase="moving")
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Open the printed `http://127.0.0.1:8767/` URL. The page receives lightweight
|
|
149
|
+
geom transforms while the Python script retains full control of simulation
|
|
150
|
+
timing and state. A named `tracking_body` also draws its live path. Use
|
|
151
|
+
`wait_for_client()` when motion should begin only after the page is ready.
|
|
152
|
+
|
|
153
|
+
After defining the task, scaffold and validate an editable environment:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
simrig new-env my_task --model path/to/scene.xml --template mjx
|
|
157
|
+
simrig validate-env envs/my_task.py
|
|
158
|
+
simrig validate-env envs/my_task.py --runtime
|
|
159
|
+
simrig smoke envs/my_task.py --steps 10
|
|
160
|
+
simrig train envs/my_task.py --preset smoke
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
The generated environment is a starter, not an invented task definition. The
|
|
164
|
+
reward, observations, actions, resets, and termination logic remain explicit
|
|
165
|
+
and editable in Python.
|
|
166
|
+
|
|
167
|
+
### Evaluate and preview
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
simrig eval runs/<run-dir>/policy.params \
|
|
171
|
+
--env Go1JoystickFlatTerrain \
|
|
172
|
+
--steps 500 \
|
|
173
|
+
--seed 0 \
|
|
174
|
+
--command 0.5 0.0 0.0
|
|
175
|
+
|
|
176
|
+
simrig preview runs/<run-dir>/policy.params \
|
|
177
|
+
--env Go1JoystickFlatTerrain \
|
|
178
|
+
--command 0.5 0.0 0.0 \
|
|
179
|
+
--port 8765
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Open `http://127.0.0.1:8765/` to orbit, zoom, pan, change commands, pause, and
|
|
183
|
+
inspect the live rollout. Preview uses the Three.js renderer by default: the
|
|
184
|
+
policy advances on a server-side rollout clock while lightweight MuJoCo geom
|
|
185
|
+
transforms update the browser scene. The camera follows the robot without
|
|
186
|
+
streaming rendered image frames. Use `--render-mode mujoco` for the older local
|
|
187
|
+
image-stream preview or `--render-mode topdown` for the schematic fallback.
|
|
188
|
+
|
|
189
|
+
## Documentation
|
|
190
|
+
|
|
191
|
+
- [Examples](examples/README.md)
|
|
192
|
+
- [Agent workflow](docs/agent_workflow.md)
|
|
193
|
+
- [Agent skill installation](docs/skill-installation.md)
|
|
194
|
+
- [Contributing](CONTRIBUTING.md)
|
|
195
|
+
- [SimRig skill source](skills/simrig/SKILL.md)
|
|
196
|
+
|
|
197
|
+
## Outputs
|
|
198
|
+
|
|
199
|
+
SimRig writes project-local artifacts:
|
|
200
|
+
|
|
201
|
+
- `reports/` — model, environment, and evaluation reports
|
|
202
|
+
- `runs/` — training configuration, metrics, checkpoints, and policy parameters
|
|
203
|
+
- `envs/` — editable custom environment modules
|
|
204
|
+
- `artifacts/` and `configs/` — user-managed outputs and configuration
|
|
205
|
+
|
|
206
|
+
## License
|
|
207
|
+
|
|
208
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=69", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "simrig"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "Agent- and human-friendly workflows for MuJoCo Playground training and evaluation."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
authors = [{ name = "SimRig contributors" }]
|
|
14
|
+
dependencies = []
|
|
15
|
+
|
|
16
|
+
[project.urls]
|
|
17
|
+
Homepage = "https://github.com/Su1eym4n/simrig"
|
|
18
|
+
Repository = "https://github.com/Su1eym4n/simrig"
|
|
19
|
+
Issues = "https://github.com/Su1eym4n/simrig/issues"
|
|
20
|
+
Changelog = "https://github.com/Su1eym4n/simrig/blob/main/CHANGELOG.md"
|
|
21
|
+
|
|
22
|
+
[project.optional-dependencies]
|
|
23
|
+
mujoco = ["mujoco"]
|
|
24
|
+
hf = ["huggingface_hub"]
|
|
25
|
+
playground = [
|
|
26
|
+
"gymnasium[mujoco]",
|
|
27
|
+
"mujoco",
|
|
28
|
+
"jax",
|
|
29
|
+
"brax",
|
|
30
|
+
"playground",
|
|
31
|
+
]
|
|
32
|
+
dev = ["build", "numpy", "pytest", "twine"]
|
|
33
|
+
|
|
34
|
+
[project.scripts]
|
|
35
|
+
simrig = "simrig.cli:main"
|
|
36
|
+
|
|
37
|
+
[tool.setuptools.packages.find]
|
|
38
|
+
include = ["simrig*"]
|
|
39
|
+
|
|
40
|
+
[tool.setuptools.dynamic]
|
|
41
|
+
version = { attr = "simrig._version.__version__" }
|
|
42
|
+
|
|
43
|
+
[tool.pytest.ini_options]
|
|
44
|
+
testpaths = ["tests"]
|
|
45
|
+
pythonpath = ["."]
|
simrig-0.2.2/setup.cfg
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"""SimRig public API."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
from simrig._version import __version__
|
|
8
|
+
from simrig.core import (
|
|
9
|
+
BackendInfo,
|
|
10
|
+
EnvInspectionReport,
|
|
11
|
+
ModelInspectionReport,
|
|
12
|
+
RunConfig,
|
|
13
|
+
SmokeResult,
|
|
14
|
+
TrainabilityStatus,
|
|
15
|
+
)
|
|
16
|
+
from simrig.mujoco_backend import inspect_model, list_models
|
|
17
|
+
from simrig.playground_backend import (
|
|
18
|
+
demo_policy,
|
|
19
|
+
eval_policy,
|
|
20
|
+
inspect_env,
|
|
21
|
+
list_envs,
|
|
22
|
+
smoke_env,
|
|
23
|
+
train_ppo,
|
|
24
|
+
)
|
|
25
|
+
from simrig.scaffold import new_env
|
|
26
|
+
from simrig.validate_env import EnvValidationResult, validate_env
|
|
27
|
+
|
|
28
|
+
__all__ = [
|
|
29
|
+
"__version__",
|
|
30
|
+
"BackendInfo",
|
|
31
|
+
"EnvInspectionReport",
|
|
32
|
+
"EnvValidationResult",
|
|
33
|
+
"ModelInspectionReport",
|
|
34
|
+
"RunConfig",
|
|
35
|
+
"SmokeResult",
|
|
36
|
+
"TrainabilityStatus",
|
|
37
|
+
"demo_policy",
|
|
38
|
+
"eval_policy",
|
|
39
|
+
"inspect_env",
|
|
40
|
+
"inspect_model",
|
|
41
|
+
"is_env_module_path",
|
|
42
|
+
"list_envs",
|
|
43
|
+
"list_models",
|
|
44
|
+
"LiveWebViewer",
|
|
45
|
+
"load_custom_env",
|
|
46
|
+
"load_env",
|
|
47
|
+
"new_env",
|
|
48
|
+
"smoke_env",
|
|
49
|
+
"serve_model_view",
|
|
50
|
+
"serve_policy_preview",
|
|
51
|
+
"train_ppo",
|
|
52
|
+
"validate_env",
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def __getattr__(name: str) -> Any:
|
|
57
|
+
"""Lazy-load browser helpers so core imports work without numpy/mujoco."""
|
|
58
|
+
if name == "LiveWebViewer":
|
|
59
|
+
from simrig.live_view import LiveWebViewer
|
|
60
|
+
|
|
61
|
+
return LiveWebViewer
|
|
62
|
+
if name == "serve_model_view":
|
|
63
|
+
from simrig.model_view import serve_model_view
|
|
64
|
+
|
|
65
|
+
return serve_model_view
|
|
66
|
+
if name == "serve_policy_preview":
|
|
67
|
+
from simrig.preview import serve_policy_preview
|
|
68
|
+
|
|
69
|
+
return serve_policy_preview
|
|
70
|
+
if name == "is_env_module_path":
|
|
71
|
+
from simrig.custom_env import is_env_module_path
|
|
72
|
+
|
|
73
|
+
return is_env_module_path
|
|
74
|
+
if name == "load_custom_env":
|
|
75
|
+
from simrig.custom_env import load_custom_env
|
|
76
|
+
|
|
77
|
+
return load_custom_env
|
|
78
|
+
if name == "load_env":
|
|
79
|
+
from simrig.playground_backend import load_env
|
|
80
|
+
|
|
81
|
+
return load_env
|
|
82
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|