Commit Graph

4570 Commits

Author SHA1 Message Date
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
Sam Haves da01bd37a2 Remove modelfiledir_ from compiled assets, use owning spec modelfiledir instead.
Previously specs that were attached to some parent spec would resolve its asset paths relative to the modelfiledir of the parent spec. This means path resolution would change depending on the source of the parent spec. Instead, this change makes asset file path resolution relative to the "owning spec" i.e. the spec where the asset was created.

This enables workflows such as loading a parent spec via resource provider, then loading a child spec via `from_zip` or in memory providing `spec.assets` and resolution will work as intended.

PiperOrigin-RevId: 903207910
Change-Id: Ia58020ab372a3ceadf31e804d145e2ae53d8e5f9
2026-04-21 07:00:05 -07:00
Kyle Bayes 3325971840 Add mj_maxContact API function.
PiperOrigin-RevId: 903135055
Change-Id: I5f103c7d51f97e327c923bc567002ace835f5517
2026-04-21 04:03:22 -07:00
Kyle Bayes bc5883e82f Update multiccd documentation.
PiperOrigin-RevId: 902779253
Change-Id: I767cd0a230b78efe2a71f83e5f2f134268997dcb
2026-04-20 12:53:17 -07:00
Kyle Bayes 6cb6e5a93f Enable multiccd by default.
PiperOrigin-RevId: 902752921
Change-Id: I8e2085ff17db0ac0db1641b8837415c458e5eca4
2026-04-20 12:00:10 -07:00
Haroon Qureshi 8e7787ad09 Use function for applying transforms to multimesh Renderables.
PiperOrigin-RevId: 902712241
Change-Id: I5bfdab8bce12ffb1a1f030ae0a32a61e9b8157e1
2026-04-20 10:39:44 -07:00
Alessio Quaglino 188196603d Fix flexcomp empty cell detection that was causing missing cells.
The previous implementation only checked whether grid cells contained mesh vertices to determine occupancy. For coarse meshes with large faces, most cells were incorrectly marked empty and pruned—even cells fully inside the object volume. This change improves the algorithm by:

- Marking cells that overlap with any mesh element's AABB as non-empty.
- For surface meshes, running a flood-fill from the grid boundary through non-overlapping cells to identify truly exterior cells. This preserves empty interior cells, preventing incorrect pruning of the object's core.
- For volumetric meshes, defaulting to element-AABB overlap detection directly.

Limitations for non-watertight meshes: If the mesh contains holes larger than the grid cell size, the flood-fill will leak into the interior. In this case, all non-element cells (including interior ones) will be marked as empty.

PiperOrigin-RevId: 902675331
Change-Id: I5a84303a33d5ca7436213e7ce9aca3806c9f5a0f
2026-04-20 09:27:40 -07:00
Haroon Qureshi 476e2e909e Allow Transforms to be set directly on Renderable.
Also allow multiple Meshes to be assigned at once rather than one at a
time.

This simplifies both the usage and implementation of Renderable.

PiperOrigin-RevId: 902665683
Change-Id: I23ff365a54fd6a3814ed3452b1e094ae9f698a1b
2026-04-20 09:06:14 -07:00
Yuval Tassa b2281883dd Improve slider precision and range clamping, fixes #3206
Add clamping to slider values in both ImGui widgets and mjUI to ensure they remain within the defined min/max ranges, preventing potential floating point inaccuracies from causing values to slightly exceed the bounds.

PiperOrigin-RevId: 902660458
Change-Id: Ia153ae7907f07b890f2b5ac2e3a4be93ecae7bd3
2026-04-20 08:54:11 -07:00
Yuval Tassa a8a5afc8dc Cache benchmark data in engine_util_sparse_benchmark_test
PiperOrigin-RevId: 902651349
Change-Id: I760e3f696b37699366c40c3c93a74e2b1b35678e
2026-04-20 08:29:56 -07:00
Alessio Quaglino 2d12dee025 Add dof="2d" option to flexcomp for in-plane deformations.
PiperOrigin-RevId: 902620719
Change-Id: Ib06d3f7b9439e1d90a8373a4289ade0c327e72e4
2026-04-20 07:14:40 -07:00
Haroon Qureshi cad734ae70 Introduce Trs type.
Combines a translation, rotation, and size into a single struct.

PiperOrigin-RevId: 902620586
Change-Id: I628bfdedebde8c83239215efe0bee4a338eabd06
2026-04-20 07:13:52 -07:00
Alessio Quaglino 35f7db8e91 Add StringToVector<std::string> overload for char*.
This overload allows `StringToVector` to accept a `char*` argument when parsing into a `std::vector<std::string>`, by converting the `char*` to `std::string` before processing.

PiperOrigin-RevId: 902611443
Change-Id: I2048918f915c1bac74522f368ea28f23ca9a6885
2026-04-20 06:48:59 -07:00