Commit Graph

1873 Commits

Author SHA1 Message Date
Haroon Qureshi be93e8eeb2 Give Resource Providers a chance to load files.
File resolution only checks local file system. Resource providers may still
be able to load from a path even if it is not resolved.

PiperOrigin-RevId: 867534134
Change-Id: I802566136b965ad839393f56a4d4924dda2e1973
2026-02-09 04:23:44 -08:00
Haroon Qureshi 8557cf201b Allow root models to be in a subfolder.
PiperOrigin-RevId: 867217045
Change-Id: Iae6f7c7f137c2b229b52d93aacea1a4c9e06003e
2026-02-08 08:08:09 -08:00
Yuval Tassa d680b3d234 Rename "delay" buffer functions to "history" buffers.
The functions and associated tests related to managing time-stamped data buffers have been renamed from `mju_delay*` to `mju_history*` to better reflect their general purpose beyond just handling delays.

PiperOrigin-RevId: 866978339
Change-Id: I8655e91bce783287ad2adc412d13a1c39aa2c322
2026-02-07 14:10:16 -08:00
Alessio Quaglino e6639f1e29 Apply prefix/suffix to flex material names.
PiperOrigin-RevId: 866518766
Change-Id: I5f042f52a27d2a6c66fe9642bccc73328fe14603
2026-02-06 10:32:32 -08:00
Yuval Tassa 6419534bad Add actuator and sensor delays. Fixes #1004
PiperOrigin-RevId: 866478839
Change-Id: Id21a6da0f98454c8fa39ea5af8a5e213d6eae497
2026-02-06 08:47:36 -08:00
Yuval Tassa 84fa527723 Add delay buffer utilities to engine_util_misc.
PiperOrigin-RevId: 866450284
Change-Id: I86d6dd6a6f7519640f75ca405fb60a12e8619c86
2026-02-06 07:22:34 -08:00
Haroon Qureshi 60b5b1d59d Fix include path.
PiperOrigin-RevId: 866348008
Change-Id: Ie67fc38ac108810c1ecbefbb8d26c394d988956b
2026-02-06 01:52:03 -08:00
Haroon Qureshi 3e8a81383a Move mjSpec/mjModel/mjData management into a separate class.
PiperOrigin-RevId: 866327584
Change-Id: I72f6ec656e193f67dee22214fe01c517432f87e5
2026-02-06 00:51:15 -08:00
Haroon Qureshi eb7aaa2868 Internal changes.
PiperOrigin-RevId: 866317956
Change-Id: Ic92c0f9b7005198025e388f83dff630253240b3b
2026-02-06 00:22:31 -08:00
Sam Haves c63ba211e5 Refactor MjcPhysics EqualityJointAPI polynomial coefficients.
The single array attribute `mjc:polycoef` has been replaced by five individual double attributes: `mjc:coef0`, `mjc:coef1`, `mjc:coef2`, `mjc:coef3`, and `mjc:coef4`.

PiperOrigin-RevId: 865947359
Change-Id: If9d14a77b0a06e5dc712eeadd6e9402411570706
2026-02-05 07:56:11 -08:00
Alessio Quaglino 6afd742f43 Fix trilinear flexcomp with unused vertices.
Fix a crash and dimension mismatch issue in user_flexcomp when dealing with interpolated="true" meshes that contain unused vertices. Previously, vertbody would correspond only to used vertices while vert included all vertices, leading to assertions or out-of-bounds access. Also enable node pinning for interpolated meshes.

PiperOrigin-RevId: 865881995
Change-Id: Id150f00f22b5f48896ffbffddf03c57b252de8c0
2026-02-05 04:41:02 -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
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
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 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 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
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
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
Haroon Qureshi 86f82d18a2 Temporarily disable mjz support.
PiperOrigin-RevId: 862383413
Change-Id: I32927f59852e149b7aaf8b5225f35020532eb7f9
2026-01-28 13:58:41 -08:00
Yuval Tassa 510cbceda5 Add missing space after comma
PiperOrigin-RevId: 862235154
Change-Id: I60ad15fcc918accf52abeced7e22a5a1d599df82
2026-01-28 07:53:18 -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
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
Yuval Tassa 1d2d0b1c37 Remove batching optimization from GEOM* sensors
PiperOrigin-RevId: 861938606
Change-Id: Ibb135a4d99cab9ce23a04f844f7c730e8f3b31c8
2026-01-27 16:44:10 -08:00
Yuval Tassa 5fb47df197 Add mjData flags marking lazily evaluated pipeline stages
PiperOrigin-RevId: 861763477
Change-Id: Ib613c56949264573a16306800658f868d2aa7665
2026-01-27 09:45:06 -08:00
Alessio Quaglino ba32568138 Move flex vertex-edge adjacency to mjModel.
PiperOrigin-RevId: 861717037
Change-Id: I2ad8090b0318cb04b43d13966cb42260c82ef930
2026-01-27 07:41:47 -08:00
Haroon Qureshi 669e9b7484 Add an "offscreen" mode that allows users to render studio to a texture
then uses SDL to blit the texture into the window.

PiperOrigin-RevId: 861697047
Change-Id: Ib949b4ade0c79d867ba74ce013bc2b6fa2571f56
2026-01-27 06:48:16 -08:00
Yuval Tassa dce2ed00ea Change not required, issue was addressed in e48da1e38c
PiperOrigin-RevId: 861680910
Change-Id: Iea5c7190bf826c9254eb1bd2f78b0098073cba20
2026-01-27 06:03:04 -08:00
Yuval Tassa e787f8717d Change not required, issue was addressed in e48da1e38c
PiperOrigin-RevId: 861680071
Change-Id: I374f091cd2686737e53234ca0edc8703897fbd4a
2026-01-27 06:01:14 -08:00
Haroon Qureshi 75715ab966 Update logic for dealing with file dialogs.
This in preparation for an upcoming change that uses native file dialogs instead
of our very basic ImGui file dialog.

PiperOrigin-RevId: 861671041
Change-Id: I9b00c05efdda5e37ffe15048a2ccf66f6eca89d9
2026-01-27 05:31:01 -08:00
Haroon Qureshi ad482a57bb Add a headless OpenGL renderer target.
PiperOrigin-RevId: 861642051
Change-Id: Ie0b880a2d3d85205dcd41bca5dc270efd35b7767
2026-01-27 04:08:33 -08:00
Haroon Qureshi fe16255602 Add mjz support to studio.
PiperOrigin-RevId: 861627355
Change-Id: Iafd291965ca78d03fdc1efe0e40dabcd4f2dacc4
2026-01-27 03:22:58 -08:00
Haroon Qureshi 32a4412e2b First-pass implementation of a spec loader for zipped assets.
PiperOrigin-RevId: 861625990
Change-Id: I65cf601cd9aa3aab4915a5a247dda00a6a9aa3db
2026-01-27 03:18:30 -08:00
Haroon Qureshi e43ed60d29 Allow GUI to be rendered to texture as well.
Update SetFrameBuffer to allow users to customize which swap chain
(window or offscreen) to use for rendering both the main mjvScene
as well as the GUI.

PiperOrigin-RevId: 861624061
Change-Id: Ife7bfc447afb007016300438fc5f88a8e4cfa0f6
2026-01-27 03:12:05 -08:00