Commit Graph

4582 Commits

Author SHA1 Message Date
Sam Haves a2cd7aa52f Make mjz_decoder threadsafe.
PiperOrigin-RevId: 907574530
Change-Id: Ie292ff10dfa515e4ddc9dad1459e44c3ba9eeabe
2026-04-29 07:19:13 -07:00
Haroon Qureshi e745538ad6 Use FilamentContext for creating objects (instead of filament::Engine).
PiperOrigin-RevId: 907568857
Change-Id: If7b1b55bac9ef56dde43dc56b45c2c1034149dac
2026-04-29 07:04:46 -07:00
Yuval Tassa 9796345888 Add font scaling to studio, bound to CTRL+MINUS/PLUS
PiperOrigin-RevId: 907491215
Change-Id: I144467c3ff0e3d11f4a5bfb6ed2b1e4e88b8693d
2026-04-29 03:42:07 -07:00
Sam Haves d92fe0810c Add MjSpec.encode method.
PiperOrigin-RevId: 907177387
Change-Id: I65800298798037c4a0c0cd79ec86706be67db51e
2026-04-28 14:22:41 -07:00
Haroon Qureshi ace90c00b9 Remove deleted file.
PiperOrigin-RevId: 906944517
Change-Id: I8471d1014888cc03632df631b47080618694f4a4
2026-04-28 06:34:47 -07:00
Haroon Qureshi 5751b09ff6 Initial pass at exposing the new mjr APIs.
Moves all internal types and structs to the "public"
render_context_filament.h header file.

PiperOrigin-RevId: 906929736
Change-Id: I7e7c315fb99a3601b09841073eaeec795718b999
2026-04-28 06:00:03 -07:00
Yuval Tassa 647af382c1 Add per-island PGS solver dispatch.
Total testspeed runtime for `2humanoids100.xml` reduced by 27.6% (63.4 -> 49.5s) due to early termination on small islands

PiperOrigin-RevId: 906910915
Change-Id: If55ad468c3680ef44eda7000455a77f8003b3122
2026-04-28 05:13:54 -07:00
Haroon Qureshi 00fff8c780 Update APIs to use opaque handle types instead of concrete types.
PiperOrigin-RevId: 906895053
Change-Id: Id61d437ea814e038f25d92375eb747a6c6775c32
2026-04-28 04:40:46 -07:00
Haroon Qureshi 32aeb377b5 Move filament::Skybox object management into SceneView.
ModelObjects no longer directly manages any filament objects.

PiperOrigin-RevId: 906873925
Change-Id: Iaa317cbeb9c5236745a5f0d04a740985bec54a5c
2026-04-28 03:56:01 -07:00
Yuval Tassa 6f275b79c6 Studio: toolbar cosmetic improvements
- Remove hard-coded button sizes (48×32) from toolbar icons; buttons now use default ImGui sizing, matching the existing copy-camera button.
- Remove the Unload button (available via menu).
- Add ImGui_ColorButtonEx widget with per-corner rounding via ImDrawFlags, enabling segmented button-group visuals.
- Use segmented rounding for the pause/viscous/play triplet: rounded-left, square, rounded-right.
- Make pause and play buttons 40% wider than the viscous button for emphasis.
- Replace the theme combo dropdown with a cycling button.
- Reduce toolbar height from 48px to 34px and vertically center content via WindowPadding.
- Zero out table CellPadding in the toolbar for precise vertical centering.
- Remove the speed combo's inflated vertical padding.

PiperOrigin-RevId: 906853958
Change-Id: I6e4ec7243adb9e0f1f06f8779fa896a6865c46c7
2026-04-28 03:12:55 -07:00
Yuval Tassa 25a9114705 No-op refactor of PGS and NoSlip solvers in preparation for island support.
PiperOrigin-RevId: 906826882
Change-Id: I2003097e1bb81ebabda3a7075f1f8200d4d5ff95
2026-04-28 02:11:30 -07:00
Alessio Quaglino e6354b4368 Add flex_interp to the MJX Model.
PiperOrigin-RevId: 906518134
Change-Id: If716e7e67827a6659fb72a6064809910fe99944f
2026-04-27 13:33:17 -07:00
Matija Kecman 9cd89eec2f Make Studio's monitoring charts responsive and full-window
* **Dynamic Full-Window Scaling**: Charts in the Performance and Solver panels now expand to fill the entire pane, automatically arranging side-by-side or stacked based on window orientation to eliminate scrollbars.

  * **Responsive Decorators**: Added reusable C++ ImPlot helper functions that auto-hide titles, legends, and tick labels when the plot surface is small.

  * **Cleaner Visualization**: Refined chart titles (e.g., "CPU msec vs frame", "Convergence vs iter") and removed redundant axis labels for improved scannability.

