Commit Graph

3359 Commits

Author SHA1 Message Date
Saran Tunyasuvunakool 0eea5d6dbd Add libwayland-dev and libxkbcommon-dev to GitHub Actions YAML.
PiperOrigin-RevId: 800462182
Change-Id: I771df8af3f827f0fe7f2d9975eb6fd04940f17dc
2025-08-28 07:40:38 -07:00
Michiel Blokzijl 508d22f794 Update the GLFW dependency used by MuJoCo to 3.4.
This makes it possible to build open-source MuJoCo with Wayland support out of
the box.

Currently, it is necessary to run cmake with -DGLFW_USE_WAYLAND=ON and ensure
cmake can find the "ECM" package somehow (a dependency of the 3.3.6 version of
GLFW), for which there is no automated fetching setup. As this is no longer a
dependency of GLFW it seems to make more sense to update GLFW to make out of the
box builds on Wayland.

PiperOrigin-RevId: 800456607
Change-Id: Iffdf1d65319bfb134e580faceb63ac3bed7b9c84
2025-08-28 07:24:26 -07:00
Yuval Tassa b1c94c3761 Add printing of block-diagonalized matrices
PiperOrigin-RevId: 800345520
Change-Id: I4996c5a7509cb451744d3e428a975cceee845ea5
2025-08-28 00:54:39 -07:00
Baruch Tabanpour ba47402853 Import google-deepmind/mujoco_warp from GitHub.
PiperOrigin-RevId: 800210640
Change-Id: I06d05ee2560f54d975458f0e13b37157c088c33b
2025-08-27 16:11:11 -07:00
Tom Power 79f2bbc727 Fix memory error when placing images in viewport
PiperOrigin-RevId: 800148735
Change-Id: I1c12ef23b0af9538b285d032460cf832eb48bf49
2025-08-27 13:20:45 -07:00
Yuval Tassa 643dc5bf4f Update USD schema formatting
PiperOrigin-RevId: 800018484
Change-Id: I7677cd099415af1271c7475d80a660653199b984
2025-08-27 07:02:50 -07:00
Haroon Qureshi ed6fa7fe09 Remove unused mjMOUSE_SELECT option.
PiperOrigin-RevId: 799957524
Change-Id: I69d091781dc2a2e4a762d2255d04fc411295602a
2025-08-27 03:19:04 -07:00
Yuval Tassa 7443e685ac Allow contact sensor subtree1/subtree2 to be any body.
PiperOrigin-RevId: 799632590
Change-Id: If9cd6c5a3a5f83d89ae024a8f64232ab1f1d603a
2025-08-26 11:00:39 -07:00
Baruch Tabanpour 9eaa31af2f Import google-deepmind/mujoco_warp from GitHub.
PiperOrigin-RevId: 799614257
Change-Id: Ie05d4dd7c45308ed5e8010c3eca4b68f552335ea
2025-08-26 10:17:11 -07:00
Taylor Howell 1ac51cf2a5 Update comment in engine_forward_test.cc.
PiperOrigin-RevId: 799550233
Change-Id: I75840bdcb94d4b10962f1fff5a225a6fe5bc0672
2025-08-26 07:12:51 -07:00
Yuval Tassa debfdf011e Add some missing Nullable annotations.
PiperOrigin-RevId: 799527319
Change-Id: If84a3b2f19243ea9cf8b114d1421879d8186eb1d
2025-08-26 05:52:01 -07:00
Yuval Tassa ec94bb49aa Make constraint island discovery on by default.
Also fix latent bug in mjData serialization.

PiperOrigin-RevId: 799505349
Change-Id: I299e7cc8133fa2ec0b339a7ff3d02543e06778b1
2025-08-26 04:27:24 -07:00
Taylor Howell 4cf5c37211 Fix spelling in engine_forward_test.cc.
PiperOrigin-RevId: 799147728
Change-Id: If5e734ba31961d459281f7cb5edea7c370c1f2fd
2025-08-25 09:15:48 -07:00
Yuval Tassa 2b45b39ce5 Move mjtConstraint from mjmodel.h to mjdata.h.
PiperOrigin-RevId: 798987338
Change-Id: I3117742de7eb3c16366f266fe0c0651262717cb4
2025-08-24 23:45:14 -07:00
Yuval Tassa d77ecb3f06 Move mjtConstraintState from mjmodel.h to mjdata.h.
This is the correct location, this enum is only used in `mjData`, not `mjModel`.

