Skip to content

Runtime scene package loading for G1 MuJoCo#2594

Draft
Nabla7 wants to merge 8 commits into
mainfrom
pim/feat/runtime-scene-loading
Draft

Runtime scene package loading for G1 MuJoCo#2594
Nabla7 wants to merge 8 commits into
mainfrom
pim/feat/runtime-scene-loading

Conversation

@Nabla7

@Nabla7 Nabla7 commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Problem

Closes N/A

Runtime stacks need a stable way to consume cooked scene packages without depending on the offline cooking toolchain. The contract also needs to make browser assets explicit by backend, because Rerun and Babylon do not support exactly the same GLB extension set.

Solution

  • Adds the runtime ScenePackage contract and scene resolver for --scene none, --scene office, metadata paths, package directories, and composed .mjb paths.
  • Adds backend-named browser visual lookup via ScenePackage.browser_visual_path(target), with legacy fallback for currently shipped packages.
  • Updates Rerun scene loading to request the rerun visual asset instead of assuming every browser GLB is Rerun-compatible.
  • Lets G1 MuJoCo compose a scene-only wrapper XML, robot-only G1 MJCF, and package entities at runtime.
  • Supports precomposed .mjb loading for large scenes where XML compile time dominates.
  • Adds G1 reset/respawn runtime state reset, /cmd_vel wiring, raycast lidar/nav/Rerun visualization, animated URDF robot visualization, and ONNX provider cleanup.
  • Ships the office scene package and G1 URDF mesh archives through the documented ./bin/lfs_push workflow.

How to Test

G1 with the cooked office scene:

python -m dimos.robot.cli.dimos \
  --simulation mujoco \
  --scene office \
  --viewer rerun \
  --n-workers 12 \
  run unitree-g1-groot-wbc \
  -o mujocosimmodule.headless=true

G1 without a scene:

python -m dimos.robot.cli.dimos \
  --simulation mujoco \
  --scene none \
  --viewer rerun \
  --n-workers 12 \
  run unitree-g1-groot-wbc \
  -o mujocosimmodule.headless=true

Prefer headless=true for normal testing and inspect Rerun native. headless=false opens the MuJoCo window and can run much slower.

Checks run locally:

ruff check dimos/simulation/scene_assets/spec.py dimos/simulation/scenes/catalog.py dimos/visualization/rerun/scene_package.py dimos/visualization/rerun/test_scene_package.py
python -m py_compile dimos/simulation/scene_assets/spec.py dimos/simulation/scenes/catalog.py dimos/visualization/rerun/scene_package.py

Earlier branch validation also covered focused runtime/nav/Rerun ruff, py_compile, dimos/codebase_checks/test_no_all.py, and dimos/visualization/rerun/test_scene_package.py.

Contributor License Agreement

  • I have read and approved the CLA.

@Nabla7 Nabla7 mentioned this pull request Jun 25, 2026
1 task
@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 46.56557% with 599 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
dimos/simulation/engines/mujoco_engine.py 18.59% 197 Missing ⚠️
dimos/simulation/engines/mujoco_sim_module.py 26.87% 111 Missing and 6 partials ⚠️
dimos/visualization/rerun/urdf_robot.py 31.48% 74 Missing ⚠️
dimos/simulation/engines/test_mujoco_sim_module.py 47.00% 62 Missing ⚠️
dimos/simulation/scene_assets/spec.py 72.78% 32 Missing and 11 partials ⚠️
dimos/simulation/scenes/catalog.py 26.08% 34 Missing ⚠️
...nitree/g1/blueprints/basic/unitree_g1_groot_wbc.py 49.23% 33 Missing ⚠️
...ntrol/tasks/g1_groot_wbc_task/g1_groot_wbc_task.py 75.00% 7 Missing and 2 partials ⚠️
dimos/control/coordinator.py 57.89% 6 Missing and 2 partials ⚠️
dimos/visualization/rerun/bridge.py 38.46% 7 Missing and 1 partial ⚠️
... and 3 more
@@            Coverage Diff             @@
##             main    #2594      +/-   ##
==========================================
+ Coverage   69.61%   70.80%   +1.19%     
==========================================
  Files         878      902      +24     
  Lines       79326    81283    +1957     
  Branches     7126     7442     +316     
==========================================
+ Hits        55220    57553    +2333     
+ Misses      22301    21836     -465     
- Partials     1805     1894      +89     
Flag Coverage Δ
OS-ubuntu-24.04-arm 63.32% <46.56%> (+0.32%) ⬆️
OS-ubuntu-latest 65.99% <46.56%> (+0.16%) ⬆️
Py-3.10 65.99% <46.56%> (+0.16%) ⬆️
Py-3.11 65.99% <46.56%> (+0.17%) ⬆️
Py-3.12 65.99% <46.56%> (+0.17%) ⬆️
Py-3.13 65.99% <46.56%> (+0.16%) ⬆️
Py-3.14 66.00% <46.56%> (+0.16%) ⬆️
Py-3.14t 65.99% <46.56%> (+0.16%) ⬆️
SelfHosted-Large 30.04% <24.12%> (-0.06%) ⬇️
SelfHosted-Linux 37.35% <25.18%> (-0.45%) ⬇️
SelfHosted-macOS 36.19% <25.18%> (-0.41%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
.../tasks/g1_groot_wbc_task/test_g1_groot_wbc_task.py 100.00% <100.00%> (ø)
dimos/core/global_config.py 81.69% <100.00%> (+0.26%) ⬆️
dimos/robot/unitree/g1/g1_rerun.py 78.26% <100.00%> (+9.51%) ⬆️
dimos/visualization/rerun/test_scene_package.py 100.00% <100.00%> (ø)
dimos/simulation/utils/xml_parser.py 20.66% <25.00%> (-0.28%) ⬇️
dimos/control/test_control.py 93.37% <80.76%> (-1.19%) ⬇️
dimos/visualization/rerun/scene_package.py 88.23% <88.23%> (ø)
dimos/control/coordinator.py 43.62% <57.89%> (+1.98%) ⬆️
dimos/visualization/rerun/bridge.py 40.07% <38.46%> (-0.34%) ⬇️
...ntrol/tasks/g1_groot_wbc_task/g1_groot_wbc_task.py 78.59% <75.00%> (-0.18%) ⬇️
... and 7 more

... and 75 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant