Commit Graph

1995 Commits

Author SHA1 Message Date
Kyle Bayes 88ba8ffdbc Remove const qualifier on mjData in mjfCollision type as mjData is non-const in mjc_SDF via mjpPlugin.
PiperOrigin-RevId: 883225786
Change-Id: I5fecaa1d575b340a6510212db7b3e7db48f361cc
2026-03-13 10:21:53 -07:00
Haroon Qureshi b18657acde Remove unused flag.
PiperOrigin-RevId: 883113888
Change-Id: I098669f8a873694903159649567bc2f68397f955
2026-03-13 05:37:47 -07:00
Matija Kecman 86aae0f5a5 Use user::ThreadPool for actuator lengthrange calculation in addition to mesh and texture compilation
PiperOrigin-RevId: 883099169
Change-Id: Id6832c2ca0b8f45e2f428615ae54df4b8bb6f434
2026-03-13 04:54:57 -07:00
Haroon Qureshi b62aed86f9 Recreate swap chain when the window size changes.
PiperOrigin-RevId: 882521107
Change-Id: I0d29d2e323e7830256c24eead439b3f2eb55de40
2026-03-12 04:56:50 -07:00
Haroon Qureshi 16d618e7b9 Ensure we have a valid vfs when loading a spec.
PiperOrigin-RevId: 882503274
Change-Id: Iddbd6f00c0344bb34d68bb72a640c0a8e81076a2
2026-03-12 04:06:05 -07:00
Sam Haves 3601b063dc Modify mjCMesh vert_ field to be vector<float> instead of vector<double>.
PiperOrigin-RevId: 882162404
Change-Id: Ia97439420f284d594f5cb1a91cd0fb640ac8dff0
2026-03-11 13:15:32 -07:00
Haroon Qureshi ad57721e2c Add missing state.
PiperOrigin-RevId: 882072832
Change-Id: I6ad75af67edc7672350c775c1a560e3db6d16969
2026-03-11 10:06:43 -07:00
Sam Haves ecc22667fa Correct polygon winding order for all meshes not only when loaded from a file.
PiperOrigin-RevId: 882053060
Change-Id: I94ee81838fa4074a1a890de4f282eca45ee9e820
2026-03-11 09:25:27 -07:00
Haroon Qureshi db9ab94555 Refactor parts of the toolbar GUI into the GUI library.
PiperOrigin-RevId: 882024591
Change-Id: I3ac73247973666f4d60e9d8d028d20d3ef709bcc
2026-03-11 08:23:12 -07:00
Michael Moss 6d70e66810 Update MuJoCo version from 3.6.0 to 3.7.0 following the 3.6.0 release
PiperOrigin-RevId: 881995135
Change-Id: I0c1a3b4a22c4c7cfada580b49a2cacde64cc84f3
2026-03-11 07:09:24 -07:00
Haroon Qureshi ed2f34baa0 Fix logic for looking up root model within an archive.
PiperOrigin-RevId: 881976329
Change-Id: I7771b84ff0aed83d55ee830deb2f92357355eb88
2026-03-11 06:18:14 -07:00
Haroon Qureshi df02fe4bc0 BodyAddChild PopupContext needs to happen immediately upon triggering it.
PiperOrigin-RevId: 881955422
Change-Id: I03675431d78c93550ff2ad6d562daf1a0e3d0d08
2026-03-11 05:20:39 -07:00
Kyle Bayes acf7f030a6 Remove const qualifier from mjData in mj_geomDistance. The function mj_geomDistance will require data stack space as nativeccd memory is determined from opt.ccd_iterations.
PiperOrigin-RevId: 881946592
Change-Id: I524b9fa41018a581e58647d44de6ca3db4c6608b
2026-03-11 04:55:44 -07:00
Copybara-Service 64ee2d041f Merge pull request #3105 from NandiniDhanrale:fix/vfs-move-3098
PiperOrigin-RevId: 881946056
Change-Id: Ide041ff1dcdae00133251d928936920b47cf6c0d
2026-03-11 04:53:57 -07:00
Sam Haves 6890e133c0 Add mjs_getCompiler C API and compiler property to Python spec elements.
PiperOrigin-RevId: 881488083
Change-Id: I3aa1c0562bf2fd27057b8056048e3156fc1b067c
2026-03-10 09:57:36 -07:00
Haroon Qureshi d6aac2041e Make filament-opengl the default graphics mode for studio.
PiperOrigin-RevId: 881362074
Change-Id: Iaa42ddf915b8b146775b2cf0263152b94c586c49
2026-03-10 04:59:03 -07:00
Alessio Quaglino f1b305632c Allow mesh with octrees in mjc_distance.
PiperOrigin-RevId: 881355677
Change-Id: I8da9f7c92d6e76f16a5d82e7d16488211a8a65b7
2026-03-10 04:41:34 -07:00
Michael Moss 955d6c0b02 Update MuJoCo version from 3.5.1 to 3.6.0 prior to next release.
The next release will include breaking changes, so this bumps the major
version to reflect that.

