Commit Graph

4055 Commits

Author SHA1 Message Date
Kevin Zakka f570ab52a8 Fix segfault in FuseStatic when body contains cameras or lights
FuseStatic deletes static (joint-less) bodies and reassigns their
children to the parent body. Geoms and sites were reassigned, but
cameras and lights were not, leaving dangling body pointers that
crash in mjCCamera::Compile() / mjCLight::Compile().

Add camera and light reassignment in FuseStatic and FuseReindex.
2026-02-09 14:56:51 -08:00
Sam Haves a6a639003f Fix number of textures in BM_CompileManyTextures to 100.
PiperOrigin-RevId: 865475996
Change-Id: I63fd1e8b9aaff9536a9609d8f8390f8c9473785e
2026-02-04 10:35:20 -08:00
Baruch Tabanpour d07f39b4a0 Add graph mode to MJX, in preparation of supporting staged graph capture.
PiperOrigin-RevId: 865380826
Change-Id: I840b48027e1142f87eb745d0d19b0cd3e87904b2
2026-02-04 06:38:13 -08:00
Haroon Qureshi b37caf6d0c Show save dialog (instead of open dialog) as needed.
PiperOrigin-RevId: 865374467
Change-Id: I599333659b12b05b7c779115fa397302f4978751
2026-02-04 06:20:01 -08:00
Haroon Qureshi 1a0fe29c41 Make missing decoder non-failing.
Otherwise, if you try to open a random file in studio, it will crash.

PiperOrigin-RevId: 865372002
Change-Id: I96d3121b6de792daaff53155ea2436ac3f6668db
2026-02-04 06:12:54 -08:00
Kyle Bayes 1a9ca3239a Replace comma operator with semi-colon.
PiperOrigin-RevId: 865353927
Change-Id: I3498d8dc17f96caf8fa1975613ed6a815d2f20e7
2026-02-04 05:14:17 -08:00
Haroon Qureshi c2ede20d08 Move model_, data_, and spec_ into private accessors.
This is in preparation for an upcoming change.

PiperOrigin-RevId: 865332731
Change-Id: I74041b3caf5de841f583f76682e1ced049557202
2026-02-04 04:02:52 -08:00
Haroon Qureshi 0add985a15 Handle null camera and vis_option.
PiperOrigin-RevId: 865088406
Change-Id: I4a3bf7f6cb696de1461bc53fd5d77b941ea0c0c5
2026-02-03 16:06:06 -08:00
Haroon Qureshi 1bd72428f1 Perform ImGui calls only when a context is available.
PiperOrigin-RevId: 865072901
Change-Id: I4b35d953df2f686d2f02f8e0aede7109729b5e04
2026-02-03 15:29:44 -08:00
Haroon Qureshi 144a8a9e85 Make EGL utils conditional on EGL.h.
PiperOrigin-RevId: 865064686
Change-Id: I3728de6e49e4c36d76b410c2458767f74df069c9
2026-02-03 15:09:51 -08:00
Haroon Qureshi feb3abcccf Fix paths.
PiperOrigin-RevId: 864933655
Change-Id: I44f34b47fe4f6725de59c6565f6b2b557b80eaa6
2026-02-03 10:16:19 -08:00
Taylor Howell 0ec7259e5c MuJoCo Warp documentation: Options
PiperOrigin-RevId: 864932415
Change-Id: I54fc7e8972ea38da783c5537fdfa62644f180e51
2026-02-03 10:14:22 -08:00
Haroon Qureshi ef8e6802ef Move EGL initialization into a separate class.
Initialize the EGL context in the Renderer when using the classic
rendering engine with no window.