These changes were based on the plot behavior of //third_party/mujoco/src/experimental/py/sample/implot.py This is an incremental improvement, we can make the plots even nicer in future.

PiperOrigin-RevId: 906351914
Change-Id: I8cb19c19bf807f0107c717066250a71bcf7e325f
2026-04-27 07:42:56 -07:00
Yuval Tassa 2e3205229c Studio: various panel usability improvements
- Reorder Physics section, move Actuator Groups to end.
- Rename "Physics Settings" → "Physics", "Rendering Settings" → "Rendering".
- Reduce IndentSpacing from 20 to 6.
- Reduce FramePadding Y from 6 to 2 for narrower buttons and popups.
- Remove explicit Unindent/Indent overrides in Rendering and Visibility Groups
  sections so buttons are naturally indented under their tree nodes.
- Dynamically adjust convergence and counts plot X-axis limits based on actual
  solver iterations instead of hardcoded 20.

PiperOrigin-RevId: 906244477
Change-Id: Ic3e6e6e793395158c8cb6692af885884ca3f7f50
2026-04-27 03:11:51 -07:00
Matija Kecman 3a5a48b9f9 Fix texture ID collisions in ImguiBridge
Texture IDs were assigned using textures_.size() + 1, which is not monotonic: after erasures the map shrinks and previously used IDs can be reassigned to new textures. This causes multiple ImGui images to reference the same underlying Filament texture, rendering them all with the same pixel data. This fix replaces the size-based scheme with a monotonically increasing counter (next_tex_id_) that never reuses IDs.

PiperOrigin-RevId: 906214496
Change-Id: I5a388861ad9565c8e00e27b39cc9c76c9750ca1e
2026-04-27 01:59:28 -07:00
Haroon Qureshi b643f50b2a Rename IndexType USHORT/UINT to U16/U32.
PiperOrigin-RevId: 906026433
Change-Id: I0016c1923560fc8517e5388ed6068d54b84d5923
2026-04-26 14:55:55 -07:00
Google DeepMind 521d152ec5 Enable Warp execution on CPU devices in MJX.
This change modifies the Warp JAX FFI to register callbacks for both CUDA and CPU platforms, allowing Warp kernels to be launched on CPU devices. MJX's io.py is updated to allow Warp to use CPU devices if no CUDA GPU is available. Tests are adjusted to no longer skip when CUDA GPUs are absent. A minor fix for sorting precision in test_util.py is also included.

Kristian Hartikainen
 - https://github.com/google-deepmind/mujoco/pull/2948

Github issue - https://github.com/google-deepmind/mujoco/issues/2947

PiperOrigin-RevId: 906018844
Change-Id: I9c026b4a4e2a0276d5d3af3954fd027cf75b6d7a
2026-04-26 14:19:34 -07:00
Haroon Qureshi 8f32f6e72e Rename enum values to match type name.
PiperOrigin-RevId: 906014884
Change-Id: I0f37ab0a0a910724723fb9f7e477b64643ca05fc
2026-04-26 14:03:59 -07:00
Haroon Qureshi 2fa2db7ae0 Re-enable spotlights in wasm builds.
PiperOrigin-RevId: 905917482
Change-Id: Iaadd2b2ccf3be91ec2edfb8ecfd40db32909dd4e
2026-04-26 07:34:17 -07:00
Matija Kecman 82eab11a88 Remove deprecated Fonts->Build() and clean up ImGui texture lifecycle
* Remove the explicit io.Fonts->Build() call from InitImGui, which was deprecated in Dear ImGui v1.92.0. With ImGuiBackendFlags_RendererHasTextures already set, the font atlas is now built lazily by ImGui and communicated to backends via the ImTextureStatus_WantCreate protocol.

* Add proper texture shutdown in ~ImguiBridge by iterating ImGui::GetPlatformIO().Textures and destroying all tracked textures, per the //third_party/dear_imgui/docs/BACKENDS.md instructions.

* Remove the "OK but missing" and "WantUpdates but missing" texture recovery hacks from Update(). These handled a state where ImGui thought textures were alive but the Filament-side storage had been torn down. With proper destruction acknowledgement (SetStatus(Destroyed) + SetTexID(Invalid)), ImGui will now transition destroyed textures to WantCreate on the next frame, and the normal creation path handles it cleanly.