PiperOrigin-RevId: 881351265
Change-Id: I970c68a0211651c07fcb8109ebd0b138196cf50a
2026-03-10 04:30:07 -07:00
Alessio Quaglino 713b5524bc Introduces a new "strain" equality mode (flex_edgeequality = 3) for flexcomps with trilinear interpolation. This mode enforces constraints on the three invariants of the Green-Lagrange strain tensor at 8 Gauss quadrature points within each flex element, resulting in 24 equality constraints per flexcomp.
Also fixes a bug when attaching a flex with constraints.

PiperOrigin-RevId: 881349765
Change-Id: I8e6df8239488bfdc87d7e5b473568975e38c737e
2026-03-10 04:26:07 -07:00
Copybara-Service 3a99f6110e Merge pull request #3084 from Ashutosh0x:fix/mingw-stat-localtime
PiperOrigin-RevId: 880906196
Change-Id: I98027e80e9882620cb184766c14110478178ce53
2026-03-09 09:54:10 -07:00
Yuval Tassa 1e1eb48261 No-op refactor of flex interpolation factorization and solve in mj_implicitSkip.
PiperOrigin-RevId: 880867833
Change-Id: I2ab8ce5a027742af07ef0256bc4cdee62289282e
2026-03-09 08:20:24 -07:00
Copybara-Service 79d14035f9 Merge pull request #3158 from mar-yan24:mark-flexcompFix
PiperOrigin-RevId: 880857702
Change-Id: Ic1ad4068312c9a02728ce7f49abb38dea3b97a46
2026-03-09 07:57:21 -07:00
Copybara-Service 3510537bcb Merge pull request #3027 from Adityakk9031:#2982
PiperOrigin-RevId: 880846172
Change-Id: I5b0ccda4b481c079a6bb640ab19756c3fd4b4b26
2026-03-09 07:26:58 -07:00
Sam Haves ed0d7ba29f Move STL handling to a mjpDecoder.
PiperOrigin-RevId: 880820344
Change-Id: Ib3a714dd9698335433e518ed6af17d7b8407a8fb
2026-03-09 06:15:04 -07:00
Kyle Bayes 330c36c99b Fix issue in GJK where the tolerance for x_norm was set too low.
PiperOrigin-RevId: 880735671
Change-Id: I324e37e8677d3c7feeb4b8bcf065a2a0122326b6
2026-03-09 02:14:52 -07:00
Mark Yang 95724d1ec2 Fix vfs load for mesh gmeshs type 2026-03-07 21:45:12 -05:00
Alessio Quaglino 8dc5cc4c70 Skip tangential components in tactile sensor if mesh has only normals.
PiperOrigin-RevId: 879036130
Change-Id: Ic4184dd535700c5099768dabf5009ba96b218542
2026-03-05 06:35:41 -08:00
Haroon Qureshi 45c7376ab4 Set actuator limits correctly.
PiperOrigin-RevId: 879012913
Change-Id: I3f03d09a98236ae9a4dc069564d14437ff5d0a2b
2026-03-05 05:35:14 -08:00
Haroon Qureshi 35c0a25cf4 No-op implementation for mjr_ functions.
This can be useful, e.g. writing tests that don't depend on rendering.

PiperOrigin-RevId: 879012859
Change-Id: Ifb8d7d5bb06a2456c1b4543f0bf4945fe8155039
2026-03-05 05:34:19 -08:00
Haroon Qureshi aef44210cb Rename render to render/classic.
This will allow us to add additional renderers to the `render` folder.

PiperOrigin-RevId: 878913300
Change-Id: I205ae41250cbbcded406ad303d4e801d4cff892e
2026-03-05 01:43:21 -08:00
Haroon Qureshi 5506fbf506 Rename member history_ to sim_history_.
PiperOrigin-RevId: 878906079
Change-Id: I1327f0216bc5042e62c598f2b7f15f6a26c192dc
2026-03-05 01:23:39 -08:00
Copybara-Service 870f9fea24 Merge pull request #3150 from kevinzakka:fix/principal-point-frustum-sign
PiperOrigin-RevId: 878610460
Change-Id: I82e1c30c9c263a9981c619d6a401b417f95c39a2
2026-03-04 12:22:39 -08:00
Haroon Qureshi 64597f45d3 Move function that parses the graphics mode from a string into graphics_mode.cc.
PiperOrigin-RevId: 878482669
Change-Id: I8b713bc740c5711b9c7cc9ea63c21bad42cd2943
2026-03-04 07:30:23 -08:00
Haroon Qureshi c70b05e037 Make Renderer more self-contained.
The Renderer should configure the context and flip the image when
in classic mode and not rely on the Window to do so.

PiperOrigin-RevId: 878480986
Change-Id: I1af899107647469659662abd85527cdf66f507f4
2026-03-04 07:26:34 -08:00
Haroon Qureshi 20efb8ee8d Add missing files.
PiperOrigin-RevId: 878445886
Change-Id: Ied34a5517c3aefc0985bef100431081a4cbfb640
2026-03-04 05:51:36 -08:00
Haroon Qureshi 13d164063c Remove separate targets for classic and filament renderer.
The platform::Renderer now supports both implementations at
runtime.

PiperOrigin-RevId: 878427862
Change-Id: I2997c197c6eddbe177c77b435cc5848fd80f1839
2026-03-04 04:56:15 -08:00
Haroon Qureshi 84682a46b0 Refactor spec editing logic into its own class.
The SpecEditor improves spec editing by keeping
track of what's being edited and how it changes
over time.

PiperOrigin-RevId: 878410011
Change-Id: I7c323eeb30178dad31946095a727a21b3955f19a
2026-03-04 04:01:56 -08:00
Haroon Qureshi 73f73d94f7 Merge renderer+offscreen mode into unified graphics mode.
Allow Studio app to switch between graphics modes dynamically.

PiperOrigin-RevId: 878396966
Change-Id: I666fe3d2452de5404b9be2bd1d017eabec789aef
2026-03-04 03:19:58 -08:00
Kevin Zakka 77ce80bc63 Fix swapped vertical frustum bounds for cameras with principal point offset.
The frustum_top and frustum_bottom assignments in mjv_updateCamera used
the wrong elements of the zver array, causing the principal point cy
offset to be applied with an inverted sign. This shifted the rendered
image vertically by 2*cy pixels.
2026-03-04 01:03:55 -08:00
Kyle Bayes 8ab791fdf7 Don't produce mesh polygon data unless graph data is present. This fixes some nondeterminism in the compiler.
Repro instructions (note compiler cache and threading must be enabled):

Assume we have a cube.stl mesh containing face data and the following XML:

<mujoco>
  <asset>
    <mesh name="cube" file="cube.stl"/>
    <mesh name="unused" file="cube.stl"/>
  </asset>
  <worldbody>
    <geom type="mesh" mesh="cube"/>
  </worldbody>
