Commit Graph

4946 Commits

Author SHA1 Message Date
Michael Moss e7ef6528b7 Enable MuJoCo Studio build and packaging on macos.
Also:
- Packages MuJoCo Studio as MuJoCoStudio.app in the MuJoCo.dmg.
- Fixes a Filament compile issue.
- Patches libwebp to fix compile error related to universal builds and forces
  it to build as static.
- Removes the separate, obsolete "build_studio" step.
PiperOrigin-RevId: 934564785
Change-Id: I50c83283b5e138062e37d53926a5a77fdf99dbfa
2026-06-18 15:03:20 -07:00
Michael Moss 8db92ab4a9 Enable building Studio (Linux only) as a component of the main MuJoCo build.
And remove the separate, conditional (and hacky) "build_studio" step.

PiperOrigin-RevId: 934375150
Change-Id: I46514d0f33c17bb29625b818cdde3a285fd2c439
2026-06-18 08:44:16 -07:00
Michael Moss 1f8c6f1183 Add licenses for third-party dependencies brought in by Studio.
PiperOrigin-RevId: 934300272
Change-Id: I7be1fccb4a80ea86803696699f53687f7d37da91
2026-06-18 05:51:06 -07:00
Yuval Tassa e2afec9153 Make decorations lit, Rename unlit_decor material to decor.
PiperOrigin-RevId: 933693797
Change-Id: I37128b528296d978d4917ec65316d8d99ce017bb
2026-06-17 06:43:37 -07:00
Haroon Qureshi 037bdfa519 Add edge and vertex rendering for flexes.
PiperOrigin-RevId: 933675465
Change-Id: Ice3c3a35820588c732b73f1dbad22e346acc4046
2026-06-17 05:56:18 -07:00
Yuval Tassa e76afa7160 Reduce the opacity of the Filament selection outline.
PiperOrigin-RevId: 933665589
Change-Id: Ic55785568c0129c2f145bedc0cde7ec4bdc05dcf
2026-06-17 05:29:04 -07:00
Yuval Tassa cedaa47d61 Migrate tests to use MockWarningHandler for warning interception.
PiperOrigin-RevId: 933656759
Change-Id: Ia21514c302799034bf598445933dd90427284737
2026-06-17 05:06:57 -07:00
Yuval Tassa 38c3388046 Fix rotation Jacobian offset in mj_jacSum sparse path.
PiperOrigin-RevId: 933640368
Change-Id: Ib30acd651b6022b0835e07b3f3b01e648791a511
2026-06-17 04:24:00 -07:00
Yuval Tassa cffb077c4b Register atexit handler to clear GlobalModel.
PiperOrigin-RevId: 933624252
Change-Id: Ib214514ac5390137dbf1034d113ff8aa9e9cdeb1
2026-06-17 03:44:08 -07:00
Yuval Tassa 410c73168c Add policies for global attribute conflict resolution upon attach
For example when loading parent_merge.xml:

```
WARNING: Attach conflict when attaching 'child' to 'parent_merge', policy is 'merge'
timestep: parent has 0.005, child has 0.002, taking the minimum
iterations: parent has 50, child has 100, taking the maximum
flag 'Damper': added from child
```

When loading parent_error.xml:

```
XML Error: Attach conflict when attaching 'child' to 'parent_error', policy is 'error'
timestep: parent has 0.005, child has 0.002
iterations: parent has 50, child has 100
Element 'attach', line 10
```
PiperOrigin-RevId: 933620810
Change-Id: Ib477863b5ef763474d27fb4be5a4148be1d5d500
2026-06-17 03:36:10 -07:00
Michael Moss 30357c38a3 Silence C++20 deprecation warnings in MuJoCo Python enums.
PiperOrigin-RevId: 933618689
Change-Id: I7cd99ed47748a56990bef9e390a6c9072d5a6c0a
2026-06-17 03:28:40 -07:00
Kyle Bayes 386b45fb75 Add tolerance to upper > lower bound check on first iteration of EPA.
PiperOrigin-RevId: 933615381
Change-Id: I175d3b97fa65f71a8f1cc34da5f6b9a23ab856d2
2026-06-17 03:19:19 -07:00
Copybara-Service f6fb4af091 Merge pull request #3350 from kevinzakka:ci-ccache-header-fix
PiperOrigin-RevId: 933605716
Change-Id: Ia2f58f4a2b3240b18dc7f3f4bce7be8dd30e7f0e
2026-06-17 02:57:15 -07:00
Haroon Qureshi 6294e77907 Do not render flexes/skins with no geometry.
PiperOrigin-RevId: 933604372
Change-Id: I80169ff09ec6908d101b5f10bbf8aa1a6e8b8249
2026-06-17 02:54:11 -07:00
Kevin Zakka ffd95cf656 CI: drop system_headers from Python-binding ccache sloppiness
CMake adds the imported mujoco target's include dir as -isystem, so with
system_headers sloppiness ccache stopped hashing the public MuJoCo headers.
A header-only change (new mjData field, new enum value) then went undetected
and ccache reused objects compiled against the old struct layout, yielding an
ABI-mismatched binding: wrong field offsets (garbage in struct/pickle tests),
stale mjENABLESTRING/mjNENABLE, and mjSpec-vs-mjData signature mismatches.