PiperOrigin-RevId: 798860951
Change-Id: I48b9a2afc831bd9a6966cc9586429fd03605bdd2
2025-08-24 12:37:54 -07:00
Yuval Tassa 1c1bb14e1c Order fields in mjxmacro like in mjmodel and mjdata headers, add tests.
PiperOrigin-RevId: 798848000
Change-Id: Id1a41f6a0a4e3e6f3bb197f096061bd1d72a4b51
2025-08-24 11:17:30 -07:00
Yuval Tassa 7479312218 Use LaTeX macros for prettier uppercase subscripts in documentation.
PiperOrigin-RevId: 798547203
Change-Id: I039886fd15ee022de780a19d0ad6e17d01c306f4
2025-08-23 05:39:36 -07:00
Yuval Tassa a230aa60c5 Improve mj_addM and associated test
- Updated docs to clarify that only the lower triangle is touched
- The function was unnecessarily adding the upper triangle in the sparse case
- The test used an unnecessarily large model and stepping it leading to timeouts under ASAN

PiperOrigin-RevId: 798528736
Change-Id: I592cc17dfb62379bb0cd6b332a8eb7e8b0ef6355
2025-08-23 03:56:47 -07:00
Google DeepMind a64a26c3ae No public description
PiperOrigin-RevId: 798355907
Change-Id: I3a225e3200cbc60ccc3d93f21694a606a7ab296a
2025-08-22 15:04:46 -07:00
Yuval Tassa 93c5665730 Add some missing Nullable annotations.
PiperOrigin-RevId: 798298579
Change-Id: I773eda7deca10c820345a33835716072e0b9af5a
2025-08-22 12:15:02 -07:00
Sam Haves 1fb1810b07 Add ability to specify a material assignment to a mesh asset.
This extends both the spec and the XML definition to allow specification of a material name on a mesh. This material acts as a fallback in the case that the referencing geom element does not specify a material of it's own.

PiperOrigin-RevId: 798232378
Change-Id: Iaf300c727732744ea1b613e64334ee505ac6e209
2025-08-22 09:11:31 -07:00
Google DeepMind 42d8454555 Internal change.
PiperOrigin-RevId: 798190254
Change-Id: Ie3a3b6e074511991cc6ccb35f2c26c6d9ae7ccd8
2025-08-22 06:41:49 -07:00
Haroon Qureshi debbd7c916 Fix cast; should be mjtGeom not mjtMouse.
PiperOrigin-RevId: 798177495
Change-Id: I5d95446dd7f7f84052b60cb378acdd856c1e4d50
2025-08-22 05:47:49 -07:00
Google DeepMind ecfe65242f Add nullable attribute to AST nodes for function parameters in API introspection. Fixes #309
This change introduces an `nullable` flag to `ArrayType`, `PointerType`, and `FunctionParameterDecl`. The code generation process now parses function comments from `mujoco.h` to identify parameters marked as "Nullable" and sets this flag accordingly.

PiperOrigin-RevId: 797870883
Change-Id: Ic7cac5a7a9c14177fbf97b8655c5c4809d4ef683
2025-08-21 12:35:10 -07:00
Baruch Tabanpour 3dec35a91e Do not update qacc_warmstart at the end of the solver call; instead, update it at the same time as all other state variables. This change makes mj_forward idempotent.
PiperOrigin-RevId: 797826112
Change-Id: Ibc51624adc3ec42c265958bf77696b33231431c1
2025-08-21 10:44:05 -07:00
Yuval Tassa 2f28473bc1 Remove transposed Jacobian fields from mjData
No longer computed unconditionally, only ad-hoc where required.

PiperOrigin-RevId: 797753297
Change-Id: I2030fc342c98ff33575b0526dd72e2110c4fcb74
2025-08-21 07:21:24 -07:00
Yuval Tassa 5fe4224ae7 Compute sparse Jacobian transpose inside solver.
PiperOrigin-RevId: 797745776
Change-Id: I2ec429120d0c6eb51bec340619ab178389482e69
2025-08-21 06:55:48 -07:00
Yuval Tassa f71053243e Replace std::array with C-style array for error buffer in GJK tests.
PiperOrigin-RevId: 797730796
Change-Id: I228c58e163c8c6d1426a88c1a6f447c4a56a34e6
2025-08-21 06:03:53 -07:00
Yuval Tassa 174a50442d Allow transposing of sparse sub-matrices whose first row is > 0
PiperOrigin-RevId: 797728559
Change-Id: I3c825118dae198333d357d2e4f248d00b0f5d8ce
2025-08-21 05:56:33 -07:00
Yuval Tassa c7a82c32dc Do not update qacc_warmstart at the end of the solver call; instead, update it at the same time as all other state variables. This change makes mj_forward idempotent.
See changelog herein for motivation and discussion.

