Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
c07aed0
Add runtime scene package loading
Nabla7 Jun 25, 2026
fc150e3
Add scene package cooking pipeline
Nabla7 Jun 25, 2026
643f7af
Add G1 scene navigation visualization
Nabla7 Jun 26, 2026
91cb68a
Merge remote-tracking branch 'origin/pim/feat/runtime-scene-loading' …
Nabla7 Jun 26, 2026
eefa3b0
Refine scene cooking workflow
Nabla7 Jun 26, 2026
6aadb4f
Fix scene runtime type checks
Nabla7 Jun 26, 2026
eea3ff0
Merge remote-tracking branch 'origin/pim/feat/runtime-scene-loading' …
Nabla7 Jun 26, 2026
fe0cc3c
Fix scene cooking type checks
Nabla7 Jun 26, 2026
d2e339e
Fix scene cooking command typing
Nabla7 Jun 26, 2026
7d36d49
Add G1 URDF meshes to LFS
Nabla7 Jun 26, 2026
24756bf
Document runtime scene package loading
Nabla7 Jun 26, 2026
ea20102
Merge remote-tracking branch 'origin/pim/feat/runtime-scene-loading' …
Nabla7 Jun 26, 2026
a770495
Clarify scene cooking workflow
Nabla7 Jun 26, 2026
48b2aa5
Simplify runtime scene package contract
Nabla7 Jun 26, 2026
6affbcc
Merge remote-tracking branch 'origin/pim/feat/runtime-scene-loading' …
Nabla7 Jun 26, 2026
db88a30
Refine scene cooking visual targets
Nabla7 Jun 26, 2026
6915607
Add supermarket scene package data
Nabla7 Jun 26, 2026
e34f105
Fix scene visual mypy narrowing
Nabla7 Jun 26, 2026
247da3a
Drop dashboard rerun port change
Nabla7 Jun 26, 2026
b20d84d
Clarify scene package runtime docs
Nabla7 Jun 26, 2026
15561e4
Merge branch 'main' into pim/feat/runtime-scene-loading
Nabla7 Jun 26, 2026
bb9bfd9
refactor: delete dead compose_entity_model
paul-nechifor Jun 27, 2026
d1841aa
refactor: drop signature reflection in reset_runtime_state
paul-nechifor Jun 27, 2026
999250c
test: move reset_to engine cleanup into a fixture
paul-nechifor Jun 27, 2026
14cd66f
Strip unreferenced vertices from cooked collision GLB
Nabla7 Jun 29, 2026
897f6f1
Address scene loading review feedback
Nabla7 Jun 29, 2026
6f0ddc7
Add composed MuJoCo binary package metadata
Nabla7 Jun 30, 2026
c867d2a
Make yourdfpy optional for Rerun URDF visualization
Nabla7 Jun 30, 2026
7991623
test: stop G1 WBC task fixtures
Nabla7 Jun 30, 2026
bde873a
fix: release coalesced MuJoCo reset waiters
Nabla7 Jun 30, 2026
44b3de5
fix: type scene alignment matrix
Nabla7 Jun 30, 2026
c617325
Merge branch 'main' into pim/feat/runtime-scene-loading
Nabla7 Jun 30, 2026
d5b500d
Merge remote-tracking branch 'origin/pim/feat/runtime-scene-loading' …
Nabla7 Jun 30, 2026
61fbec4
Organize scene cooking implementation
Nabla7 Jun 30, 2026
d147dcc
Merge remote-tracking branch 'origin/main' into pim/fix/collision-weld
Nabla7 Jun 30, 2026
831d2eb
Separate scene cook specs from runtime metadata
Nabla7 Jun 30, 2026
fae44c4
Clarify scene cooking module structure
Nabla7 Jun 30, 2026
e5b2973
Merge branch 'main' into pim/feat/scene-cooking
Nabla7 Jun 30, 2026
ad1a045
Clarify MuJoCo scene package entity composer
Nabla7 Jun 30, 2026
9116085
Keep runtime scene asset spec module name
Nabla7 Jul 1, 2026
3971884
Clarify scene cooking package docs
Nabla7 Jul 1, 2026
99acd8c
Split scene cooking architecture docs
Nabla7 Jul 1, 2026
3b2397c
Make scene cooking architecture concrete
Nabla7 Jul 1, 2026
728b780
Drop rerun scene package formatting churn
Nabla7 Jul 1, 2026
997345d
Tighten scene cooking architecture overview
Nabla7 Jul 1, 2026
d06b8a8
fix: narrow broad excepts in collision_export mesh/visual writers
paul-nechifor Jul 2, 2026
85ec55d
fix: narrow broad except in collision_policy primitive fitting
paul-nechifor Jul 2, 2026
4f986b0
fix: stop mislabeling missing CoACD as a decomposition failure
paul-nechifor Jul 2, 2026
dcf35c8
refactor: dedupe CoACD log-silencing into a shared helper
paul-nechifor Jul 2, 2026
5b10a0f
refactor: delete dead GeomEmission dataclass, fix stale docstrings
paul-nechifor Jul 2, 2026
6f395f7
chore: drop scene extra deps already declared as core dependencies
paul-nechifor Jul 2, 2026
25e0d00
refactor: name min-extent epsilon, dedupe AABB-extent clamp helper
paul-nechifor Jul 2, 2026
4ba6ce8
refactor: name the floor-probe ray height constant in mesh.py
paul-nechifor Jul 2, 2026
998c189
refactor: name magic numbers in glb.py
paul-nechifor Jul 2, 2026
6949ec0
fix: narrow broad except in normalized_texture_bytes
paul-nechifor Jul 2, 2026
eeb155b
refactor: reuse glb.py's public GLB layout constants in test_glb.py
paul-nechifor Jul 2, 2026
73c5233
refactor: drop redundant rerun browser visual profile
paul-nechifor Jul 2, 2026
3e0c74e
refactor: name magic numbers in collision_export.py
paul-nechifor Jul 2, 2026
548c407
refactor: name the entity id sample cap constant in cook.py
paul-nechifor Jul 2, 2026
b7213b7
refactor: name the gltfpack warning tail-lines constant
paul-nechifor Jul 2, 2026
cb19aec
fix: respect XDG_CACHE_HOME for scene cook cache directories
paul-nechifor Jul 2, 2026
e764235
fix: fail entity collision tests on missing open3d/coacd instead of s…
paul-nechifor Jul 2, 2026
aa2b07e
refactor: object -> Any in scene_cooking type hints, drop stale ignores
paul-nechifor Jul 2, 2026
7ddb7b5
refactor: hoist numpy import to module scope in entities/collision.py
paul-nechifor Jul 2, 2026
249fbba
refactor: hoist json/scipy imports to module scope in collision_expor…
paul-nechifor Jul 2, 2026
3a73f33
chore: add lazy-import comment for mujoco in cook.py
paul-nechifor Jul 2, 2026
a166308
refactor: hoist trimesh import to module scope in browser/collision.py
paul-nechifor Jul 2, 2026
dd7dbeb
chore: comment the inline browser.collision import in test_cooking.py
paul-nechifor Jul 2, 2026
18c32cf
refactor: printf-style logging -> structured kwargs
paul-nechifor Jul 2, 2026
001def1
perf: vectorize duplicated fan-triangulation in mesh.py
paul-nechifor Jul 2, 2026
6fa949f
refactor: bare np.ndarray -> NDArray[...] in browser/collision.py
paul-nechifor Jul 2, 2026
d762370
refactor: bare np.ndarray -> NDArray[...] in planning.py
paul-nechifor Jul 2, 2026
8e192ef
refactor: bare np.ndarray -> NDArray[...] in mesh.py
paul-nechifor Jul 2, 2026
b6c87aa
Update scene cooking example data
Nabla7 Jul 2, 2026
8400a4d
refactor: bare np.ndarray -> NDArray[...] in collision_export.py
paul-nechifor Jul 2, 2026
d2d410a
refactor: bare np.ndarray -> NDArray[...] in collision_policy.py
paul-nechifor Jul 2, 2026
448e678
Merge remote-tracking branch 'origin/pim/feat/scene-cooking-autofixes…
Nabla7 Jul 6, 2026
349c410
ci: install coacd + trimesh with the tests group
Nabla7 Jul 6, 2026
92e9a9a
fix: import open3d before coacd to avoid segfault
Nabla7 Jul 6, 2026
e0e163c
Merge remote-tracking branch 'origin/main' into pim/feat/scene-cooking
Nabla7 Jul 6, 2026
e0f2e67
fix: import SceneMeshAlignment from its defining module
Nabla7 Jul 6, 2026
3985650
refactor: drop dead has_entities and floor_z_under_origin
Nabla7 Jul 6, 2026
3224405
refactor: resolve remaining dead code in scene cooking
Nabla7 Jul 6, 2026
cecae0b
fix: invalidate browser collision cache when cook inputs change
Nabla7 Jul 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions data/.lfs/office_scene_cooking_example.tar.gz
Git LFS file not shown
4 changes: 2 additions & 2 deletions data/.lfs/scene_packages.tar.gz
Git LFS file not shown
2 changes: 2 additions & 0 deletions dimos/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
except ImportError:
CONFIG_DIR = Path(os.environ.get("XDG_CONFIG_HOME", Path.home() / ".config"))
STATE_DIR = Path(os.environ.get("XDG_STATE_HOME", Path.home() / ".local" / "state")) / "dimos"
CACHE_DIR = Path(os.environ.get("XDG_CACHE_HOME", Path.home() / ".cache")) / "dimos"
else:
CONFIG_DIR = Path(GLib.get_user_config_dir())
STATE_DIR = Path(GLib.get_user_state_dir()) / "dimos"
CACHE_DIR = Path(GLib.get_user_cache_dir()) / "dimos"