</mujoco>

Suppose Thread A processes "cube" and Thread B processes "unused". Thread A will generate the mesh hull and will generate polygon data from faces from qhull. Thread B will NOT generate the mesh hull and will generate polygon data from faces coming from mesh file. Thread A beats Thread B to caching the mesh.

When "unused" is later pulled from the cache it gets the polygon data that was generated from "cube" which is not the same that was generated from "unused".

PiperOrigin-RevId: 878336494
Change-Id: I275b09b44490c54b2a5f09d91d0cc047026090f2
2026-03-04 00:36:48 -08:00
Kyle Bayes 490c1f4126 Refactor mj_collideGeoms.
PiperOrigin-RevId: 878091736
Change-Id: I738c2e5a21036d859b7b163cb000dc516b63a878
2026-03-03 13:11:14 -08:00
Sam Haves 91d3565cd5 Move OBJ handling to a mjpDecoder.
PiperOrigin-RevId: 878041994
Change-Id: I6e7f6876e65fd2184ff5637d4268644cefcabecf
2026-03-03 11:22:02 -08:00
Kyle Bayes a06c091157 Fix repeated call to restrict pointer.
PiperOrigin-RevId: 877451707
Change-Id: I4849ccb8562ea1926173209da9934c11de64a109
2026-03-02 10:03:19 -08:00
Kyle Bayes d00ddea269 Merge mjc_ccdIteration into mjc_penetration.
PiperOrigin-RevId: 877432442
Change-Id: I6bffb36522f9e4f0e7b1023003e70df064e1ebb7
2026-03-02 09:17:56 -08:00
Alessio Quaglino bf74d01d93 Add collisions between flexes and SDF geoms.
The flex-SDF algorithm uses the same logic as mesh-SDF. Previous to this change, the flex was instead colliding with the convex hull of the mesh generated automatically with marching cubes from the SDF.

PiperOrigin-RevId: 876420302
Change-Id: I3bf6552b6b8e108ba4c4209bbcf10fe5f2b2fd90
2026-02-27 14:35:27 -08:00
Alessio Quaglino c2e67ab507 Refactor Mesh-SDF collision to use farthest point sampling and mjMAXCONPAIR.
Deleted MAXMESHPNT farthest point sampling instead of sorting by penetration distance is now used to select the best contact points, up to mjMAXCONPAIR. Deleted MAXSDFFACE, the BVH traversal now directly calls a function to process each leaf face against the SDF, instead of collecting face indices and processing them in a separate loop. This reduces memory by removing the need to store all intersecting face indices.

PiperOrigin-RevId: 876296914
Change-Id: I8068d634e2a01ffa9357d0c5381219d097e97abe
2026-02-27 09:42:16 -08:00
Haroon Qureshi 07d7bc95e3 Expose vsm blur width parameter.
PiperOrigin-RevId: 875733943
Change-Id: Ic8cb423104d2e62ce295f6a2ab6fd67d548910a6
2026-02-26 08:23:30 -08:00
Alessio Quaglino 47a750d4a6 Restore mesh-SDF collisions.
This CL rolls back the change from changelist 794576123 since the previous version was more robust and stable. Compared to the original algorithm, this changes handles degenerate and very large triangles as well.

BEGIN_PUBLIC
Restore mesh-SDF collisions.
END_PUBIC

PiperOrigin-RevId: 875716983
Change-Id: If0de41dc7bbd60460779821d2338cf2d661f40d5
2026-02-26 07:39:34 -08:00
Sam Haves 0ec836b281 Rollback of Move OBJ handling to a mjpDecoder.
PiperOrigin-RevId: 875705083
Change-Id: I21403d84abd56ef72de915bddc724fe3efa506e6
2026-02-26 07:04:39 -08:00
Haroon Qureshi 55d7226b06 Improve error handling of spec editor compilation.
PiperOrigin-RevId: 875703124
Change-Id: Idf4a90a48d75185ad03e4469cee9098104751d67
2026-02-26 06:59:31 -08:00