PiperOrigin-RevId: 797392841
Change-Id: If50e9f09e1d07e8363169d3589c32097aeca2432
2025-08-20 11:30:13 -07:00
Baruch Tabanpour bf04103b6f Import google-deepmind/mujoco_warp from GitHub.
#MIGRATION_3P_PY_MUJOCO_WARP__DEFAULT

  - 19dde09e179dbbaf4d07084185074f6a774b3255 update derivative.py by Taylor Howell <taylorhowell@google.com>
  - 04bc115c3766e974ef000cca16d40bacb92c01d2 fix _ray_hfield by Taylor Howell <taylorhowell@google.com>
  - 7fcbf8ddba08c9b9d33b0fdd4dd3fe39e40a0bd7 Use sparsity structures in `mjModel` rather than `mjData` by Yuval Tassa <6387526+yuvaltassa@users.noreply.github.com>
  - bfd2e4fe3cb5ba5dee97445ddc1d072344f443ec Fix override for enums (#617) by Kenny-Vilella <163487060+Kenny-Vilella@users.noreply.github.com>
  - f4dbf5345bd5dcae60c415361dd425605b672e5c Add keyframe selection to viewer (#616) by Kenny-Vilella <163487060+Kenny-Vilella@users.noreply.github.com>
  - 0e7edf9e8fd337502586929b2e4dd3d51201f462 add prunning to multiccd by Kyle Bayes <42924292+kbayes@users.noreply.github.com>
  - 791c30237cbdecf876bc53ac0b3dcff8b8b1317d format by Kyle Bayes <42924292+kbayes@users.noreply.github.com>
  - 7a7bae6c1390df3f29058e90f25f9ed5caab3fb1 Fix override in viewer and testspeed (#620) by Kenny-Vilella <163487060+Kenny-Vilella@users.noreply.github.com>
  - 9e230c229c7dd721fbf6fa5fe69fc98717895500 add + 0.0 by Taylor Howell <taylorhowell@google.com>
  - 8a70a5e8839b84c11601bf1a98f9e7d1d31603f1 Update the test_cost unit test to test more properties (#... by Kenny-Vilella <163487060+Kenny-Vilella@users.noreply.github.com>
  - cf317c60845b24ddba4b6814dbac9eba32b4c8b0 parallel linesearch with log scale for step sizes (#575) by Taylor Howell <taylorhowell@google.com>
  - b73e4edbc0d331d1e4f15c006d4535cc59595e70 add better reporting (#600) by adenzler-nvidia <116633880+adenzler-nvidia@users.noreply.github.com>
  - 007ad0b204ed4d48584024cce4676ac25a5695b5 Optimization: Fusing kernels around update_gradient_JTDAJ... by Kenny-Vilella <163487060+Kenny-Vilella@users.noreply.github.com>
  - 640a89fcf452b9564508cacdeb30ecef3a83aede Adding static to broadphase filter (#621) by Kenny-Vilella <163487060+Kenny-Vilella@users.noreply.github.com>
  - daca09ff3261db2713abc912191d6cf76437b8b7 Add reporting of converged worlds in testspeed (#619) by Kenny-Vilella <163487060+Kenny-Vilella@users.noreply.github.com>
  - 33830bddd95a7f0d3febe1b090398ddadeb86ee2 Fix call to benchmark from asv (#627) by Kenny-Vilella <163487060+Kenny-Vilella@users.noreply.github.com>
  - 382eb65f7bb45798698f4025a980287ab1ec84c7 Update flex_bending dimensions (#628) by Alessio Quaglino <102665781+quagla@users.noreply.github.com>
  - c56b8875439cfaa93c1393f0a6e2ad057e029064 contact sensor maxforce reduction (#602) by Taylor Howell <taylorhowell@google.com>
  - 4f731941cb9dea397d4f71cf8151100b83eae576 A few airspeed velocity improvements. (#626) by Erik Frey <misc@fawx.com>

PiperOrigin-RevId: 797054114
Change-Id: I380e0b9446f94202b2389e2a760d6de5f0ec5af7
2025-08-19 16:01:28 -07:00
Baruch Tabanpour fd96de330e Updates to Playground for warp.
PiperOrigin-RevId: 797037846
Change-Id: I3828b48aead8a7534a4e8cd735c96017353daa3b
2025-08-19 15:12:31 -07:00
Sam Haves 4bad134ba2 Add proper handling of MJCF asset/mesh/texturedir compiler attributes to USD plugin.
This allows the MJCF SdfFileFormat plugin to load MJCF files that specify assetdir, meshdir, or texturedir attributes. This is specifically important for resolver implementations that fetch assets into a local cache.

PiperOrigin-RevId: 796509754
Change-Id: Ib2b0c9cf9d6a3351ceea49d90c882edf94d0b880
2025-08-18 11:38:32 -07:00
Yuval Tassa 424226b640 Refactor mj_mulM to use CSR structure
PiperOrigin-RevId: 796450207
Change-Id: I2a9d567732614674547c7ae02ff0d3d4bbf1b654
2025-08-18 09:09:29 -07:00
Alessio Quaglino c2ff60e630 Decrease time step in shell examples.
Also add bending damping.

PiperOrigin-RevId: 796446515
Change-Id: I4744003caf6146e5e00614a6016d1a6dfc42cca7
2025-08-18 09:00:10 -07:00
Sam Haves eed43f6982 Add section to OpenUSD/Exporting docs linking to mujoco-usd-converter.
PiperOrigin-RevId: 796420566
Change-Id: I47728e3900720d732162c06f96a231a75d8bc931
2025-08-18 07:44:40 -07:00
Yuval Tassa 7c10a62f21 Improve island visualization colors and logic.
- Make island visualization off by default
- Give it the keyboard shortcut 'N'
- Use HSV island coloring

PiperOrigin-RevId: 796375514
Change-Id: I3cc8d6f8142412c771b2b8e57e82e70000727770
2025-08-18 05:03:41 -07:00
Alessio Quaglino b66175eba6 Bending stiffness for curved shells in flex.
PiperOrigin-RevId: 796361841
Change-Id: I105ea235fe2a8e1bcbde67276d77fa92eed214a1
2025-08-18 04:13:18 -07:00
Yuval Tassa 972ffd7b90 Improve mj_fullM documentation, add clarifying test.
PiperOrigin-RevId: 796134559
Change-Id: I85ab3680d3545ccf83d0d3af8a7c21cb36e96d4e
2025-08-17 11:02:14 -07:00
Yuval Tassa 6b41fbe72a Use CSR matrices for dof-dof index mappings
PiperOrigin-RevId: 795895311
Change-Id: I1000e0ee98906ef35990e73236e85d6354487b82
2025-08-16 13:06:32 -07:00
Yuval Tassa c0096b51a4 Move ntree to mjModel allocator sizes
PiperOrigin-RevId: 795855203
Change-Id: Idab185294d53dced9ebf073b782969dc5643b95a
2025-08-16 09:16:41 -07:00
Yuval Tassa 1447711037 Rename spec to sig in state-related API functions.
(to avoid confusion with mjSpec)

PiperOrigin-RevId: 795848898
Change-Id: I0b64eb85f5c7a3ee889a746c751d9f5561650277
2025-08-16 08:38:25 -07:00
Yuval Tassa 5a24eb2d34 Add error reporting to model loading in engine tests, where missing
PiperOrigin-RevId: 795844607
Change-Id: I4163c53c05796c2e3036af28a98f58c15bb1c99c
2025-08-16 08:11:49 -07:00
Yuval Tassa bbb70d98a4 Add utility functions for mapping between sparse matrix patterns.
PiperOrigin-RevId: 795543910
Change-Id: I92be3afc3cd90020027737fffdba18c45e25f825
2025-08-15 11:22:35 -07:00
Google DeepMind 931036adda Always try to find the skybox texture, even if there are no materials in the MJCF. Fixes #2412
Before the fix this only occured if the MJCF contained 0 materials.

PiperOrigin-RevId: 795510952
Change-Id: I0a36c275e6006f80dc9a5ba6b9c6040ce21187c9
2025-08-15 09:53:37 -07:00
Yuval Tassa b566ef2883 Ignore geoms with tiny mass in inertiafromgeom computation. Fixes #2754
PiperOrigin-RevId: 795475978
Change-Id: I02b5db9e2ac7ec556cb0a0ec6dbe4214ba9128d7
2025-08-15 07:57:02 -07:00
Yuval Tassa 977f94e9df Delete sparsity structures from mjData, use the ones in mjModel
PiperOrigin-RevId: 795067950
Change-Id: If4f52e40ac49f7c6986b33ef9c8b534199dfd21a
2025-08-14 09:13:02 -07:00
Yuval Tassa 7eb13777f8 Put sparsity structures in mjModel, don't use them yet.
PiperOrigin-RevId: 795032051
Change-Id: I75c69e881980ff9c308acf00bb3a65f4b2ef12f5
2025-08-14 07:37:42 -07:00
Yuval Tassa f077fd00a9 Compute sparse matrix sizes before making the mjModel in the compiler.
PiperOrigin-RevId: 794998215
Change-Id: Ib7d0a2479b18cc8b3168c0656d3c4be0eff43a0f
2025-08-14 05:51:17 -07:00
Taylor Howell 0ba31e2c1f MJX safe division. Fixes #2776, #2568, #2657.
PiperOrigin-RevId: 794997676
Change-Id: I3100af7c1987a8435b29cc68c4e5c624dc573986
2025-08-14 05:49:12 -07:00