DIMOS_PROJECT_ROOT = Path(__file__).parent.parent

Expand Down
199 changes: 199 additions & 0 deletions dimos/experimental/scene_cooking/ARCHITECTURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
# Scene Cooking Architecture

Scene cooking converts authored environment assets into scene packages that
runtime systems can load without understanding the original asset layout.

```text
source asset + sidecar + alignment
-> SceneCookPlan
-> backend artifacts
-> scene.meta.json
-> runtime consumers
```

The cook is experimental because asset policy will evolve. The runtime boundary
is the stable idea: consumers load a `ScenePackage`, not source assets or cook
internals.

## Contracts

```text
source asset
Raw authored file: .blend, .glb, .usd, .obj, .ply, .stl, ...
This is input data, not the runtime contract.

sidecar
Authored scene intent in <scene>.cook.json. It says which prims are floors,
walls, fixtures, interactables, repeated entity groups, or skipped geometry.

alignment
Scale, rotation, translation, and up-axis conversion from the source asset
frame into DimOS world frame.

SceneCookPlan
Internal resolved recipe. It maps the sidecar onto actual source prims and
decides what each artifact writer should see.

backend artifacts
Viewer- or simulator-specific files: Rerun GLB, browser collision GLB,
MuJoCo wrapper XML, entity assets, optional MuJoCo binaries.

scene.meta.json
Runtime manifest. It records package-relative artifact paths, frames,
entities, and cook stats.

ScenePackage
Python runtime object loaded from scene.meta.json.
```

