simrig 0.2.2__tar.gz → 0.4.0__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.4.0/PKG-INFO +426 -0
- simrig-0.4.0/README.md +394 -0
- {simrig-0.2.2 → simrig-0.4.0}/pyproject.toml +8 -6
- {simrig-0.2.2 → simrig-0.4.0}/simrig/_version.py +1 -1
- {simrig-0.2.2 → simrig-0.4.0}/simrig/browser_render.py +19 -0
- simrig-0.4.0/simrig/browser_shell.py +333 -0
- {simrig-0.2.2 → simrig-0.4.0}/simrig/cli.py +298 -3
- {simrig-0.2.2 → simrig-0.4.0}/simrig/core.py +2 -1
- simrig-0.4.0/simrig/custom_env.py +248 -0
- {simrig-0.2.2 → simrig-0.4.0}/simrig/huggingface.py +7 -5
- simrig-0.4.0/simrig/lambda_cloud.py +464 -0
- {simrig-0.2.2 → simrig-0.4.0}/simrig/model_view.py +135 -5
- simrig-0.4.0/simrig/networks.py +80 -0
- {simrig-0.2.2 → simrig-0.4.0}/simrig/playground_backend.py +395 -47
- simrig-0.4.0/simrig/presets.py +176 -0
- {simrig-0.2.2 → simrig-0.4.0}/simrig/preview.py +537 -57
- {simrig-0.2.2 → simrig-0.4.0}/simrig/rendering.py +11 -0
- simrig-0.4.0/simrig/runtime.py +228 -0
- {simrig-0.2.2 → simrig-0.4.0}/simrig/three_scene.py +25 -0
- simrig-0.4.0/simrig/validate_env.py +495 -0
- simrig-0.4.0/simrig.egg-info/PKG-INFO +426 -0
- {simrig-0.2.2 → simrig-0.4.0}/simrig.egg-info/SOURCES.txt +7 -0
- simrig-0.4.0/simrig.egg-info/requires.txt +21 -0
- {simrig-0.2.2 → simrig-0.4.0}/tests/test_cli.py +103 -1
- {simrig-0.2.2 → simrig-0.4.0}/tests/test_custom_env.py +93 -1
- simrig-0.4.0/tests/test_huggingface.py +73 -0
- simrig-0.4.0/tests/test_lambda_cloud.py +270 -0
- {simrig-0.2.2 → simrig-0.4.0}/tests/test_model_view.py +58 -0
- simrig-0.4.0/tests/test_networks.py +71 -0
- simrig-0.4.0/tests/test_playground_backend.py +259 -0
- simrig-0.4.0/tests/test_presets.py +87 -0
- simrig-0.4.0/tests/test_preview.py +108 -0
- {simrig-0.2.2 → simrig-0.4.0}/tests/test_rendering.py +35 -1
- simrig-0.4.0/tests/test_runtime.py +107 -0
- simrig-0.4.0/tests/test_scaffold.py +165 -0
- simrig-0.2.2/PKG-INFO +0 -238
- simrig-0.2.2/README.md +0 -208
- simrig-0.2.2/simrig/browser_shell.py +0 -130
- simrig-0.2.2/simrig/custom_env.py +0 -109
- simrig-0.2.2/simrig/presets.py +0 -93
- simrig-0.2.2/simrig/validate_env.py +0 -211
- simrig-0.2.2/simrig.egg-info/PKG-INFO +0 -238
- simrig-0.2.2/simrig.egg-info/requires.txt +0 -19
- simrig-0.2.2/tests/test_huggingface.py +0 -36
- simrig-0.2.2/tests/test_playground_backend.py +0 -65
- simrig-0.2.2/tests/test_presets.py +0 -34
- simrig-0.2.2/tests/test_scaffold.py +0 -67
- {simrig-0.2.2 → simrig-0.4.0}/LICENSE +0 -0
- {simrig-0.2.2 → simrig-0.4.0}/setup.cfg +0 -0
- {simrig-0.2.2 → simrig-0.4.0}/simrig/__init__.py +0 -0
- {simrig-0.2.2 → simrig-0.4.0}/simrig/io.py +0 -0
- {simrig-0.2.2 → simrig-0.4.0}/simrig/live_view.py +0 -0
- {simrig-0.2.2 → simrig-0.4.0}/simrig/mujoco_backend.py +0 -0
- {simrig-0.2.2 → simrig-0.4.0}/simrig/paths.py +0 -0
- {simrig-0.2.2 → simrig-0.4.0}/simrig/scaffold.py +0 -0
- {simrig-0.2.2 → simrig-0.4.0}/simrig.egg-info/dependency_links.txt +0 -0
- {simrig-0.2.2 → simrig-0.4.0}/simrig.egg-info/entry_points.txt +0 -0
- {simrig-0.2.2 → simrig-0.4.0}/simrig.egg-info/top_level.txt +0 -0
- {simrig-0.2.2 → simrig-0.4.0}/tests/test_core.py +0 -0
- {simrig-0.2.2 → simrig-0.4.0}/tests/test_demo_reach.py +0 -0
- {simrig-0.2.2 → simrig-0.4.0}/tests/test_jax_compat.py +0 -0
- {simrig-0.2.2 → simrig-0.4.0}/tests/test_live_view.py +0 -0
- {simrig-0.2.2 → simrig-0.4.0}/tests/test_mujoco_integration.py +0 -0
- {simrig-0.2.2 → simrig-0.4.0}/tests/test_paths.py +0 -0
simrig-0.4.0/PKG-INFO
ADDED
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: simrig
|
|
3
|
+
Version: 0.4.0
|
|
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.11
|
|
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]==1.3.0; extra == "playground"
|
|
20
|
+
Requires-Dist: mujoco==3.10.0; extra == "playground"
|
|
21
|
+
Requires-Dist: mujoco-mjx==3.10.0; extra == "playground"
|
|
22
|
+
Requires-Dist: jax==0.10.2; extra == "playground"
|
|
23
|
+
Requires-Dist: brax==0.14.2; extra == "playground"
|
|
24
|
+
Requires-Dist: playground==0.2.0; extra == "playground"
|
|
25
|
+
Requires-Dist: warp-lang==1.13.0; extra == "playground"
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: build; extra == "dev"
|
|
28
|
+
Requires-Dist: numpy; extra == "dev"
|
|
29
|
+
Requires-Dist: pytest; extra == "dev"
|
|
30
|
+
Requires-Dist: twine; extra == "dev"
|
|
31
|
+
Dynamic: license-file
|
|
32
|
+
|
|
33
|
+
# SimRig
|
|
34
|
+
|
|
35
|
+
<div align="center">
|
|
36
|
+
|
|
37
|
+
<img src="assets/g1-greeting.gif" alt="Unitree G1 waving hello in SimRig's interactive browser preview" width="100%">
|
|
38
|
+
|
|
39
|
+
<br>
|
|
40
|
+
|
|
41
|
+
<em>A pretrained Unitree G1 policy preview with a scripted greeting.</em>
|
|
42
|
+
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
Turn MuJoCo robots into trained policies with agent-guided task design, PPO
|
|
46
|
+
training, evaluation, and interactive previews.
|
|
47
|
+
|
|
48
|
+
SimRig combines:
|
|
49
|
+
|
|
50
|
+
- a Python CLI that inspects models, runs MuJoCo Playground environments,
|
|
51
|
+
trains Brax PPO policies, evaluates checkpoints, and serves previews;
|
|
52
|
+
- an agent skill that teaches Codex, Claude Code, and Cursor how to use that
|
|
53
|
+
pipeline safely.
|
|
54
|
+
|
|
55
|
+
Raw robot XML is not automatically a training task. SimRig helps the agent move
|
|
56
|
+
from a model and a requested behavior to explicit observations, actions,
|
|
57
|
+
rewards, resets, termination conditions, validation, training, and evaluation.
|
|
58
|
+
|
|
59
|
+
## From prompt to simulation
|
|
60
|
+
|
|
61
|
+
### Train Go1 through a smoke-gated cloud workflow
|
|
62
|
+
|
|
63
|
+
SimRig prepares the existing Go1 locomotion environment and runs local smoke
|
|
64
|
+
tests before requesting the user's Lambda Cloud details. The full cloud run
|
|
65
|
+
starts only after that handoff. The recorded result below shows the trained
|
|
66
|
+
checkpoint downloaded and running in SimRig's interactive browser preview.
|
|
67
|
+
|
|
68
|
+
<details>
|
|
69
|
+
<summary><strong>Prompt</strong></summary>
|
|
70
|
+
|
|
71
|
+
> Prepare the full Go1 robot training setup and run local smoke tests to verify
|
|
72
|
+
> everything works. Once the tests pass, ask me for my Lambda Cloud details
|
|
73
|
+
> before starting the full training run.
|
|
74
|
+
|
|
75
|
+
</details>
|
|
76
|
+
|
|
77
|
+
<img src="assets/go1-training.gif" alt="Codex running a smoke-gated Go1 training workflow and previewing the trained policy in SimRig" width="100%">
|
|
78
|
+
|
|
79
|
+
### Trace a five-pointed star with Franka Panda
|
|
80
|
+
|
|
81
|
+
This example uses a directly scripted Cartesian trajectory and inverse
|
|
82
|
+
kinematics—no reinforcement learning is needed. The controller keeps the
|
|
83
|
+
end-effector orientation fixed, moves smoothly between star vertices, and
|
|
84
|
+
publishes the running simulation and visible trace through SimRig's browser
|
|
85
|
+
viewer.
|
|
86
|
+
|
|
87
|
+
<details>
|
|
88
|
+
<summary><strong>Prompt</strong></summary>
|
|
89
|
+
|
|
90
|
+
> Can you configure a Franka Panda robotic arm in simulation so that its end
|
|
91
|
+
> effector traces a five-pointed star trajectory?
|
|
92
|
+
>
|
|
93
|
+
> Please:
|
|
94
|
+
>
|
|
95
|
+
> - Use the Franka Panda arm and gripper.
|
|
96
|
+
> - Move the end effector along a clear five-pointed star path in Cartesian
|
|
97
|
+
> space.
|
|
98
|
+
> - Keep the end-effector orientation fixed and stable throughout the motion.
|
|
99
|
+
> - Use inverse kinematics, trajectory planning, or a direct scripted controller
|
|
100
|
+
> rather than reinforcement learning unless training is genuinely necessary.
|
|
101
|
+
> - Add a visible trajectory trace, marker, or drawing surface so the completed
|
|
102
|
+
> star can be verified.
|
|
103
|
+
> - Make the motion smooth, with controlled velocity and acceleration between
|
|
104
|
+
> each star vertex.
|
|
105
|
+
> - Provide the complete runnable script and all required launch commands.
|
|
106
|
+
> - Explain how to modify the star size, star position, drawing plane,
|
|
107
|
+
> end-effector height, motion speed, and number of repetitions.
|
|
108
|
+
> - State clearly whether the solution is directly scripted or trained, and
|
|
109
|
+
> explain why that method is appropriate.
|
|
110
|
+
> - Prefer the simplest reliable direct-control implementation.
|
|
111
|
+
|
|
112
|
+
</details>
|
|
113
|
+
|
|
114
|
+
<img src="assets/franka-panda-star.gif" alt="Codex configuring a Franka Panda arm to trace a five-pointed star in SimRig's browser viewer" width="100%">
|
|
115
|
+
|
|
116
|
+
## What SimRig can do
|
|
117
|
+
|
|
118
|
+
| Goal | SimRig workflow |
|
|
119
|
+
|---|---|
|
|
120
|
+
| Train a known Playground robot | Inspect the environment, smoke-test it, train, evaluate, and preview |
|
|
121
|
+
| Use a custom MJCF/XML robot | Inspect the model, define the task, create an editable environment, then validate and train |
|
|
122
|
+
| Build locomotion or posture behaviors | Design command tracking, contacts, rewards, failures, and evaluation scenarios |
|
|
123
|
+
| Build custom scenes | Add terrain, props, targets, sensors, cameras, or contact rules in ordinary MJCF and Python |
|
|
124
|
+
| Evaluate an existing policy | Run reproducible headless rollouts and open a browser or native MuJoCo preview |
|
|
125
|
+
|
|
126
|
+
SimRig v0 uses MuJoCo and MuJoCo Playground. Isaac Lab is not currently a
|
|
127
|
+
supported backend.
|
|
128
|
+
|
|
129
|
+
## Installation
|
|
130
|
+
|
|
131
|
+
SimRig requires Python 3.11 or newer. Install the Playground training stack
|
|
132
|
+
from PyPI:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
python3.12 -m venv .venv
|
|
136
|
+
source .venv/bin/activate
|
|
137
|
+
python -m pip install --upgrade pip
|
|
138
|
+
python -m pip install "simrig[playground]"
|
|
139
|
+
|
|
140
|
+
simrig --version
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
For an editable source installation, clone the repository and install from its
|
|
144
|
+
root instead:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
git clone https://github.com/Su1eym4n/simrig.git
|
|
148
|
+
cd simrig
|
|
149
|
+
python3.12 -m venv .venv
|
|
150
|
+
source .venv/bin/activate
|
|
151
|
+
python -m pip install --upgrade pip
|
|
152
|
+
python -m pip install -e ".[playground]"
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Development dependencies, tests, and contribution checks are documented in
|
|
156
|
+
[CONTRIBUTING.md](CONTRIBUTING.md).
|
|
157
|
+
|
|
158
|
+
## Install the agent skill
|
|
159
|
+
|
|
160
|
+
Inside this repository, Codex discovers the SimRig skill automatically through
|
|
161
|
+
`.agents/skills/simrig`.
|
|
162
|
+
|
|
163
|
+
To make the skill available from any project, install it globally with the
|
|
164
|
+
Skills CLI:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
npx skills add Su1eym4n/simrig --skill simrig --global
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
The installer supports Codex, Claude Code, Cursor, and other agents. Restart the
|
|
171
|
+
agent after installation. See
|
|
172
|
+
[Agent skill installation](docs/skill-installation.md) for provider-specific
|
|
173
|
+
commands, manual installation, and troubleshooting.
|
|
174
|
+
|
|
175
|
+
## Use SimRig
|
|
176
|
+
|
|
177
|
+
Open a project containing a MuJoCo robot or scene and ask the agent naturally:
|
|
178
|
+
|
|
179
|
+
> Train this MuJoCo robot to walk forward.
|
|
180
|
+
|
|
181
|
+
> Create a crouching task for this robot, smoke-test it, and start a small
|
|
182
|
+
> training run.
|
|
183
|
+
|
|
184
|
+
> Evaluate this checkpoint across five seeds and preview the policy.
|
|
185
|
+
|
|
186
|
+
You can invoke the workflow explicitly with `$simrig`, but the skill can also
|
|
187
|
+
activate automatically when the request matches its description.
|
|
188
|
+
|
|
189
|
+
### Existing Playground environment
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
simrig list-envs --backend mujoco-playground
|
|
193
|
+
simrig inspect-env Go1JoystickFlatTerrain
|
|
194
|
+
simrig smoke Go1JoystickFlatTerrain --steps 10
|
|
195
|
+
simrig train Go1JoystickFlatTerrain --preset smoke --impl auto --seed 0
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Use the `smoke` preset before a longer `local` or `cloud` configuration.
|
|
199
|
+
For registered Playground environments, SimRig starts from the environment's
|
|
200
|
+
tuned Brax PPO/network configuration and declared domain randomizer, then
|
|
201
|
+
bounds the expensive dimensions for `smoke` or `local`. The `cloud` preset uses
|
|
202
|
+
the full upstream task configuration unless you pass explicit overrides.
|
|
203
|
+
|
|
204
|
+
`--impl auto` uses the environment's default implementation when supported. It
|
|
205
|
+
selects MuJoCo Warp on a JAX-visible GPU when the environment defaults to Warp,
|
|
206
|
+
and falls back to JAX on CPU-only hosts. Use `--impl jax` or `--impl warp` to
|
|
207
|
+
make the choice explicit. Disable an available randomizer only for a deliberate
|
|
208
|
+
baseline with `--no-domain-randomization`.
|
|
209
|
+
|
|
210
|
+
### Custom robot or scene
|
|
211
|
+
|
|
212
|
+
Inspect the model before designing a task:
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
simrig inspect-model path/to/robot.xml --save-report
|
|
216
|
+
simrig view-model path/to/robot.xml --port 8766
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
Open `http://127.0.0.1:8766/` to inspect the compiled model, orbit/zoom/pan the
|
|
220
|
+
camera, and adjust named joints. The default `threejs` renderer sends MuJoCo's
|
|
221
|
+
visual meshes and primitives to a GPU-accelerated WebGL scene, so camera motion
|
|
222
|
+
stays smooth. When the MJCF contains named cameras, the page also shows a
|
|
223
|
+
**Robot View** inset. Its default **Emulated** mode uses a second Three.js camera
|
|
224
|
+
with the compiled MuJoCo camera's live world pose and vertical field of view,
|
|
225
|
+
giving it the same visual design as the orbit view. Switch to **Sensor** for the
|
|
226
|
+
native MuJoCo offscreen image, use the camera dropdown to switch cameras, or
|
|
227
|
+
choose the initial camera with `--camera NAME`. The inset follows joint-slider
|
|
228
|
+
changes while the main Three.js camera remains freely movable. The emulation is
|
|
229
|
+
for human inspection; vision policies train on MJX/Warp pixels, not this WebGL
|
|
230
|
+
render. If the MJCF defines a keyframe, the viewer starts from its first
|
|
231
|
+
authored pose and **Reset Joints** restores it.
|
|
232
|
+
|
|
233
|
+
The Three.js modules are pinned and loaded from jsDelivr, so the default viewer
|
|
234
|
+
needs an internet connection when the page first loads. For an entirely local
|
|
235
|
+
MuJoCo-rendered image stream, use:
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
simrig view-model path/to/robot.xml --render-mode mujoco --port 8766
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Use `--render-mode topdown` only for the schematic debugging fallback.
|
|
242
|
+
|
|
243
|
+
### View a running MuJoCo script
|
|
244
|
+
|
|
245
|
+
Standalone controllers can publish the `MjModel` and `MjData` they already own
|
|
246
|
+
to the same Three.js viewer. SimRig does not step, pause, or replay the script:
|
|
247
|
+
|
|
248
|
+
```python
|
|
249
|
+
from simrig import LiveWebViewer
|
|
250
|
+
|
|
251
|
+
with LiveWebViewer(
|
|
252
|
+
model,
|
|
253
|
+
data,
|
|
254
|
+
name="my controller",
|
|
255
|
+
tracking_body="end_effector",
|
|
256
|
+
) as web:
|
|
257
|
+
while running:
|
|
258
|
+
with web.lock:
|
|
259
|
+
data.ctrl[:] = controller(data)
|
|
260
|
+
mujoco.mj_step(model, data)
|
|
261
|
+
web.sync(phase="moving")
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
Open the printed `http://127.0.0.1:8767/` URL. The page receives lightweight
|
|
265
|
+
geom transforms while the Python script retains full control of simulation
|
|
266
|
+
timing and state. A named `tracking_body` also draws its live path. Use
|
|
267
|
+
`wait_for_client()` when motion should begin only after the page is ready.
|
|
268
|
+
|
|
269
|
+
After defining the task, scaffold and validate an editable environment:
|
|
270
|
+
|
|
271
|
+
```bash
|
|
272
|
+
simrig new-env my_task --model path/to/scene.xml --template mjx
|
|
273
|
+
simrig validate-env envs/my_task.py
|
|
274
|
+
simrig validate-env envs/my_task.py --runtime
|
|
275
|
+
simrig smoke envs/my_task.py --steps 10
|
|
276
|
+
simrig train envs/my_task.py --preset smoke --seed 0
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
The generated environment is a starter, not an invented task definition. The
|
|
280
|
+
reward, observations, actions, resets, and termination logic remain explicit
|
|
281
|
+
and editable in Python.
|
|
282
|
+
|
|
283
|
+
### Train from rendered pixels
|
|
284
|
+
|
|
285
|
+
Custom environments can declare a Brax vision CNN instead of the legacy MLP.
|
|
286
|
+
The included cartpole example renders real 64x64 MuJoCo frames, stacks three
|
|
287
|
+
grayscale frames, feeds pixels plus the previous action to the actor, and gives
|
|
288
|
+
the critic additional simulator state:
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
# CPU-safe metadata check
|
|
292
|
+
simrig validate-env examples/vision_cartpole.py --vision
|
|
293
|
+
|
|
294
|
+
# These require a JAX-visible CUDA GPU and MuJoCo Warp.
|
|
295
|
+
simrig validate-env examples/vision_cartpole.py --runtime --vision
|
|
296
|
+
simrig smoke examples/vision_cartpole.py --steps 5
|
|
297
|
+
simrig train examples/vision_cartpole.py --preset smoke \
|
|
298
|
+
--output runs/vision-cartpole-smoke
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
A vision module declares literal `NETWORK_SPEC`, `VISION_SPEC`, and
|
|
302
|
+
`DEFAULT_CONFIG` mappings for import-free static validation. Runtime hooks
|
|
303
|
+
`network_spec()`, `vision_spec()`, and optionally `training_config()` may enrich
|
|
304
|
+
those declarations after dependencies are installed. SimRig persists the
|
|
305
|
+
selected `network_type` and complete network factory in `config.json`, then
|
|
306
|
+
reconstructs the same CNN for `eval`, `demo`, and `preview`. Checkpoints created
|
|
307
|
+
before vision support remain MLP by default.
|
|
308
|
+
|
|
309
|
+
#### Run the pretrained vision reference
|
|
310
|
+
|
|
311
|
+
The published reference policy was trained for 5,079,040 PPO steps with a
|
|
312
|
+
1,000-step episode horizon. It completed all 1,000 requested steps without
|
|
313
|
+
termination for evaluation seeds 0 through 4. Install both optional extras so
|
|
314
|
+
SimRig can run the Playground environment and resolve the Hub artifact:
|
|
315
|
+
|
|
316
|
+
```bash
|
|
317
|
+
python3.11 -m venv .venv
|
|
318
|
+
.venv/bin/python -m pip install -e ".[playground,hf]"
|
|
319
|
+
|
|
320
|
+
.venv/bin/simrig eval \
|
|
321
|
+
hf://ssuleiman/simrig-vision-cartpole/policy.params \
|
|
322
|
+
--env examples/vision_cartpole.py \
|
|
323
|
+
--hf-revision v1 \
|
|
324
|
+
--steps 1000 \
|
|
325
|
+
--seed 0
|
|
326
|
+
|
|
327
|
+
.venv/bin/simrig preview \
|
|
328
|
+
hf://ssuleiman/simrig-vision-cartpole/policy.params \
|
|
329
|
+
--env examples/vision_cartpole.py \
|
|
330
|
+
--hf-revision v1 \
|
|
331
|
+
--auto-reset \
|
|
332
|
+
--port 8765
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
Both commands require a JAX-visible CUDA GPU and MuJoCo Warp. Hub resolution
|
|
336
|
+
downloads `policy.params` with its sibling `config.json` so SimRig can rebuild
|
|
337
|
+
the recorded vision CNN. Exact evaluation should use the recorded Python and
|
|
338
|
+
package versions. `--allow-runtime-mismatch` is only for an explicitly
|
|
339
|
+
qualitative preview on a different compatible runtime. The checkpoint,
|
|
340
|
+
training configuration, metrics, environment snapshot, and five-seed report
|
|
341
|
+
are published at
|
|
342
|
+
[ssuleiman/simrig-vision-cartpole](https://huggingface.co/ssuleiman/simrig-vision-cartpole).
|
|
343
|
+
|
|
344
|
+
### Evaluate and preview
|
|
345
|
+
|
|
346
|
+
```bash
|
|
347
|
+
simrig eval runs/<run-dir>/policy.params \
|
|
348
|
+
--env Go1JoystickFlatTerrain \
|
|
349
|
+
--steps 500 \
|
|
350
|
+
--seed 0 \
|
|
351
|
+
--command 0.5 0.0 0.0
|
|
352
|
+
|
|
353
|
+
simrig preview runs/<run-dir>/policy.params \
|
|
354
|
+
--env Go1JoystickFlatTerrain \
|
|
355
|
+
--command 0.5 0.0 0.0 \
|
|
356
|
+
--auto-reset \
|
|
357
|
+
--port 8765
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
Open `http://127.0.0.1:8765/` to orbit, zoom, pan, change supported commands,
|
|
361
|
+
toggle automatic episode reset, pause, and inspect the live rollout. Preview
|
|
362
|
+
uses the Three.js renderer by default: the
|
|
363
|
+
policy advances on a server-side rollout clock while lightweight MuJoCo geom
|
|
364
|
+
transforms update the browser scene. The camera follows the robot without
|
|
365
|
+
coupling policy stepping to display rendering. Environments with named MuJoCo
|
|
366
|
+
cameras also get a **Robot View** inset, selectable without moving the human
|
|
367
|
+
orbit camera. **Emulated** renders the live authored camera pose and FOV in the
|
|
368
|
+
same Three.js scene; **Sensor** shows the native MuJoCo offscreen image for
|
|
369
|
+
comparison. Neither changes policy input: training and rollout inference keep
|
|
370
|
+
using the environment's configured observation pipeline. Use
|
|
371
|
+
`--render-mode mujoco` for the older full-page local image stream or
|
|
372
|
+
`--render-mode topdown` for the schematic fallback.
|
|
373
|
+
|
|
374
|
+
### Train on a Lambda Cloud GPU
|
|
375
|
+
|
|
376
|
+
After launching a Lambda On-Demand instance with an SSH key, SimRig can connect,
|
|
377
|
+
sync this checkout, verify JAX GPU visibility, train, monitor a detached run,
|
|
378
|
+
and download its artifacts:
|
|
379
|
+
|
|
380
|
+
```bash
|
|
381
|
+
simrig cloud lambda connect INSTANCE_IP --identity ~/Downloads/lambda-key.pem
|
|
382
|
+
simrig cloud lambda prepare INSTANCE_IP --identity ~/Downloads/lambda-key.pem
|
|
383
|
+
simrig cloud lambda smoke INSTANCE_IP Go1JoystickFlatTerrain \
|
|
384
|
+
--identity ~/Downloads/lambda-key.pem
|
|
385
|
+
simrig cloud lambda train INSTANCE_IP Go1JoystickFlatTerrain \
|
|
386
|
+
--identity ~/Downloads/lambda-key.pem \
|
|
387
|
+
--preset smoke \
|
|
388
|
+
--impl auto \
|
|
389
|
+
--seed 0
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
Only after the environment and PPO smoke gates pass, start a detached large
|
|
393
|
+
run with `--preset cloud --detach`. SimRig operates on an instance you already
|
|
394
|
+
provisioned; it never launches or terminates billable Lambda resources. See the
|
|
395
|
+
complete [Lambda Cloud GPU guide](docs/lambda-cloud.md), including persistent
|
|
396
|
+
storage, monitoring, artifact download, and shutdown reminders.
|
|
397
|
+
|
|
398
|
+
Lambda preparation requires Python 3.11+ and installs a pinned Playground
|
|
399
|
+
training stack. Every run records its resolved PPO/network configuration,
|
|
400
|
+
implementation, seed, randomizer, source hashes, Git state, JAX devices,
|
|
401
|
+
precision-related environment, and package versions. Checkpoint eval, demo, and
|
|
402
|
+
preview reconstruct the recorded implementation and network, and reject a
|
|
403
|
+
different runtime unless `--allow-runtime-mismatch` is explicitly selected for
|
|
404
|
+
qualitative review.
|
|
405
|
+
|
|
406
|
+
## Documentation
|
|
407
|
+
|
|
408
|
+
- [Examples](examples/README.md)
|
|
409
|
+
- [Agent workflow](docs/agent_workflow.md)
|
|
410
|
+
- [Lambda Cloud GPU training](docs/lambda-cloud.md)
|
|
411
|
+
- [Agent skill installation](docs/skill-installation.md)
|
|
412
|
+
- [Contributing](CONTRIBUTING.md)
|
|
413
|
+
- [SimRig skill source](skills/simrig/SKILL.md)
|
|
414
|
+
|
|
415
|
+
## Outputs
|
|
416
|
+
|
|
417
|
+
SimRig writes project-local artifacts:
|
|
418
|
+
|
|
419
|
+
- `reports/` — model, environment, and evaluation reports
|
|
420
|
+
- `runs/` — training configuration, metrics, checkpoints, and policy parameters
|
|
421
|
+
- `envs/` — editable custom environment modules
|
|
422
|
+
- `artifacts/` and `configs/` — user-managed outputs and configuration
|
|
423
|
+
|
|
424
|
+
## License
|
|
425
|
+
|
|
426
|
+
[MIT](LICENSE)
|