PiperOrigin-RevId: 864884976
Change-Id: Ic6cc4637855a361e41f3bfb4b738c012ec93711f
2026-02-03 08:12:35 -08:00
Haroon Qureshi 7ec8b6e341 Pause sim when loading an empty model.
PiperOrigin-RevId: 864855430
Change-Id: Ib8c2b0949ee6fda8dd1490017e146d792119e840
2026-02-03 06:49:58 -08:00
Haroon Qureshi 34add7bb32 Removing trailing newline in zenity file dialogs.
PiperOrigin-RevId: 864842389
Change-Id: Ie4cc61a91732fcde0ef2c7eba927aede217b2e6d
2026-02-03 06:15:37 -08:00
Haroon Qureshi e82253e86c Prevent file dialog from reopening after being dismissed.
PiperOrigin-RevId: 864842269
Change-Id: I91819a3418875fe06dbed0cf7777e1dc7d358079
2026-02-03 06:14:35 -08:00
Haroon Qureshi 1a2bca4986 Use runtime enum for the renderer backend instead of preprocessor macros.
TESTED:
  studio:vulkan
  studio:vulkan --offscreen_mode=true
  studio:opengl
  studio:opengl_egl
  studio:classic
  studio:classic --offscreen_mode=true
  studio:server
  robot_sim/frontend:debug_server
  pyviewer:example
  pyviewer:example --define=mujoco_gl=vulkan
PiperOrigin-RevId: 864768322
Change-Id: I4478e0115b3807060d60d98b4ddfd63da9389aac
2026-02-03 02:13:15 -08:00
Taylor Howell 24e5b966c3 MuJoCo Warp documentation: remove beta software warning.
PiperOrigin-RevId: 864761934
Change-Id: I56afaf9bf9e86ed3ea34ff576230d3b3bc4bf28a
2026-02-03 01:56:35 -08:00
Alessio Quaglino a54c9f1d78 Specialized box and capsule collision primitives for stable 2D flex interactions.
PiperOrigin-RevId: 864500749
Change-Id: I52aed6e29569477a8a0b6b5eb55ad483f1077c0e
2026-02-02 13:36:42 -08:00
Sam Haves 8344dba11e Remove special USD handling from simulate CMakeLists.
USD support is now enabled via plugin.

PiperOrigin-RevId: 864491943
Change-Id: Ib0a80413821b0f398ff05bf87c8fb79e93a811e6
2026-02-02 13:15:48 -08:00
Sam Haves 49b4790877 Enable multithreading for texture compilation, use new user ThreadPool for compilation.
PiperOrigin-RevId: 864449279
Change-Id: I5dd053ab0b1f14d81e1f68296eadc59cd5b8d698
2026-02-02 11:35:41 -08:00
Sam Haves f0d5ed73b2 Restore cache capacity after BM_CompileManyTextures benchmark.
The BM_CompileManyTextures benchmark temporarily sets the MuJoCo cache capacity to 0. This change ensures that the original cache capacity is restored after the benchmark completes, preventing side effects on other tests.

PiperOrigin-RevId: 864332653
Change-Id: I5f756e30d4922d5e6f9b70d19ba9d0e31cde9259
2026-02-02 06:43:05 -08:00
Sam Haves 683b1b5d38 Create threadpool for src/user and primarily compiler usage.
PiperOrigin-RevId: 864328236
Change-Id: Iffaa9b8e6eacdb038020af9d6ad82d7cb7a6c941
2026-02-02 06:31:00 -08:00
Haroon Qureshi b7a46d04b6 Implement OS-specific file dialogs.
PiperOrigin-RevId: 864235878
Change-Id: I709fc52c0c467f317694ba0772572a448c45de35
2026-02-02 01:33:40 -08:00
Yuval Tassa 815dbb996e Use body_weldid to find the first movable body in a chain.
PiperOrigin-RevId: 863774053
Change-Id: I8df96d5af7cc80d78a6f35560c3c31bed8be550e
2026-01-31 17:16:36 -08:00
Google DeepMind 7418d86eda Enable Emscripten threading for MuJoCo WASM builds.
PiperOrigin-RevId: 863309872
Change-Id: I2edabb386f3abc74e507d0419b136b1586d01241
2026-01-30 10:58:18 -08:00
Haroon Qureshi b073cd2ca4 Refactor mjVFS and resource management.
Resource operations (e.g. mju_openResource, mju_readResource, and
mju_closeResource, etc.) are now all handled by a VFS instance. It
is now up to the VFS to determine which provider to use in order to
handle those operations.