## The Central Boundary

`SceneCookPlan` is the boundary between authored intent and artifact writers.

The sidecar is written in terms of scene names and patterns. The plan resolves
that into concrete facts:

```text
which source prims become runtime entities
which entity prims are removed from static collision
which repeated entities share a collision prototype
which visual nodes Blender should extract/delete
which effective CollisionSpec all collision writers should use
```

After the plan exists, browser, entity, and MuJoCo writers should consume that
resolved plan instead of repeating source-scene matching themselves.

## Artifact Matrix

| Consumer | Artifact | Frame | Producer | Runtime Access |
| --- | --- | --- | --- | --- |
| Rerun visual | `browser/visual.rerun.glb` | source | `browser/visuals.py` | `package.browser_visual_path("rerun")` |
| Babylon/PimSim visual | `browser/visual.babylon.glb` | source | `browser/visuals.py` | `package.browser_visual_path("babylon")` |
| Browser picking/raycast | `browser/collision.glb` | source | `browser/collision.py` | `package.browser_collision_path` |
| Browser object lookup | `browser/objects.json` | source | `browser/collision.py` | `package.objects_path` |
| MuJoCo static scene | `mujoco/<hash>/wrapper.xml` | dimos_world | `mujoco/collision_export.py` | `package.mujoco_scene_path` |
| MuJoCo scene binary | `mujoco/<hash>/wrapper.mjb` | dimos_world | `cook.py` | `package.mujoco_binary_path` |
| MuJoCo composed binary | `mujoco/composed/*.mjb` | dimos_world | external/precompute flow | `package.mujoco_composed_binary_path(...)` |
| Runtime entities | `entities/<id>/...` | dimos_world / entity-local | `entities/*.py` | `package.entities` |