Removing system_headers makes ccache hash these headers and recompile on
change. The mtime/ctime flags stay (they absorb pip's per-run temp-dir churn
without affecting content detection).
2026-06-16 23:45:18 -07:00
Haroon Qureshi e1711529f2 Add RGBA8 support to RenderTarget::ReadColorPixels.
PiperOrigin-RevId: 933521511
Change-Id: Ic279fb8f86615cc4cfddef6ac27a502b22bafd79
2026-06-16 23:30:04 -07:00
Yuval Tassa 6f8bb5ef55 Refactor compiler warning handling.
Compiler warnings are now accumulated in a vector of strings within the mjSpec object. New API functions `mjs_numWarnings` and `mjs_getWarning` are added to access these warnings. The compiler's log handler now chains warnings to the global log handler, ensuring they are still displayed immediately. Call sites in `mj_loadXML`, `mj_compile`, and the Python and WASM bindings have been updated to use the new warning API.

PiperOrigin-RevId: 933361650
Change-Id: I47cab98a460c57b0898c0a1a43fce2a5b9648eb1
2026-06-16 16:28:33 -07:00
nas 55c6332f20 Copybara import of the project:
--
8ce7d8199ace95d0f429b0ca9169d290d167cee1 by Anas <anaselghoudane@gmail.com>:

Use box midpoint to choose finite-difference direction in jacobian_fd

When bounds are provided, `jacobian_fd` chooses each coordinate's
finite-difference direction so the perturbation steps away from the nearer
bound. It compared `x` against `0.5 * (bounds[1] - bounds[0])`, which is half
the box *width*, not the box midpoint. For bounds that are not centered on the
origin this selects the wrong direction, and at the lower bound the perturbation
steps outside the box.

Compare against the midpoint `0.5 * (bounds[0] + bounds[1])` instead. Adds a
regression test checking that all residual evaluations stay within an off-center
box when `x` is at the lower bound; it fails before this change and passes after.

--
cfa085484c30df808362898e322de8adc6660b59 by Kevin Zakka <kevinarmandzakka@gmail.com>:

Expand jacobian_fd bounds test and avoid midpoint overflow

Use the distributive form `0.5*lo + 0.5*hi` instead of
`0.5*(lo+hi)` to avoid overflow for extreme bound values.

Expand the single-case test into a parameterized subTest covering
all four boundary positions (lower/upper of positive and negative
off-center boxes), and rename it to `test_jacobian_fd_respects_bounds`.

