Skip to content
This repository was archived by the owner on Apr 15, 2025. It is now read-only.

Syncing with March 2023 work - #3

Open
stillonearth wants to merge 151 commits into
stillonearth:mainfrom
zalo:main
Open

stillonearth wants to merge 151 commits into
stillonearth:mainfrom
zalo:main

Conversation

@stillonearth

Copy link
Copy Markdown
Owner

No description provided.

zalo and others added 30 commits July 11, 2025 14:47
Co-authored-by: zalo <174475+zalo@users.noreply.github.com>
Fix texture assignment to use mat_texid matrix with mjNTEXROLE indexing
…g mat_texid matrix fix

Co-authored-by: zalo <174475+zalo@users.noreply.github.com>
Revert faulty mjvScene geom access while preserving mat_texid matrix fix
Update MuJoCo to 3.3.8.X and the Official WASM Bindings
The official WASM bindings moved from the stale mujoco-js package
(0.0.7, MuJoCo 3.3.8) to @mujoco/mujoco, versioned in lockstep with
MuJoCo releases.

API migrations for 3.3.8 -> 3.12.0:
- MjModel.loadFromXML() was removed; use MjModel.mj_loadXML().
- The wasm binary now ships as a separate file instead of being
  embedded in the JS, so pass locateFile to the module loader
  (resolves via import.meta.url for both ./src and the esbuild bundle).
- model.tex_adr is now an mjtSize (64-bit) field exposed as a
  BigInt64Array; convert with Number() before arithmetic.
- model.actuator_ctrllimited is unreadable in the 3.12.0 bindings
  (boolean memory views are unregistered), so infer actuator limits
  from ctrlrange instead, matching the official viewer since 3.11.
- Free the old MjModel on scene switch; wasm heap objects are not
  garbage-collected.

Scene XML migrations from the release notes:
- 3.9.0 redesigned margin/gap semantics (margin_new = margin_old -
  gap_old): applied to model.xml, and synced adhesion.xml with
  upstream's migrated version (which also replaces the particle
  composite with replicate).

Adds test_load.mjs (npm test): loads all 17 scene XMLs in Node,
steps each 100 frames, and probes every field the renderer reads.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The catch-up clamp in render() reset the physics clock to the current
frame time, which made the step loop run zero iterations on the frame
that triggered it. If frames consistently exceeded 35ms (heavy scene or
slow GPU), the clamp fired every frame and the simulation froze
entirely while rendering continued; an isolated hitch dropped a full
physics frame right after the jank.

Clamp the accumulated debt to 35ms instead of zeroing it, so physics
always keeps stepping while still never catching up more than 35ms of
sim time per frame.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Update to MuJoCo 3.12.0 and fix physics freeze on slow frames
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants