Commit Graph

4836 Commits

Author SHA1 Message Date
Mustafa Hasekioglu 994cfa0e4a update mjx model and shims 2026-06-06 14:39:01 -04:00
Taylor Howell 2e43279ac3 MuJoCo Warp documentation: remove parallel linesearch
PiperOrigin-RevId: 927417172
Change-Id: I43f72ec0be89e9370b6e7699a8080d8ecf02b4ab
2026-06-05 12:05:58 -07:00
Kevin Zakka 5fe916045c Replace strncpy with memcpy for gridlayout initialization.
memcpy is more appropriate here as the source and destination buffers have the same size, ensuring the entire buffer is copied.

PiperOrigin-RevId: 927395770
Change-Id: Idbe9dade3160f593060fae5783743b28c0452695
2026-06-05 11:25:49 -07:00
Haroon Qureshi 511cf27ff8 Move segmentation coloring logic into renderer.
PiperOrigin-RevId: 927300828
Change-Id: I994c5742ec30993d2245df167042e72820f91ac7
2026-06-05 07:57:59 -07:00
Copybara-Service fdd82ac420 Merge pull request #3287 from kevinzakka:sysid-issue-3284-fixes
PiperOrigin-RevId: 927249817
Change-Id: I63db037d24238dd0ce82ffe157a2e1bb33c9314a
2026-06-05 05:56:46 -07:00
Taylor Howell 2a4af3246e Import google-deepmind/mujoco_warp from GitHub.
PiperOrigin-RevId: 927227210
Change-Id: Ic72c58524c8e91e6fff44b4cab7f4a0f7de2bb33
2026-06-05 04:56:58 -07:00
Yuval Tassa d80a847bae Move CompareModel to a separate library.
PiperOrigin-RevId: 927174846
Change-Id: Ia8b8b2c8593133d8910399be755e614282bf3252
2026-06-05 02:44:53 -07:00
Yuval Tassa 5ce9a0ad0b Split large parameterized tests into dedicated files.
PiperOrigin-RevId: 927159897
Change-Id: Ib0e11727c49195bc03d190b736c01b14c10268fe
2026-06-05 02:07:47 -07:00
Haroon Qureshi 8fbacf2883 Introduce MaterialManager to allow sharing of material instances.
PiperOrigin-RevId: 927139826
Change-Id: I923a24f28ab7af3a8c854286f064e851b9fd494e
2026-06-05 01:17:37 -07:00
Kevin Zakka 2b9960a617 Address reviewer feedback. 2026-06-04 09:53:17 -07:00
Kevin Zakka ab4102ea42 Add opt-in cond(J^T J) check to sysid optimize().
Pass check_conditioning=True to FD the Jacobian at the starting point
and warn if cond(J^T J) suggests numerical ill-conditioning.
2026-06-04 09:53:17 -07:00
Kevin Zakka d75b709892 Forward x_scale through the sysid mujoco backend.
mujoco.minimize.least_squares now supports x_scale natively, so the
sysid wrapper becomes a thin pass-through. 'jac' is adaptive per
iteration (was static at x0).
2026-06-04 09:53:17 -07:00
Kevin Zakka 5ae677f026 Warn and rescue sysid parameters that start at a box bound.
ParameterDict.move_off_bounds() shifts at-bound values into the interior;
optimize() warns when any non-frozen component starts at a bound.
2026-06-04 09:53:17 -07:00
Kyle Bayes 66156c7d9a Update tolerances on engine_collision_gjk_test.cc to run with single precision.
PiperOrigin-RevId: 926681633
Change-Id: I14f7b756fd3cf7b8f797b5f7b917efba00006b88
2026-06-04 07:37:15 -07:00
Copybara-Service dadd624255 Merge pull request #3244 from google-deepmind:dependabot/npm_and_yarn/wasm/postcss-8.5.10
PiperOrigin-RevId: 926661082
Change-Id: Ic0d56385914f82aca61268a0372a6163388378f3
2026-06-04 06:48:02 -07:00
Michael Moss a2f08767cf Workaround for CMake "subproject language bug" triggered by recent Filament change.
PiperOrigin-RevId: 926623512
Change-Id: I4aefd6b13bc55881a7013a0f2b7d48ce0b78bd7c
2026-06-04 05:06:09 -07:00
Haroon Qureshi 53ac994759 Add missing files.
PiperOrigin-RevId: 926123240
Change-Id: I59b9baaa106ef12a9bf3c7a6399558753c2c5415
2026-06-03 10:27:41 -07:00
Google DeepMind 36f5c4899c Remove the usage of Texture::setImage that uses FaceOffsets
PiperOrigin-RevId: 926092842
Change-Id: I8010804c6dda89d41ebaf650af776505e5c5ed34
2026-06-03 09:47:37 -07:00
Haroon Qureshi 4d70b18048 Manage reflections at the scene level.
Renderables may be created/destroyed frequently causing issues with
the underlying RenderTargets used for reflections. Instead, use a
ReflectionManager (associated with a Scene) to manage the RenderTargets.

PiperOrigin-RevId: 926072766
Change-Id: I56c70000183417a92ab9297bc6fec5779f484cbd
2026-06-03 09:18:32 -07:00
Kevin Zakka 25afa6b732 Fix wasm OOM on large models: 32mb stack, raise MAXIMUM_MEMORY to 4gb.
PiperOrigin-RevId: 926060014
Change-Id: I8c4e152321737b1f4cc963f3c6c424af2fe951b4
2026-06-03 08:59:05 -07:00
Kevin Zakka 0897e3aec1 Skip the prefetcher when the URL scheme isn't fetchable.
Drag-and-drop uploads go through Module.loadFile and never reached the prefetcher. This is a guard for future provider schemes (e.g., vfs) that shouldn't be passed to fetch().

PiperOrigin-RevId: 926042158
Change-Id: I119d5b1a7512f8e84bb4c752414797593a1e98cd
2026-06-03 08:23:19 -07:00
Yuval Tassa 45d5f2ed5f Improve link in light/directional docs
PiperOrigin-RevId: 926006386
Change-Id: Idfd3eae6c127f29919587ae88aa4291c290e2944
2026-06-03 07:12:04 -07:00
Kyle Bayes 558366f364 Always normalize in planeNormal to reduce rounding errors in single precision.
PiperOrigin-RevId: 926002329
Change-Id: I682f3b90249e60838c2432231b3181e57c565c28
2026-06-03 07:04:12 -07:00
Taylor Howell 5d231c64cd Import google-deepmind/mujoco_warp from GitHub.
PiperOrigin-RevId: 925939529
Change-Id: Idb92c2d50d5be9df7b6e91113b576e9c706847ca
2026-06-03 04:41:10 -07:00
Haroon Qureshi 4cfdf5f34b Bind materials before rendering reflection passes.
PiperOrigin-RevId: 925911124
Change-Id: I134d29424233ccbf57f56e7379e8830662a57836
2026-06-03 03:31:03 -07:00
Haroon Qureshi 0fe2064847 Cleanup Renderable API.
Add function for getting the material. Remove unused/unneeded functions.

PiperOrigin-RevId: 925847769
Change-Id: Iefaf9112b7419830eb2dc4d1323e9c27725c4b16
2026-06-03 01:06:21 -07:00
Yuval Tassa 7b9b88060e Refactor mj_fullM. This change is part of the deprecation of mjData.qM.
PiperOrigin-RevId: 925669464
Change-Id: I4889c66591bc1df4c31135a13776052aad491f7a
2026-06-02 17:22:55 -07:00
Matija Kecman 49211a05c5 Add support for custom physics step functions in StudioApp.
This change allows users to provide an optional `step_fn` callable to `StudioApp.update` and `StudioApp.update_from_viewer`. When provided, this function is called to advance the physics simulation instead of the default `step_control.advance`.