PiperOrigin-RevId: 905886622
Change-Id: Ic449eeaf083740a67eae9c637fb53546a6192b28
2026-04-26 05:19:26 -07:00
Yuval Tassa 2f2d00daed Fix issues in changelog.
PiperOrigin-RevId: 905663581
Change-Id: Ic5146db3282e303b2a5676e77e27dea3100bf072
2026-04-25 15:00:35 -07:00
Haroon Qureshi 4eb987ad25 Fix uninitialized value.
PiperOrigin-RevId: 905169930
Change-Id: I8df07e8731e8eb1847bc43388f26654d28bcef4c
2026-04-24 12:37:48 -07:00
Michael Moss 2b7cc28afa Update MuJoCo version to 3.8.1 following the 3.8.0 release
PiperOrigin-RevId: 905108575
Change-Id: Ief1f9c6f34559e7a5ccc60dcceec589316bcdf9e
2026-04-24 10:37:50 -07:00
Michael Moss 34d69ad4cb Update changelog for the 3.8.0 release.
PiperOrigin-RevId: 905086535
Change-Id: Id5b32348465b9fa756a8d60234f5c300ded7a27b
2026-04-24 09:56:24 -07:00
Michael Moss 2f5e5d3da1 Add documentation for mjpDecoder.
PiperOrigin-RevId: 905048609
Change-Id: I6342673cdc53b80406ad77fc95cb8bb5790a5df6
2026-04-24 08:38:31 -07:00
Haroon Qureshi a2ee85f477 Fix wasm flickering.
Always execute the engine in non-threading (wasm) builds.
And stop rendering if any beginFrame call returns false.

PiperOrigin-RevId: 905000139
Change-Id: I0a6f06a07a8fc0ab0251a67be13a9d170d4a905d
2026-04-24 06:42:38 -07:00
Michael Moss a04cf1b2b3 Mention Python 3.14 in the changelog.
PiperOrigin-RevId: 904898900
Change-Id: I5ba3d619b496cd038f8614df924fe9cec38b56f9
2026-04-24 02:26:48 -07:00
Saran Tunyasuvunakool 1465d8b6ce Initial implementation of MuJoCo Live.
This is a combination of minor tweaks to the existing Studio WASM application, CMake cleanup to make it buildable, and integration with GitHub Actions for deployment.

The new features added are drag-and-drop, model specification through `?model=` URL parameter, HTTP and HTTPS resource provider, and a user-visible loading message while the model is loading.

PiperOrigin-RevId: 904594610
Change-Id: I3a73b1ca0fcd6fc9ba192469942b2dab010a9308
2026-04-23 12:56:12 -07:00
Alessio Quaglino 4eba85093a Add new flex_node fields to MJX.
PiperOrigin-RevId: 904576383
Change-Id: Ie0cb8e0f25bdeadbecc2ea229835b0f2a2957254
2026-04-23 12:16:09 -07:00
Haroon Qureshi c52d3d0789 Split out the compatibility classes from the filament renderer.
The filament library provides APIs for creating the low-level
objects such as meshes and textures. The compat library provides
the high-level compatibility layer between mjvScene and the core
library.

PiperOrigin-RevId: 904504900
Change-Id: Ida1aecab4b9a8aefbbf6b0a0c4ba7ff164864b8e
2026-04-23 09:52:45 -07:00
Michael Moss 15f61679bf Update next MuJoCo version to 3.8.0 for pending breaking changes.
PiperOrigin-RevId: 904496070
Change-Id: I0b8b01cbcf27f28ac80dbc283bc63090f745f403
2026-04-23 09:33:15 -07:00
Michael Moss e5a38431af Update dependencies ahead of the 3.8.0 release.
PiperOrigin-RevId: 904477783
Change-Id: I58a9749d16241fb37c0fbb848fcaf383b28a658d
2026-04-23 08:46:16 -07:00
Matija Kecman 2b211e1ce6 Detect wayland sessions and report a clear error prompting users to switch to X11 or choose a different graphics mode
PiperOrigin-RevId: 904460146
Change-Id: I9324f403cb09787833c06f863ac157059eea60e7
2026-04-23 08:02:29 -07:00
Haroon Qureshi 8a87a1efbf Rename types to conform to mjr naming conventions.
PiperOrigin-RevId: 904459745
Change-Id: I9369bec34e72dc973df45f844fcf1a6cb08b26b1
2026-04-23 08:01:46 -07:00
Haroon Qureshi 2bc97d8408 Rename types to conform to mjr naming conventions.
PiperOrigin-RevId: 904458866
Change-Id: Id9ca27b698e0e40469524ba4454ab9721a65e785
2026-04-23 07:59:19 -07:00
Haroon Qureshi ead7b1f65e Rename types to conform to mjr naming conventions.
PiperOrigin-RevId: 904457841
Change-Id: I023ffe87eee0a190006dea72ced8748725490098
2026-04-23 07:56:27 -07:00
Haroon Qureshi 3d13d43c9c Rename types to conform to mjr naming conventions.
PiperOrigin-RevId: 904456797
Change-Id: I759b1430a43c7072ed9750d084679d02f0c9cb6e
2026-04-23 07:53:34 -07:00
Haroon Qureshi 4345a2a09f Rename types to conform to mjr naming conventions.
PiperOrigin-RevId: 904440645
Change-Id: I0b9a0c6bd61170ace1a3ea7fb54fb70b615c346b
2026-04-23 07:14:46 -07:00
Haroon Qureshi c1c7643fad Rename types to conform to mjr naming conventions.
PiperOrigin-RevId: 904438811
Change-Id: I77fe14592a4460234e0aff473ee3f530e652bca9
2026-04-23 07:13:00 -07:00
Haroon Qureshi fa33310750 Fix use-after-release issue.
PiperOrigin-RevId: 904351356
Change-Id: Ie6a574763b2ee0ffc0cf5537d8ccdfe87ab1b477
2026-04-23 03:23:55 -07:00
Haroon Qureshi e1794b3d1c Add missing files.
PiperOrigin-RevId: 904346200
Change-Id: I63f4e8741098d5da9403c05ca13419c670743848
2026-04-23 03:10:54 -07:00
Haroon Qureshi 57ad7463b1 Use separate SceneView for main scene and UX.
Refactor FilamentContext to allow multiple render requests to
be submitted onto a single RenderTarget. The main scene and the
ux scene are then submitted as two separate requests that share
the same target, resulting in a single, composited render.