COPYBARA_INTEGRATE_REVIEW=https://github.com/google-deepmind/mujoco/pull/3301 from Nas01010101:fix/minimize-fd-box-midpoint cfa085484c30df808362898e322de8adc6660b59
PiperOrigin-RevId: 933224876
Change-Id: I833cfe3324876cdeb7ca680c23d1d8a4d16adcf1
2026-06-16 12:06:34 -07:00
Copybara-Service 167901cec4 Merge pull request #3347 from kevinzakka:fix-dependabot-esbuild-usdcore
PiperOrigin-RevId: 933129237
Change-Id: I6864bd002ea48955b8c11332c40ac6891ba6659d
2026-06-16 09:25:30 -07:00
Kyle Bayes 0eec09dd60 Add runtime assertions to mji functions.
PiperOrigin-RevId: 933106771
Change-Id: I523cdceb89c90611f27983731c49fd4887034431
2026-06-16 08:36:32 -07:00
Kyle Bayes d9b677b49b Refactor remaining primitive and convex collision code to use mjPreContact instead of mjContact. Introduce internal struct mjcPair in engine_collision_driver.c for readability and extensibility for flex objects. This is a no-op.
PiperOrigin-RevId: 933105275
Change-Id: Id862b01774df63dcdb42629a5b7dd12019f12ffd
2026-06-16 08:33:09 -07:00
Kyle Bayes b469144a81 Modify mjc_FlexSDF to support mjPreContact directly.
PiperOrigin-RevId: 933068825
Change-Id: I328d64bb05270067ce146908b0df3ca83f10ed9b
2026-06-16 07:04:16 -07:00
Yuval Tassa 55d7ff49ec Fix broken link in docs.
PiperOrigin-RevId: 933054777
Change-Id: Ic862992051200bff1b742025926961a7c2087ffa
2026-06-16 06:24:16 -07:00
Yuval Tassa 8efb396b26 Reorder and adjust GUI physics options.
PiperOrigin-RevId: 933007222
Change-Id: Ia6944744112baa309de165144179ad96d914a734
2026-06-16 04:06:35 -07:00
Haroon Qureshi c0fa33f97f Rename mjrFilamentConfig to mjrfContextConfig.
PiperOrigin-RevId: 932996526
Change-Id: Ia81ee074471ab4ff41e0829fa5ba70203599fdb6
2026-06-16 03:36:22 -07:00
Haroon Qureshi ecee1e0c53 Rename nattributes to num_attributes for consistency.
PiperOrigin-RevId: 932973447
Change-Id: Idbf9a52c89e24f34ae360d1617cb72dfaa92aa4e
2026-06-16 02:40:13 -07:00
Kevin Zakka c44acdeb59 Bump vite to 8 to patch esbuild Dependabot alerts 2026-06-15 18:15:35 -07:00
Kevin Zakka 351f1ee2ba Bump usd-core to 25.11 to patch remaining Dependabot alert 2026-06-15 18:14:02 -07:00
Copybara-Service 8e13f3b54d Merge pull request #3332 from kevinzakka:fix-dependabot-pip-hashes
PiperOrigin-RevId: 932719862
Change-Id: I3627eaad46bf7f92ab927bb610c44d640a473adb
2026-06-15 16:04:37 -07:00
Kevin Zakka 936d040022 Bump usd-core to 25.8 to patch critical Dependabot alert 2026-06-15 08:53:04 -07:00
Kevin Zakka b1725b4fc9 Bump pinned pip dependencies to patch Dependabot alerts 2026-06-15 08:53:04 -07:00
Copybara-Service c9ba1e452d Merge pull request #3338 from devshahofficial:devshahofficial/filament-emissive-factors
PiperOrigin-RevId: 932483570
Change-Id: If8ff968d2650551118a38ea4837063796bd85f66
2026-06-15 08:45:48 -07:00
Copybara-Service eb6c2eea91 Merge pull request #3331 from kevinzakka:fix-dependabot-security-alerts
PiperOrigin-RevId: 932472549
Change-Id: Ib0830dfefca386ae338f427d675a9d5e148efd2e
2026-06-15 08:21:26 -07:00
Yuval Tassa 60b5cac066 Switch MJX DataJAX from legacy qM format to CSR M format
Switch MJX DataJAX to use the CSR-format `M` as its primary sparse inertia representation, matching MuJoCo C `mjData.M`. This allows both `mjData.qM` and `mjModel.mapM2M` to be deleted in the future.

PiperOrigin-RevId: 932433465
Change-Id: I194ffbfdba0cdd9c718277ee0d5de7ac20f2b06f
2026-06-15 06:52:45 -07:00
Michael Moss 3317921999 Add Studio assets into the python packaging.
PiperOrigin-RevId: 932432607
Change-Id: Id5122f3655c519f185b5647f3fb92f3ed54ba82c
2026-06-15 06:50:33 -07:00
Haroon Qureshi 7472440dbd Make mjrfilament.h conform to C standards.
PiperOrigin-RevId: 932424719
Change-Id: I1f8d8d91041ea1c2b77010761404bf0e519bcc29
2026-06-15 06:33:18 -07:00
Yuval Tassa 4e10f20be6 Fix set_to_muscle() to accept tuple arguments.
Correct argument types for timeconst and range parameters in pybind11
python bindings from C arrays to std::array.