This allows us to dynamically add/remove (aka "mount") providers to
a VFS to handle special requests. mj_addFileVFS and mj_addBufferVFS
have been reimplemented as two such use-cases. Moreover, we expose
the mounting behaviour with two new functions: mj_mountVFS and
mj_unmountVFS.

PiperOrigin-RevId: 863248779
Change-Id: I8bcbd5445814ba1e72c6d7b80ad6a054f5f1df57
2026-01-30 08:20:53 -08:00
Haroon Qureshi 9da834c12c Tweak status bar layout.
PiperOrigin-RevId: 863184918
Change-Id: Ibff6c71e6004f4dd2ad2b49cc889d2f9c2dfd41e
2026-01-30 05:07:11 -08:00
Haroon Qureshi e35c981f48 Add uv offsets to autogenerated 2D uv coordinates.
The original render_gl3.c code does the following:

```
mjr_setf4(plane, 0.5*scl[0], 0, 0, -0.5);
glTexGenfv(GL_S, GL_OBJECT_PLANE, plane);
mjr_setf4(plane, 0, -0.5*scl[1], 0, -0.5);
glTexGenfv(GL_T, GL_OBJECT_PLANE, plane);
```

The 4th component of the GL_OBJECT_PLANE function effectively
describes a UV-offset for the generates uvs. In our filament
implementation, we had overlooked this 4th component.

PiperOrigin-RevId: 863181644
Change-Id: I60688117ea2019257da683cdda0c7d389dd5af1e
2026-01-30 04:55:31 -08:00
Google DeepMind f022faadf7 Revert 42b81966b7 due to GitHub failures
PiperOrigin-RevId: 862869742
Change-Id: I9c56c8e15b609c9a67e6c90542722e7326d8fe2c
2026-01-29 13:17:49 -08:00
Google DeepMind 63de5c51ee Fix line numbers in named access tests link.
The link to the named access tests in `tests/bindings_test.ts` was incorrectly formatted.

PiperOrigin-RevId: 862786877
Change-Id: Idf10d75638e55b7d3b0312c765a977274d014857
2026-01-29 10:08:44 -08:00
Taylor Howell 1381e8adee Add mjMINAWAKE to constants.cc
PiperOrigin-RevId: 862784740
Change-Id: I309fca497027cd8cb7cee6c998fc34d0cb5e94fd
2026-01-29 10:04:43 -08:00
Yuval Tassa 55f300b78c Fix typo
PiperOrigin-RevId: 862781462
Change-Id: I88844e2148e821ec92e37aa8aab3554c132a4d43
2026-01-29 09:57:09 -08:00
Yuval Tassa 883e69d7b1 Minor improvements to collision sensor documentation.
PiperOrigin-RevId: 862767431
Change-Id: I53861430e7868b23e37be9694f195a2dd3685db4
2026-01-29 09:22:23 -08:00
Google DeepMind 42b81966b7 Add a test for compiling XML with multiple assets from VFS.
PiperOrigin-RevId: 862767395
Change-Id: I6d51b5630a0d5033231a555c3b9297ae18dc429f
2026-01-29 09:21:11 -08:00
Sam Haves f434578d30 USD decoder improvements: Support actuators targeting tendons and improve side site index handling.
Adds support for mjTRN_TENDON actuators in the USD decoder. Modifies the tendon path parsing to correctly handle side site indices, allowing -1 to signify no side site for a given path element.

