Commit Graph

840 Commits

Author SHA1 Message Date
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
Sam Haves b907ffedaa Move OBJ handling to a mjpDecoder.
PiperOrigin-RevId: 875194599
Change-Id: I2cccc683d69a217f1817e70d16bc1815e366d00c
2026-02-25 09:13:09 -08:00
Taylor Howell 52ed96bc3a Move tendon sparsity fields from mjData to mjModel
PiperOrigin-RevId: 875087590
Change-Id: I1a5489d2d2011795ee38b09d547e68acd72e3cc7
2026-02-25 04:32:11 -08:00
Michael Moss a043df6bdf Update supported Python versions and remove obsolete 3.9 references.
PiperOrigin-RevId: 874063785
Change-Id: Ia4b2956b632aae5f0211fa766b6d413edcba8fe2
2026-02-23 07:29:47 -08:00
Copybara-Service 7d3e1abb21 Merge pull request #3083 from Ashutosh0x:fix/mingw-linker-stack
PiperOrigin-RevId: 871828475
Change-Id: I8abe526a81b9c1f51307729b5dde01aad809ff97
2026-02-18 05:59:41 -08:00
ashutosh0x 50349dc685 Fix MinGW stack flag syntax and Python binding crashes
- Detect linker type (lld-link vs ld) and use the appropriate stack flag: /STACK:16777216 for lld-link, --stack,16777216 for MinGW ld

- Filter out stack-related flags from Python binding modules to prevent crashes when loading MuJoCo as a DLL in Python

Fixes #3011
2026-02-18 14:22:59 +05:30
Sam Haves 448e221690 Raise ValueError if adding a spec results in a duplicate name.
PiperOrigin-RevId: 871397807
Change-Id: I50742efe7ba194ed3b1fe916f05e35b7fb2d7ec0
2026-02-17 10:54:47 -08:00
Haroon Qureshi 8f2799a34b Move renderer.py and gl_context.py into a submodule.
PiperOrigin-RevId: 870789311
Change-Id: Iaa0fcc764a770eeb4570a6a189a5ad032d41d64c
2026-02-16 02:41:35 -08:00
Saran Tunyasuvunakool 2efca34f58 Fix mjpython after breakage from 496f6b47fc.
PiperOrigin-RevId: 870253531
Change-Id: Icfbfaed41d4cdd3f8472c37a254cb7b1f2a32d7b
2026-02-14 14:32:42 -08:00
Saran Tunyasuvunakool 5274e5f720 Clean up X macros and usages for mjOption, mjStatistic, and mjVisual.
* Replace various MJOPTION_ macros with a single MJOPTION_FIELDS.
* Use XVEC macro to denote vector members where there is a mixture of
  vector and scalar members in a given struct type.
* Split up MJVISUAL_FIELDS into separate macros for each substruct.
* Modify engine_print.c and Python bindings struct.h/cc to use the
  new X macros.

PiperOrigin-RevId: 869760513
Change-Id: Idac4fe9aa99f0258e7c79802ca9023a0d4486e2d
2026-02-13 09:10:36 -08:00
Taylor Howell 5903d4826f Sparse ten_J and ten_J_colind
PiperOrigin-RevId: 869712136
Change-Id: Id2979684aa0c39552cb8453852483cbac55f0ea3
2026-02-13 06:57:22 -08:00
Michael Moss 42958aab81 Update MuJoCo version from 3.5.0 to 3.5.1 following the 3.5.0 release
PiperOrigin-RevId: 869654894
Change-Id: I9cacaf4cbb70ad17faa24c3c30ec38ffe91b5deb
2026-02-13 03:54:25 -08:00
Saran Tunyasuvunakool 496f6b47fc In mjpython, check the result of Py_InitializeFromConfig.
This is to properly handle the case where the interpreter wants to exit immediately, e.g. when `mjpython --version` is run.

Currently, we call `PyGILState_Ensure` regardless of the result of `Py_InitializeFromConfig` resulting in a segfault, as in issue #2870.

PiperOrigin-RevId: 869652555
Change-Id: I3a898279eb8aa25afbaece904cfdcc4fdcc92972
2026-02-13 03:44:58 -08:00
Michael Moss 716ae107c6 Update dependencies and changelog ahead of the 3.5.0 release.
PiperOrigin-RevId: 869221912
Change-Id: I77aa1f898009c5d24218434863d0588ddf8a058b
2026-02-12 08:08:14 -08:00
Yuval Tassa a8cf4e012d Add Colab link for System Identification toolbox.
PiperOrigin-RevId: 869091889
Change-Id: Ib5ec2e451c7037cc92b4cb1a9c58d05f0049b298
2026-02-12 01:41:40 -08:00
Kevin Zakka 2396a2541c Copybara import of the project:
--
4cabc9c52dc07ea2d64a3de6dbd58e47a2ad023c by Kevin Zakka <kevinarmandzakka@gmail.com>:

Add system identification tutorial and fix template packaging

- Add sysid tutorial notebook (sysid.ipynb)
- Include HTML templates in package-data to fix TemplateNotFound errors
  when pip installing mujoco[sysid]

COPYBARA_INTEGRATE_REVIEW=https://github.com/google-deepmind/mujoco/pull/3092 from kevinzakka:sysid-notebook 4cabc9c52dc07ea2d64a3de6dbd58e47a2ad023c
PiperOrigin-RevId: 868900119
Change-Id: I53c4cc94b5fb6f864c5cee589af9dfad9bfc8744
2026-02-11 16:43:08 -08:00
Google DeepMind 336e1026a4 Sparse ten_J and ten_J_colind memory
PiperOrigin-RevId: 868834376
Change-Id: Iec92d9e09e3134666895e54a78cb02439d74a4de
2026-02-11 14:05:43 -08:00
Taylor Howell d011285380 Sparse ten_J and ten_J_colind memory
PiperOrigin-RevId: 868800229
Change-Id: Id83f9fd40dd9bece06fd99753e4202eea17ca884
2026-02-11 12:45:50 -08:00
Adrian Collister d881e9e374 Change tex_adr type to mjtSize.
Adds a test which verifies that we can index into the texture buffer at offsets larger than can be represented by a 32-bit signed int.

PiperOrigin-RevId: 868756646
Change-Id: Ibc1a2b269fce41aec370611b0aab77803837e7a8
2026-02-11 11:09:36 -08:00
Google DeepMind cc5d544d15 Update typos in sysid/README.md
PiperOrigin-RevId: 868690171
Change-Id: Iffc71fb7bad73e18be767429600936014095ed9e
2026-02-11 08:25:56 -08:00
Copybara-Service 91751a506b Merge pull request #3082 from aftersomemath:sysid-pr2
PiperOrigin-RevId: 868599752
Change-Id: Ifb57f34857d542b542b8ac9f047397c651f8008b
2026-02-11 04:06:44 -08:00
Levi Burner e89dae359e sysid: named ic construction, bug fixes, docstrings, README, more tests
Co-authored-by: Kevin Zakka <kevinarmandzakka@gmail.com>
2026-02-11 00:22:56 -05:00
Sam Haves 6715a0ceaa Expose mju resource functions to public header.
Many of these functions are useful when writing a custom decoder.

