Commit Graph

4621 Commits

Author SHA1 Message Date
Haroon Qureshi d168eb2d7d Expose several functions in the public C API.
PiperOrigin-RevId: 910629209
Change-Id: I8623309e348c72350703f6874a887592f0607bba
2026-05-05 05:56:02 -07:00
Yuval Tassa 4ed69b5ce7 Randomize PGS constraint visitation order.
Total testspeed runtime for `2humanoids100.xml` reduced by 19.6% (49.5 -> 39.8s).

PiperOrigin-RevId: 910608140
Change-Id: Ided0ae5bdb8e4e8196f84e08354a9ae8cfa5b626
2026-05-05 05:10:26 -07:00
Haroon Qureshi 88bff84cbb Add API functions for creating and destroying objects.
Also provide a header-only C++ library that wraps created objects into
unique_ptrs.

PiperOrigin-RevId: 910607824
Change-Id: I0427f6dedab6aa299b3128031b055bd4d0c8e497
2026-05-05 05:08:25 -07:00
Haroon Qureshi de030f4664 Allow SceneView to read configuration from mjModel directly.
PiperOrigin-RevId: 910548865
Change-Id: I4db045e76cd36012810c75b9d150c6c5f5746488
2026-05-05 02:52:18 -07:00
Haroon Qureshi 68fdc439e4 Use mjrTextureTarget type instead of filament type.
PiperOrigin-RevId: 910547104
Change-Id: I3e8aa30a72b9b5ec8c45e8fa6bac18353ce7b485
2026-05-05 02:47:53 -07:00
Yuval Tassa a5de6506eb Add backlinks from tech note to dcmotor docs.
PiperOrigin-RevId: 910543352
Change-Id: I171c34a793f23b09feeb46ab7b02ebe7900902ba
2026-05-05 02:38:38 -07:00
Copybara-Service bc8c1f826c Merge pull request #3235 from tkelestemur:mjx-warp-segmentation
PiperOrigin-RevId: 910401768
Change-Id: I015bd05d9d823db5efb92f660c707a67ddca6591
2026-05-04 20:42:32 -07:00
Yuval Tassa 767c607f58 Add mju_sym2dense, document future breakage of mj_fullM
PiperOrigin-RevId: 910242375
Change-Id: Ibfbdef9cfb66088723499ea257da09aee0d80938
2026-05-04 14:25:53 -07:00
Baruch Tabanpour a51a7bf062 Open-source MJX-Warp codegen to make external contribution easier.
PiperOrigin-RevId: 910200635
Change-Id: I0218f8e281413803500c98fc29d0589c4e90d6b1
2026-05-04 13:14:28 -07:00
Taylor Howell 0aeea2e4f6 Import google-deepmind/mujoco_warp from GitHub.
PiperOrigin-RevId: 910110405
Change-Id: Ia20c749e07b0d92613948313d38161e9f9a074b9
2026-05-04 10:33:21 -07:00
Yuval Tassa 25751a7b98 Add dense LU factorization and solve functions.
PiperOrigin-RevId: 909290647
Change-Id: I77ae2352b20abf96ef7b48ae32b03a1f4098604e
2026-05-02 13:27:04 -07:00
Alessio Quaglino dbd451138c Add flex_bendingadr to mjModel.
PiperOrigin-RevId: 909088123
Change-Id: If062335d0aa3702c1e0b082dd9e29c3be0e76ea6
2026-05-02 00:13:39 -07:00
Alessio Quaglino b2feed63e4 Skip implicit solver if there are strain constraints.
PiperOrigin-RevId: 908890994
Change-Id: Ieb05a162142edac14269ec6a509fc507c9146ac5
2026-05-01 14:10:00 -07:00
Sam Haves 723b8b1ea6 Introduce explicit VFS in Python MjVfs
This change introduces MjVFS, an explicit object to mirror the C mjVFS. This is meant to replace the MjSpec.assets dict. This latter while convenient guides users towards harmful authoring patterns with respect to data duplication and spec attachment workflows. Making VFS management explicit should encourage better memory usage and allow us to make better compile time optimizations.

From this change, `spec.assets` is deprecated. However we will temporarily support backwards compatibility due to the wide spread usage. An error will be thrown if calling code tries to use a spec that uses both the assets dict and the new MjVfs.

PiperOrigin-RevId: 908772050
Change-Id: I77c6d0369307fc300c954768fed17401261e18da
2026-05-01 09:34:17 -07:00
Yuval Tassa 910b3336ed Restrict midpoint integration to unconstrained free bodies in implicitfast
PiperOrigin-RevId: 908750768
Change-Id: I9a45a160ac757cc82bfe54871609956769988369
2026-05-01 08:41:47 -07:00
Alessio Quaglino 8287d9d152 Fix insidesite sensor for massless flex parent bodies.
mjSENS_INSIDESITE uses xipos to test containment, but for massless flex
parent bodies xipos equals the static body frame origin and does not
track the actual flex position.