Fixes #3282, #3282, #3318

Thanks to @Abzaek for original PRs

PiperOrigin-RevId: 932423401
Change-Id: Ic30ba076913693f5c0e545789690e8b0fa444390
2026-06-15 06:29:43 -07:00
Haroon Qureshi b1f4656d1a Parse all headers for possible functions.
Allows other files (e.g. mjrfilament) to define functions that
will be added to the introspection output.

PiperOrigin-RevId: 932403177
Change-Id: Ie2d2c6be67f0706463fdec4fc498364125e05dad
2026-06-15 05:39:54 -07:00
Matija Kecman 81bc303a8f Add an async example using multi threading
PiperOrigin-RevId: 932400523
Change-Id: I6649dfd3a657ce11b7dc6cf130f01be8a85a095c
2026-06-15 05:34:08 -07:00
Haroon Qureshi 9e45ce9801 Use num_ prefix consistently in API.
PiperOrigin-RevId: 932391786
Change-Id: I71c7f300fdb84ce1129ea3da6336df2fcffc5712
2026-06-15 05:08:34 -07:00
Matija Kecman 7c22920720 Improve async example and remove Network demo code
- Move SimToView and ViewToSim dataclasses from async.py to viewer_protocol.py (adding a user_data field) to consolidate IPC protocol definitions.
  - Remove the simulated Network class and latency UI controls from async.py to simplify the example and focus on core multiprocessing communication.
  - Use parser.parse() in main() for cleaner and more direct MuJoCo model loading.
  - Add cancel_join_thread() to multiprocessing queues and a join timeout to prevent atexit handlers from blocking during process shutdown.

PiperOrigin-RevId: 932327625
Change-Id: If91777dba934814b3f9faa17f9055869920575d7
2026-06-15 02:31:07 -07:00
Haroon Qureshi 2a210da0f7 Add more types to known types for generator.
PiperOrigin-RevId: 932327432
Change-Id: Ia62d2679f75d786c868f9d576af40a344b675508
2026-06-15 02:30:20 -07:00
devshahofficial 7646a56e82 Fix Filament emissive material factors 2026-06-13 15:58:30 -07:00
Yuval Tassa 67a1ea6dca Track authored flags for global attributes
PiperOrigin-RevId: 931585539
Change-Id: Ifdc8c59de6c5a553daf6e0af09d8192aff6b0610
2026-06-13 02:58:32 -07:00
Haroon Qureshi 0ea9c7cb3a Expose function for determining if tendons should be drawn using a catenary.
PiperOrigin-RevId: 931170146
Change-Id: Ia3352a3e2bdc5e4df932e9d476e1e34200b62df1
2026-06-12 08:45:22 -07:00
Michael Moss 4bb02e299d Resolve Studio assets path dynamically.
PiperOrigin-RevId: 931162732
Change-Id: Ib44a74790facfa797ca2c4f107edb0062a89c117
2026-06-12 08:26:24 -07:00
Haroon Qureshi 2c125dd447 Add Update function to LightManager.
PiperOrigin-RevId: 931152006
Change-Id: I6fe5d4ab0dbc8032fe84fd12968666d755d1d7d5
2026-06-12 07:58:43 -07:00
Haroon Qureshi 01d5be61e3 Move ModelObjects and LightManager to filament/support.
PiperOrigin-RevId: 931136854
Change-Id: I3ce3b7265c5d3c9a49fa84be46e87a76c6e2c8b5
2026-06-12 07:18:07 -07:00
Michael Moss 1ae561407a Minor cleanup to avoid unwanted files in mjx packaging.
PiperOrigin-RevId: 931118601
Change-Id: I94adedd0b29370e652140bb91f1488722eb61c55
2026-06-12 06:26:42 -07:00
Yuval Tassa f27503509e Fix GCC truncation warnings in Python bindings errors.h
Widen mju_error_msg buffer from 1024 to 2048 and replace strncpy with
snprintf to avoid -Wformat-truncation and -Wstringop-truncation.

PiperOrigin-RevId: 930982013
Change-Id: I0fcd726e5ed1ad28594bd4ef55b8b1ae72020043
2026-06-12 00:31:17 -07:00