Commit Graph

4643 Commits

Author SHA1 Message Date
Haroon Qureshi f2da6cabdf Add API function for querying frame stats.
Replaces the current GetFrameRate function.

PiperOrigin-RevId: 911897360
Change-Id: I4199ba9ce40d1d8bc37b551fa7058d964186641d
2026-05-07 04:57:30 -07:00
Haroon Qureshi e1b27afcda Merge math_util and model_util and rename to filament_util.
Move filament_util to the main folder so as to indicate that
these utilities can be used by anyone and aren't internal to
the filament renderer implementation.

PiperOrigin-RevId: 911884375
Change-Id: Ieb58184263bdac7e44a07f1e44a4649c68c6bf77
2026-05-07 04:20:28 -07:00
Haroon Qureshi 7ade42ca88 Internal changes.
PiperOrigin-RevId: 911871922
Change-Id: I82452ffb4c96dca0206d2284193e0756e3dc830e
2026-05-07 03:49:14 -07:00
Haroon Qureshi 607970a900 Remove dependency between SceneBridge and ObjectManager.
PiperOrigin-RevId: 911824153
Change-Id: Ie87d6d9e77b0b3f68a41a0c7d13a36fb2029e4c2
2026-05-07 01:55:52 -07:00
Haroon Qureshi 8e214e5133 Move imgui_editor into filament library.
PiperOrigin-RevId: 911808107
Change-Id: I14318b1c7396e2eaf0df9d6afcc5298de01bcfa4
2026-05-07 01:19:30 -07:00
Haroon Qureshi 39c891e358 Add function for creating Renderable meshes from mjtGeom types.
The Renderable class now internally knows which built-in meshes
to use for a given geom type. It gets these meshes from the
ObjectManager which now stores the collection of built-ins based
on the nstack/nslice/nquad quality arguments.

PiperOrigin-RevId: 911782530
Change-Id: I6698ec3964a5c657f6a9495809cc795eec2e346f
2026-05-07 00:13:01 -07:00
Alessio Quaglino 0c05215e18 Reduce flex stiffness and bending memory size to the exact amount needed.
PiperOrigin-RevId: 911774147
Change-Id: I3b18eba23e75ec91ece8342945f25e0cd7c63a1a
2026-05-06 23:53:19 -07:00
Haroon Qureshi b6aac76cc4 Pass filament::Engine instead of FilamentContext
for textures, meshes, and render targets.

PiperOrigin-RevId: 911770834
Change-Id: I081458e118f0e91091d6d4df7b760e9dbb321672
2026-05-06 23:44:39 -07:00
Yuval Tassa 0f53f55853 Add checks for degenerate meshes in convex hull computation.
Fixes #3260

PiperOrigin-RevId: 911610731
Change-Id: I9efd15eee1bb5cb13639fd733a49535a147c3401
2026-05-06 16:25:13 -07:00
Sam Haves a501731089 Update multiccd default in mjcPhysics.
PiperOrigin-RevId: 911410939
Change-Id: Ia20b5be87f85c4662b71994dd824d90c6b98b3ed
2026-05-06 10:21:48 -07:00
Haroon Qureshi 2aa2131057 Refactor how render requests are generated.
Get the camera and drawmode from the bridges rather than recalculating
it unecessarily.

PiperOrigin-RevId: 911406470
Change-Id: Ia295846bb80105a2b0ad5da21912ca82b25e04bd
2026-05-06 10:13:37 -07:00
Haroon Qureshi 2b67fe3c3a Remove direct dependency between SceneBridge and ImguiBridge.
PiperOrigin-RevId: 911366540
Change-Id: I05c348ea6b1d08c034f2bb26e4c770079073c61d
2026-05-06 08:57:23 -07:00
Taylor Howell 9ffd50ce6a Import google-deepmind/mujoco_warp from GitHub.
PiperOrigin-RevId: 911361969
Change-Id: I2dd1223a4279b3df2f11adc4f44778b8d153e599
2026-05-06 08:47:54 -07:00
Yuval Tassa 6376e67070 Extract AVX code from engine_util_blas.c into engine_util_blas_avx.h
PiperOrigin-RevId: 911274884
Change-Id: Iaac2789f9538f669c49b497d1e60947a783368d3
2026-05-06 05:25:53 -07:00
Sam Haves 579a27e9d2 Make mjSpec related getter/find utilities take const parameters.
PiperOrigin-RevId: 910848529
Change-Id: I1c966a6299fe47317cbf0bfb8f8b835cbcd4ed65
2026-05-05 12:35:56 -07:00
Alessio Quaglino d249c882d5 Fix gcc errors due to restrict.
PiperOrigin-RevId: 910814591
Change-Id: I6858b1a36e21c6d47df803f49ceaed62c8e56248
2026-05-05 11:38:55 -07:00
Yuval Tassa 5c156ebf15 Refactor sparse constraint Jacobian supernode computation.
- Compute efc_J_rowsuper incrementally in mj_addConstraint instead of post-hoc via mju_superSparse.
- Better exploitation of supernodes in A matrix pipeline: precount and fill skip redundant chain traversals for supernode rows.
- Redundant B_rowsuper computation via mju_superSparse is eliminated (indentical to efc_J_rowsuper).

PiperOrigin-RevId: 910787825
Change-Id: I6eda9996659602b7051ee1090aeedb862603c84e
2026-05-05 10:57:31 -07:00
Alessio Quaglino d933b195ee Implement bending forces for interpolated flex shells.
This change adds a new passive force computation for flexes with elastic2d="bend" and dof="trilinear". The bending energy is based on the squared difference of normals between adjacent face elements at their shared edge midpoint. The edge data is precomputed during model compilation and stored in flex_bending.

PiperOrigin-RevId: 910772638
Change-Id: I3b12c7b7f1ba6ac1875df495d89e8cfec921ca80
2026-05-05 10:33:18 -07:00
Haroon Qureshi a692283db3 Add functions to create context and render.
Rename mjrf_render to mjrf_renderScene to avoid naming collision.
This function is will be removed in a future CL.

PiperOrigin-RevId: 910764245
Change-Id: If4d05e806a9699570ca4bbc882f28bfdd05dbd8d
2026-05-05 10:20:04 -07:00
Yuval Tassa 9f972aa42e Use cinematic cameras by default in cards.xml and leaves.xml
PiperOrigin-RevId: 910687282
Change-Id: I382c06f36d79fdd36a8299c36460ca74cf277aae
2026-05-05 07:54:23 -07:00
Haroon Qureshi 24ce1eff10 Update compat library to use public functions.
There are still a few places where the compat library is downcasting
to the internal types due to limitations in the public APIs.

PiperOrigin-RevId: 910646480
Change-Id: I1ccb6714db08a2010d9535f59338e5eba06d1d35
2026-05-05 06:33:04 -07:00
Alessio Quaglino b9c1877ecb Project out rigid body modes from flex strain equality constraints.
Modify EigendecomposeStiffness to project out rigid body translations and rotations from the stiffness matrix eigenvectors. This prevents "ghost damping" from rigid body modes being incorrectly constrained. Update hollow_vs_solid.xml with solimp parameters for edge constraints. Adjust engine_core_constraint_test.cc to reflect the reduced number of equality constraints due to the projection.

PiperOrigin-RevId: 910631207
Change-Id: Ibaaa59bc030cfc6ae657d8f0d1b2a51002cc8d4e
2026-05-05 06:01:15 -07:00
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