The frame column matters. Browser visual and browser collision assets stay in
source coordinates and receive the package alignment at runtime. MuJoCo assets
are baked into DimOS world coordinates.

## Runtime Boundary

Runtime code should depend on:

```python
from dimos.simulation.scene_assets.spec import load_scene_package
from dimos.simulation.scenes.catalog import resolve_scene_package
```

Runtime code should not import:

```text
dimos.experimental.scene_cooking.*
```

That keeps simulators and viewers independent from the offline cook process.
They only need `ScenePackage` fields and methods:

```python
package.browser_visual_path("rerun")
package.browser_visual_path("babylon")
package.browser_collision_path
package.objects_path
package.mujoco_scene_path
package.mujoco_binary_path
package.mujoco_composed_binary_path(robot="unitree-g1-groot-wbc")
package.entities
```

## Runtime Loading

### Rerun

`dimos/visualization/rerun/scene_package.py` resolves the package, selects the
Rerun visual with `browser_visual_path("rerun")`, and logs:

```text
rr.Transform3D(package.alignment)
rr.Asset3D(GLB bytes)
```

The GLB is sent as bytes, so a Rerun viewer does not need direct filesystem
access to the cooked package.

### MuJoCo

The normal MuJoCo path loads `package.mujoco_scene_path`, attaches the robot
MJCF at runtime, then appends `spawn=="initial"` entities from
`package.entities`.

The scene-only `wrapper.xml` keeps the package robot-agnostic. A composed `.mjb`
can be used for large scenes when startup time matters, but it is specific to:

```text
robot
spawn pose
entity policy
scene revision
MuJoCo version
```

## Extension Points

New representations should fit into the same pattern:

```text
1. Add cook-time options if the backend needs them.
2. Add an artifact writer that consumes the source and/or SceneCookPlan.
3. Add manifest fields only when runtime needs to discover the artifact.
4. Serialize artifact paths package-relative.
5. Resolve them through load_scene_package().
6. Keep runtime consumers dependent on ScenePackage, not cook internals.
```

Examples:

```text
Gaussian splats
Cook a splat artifact, add a manifest path, and let a viewer consume it from
ScenePackage.

Articulated assets
Extend sidecar/entity metadata with articulation description, cook per-asset
visual/collision/runtime files, and expose them through package.entities.

New simulator backend
Add a backend artifact writer and a manifest path. The simulator loads the
package artifact without knowing source prim matching or sidecar rules.
```

## Code Map

```text
cook.py top-level cook CLI and orchestration
package_config.py cook-time options and visual target profiles
sidecar.py authored sidecar schema
planning.py sidecar + source prims -> SceneCookPlan

source_assets/normalize.py source normalization and .blend export
source_assets/mesh.py source prim loading and alignment
source_assets/inspect.py asset budget inspection
source_assets/glb.py GLB JSON/BIN rewrite helpers

browser/visuals.py target-specific browser visual cooking
browser/collision.py browser collision GLB and objects.json
entities/visuals.py entity visual extraction/filtering
entities/collision.py entity collision hulls
mujoco/collision_policy.py shared static collision policy
mujoco/collision_export.py MuJoCo XML and mesh export

dimos/simulation/scene_assets/spec.py
runtime ScenePackage metadata contract

dimos/simulation/scenes/catalog.py
runtime scene name/path resolution
```
Loading
Loading