PiperOrigin-RevId: 868321921
Change-Id: I7e0dd285e0559b6f486acf8cbf4376ff8d91943d
2026-02-10 14:31:41 -08:00
Copybara-Service 3ec09f7296 Merge pull request #3079 from aftersomemath:sysid-pr
PiperOrigin-RevId: 868229512
Change-Id: I790bc08fc8b0745583a2f92d9ee2c5a19ba558ea
2026-02-10 11:04:12 -08:00
Yuval Tassa 4fa062c7e5 Update unreleased MuJoCo version from 3.4.1 to 3.5.0.
PiperOrigin-RevId: 868169291
Change-Id: I8041842811f5f664c80116993315f50d549b5575
2026-02-10 08:52:04 -08:00
Kevin Zakka 146a5c08f7 System identification toolbox for MuJoCo.
This resulted from a lengthy collaboration with @kevinzakka, @jonathanembleyriches, @nimrod-gileadi, @gizemozd, @quagla, and @yuval.
2026-02-09 12:12:24 -05:00
Yuval Tassa 6419534bad Add actuator and sensor delays. Fixes #1004
PiperOrigin-RevId: 866478839
Change-Id: Id21a6da0f98454c8fa39ea5af8a5e213d6eae497
2026-02-06 08:47:36 -08:00
Taylor Howell 1381e8adee Add mjMINAWAKE to constants.cc
PiperOrigin-RevId: 862784740
Change-Id: I309fca497027cd8cb7cee6c998fc34d0cb5e94fd
2026-01-29 10:04:43 -08:00
Yuval Tassa 55f300b78c Fix typo
PiperOrigin-RevId: 862781462
Change-Id: I88844e2148e821ec92e37aa8aab3554c132a4d43
2026-01-29 09:57:09 -08:00
Yuval Tassa 5fb47df197 Add mjData flags marking lazily evaluated pipeline stages
PiperOrigin-RevId: 861763477
Change-Id: Ib613c56949264573a16306800658f868d2aa7665
2026-01-27 09:45:06 -08:00
Alessio Quaglino ba32568138 Move flex vertex-edge adjacency to mjModel.
PiperOrigin-RevId: 861717037
Change-Id: I2ad8090b0318cb04b43d13966cb42260c82ef930
2026-01-27 07:41:47 -08:00
Haroon Qureshi 0ddbb46fa1 Refactor mjVFS and resource management.
Resource operations (e.g. mju_openResource, mju_readResource, and
mju_closeResource, etc.) are now all handled by a VFS instance. It
is now up to the VFS to determine which provider to use in order to
handle those operations.

This allows us to dynamically add/remove (aka "mount") providers to
a VFS to handle special requests. mj_addFileVFS and mj_addBufferVFS
have been reimplemented as two such use-cases. Moreover, we expose
the mounting behaviour with two new functions: mj_mountVFS and
mj_unmountVFS.

PiperOrigin-RevId: 861550939
Change-Id: I070eb4bcc2982466c8f368f7918005538baa5185
2026-01-26 23:53:29 -08:00
Matija Kecman e977b0d660 Fix GIL deadlock in Python viewer methods
Removed the GIL lock in set_figures, clear_figures, set_texts, clear_texts, set_images, and clear_images

PiperOrigin-RevId: 861245200
Change-Id: I52f21d82f9813752c7cb357213c24ea6188583db
2026-01-26 10:11:16 -08:00
Alessio Quaglino 54ace777c1 Add convenient plugin assignment in Python bindings.
PiperOrigin-RevId: 861168536
Change-Id: I274fbf3460d475434f837ab58bf5e2b0988369fd
2026-01-26 06:37:31 -08:00
Alessio Quaglino 7da271c687 Add vertex equality option.
PiperOrigin-RevId: 860299454
Change-Id: I7befd8e5f4c8bac6d74684a96a9cc3cee9ae1e29
2026-01-23 16:30:05 -08:00
Yuval Tassa 30b903b6c0 Migrate mjModel size fields from int to mjtSize.
This change updates all size-related members within the `mjModel` struct from `int` to `mjtSize`. This allows MuJoCo to handle models with a larger number of elements. Corresponding changes were made to macros, function signatures, and I/O routines to accommodate the new `mjtSize` type.

