This enables decoders to leverage their own file resolution systems. For example: USD can compose a stage (scene) from memory, via a file on disk, or via custom asset resolver.
Passing it through to the decoder reduces the need for custom resource providers that wrap these other resolution systems.
This will also enable a fun, but likely niche usecase where the decoder does procedural generation and does not have to be backed by a resource. See the tests for an example of this.
PiperOrigin-RevId: 828939899
Change-Id: Ic319a685332d91198a4ae926867c834bf7f7f724
Interactions (like moving the camera or mouse picking) no longer depend
on needing an mjvScene. Instead, everything is done relative to the
camera directly.
This duplicates some code in engine_vis_visualize which we will try to
resolve and recombine at a future time.
PiperOrigin-RevId: 828461259
Change-Id: If26329c1a7c37516f0213b18056c3e31760f60ae
Added `sphinx.ext.extlinks` to the Sphinx configuration and defined `extlinks` for `:issue:` and `:pr:` roles, pointing to the MuJoCo GitHub repository. Updated `changelog.rst` to use these new roles, replacing `:github:issue:` and `:github:pull:` which are currently failing.
Also fix a formatting bug in the 3.3.7 changelog
PiperOrigin-RevId: 828403002
Change-Id: I7f0134e4dd555fc59a3fee090338de56aababe1c
This change modifies the code generation for structs in `bindings.cc`. Instead of placing each struct's constructor and member functions under individual markers, all autogenerated struct source code is now grouped together under a single `// {{ AUTOGENNED_STRUCTS_SOURCE }}` marker. This improves the organization of the generated file and simplifies the template.
Future work would move the rest of the structs into this pattern
PiperOrigin-RevId: 828390272
Change-Id: Iee9d0e8766db86b2c1d4296a37ac7a8e6e05428b
The `sort_structs_by_dependency` function now takes a dictionary of `WrappedStructData` and uses the pre-computed `typename` within `WrappedFieldData` for dependency analysis, instead of re-introspecting the AST. This change also includes populating the `typename` in various `WrappedFieldData` generation methods.
PiperOrigin-RevId: 828389481
Change-Id: Ie97c1a66e5e69bd148a928fda26afdaa09f56687
Updated the wasm/README.md to describe how to manually run the benchmark tests.
PiperOrigin-RevId: 827881670
Change-Id: I1d524851d9f3f8182ecbfcc649bb9a5a61d716ae
* Add newline function to code_builder
* Remove type aliases which made jump to definition less ergonomic
* Add types to constants
PiperOrigin-RevId: 827863199
Change-Id: Ib4390d398926466ecce491a3d0ebe308ed5e0cbe
This enables two workflows:
1) Users that parsed some other format into MjSpec, or built it programmatically can export animated USD easily with as minimal as possible interaction with USD.
2) Creating a spec from USD, then modifying the spec, should not cause a duplication of data when writing to USD.
PiperOrigin-RevId: 827627520
Change-Id: I02c8c14a18569547710e54f3704d52ac0bf70ce6
- When `mjData.nefc` was 0 (solver not run at all), we were plotting the stale diagnostics from the last run; now fixed.
- In the case where islands were used, the semantic of the plotted diagnostic `sqrt_nnz` (square root of Hessian nonzeros) is changed. It used to be the sum of square roots of solver nonzeros per island, it is now the square root of the sum of all nonzeros in all islands. The semantic `sqrt(sum(nnz_i))` was found to be more consistent than `sum(sqrt(nnz_i))`, in the sense that switching islanding on/off leads to smaller changes and is more in line with the interpretation of islanding as [block-diagonalization](https://mujoco.readthedocs.io/en/3.3.7/computation/#constraint-islands).
PiperOrigin-RevId: 827624908
Change-Id: I5fc86364ead585a4752a6d44823fb75cf6c7c318
Since we don't do any on demand data loading for USD and always convert everything it should be safe to use the SdfLayer API instead of the SdfAbstractData API. This enables other codepaths such as the USD writer class to reuse the same logic to generate USD specification from an mjSpec.
PiperOrigin-RevId: 827431722
Change-Id: I60a581e0c9577164a4a66229ea9dcb8912afcf74
- plugin system similar to mjpResourceProvider, but instead of loading a resource it converts an existing mjResource into an mjSpec.
- The returned spec is then composed into the referencing spec.
- This enables different file types to generate arbitrary specs, and allows us to separate format parsing from compilation code.
Follow up CLs will move some of the logic in src/engine for PNG, USD, KTX, OBJ loading into decoders.
The mj_parse function MjSpec from a given file, it's a more generic version of mj_parseXML.
In it's implementation, mj_parse as opposed to mj_parseXML will look for any registered decoder and
not assume we are striclty dealing with MJCF.
PiperOrigin-RevId: 826149497
Change-Id: I0ece26904280cb94bd5ded6dd5a565c539d60254
This allows setting attributes with bind using a list of mjSpec objects as arguments.
PiperOrigin-RevId: 825456920
Change-Id: Ie6af956feab0a805175d7aaecf26e071401fbf05