PiperOrigin-RevId: 925439890
Change-Id: Ia833503f6dd0c22fb8d75af6c5f06757496853e5
2026-06-02 10:27:52 -07:00
Matija Kecman 0e4749501c Allow custom step function in StepControl::Advance.
The StepControl::Advance method now accepts an optional std::function to be used instead of mj_step. This allows for custom simulation logic to be executed within the stepping loop. The Python bindings for StepControl::advance have been updated to support passing a Python callable as the custom step function.

PiperOrigin-RevId: 925393132
Change-Id: Id2820c4b55cbdfee6b01adc2395e99a990d4e7a3
2026-06-02 09:20:06 -07:00
Kyle Bayes 3a5626bc27 Align GJK internal memory to avoid misalignment segfaults when compiled as single precision. This is effectively a no-op under double precision.
PiperOrigin-RevId: 925389982
Change-Id: I7117779669965ebf72cb77ccbece419acf9b1b96
2026-06-02 09:15:26 -07:00
Copybara-Service 15cbc8fb55 Merge pull request #3156 from andrewkaufman:newton-schemas
PiperOrigin-RevId: 925328794
Change-Id: If45b8659ea9b88785660331bca5ee837ac172f67
2026-06-02 07:06:59 -07:00
Matija Kecman 4cf4a5665d Configure Copybara export for Dear ImGui and ImPlot Python bindings
Following the export declarations in Dear ImGui and ImPlot METADATA, this change updates MuJoCo's Copybara configuration (copy.bara.sky) to export and transform the Python bindings. `//third_party/dear_imgui/google/py` exports to `python/mujoco/experimental/dear_imgui` and `//third_party/implot/google/py` exports to  `python/mujoco/experimental/implot`.

PiperOrigin-RevId: 925293624
Change-Id: Ie6e32d247a6f7fc24bb36ae7060f2075d8efeb26
2026-06-02 05:32:22 -07:00
Yuval Tassa 062b0f1ea6 Remove deprecated mju_{error,warning}_{i,s} functions.
PiperOrigin-RevId: 925204136
Change-Id: Ia877d08a135092db8037d04e6a237e81325a1d7c
2026-06-02 01:59:05 -07:00
Kyle Bayes ad23db5942 Guard againsts NaNs in engine_collision_gjk_test.cc.
PiperOrigin-RevId: 924844839
Change-Id: I98d5acd8ee97881ebd17f7ba7a40fb378ca1fb2d
2026-06-01 12:17:42 -07:00
Copybara-Service e7ed648cac Merge pull request #3278 from tkelestemur:tarik/mjx-light-active-public-api
PiperOrigin-RevId: 924570592
Change-Id: I86d506e9f03d3230eaaca7061f6794ecdbfe164f
2026-06-01 02:15:20 -07:00
Alessio Quaglino 91c92279d2 Enable interior nodes for interpolated flex shell mode.
Previously shell mode required cellcount=1 along at least one axis. This CL
adds support for cellcount > 1 in all three axes by pinning interior grid nodes
to the parent body and reconstructing their positions from boundary nodes via
Transfinite Interpolation (TFI).

PiperOrigin-RevId: 924314800
Change-Id: I8c2438f4866dd4133feed65f535a1ab69f0c9188
2026-05-31 10:36:01 -07:00
Yuval Tassa 4548e81e4d Rename efc_diagApprox -> efc_diagA.
The field now stores either an approximate or exact diagonal of the constraint matrix A, so the name is made more general.

PiperOrigin-RevId: 924244954
Change-Id: I62b2f76531fb88b7b3bf96e6769940197596702b
2026-05-31 04:54:11 -07:00
Yuval Tassa cd6db9ebe2 Improve CG solver precision and stability under float32 via line search refactor
Fixes #2313

This CL combines two complementary improvements to the Conjugate Gradient (CG) solver, significantly improving numerical precision, stability, and efficiency, particularly in single precision (float32).