PiperOrigin-RevId: 862755621
Change-Id: I18b13b160e3d1c27945d0972a69012d6307131e9
2026-01-29 08:51:02 -08:00
Google DeepMind d2efc0e154 Add object-based accessors for mjData in WASM bindings.
PiperOrigin-RevId: 862736608
Change-Id: I0618e9d2af37e377bad1aead1b3fd1a12334df35
2026-01-29 07:55:56 -08:00
Google DeepMind 59c5017073 Improve error messages for named/indexed lookups in WASM bindings.
PiperOrigin-RevId: 862682001
Change-Id: I6381af64b724de0ab5aee43cdc89ce463b590cf1
2026-01-29 04:53:54 -08:00
Haroon Qureshi f6796f36b2 Only update GuiView::UpdateRenderable (which calls imGui::EndFrame
internally) when we want to render the GUI to the same target as the
scene.

PiperOrigin-RevId: 862647358
Change-Id: If3656032b74a168b804dfa34ef3eb97c9817c2c0
2026-01-29 02:54:44 -08:00
Taylor Howell 57b5ebc92b MuJoCo Warp documentation: height field collision overflow
PiperOrigin-RevId: 862454467
Change-Id: Iaccc44aa0c57faf6ad2dbc62f2b727cea2e4980d
2026-01-28 16:55:10 -08:00
Haroon Qureshi 86f82d18a2 Temporarily disable mjz support.
PiperOrigin-RevId: 862383413
Change-Id: I32927f59852e149b7aaf8b5225f35020532eb7f9
2026-01-28 13:58:41 -08:00
Taylor Howell 8889c13fa7 MuJoCo Warp documentation: Inertia matrix factorization
PiperOrigin-RevId: 862290080
Change-Id: I7acd30f1fff5cca95ca1139f71710cab5c493561
2026-01-28 10:18:50 -08:00
Yuval Tassa c5925e7b0e Improve wording in changelog
PiperOrigin-RevId: 862288773
Change-Id: I2dcd09ed1fb929396218ee32e99242d9be508b3b
2026-01-28 10:15:11 -08:00
Yuval Tassa 510cbceda5 Add missing space after comma
PiperOrigin-RevId: 862235154
Change-Id: I60ad15fcc918accf52abeced7e22a5a1d599df82
2026-01-28 07:53:18 -08:00
Haroon Qureshi a050b64635 Update minimum CMake version for miniz.
PiperOrigin-RevId: 862226233
Change-Id: I8612260e65f9f1c4192325a90bcfc6bac71585c0
2026-01-28 07:28:09 -08:00
Matija Kecman 0eff7acf80 Improve filament gui
* Added color to widgets which have changed from their initial values and the ability to revert to their initial values by clicking with the right mouse button
* Added some reasonable range limits, which are especially useful for drag widgets

PiperOrigin-RevId: 862220411
Change-Id: I1d2c61d8889d5ec29890d81b5f97af576cb5c611
2026-01-28 07:09:01 -08:00
Haroon Qureshi 40f2fe0977 CMakeLists for mjz.
PiperOrigin-RevId: 862214752
Change-Id: I498a1f0092adc9e94016bf23589403296bffb4f7
2026-01-28 06:53:06 -08:00
Yuval Tassa 1d44f7a0d0 Minor fix to changelog
PiperOrigin-RevId: 862213255
Change-Id: I20017785aca047efaead582f84a1ba9769411d41
2026-01-28 06:48:39 -08:00
Haroon Qureshi 2fd9b5e92f Partial roll back VFS refactor due internal breakages
PiperOrigin-RevId: 862210191
Change-Id: Ia15a345a267bcef4b593d507d54f1668da0c0611
2026-01-28 06:40:11 -08:00
Yuval Tassa 19ff06155a Refactor sensor computation into per-sensor functions.
PiperOrigin-RevId: 862180688
Change-Id: I9f3f4da8ca8abed778965fd3970171276ee4570d
2026-01-28 05:04:59 -08:00