Fix: in the INSIDESITE sensor case, when the object is a massless body
with positive subtree mass (i.e., a flex parent), use subtree_com
instead of xipos. This correctly reflects the mass-weighted centroid of
the flex child bodies without changing the global semantics of xipos.
PiperOrigin-RevId: 908745144
Change-Id: I527f0efb7b419345188411c9da883505156ebeea
2026-05-01 08:27:04 -07:00
Yuval Tassa f7d31e06f0 Refactor utility functions for block extraction.
PiperOrigin-RevId: 908744392
Change-Id: I8d1323946870c90d5e37b1853697fb35d5291e11
2026-05-01 08:24:38 -07:00
Copybara-Service 3367b64a8e Merge pull request #3225 from devshahofficial:fix/renderer-del-init-failure
PiperOrigin-RevId: 908640282
Change-Id: I4f474423f94ec785598ed9c2d5b74eba3d927697
2026-05-01 03:17:02 -07:00
Haroon Qureshi ee3ac5b349 Expose Renderable settings in mjrRenderableParams.
PiperOrigin-RevId: 908587103
Change-Id: Ic0e19a7fb3535bf32782b85d2da0049ec4ac8ec7
2026-05-01 00:19:28 -07:00
Haroon Qureshi 0399bfd058 Allow custom getProcAddress for glad resolution.
PiperOrigin-RevId: 908587023
Change-Id: Idc4dcc5ee8d2d67f83486ca2ff4667f2b4b283eb
2026-05-01 00:18:26 -07:00
Alessio Quaglino 7d54123303 Make flex vert0 rotation-invariant for interpolated flexes.
The `vert0` array, used for parametric vertex coordinates in flexes, is now computed in the flex's local, unrotated frame when using interpolation. This ensures that the parametric coordinates are independent of the flex's initial orientation. A new test confirms that `flex_vert0` is identical for an unrotated and a rotated flex grid.

PiperOrigin-RevId: 908196464
Change-Id: I47d6bcc2bc5df581479d485480e0e947ec6d3ffd
2026-04-30 08:41:01 -07:00
Yuval Tassa 22ca5fe0df studio: improve behavior of help window
PiperOrigin-RevId: 908132295
Change-Id: Iac0aead82a575dffbe35e3be8ba06af13986d1a2
2026-04-30 06:21:10 -07:00
Alessio Quaglino e71bd3db8e Refactor flex passive forces into dedicated functions.
The code for computing passive forces for flex elements is moved into new static functions `mj_flexPassiveInterp`, `mj_flexPassiveBend`, and `mj_flexPassiveStretch`. This improves the structure of `mj_springdamper`.

PiperOrigin-RevId: 907671516
Change-Id: I6d1e781bbd370331ae645a954b78092ecb1925b9
2026-04-29 10:50:54 -07:00
Sam Haves e552a5f80d Expose more filament render settings via XML custom fields
PiperOrigin-RevId: 907659170
Change-Id: I0d8ca1ec058d40ed072db09c370f48b1e79ca6b3
2026-04-29 10:26:51 -07:00
Alessio Quaglino 9c6a4f76eb Add 2D membrane elasticity for interpolated flex shell mode
When elastic2d="stretch" is set on an interpolated flexcomp, treat the bounding box boundary as membrane elements rather than volumetric cells. This computes plane-stress stiffness over the boundary faces and updates the runtime force/derivative kernels accordingly.

Interior vertex tracking (moving vertices that follow the deforming shell) is not yet implemented so all mesh vertices need to be on the bounding box surface or the background grid should have no interior nodes (i.e. cellcount should be 1 on at least one axis).

PiperOrigin-RevId: 907654080
Change-Id: I51b90e2f6a1d1b036f9604e42de20e377dc5d3f9
2026-04-29 10:17:21 -07:00
Sam Haves 517c113656 Add Rendering differences section to MjWarp documentation.
PiperOrigin-RevId: 907644012
Change-Id: I6d79792e4cb4088a89cb3f995f3bddf9b0aada15
2026-04-29 09:58:14 -07:00
Yuval Tassa cae70086da Scale UI style sizes by DPI.
PiperOrigin-RevId: 907630627
Change-Id: Ia6dc35ce00e9764a454f4021250089b0d9a94073
2026-04-29 09:31:33 -07:00
Haroon Qureshi 4e7b2f2124 Allow dimensions to be specified when creating a render target.
PiperOrigin-RevId: 907622395
Change-Id: I0f806f4d77afa6a178a20d36dae3e96b81359494
2026-04-29 09:14:10 -07:00
Haroon Qureshi 7e848e9406 Add mjr_sceneParams for creating Scene objects.
PiperOrigin-RevId: 907589621
Change-Id: If7537cf6fbac6d6418ac2bf8315714ada969511d
2026-04-29 07:58:42 -07:00
Yuval Tassa 52e90bf55d Fix high-DPI window size in Studio.
PiperOrigin-RevId: 907585586
Change-Id: Ie7db20f5242d89926a4a34ffed3a6e39698defd3
2026-04-29 07:48:12 -07:00
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
Tarik Kelestemur 5a51f4795d Merge branch 'google-deepmind:main' into mjx-warp-segmentation 2026-04-29 09:28:08 -04: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
Tarik Kelestemur 1009478de9 Merge branch 'google-deepmind:main' into mjx-warp-segmentation 2026-04-26 21:36:32 -04: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