1. Line Search Cost Evaluation Refactor: Previously, solver improvement was calculated by subtracting absolute costs: cost(alpha) - cost(0). In highly converged states or single precision, this is susceptible to catastrophic cancellation. We refactor PrimalSearch to compute the cost delta directly, dramatically improving precision.

2. Improved Solver Termination Condition: Near the float32 precision limit, line search deltas can occasionally be slightly negative due to numerical noise. Previously, any value below m->opt.tolerance (including negative values) triggered termination, halting the solver and locking in destabilizing steps. We update the termination condition to require positive improvement (0 < improvement < m->opt.tolerance), allowing the solver to continue iterating and recover stability.

Together, these changes yield substantial improvements, see reduced tolerances herein.

PiperOrigin-RevId: 924229669
Change-Id: Ic0bbefaed090f3a8b1e79ab8d45422c3e86fb56c
2026-05-31 04:00:09 -07:00
Yuval Tassa 4358a102cd Add manual test for CG converence
Also add MJTOL_SCALE to fixture to allow tests to be run with zero tolerance. This is useful when assesing the impact of code changes (A/B comparison of failure values)

PiperOrigin-RevId: 924219083
Change-Id: Ifdd09ac850904ca8dd79179930ce738a4b37d284
2026-05-31 03:15:54 -07:00
Tarik Kelestemur 9bd8daf53b Minimize generated WARP types diff 2026-05-30 16:29:27 -04:00
Tarik Kelestemur f8a12a827f Merge origin/main into light_active PR 2026-05-30 16:24:27 -04:00
Taylor Howell 50e823e91c Import google-deepmind/mujoco_warp from GitHub.
PiperOrigin-RevId: 923922783
Change-Id: I0b407347a70a0e2024aae7ed5bab1592dc40a074
2026-05-30 07:44:29 -07:00
Taylor Howell b9c7a4b81a Import NVIDIA/warp 1.13.0 from GitHub.
PiperOrigin-RevId: 923878216
Change-Id: If9df5e0672e956eb62874fb6f4f74ba3a02977b3
2026-05-30 04:48:08 -07:00
Yuval Tassa 3a6e0ee9b3 Reduce effect of infinite planes on center and extent statistics
PiperOrigin-RevId: 923868757
Change-Id: I3630d29f05a19e0767549284abbe8a8d9386894b
2026-05-30 04:12:07 -07:00
Yuval Tassa d7e872b6f9 Add UI control for MuJoCo threadpool size.
PiperOrigin-RevId: 923860258
Change-Id: I11dc5d7904f1c3657d7e1dd2b0e3c7864c0c7ead
2026-05-30 03:41:38 -07:00
Yuval Tassa 96bf8aea81 Move island-specific sparse matrices from arena to stack.
PiperOrigin-RevId: 923850345
Change-Id: I9683d7554b15b7cd8c45a8dce7814640aa266452
2026-05-30 03:09:46 -07:00
Yuval Tassa 5d782a2bb8 Fix memory overallocation in sparse primal solvers.
PiperOrigin-RevId: 923586079
Change-Id: I8d484b840063c0a7a8a79c5bdc9074a57d2ee55f
2026-05-29 13:51:47 -07:00
Copybara-Service ffe1eadd7e Merge pull request #3294 from kevinzakka:mujoco-minimize-x-scale
PiperOrigin-RevId: 923519000
Change-Id: I4a8fa1f031428cf41d194d17ea4c41975f93f745
2026-05-29 11:34:36 -07:00
Haroon Qureshi f63b92da5e Clear draw queue instead of failing if rendering skipped.
PiperOrigin-RevId: 923420183
Change-Id: I34aac76810a7bf0e4a0394ebe27b45a8fc32f110
2026-05-29 08:09:15 -07:00
Yuval Tassa 8eaf174a88 Change "Num threads" UI element to a slider.
PiperOrigin-RevId: 923378753
Change-Id: Ie5f53faf6ad90e0e1a1148f004b1867a57e6fb5e
2026-05-29 06:30:38 -07:00