Nirav Madhani
Import World Representation Space
5af572e
|
Raw
History Blame Contribute Delete
1.85 kB
# MuJoCo Rendering Scripts
Render videos for the Hybrid Field–Graph World Model playbook.
## Setup (Windows)
```bash
pip install mujoco numpy imageio imageio-ffmpeg
```
Requires Python 3.9+ and MuJoCo 3.x (pure pip install, no separate binary needed).
## Scripts
### 1. `render_exp1_push.py` β€” The Indistinguishable Pair
Renders two identical red cubes being pushed with the same force.
Steel cube barely moves. Foam cube slides across the table.
```bash
python render_exp1_push.py
```
Outputs:
- `exp1_push_2N.mp4` β€” Side-by-side push at 2N
- `exp1_push_5N.mp4` β€” Side-by-side push at 5N
- `exp1_push_sweep.mp4` β€” Animated force sweep 0.5N β†’ 5N
### 2. `render_exp2_estimation.py` β€” Material Estimation Interactions
Renders a sequence of push interactions on a single object.
```bash
python render_exp2_estimation.py
```
Outputs:
- `exp2_wood_interactions.mp4`
- `exp2_metal_interactions.mp4`
### 3. `render_exp3_grasp.py` β€” Grasp Force Demo
Renders grasp attempts at different forces on different materials.
```bash
python render_exp3_grasp.py
```
Outputs:
- `exp3_grasp_egg.mp4` β€” Egg: success vs crush
- `exp3_grasp_rubber.mp4` β€” Rubber: easy grasp
### 4. `render_scene_overview.py` β€” Multi-object tabletop
Renders a rotating camera view of the full 5-object tabletop scene.
```bash
python render_scene_overview.py
```
Outputs:
- `scene_overview.mp4`
## Parameters
Each script has configurable parameters at the top:
- `WIDTH`, `HEIGHT` β€” resolution (default 1280Γ—720)
- `FPS` β€” frame rate (default 60)
- `CAMERA_*` β€” camera position and angle
## Notes
- All rendering uses MuJoCo's built-in OpenGL renderer (offscreen)
- On Windows, this uses EGL or WGL automatically
- If you get OpenGL errors, try setting `MUJOCO_GL=egl` environment variable
- Videos are encoded as H.264 MP4 via imageio-ffmpeg