PiperOrigin-RevId: 860144595
Change-Id: I701c6d607715d240766b6210a9773cd9e4258c59
2026-01-23 09:41:49 -08:00
Taylor Howell 5ae6b5fe31 Fix MjSpec.add_texture gridlayout argument to accept strings and character lists
PiperOrigin-RevId: 859599919
Change-Id: If785f36010a7437b354ec0ce7db30c2b7ec69fe6
2026-01-22 07:28:16 -08:00
Alessio Quaglino 54dd623650 Add vertex-based flex constraints (dim=2).
PiperOrigin-RevId: 859552050
Change-Id: I61d4b9dc40f041c5b930e5f8810a803e8bccb87a
2026-01-22 04:54:53 -08:00
Taylor Howell 23c56ec4bb mjSpec python bindings for add functions: accept size with 1, 2, or 3 parameters
PiperOrigin-RevId: 858494291
Change-Id: I8a02dcac1d2419fbc728607907425b401cf66da4
2026-01-20 02:39:04 -08:00
Alessio Quaglino e56b31e98f Reduce flexedge_J size from nflexedge x nv to the effective sparse size.
PiperOrigin-RevId: 856290141
Change-Id: Ide297d1b6f0e3aa07e3e20bf9ab44b6501097695
2026-01-14 11:18:41 -08:00
Google DeepMind cbc1136502 Roll back VFS refactor due internal breakages
PiperOrigin-RevId: 856273160
Change-Id: I4097e05ed4e48ebee05b4347d0f227d4f39c1b09
2026-01-14 10:38:29 -08:00
Haroon Qureshi d387578783 Refactor mjVFS and resource management.
Resource operations (e.g. mju_openResource, mju_readResource, and
mju_closeResource, etc.) are now all handled by a VFS instance. It
is now up to the VFS to determine which provider to use in order to
handle those operations.

This allows us to dynamically add/remove (aka "mount") providers to
a VFS to handle special requests. mj_addFileVFS and mj_addBufferVFS
have been reimplemented as two such use-cases. Moreover, we expose
the mounting behaviour with two new functions: mj_mountVFS and
mj_unmountVFS.

PiperOrigin-RevId: 856166919
Change-Id: Id723d612ffc0bff020705cf19ef95fbf24676840
2026-01-14 05:19:57 -08:00
Yuval Tassa 218226fc95 Breaking change: Add surface normal output to MuJoCo raycast functions.
PiperOrigin-RevId: 855781592
Change-Id: Id96b1ca7eaf722e260cc69d7706c28dc51f52d92
2026-01-13 10:22:21 -08:00
Alessio Quaglino a49576e469 Move flexedge sparse Jacobian indices to mjModel.
PiperOrigin-RevId: 855718305
Change-Id: Ic136f4efa6735b934288f65c332d71ee8b0f6da5
2026-01-13 07:33:17 -08:00
Google DeepMind 09a6fb7d4d #mjspec Enforce that material textures array is always of length mjNTEXROLE.
PiperOrigin-RevId: 855684213
Change-Id: Id8a3734c75841dfb91bd2252114249f08461b7f2
2026-01-13 05:55:09 -08:00
Sam Haves 7e45bbb51c Add urdf file extension case to mj_parse.
fixes #3004

PiperOrigin-RevId: 855249634
Change-Id: I6c21d0ada4fe482059f64e96d413796f5c1c66ce
2026-01-12 08:59:00 -08:00
Yuval Tassa d7e4038be8 Expose mj_copyData in Python bindings.
This allows calling `mujoco.mj_copyData(dest, model, src)` to copy data between existing `mjData` instances.

PiperOrigin-RevId: 855150139
Change-Id: If122cb7acf590846e25ee15f9770c3c087147169
2026-01-12 03:21:15 -08:00
Yuval Tassa a26f09accf Standardize function docstring style in MuJoCo API.
Updates function comments to consistently use a semicolon (`;`) before describing the return value and to use the imperative form "return" instead of "returns".

Also fix error in docstring of `mjp_registerResourceProvider`

PiperOrigin-RevId: 854888532
Change-Id: I311239a2770ded5febece9958ae4e94c1e522600
2026-01-11 09:00:35 -08:00
Sam Haves e37c2268a6 Release gil when compiling spec.
When compiling with threading, we will block the main thread anyways waiting for all threads to complete.

PiperOrigin-RevId: 854230560
Change-Id: Ief689d381afaa3aacc5d712a8df0cb4b6762251c
2026-01-09 09:50:15 -08:00
Sam Haves ce74475c39 Delete VFS created from assets dict before throwing error.
PiperOrigin-RevId: 853838173
Change-Id: Id0dd33b69657813275d1f42db54fae222c337791
2026-01-08 12:13:55 -08:00