PiperOrigin-RevId: 904324801
Change-Id: I7c47ec4f8d159320612fa33384c01e8db3414daa
2026-04-23 02:23:23 -07:00
Haroon Qureshi c41ed42407 Split the core filament context from the mjr_ API compatibility layer.
PiperOrigin-RevId: 904305762
Change-Id: I462068a847a21be8ad7f3f1a8889f6b5b2aa2d5f
2026-04-23 01:39:12 -07:00
Michael Moss e8ebc994d2 Add 3.14 to the supported Python versions.
PiperOrigin-RevId: 904301647
Change-Id: I30a75bec09068494be060e6ad046badf968d4241
2026-04-23 01:27:34 -07:00
Michael Moss 4b3f3aee6b Add hashes for 3.14 wheels to Python build requirements.
PiperOrigin-RevId: 904299450
Change-Id: I6ac356d1fa9ae4965bd57d24ae11adac8d875a6c
2026-04-23 01:22:21 -07:00
Alessio Quaglino a891782553 Clean-up flex assumptions.
Do not allow a mix of `elastic2d != none` with `dof = trilinear` since the latter assumes 3d elasticity.

Also, do not assume that `flex_interp > 0` in the engine. This will enable to use, e.g., `flex_interp = -1` to mean a linear surface finite element instead of a 3d finite element which is currently identified with `flex_interp = 1`.

PiperOrigin-RevId: 903852035
Change-Id: Ia6290b4a05e9e510ffb7f36d141cd525b40d3110
2026-04-22 08:01:34 -07:00
Matej Aleksandrov 863a084d7f Adjust refcount expectations for Python 3.14
PiperOrigin-RevId: 903813225
Change-Id: Ieb529f2a850e697b643e5023554341c0718ac0e1
2026-04-22 06:33:48 -07:00
Sam Haves 4cfebcc32b Add mj_containsFileVFS and mj_containsBufferVFS functions.
PiperOrigin-RevId: 903785790
Change-Id: I013b37a177284f8440179c4ae5c6221e0f572b49
2026-04-22 05:27:15 -07:00
Taylor Howell c3fddf5dc1 Update doc/mjwarp/update_types.py
PiperOrigin-RevId: 903289569
Change-Id: I7e05736c54fa72dc0c89152f49cf3d9ee6e5492d
2026-04-21 10:03:42 -07:00
Alessio Quaglino ba149aa043 Fix flexcomp strain constraints with rotated grids.
The reference node positions and the positions used for computing stiffness eigenvectors were previously stored in world frame. However, the runtime expects these quantities in the unrotated local frame. This caused non-zero constraint residuals and simulation instability when the grid was rotated — either by the parent body's initial orientation, or by the flexcomp's own frame attributes.

Rather than tracking each rotation source individually, this change extracts the total grid rotation directly from the cell geometry. All node positions are then un-rotated before computing the stiffness matrix.

PiperOrigin-RevId: 903232388
Change-Id: If877af89025ce1e61a76b38c29403d593d892749
2026-04-21 08:02:11 -07:00