Commit Graph

3594 Commits

Author SHA1 Message Date
Matija Kecman f2badc05ac Add JavaScript bindings and WASM support
Co-authored-by: Matija Kecman <matijak@google.com>
Co-authored-by: Sebastian Noreña Rendón <sebas.norena@creativa77.com.ar>
Co-authored-by: Kyle Bayes <kylebayes@google.com>
PiperOrigin-RevId: 826109484
Change-Id: I327fd54122762bd2e239cc31c602a3eb73051c26
2025-10-30 11:11:52 -07:00
Matias Manevi 76e64d96bb Add JavaScript bindings and WASM support
Co-authored-by: Matija Kecman <matijak@google.com>
Co-authored-by: Sebastian Noreña Rendón <sebas.norena@creativa77.com.ar>
Co-authored-by: Kyle Bayes <kylebayes@google.com>
PiperOrigin-RevId: 826094938
Change-Id: Id2658a187bc078056f4410c71202696753319e64
2025-10-30 10:38:16 -07:00
Taylor Howell 10f4b36fb7 MuJoCo Warp documentation: Beta software.
PiperOrigin-RevId: 825958166
Change-Id: I1e90d78d7413956cfa84711336be26a23a18e5aa
2025-10-30 03:37:22 -07:00
Alessio Quaglino 37563a050e Remove obsolete docs references to convexhull.
Fixes #2912.

PiperOrigin-RevId: 825679563
Change-Id: I8ee14415fb1eb64ece5cf4f3c07d016126025364
2025-10-29 13:17:48 -07:00
Taylor Howell 3df784fc84 Updates for MuJoCo Warp documentation.
PiperOrigin-RevId: 825489001
Change-Id: I6ec4a0433f96da05befeb2b76793763e50a893d8
2025-10-29 04:42:46 -07:00
Google DeepMind d769440924 Store asset keys relative to the MJCF. This CL fixes cases when loading a spec with "from_zip" that fails on zipped folders that contain a root directory.
PiperOrigin-RevId: 825484553
Change-Id: I79c6f542edbd3ffd167d0b5cecc704c32c8d6824
2025-10-29 04:24:09 -07:00
Alessio Quaglino 010d919244 Add __setattr__ to _MjBindModel and _MjBindData.
This allows setting attributes with bind using a list of mjSpec objects as arguments.

PiperOrigin-RevId: 825456920
Change-Id: Ie6af956feab0a805175d7aaecf26e071401fbf05
2025-10-29 02:55:08 -07:00
Haroon Qureshi 80eb511620 Remove dependency on Window, Physics, and Renderer classes.
PiperOrigin-RevId: 825137441
Change-Id: I099a518ca9618698401d0330a6ef08278168f88e
2025-10-28 11:42:17 -07:00
Haroon Qureshi 4620b9f23a Merge HandleMouseEvents and HandleKeyboardEvents back into app.cc.
PiperOrigin-RevId: 825081195
Change-Id: I36445b8c452b15ca26056a52fd1844cf77083c0a
2025-10-28 09:44:42 -07:00
Baruch Tabanpour d001bd6525 Add naconmax, deprecation warning for nconmax.
PiperOrigin-RevId: 825018530
Change-Id: I344b296ac4353592d65a85b826850eaa7df5d39a
2025-10-28 06:59:01 -07:00
Alessio Quaglino 2bdea1a0aa Use "/" as default prefix during attach if not specified.
The user can recover the old behavior by passing prefix="".

This enables to attach children with default and save a valid result to XML.

PiperOrigin-RevId: 825011185
Change-Id: Id20c2589da928bf92b77bdb01cfba73dfc1d2f52
2025-10-28 06:40:34 -07:00
Alessio Quaglino 1bfa8b6fa6 Do not add bodies at mesh points for quadratic flex interpolation.
PiperOrigin-RevId: 825001743
Change-Id: Ica085b947fb1c3f56251bceaa6a228f364535d3e
2025-10-28 06:13:27 -07:00
Haroon Qureshi 3b79d3f14b Set flags directly on Renderer class.
This removes a dependency on mjvScene from the App class.

PiperOrigin-RevId: 824983816
Change-Id: I20dd411e6359ee411f9b0b86d4442c090ba4bd5c
2025-10-28 05:24:05 -07:00
Haroon Qureshi 7ba0d96d77 Use mjvCamera directly for generating camera string.
PiperOrigin-RevId: 824982264
Change-Id: I0d8760bb27153849c8f4dacb10aa3162f29c2f6e
2025-10-28 05:18:58 -07:00
Yuval Tassa e1a73f9c4c Add early exit in mj_xfrcAccumulate using mju_isZeroByte
`xfrc_applied` mostly contains user perturbations which are rare. It is very often identically zero and for large arrays `mju_isZeroByte` is significantly faster than `mju_isZero`.

PiperOrigin-RevId: 824975356
Change-Id: Iadb1d300d68cf12de00c14a0665bd89924a2d7e0
2025-10-28 04:59:14 -07:00
Taylor Howell 017788b9d6 MuJoCo Warp documentation: Parallel Linesearch.
PiperOrigin-RevId: 824937806
Change-Id: I95b416f7b0380099aa6ea4200a27acfc2b2c6bb7
2025-10-28 03:01:07 -07:00
Haroon Qureshi a16805f8ee Add CMakeLists.txt files for new (experimental) code.
This includes the filament, toolbox, and studio projects.

Adds a MUJOCO_BUILD_STUDIO option to enable building of the `studio` app (disabled by default).

Adds a MUJOCO_USE_FILAMENT to allow the studio app to use the filament rendering backend. A separate MUJOCO_USE_FILAMENT_VULKAN flag can be used to enable vulkan rendering.

PiperOrigin-RevId: 824602367
Change-Id: I26d46c16211ae2118f96c163c4194fea5b5a15a9
2025-10-27 11:26:14 -07:00
Taylor Howell be055840b4 Add Batched Model Fields section to MuJoCo Warp documentation.
PiperOrigin-RevId: 824596731
Change-Id: Ic2fc96df6f8d9639286f08ec86c5cdca64fc03d8
2025-10-27 11:12:43 -07:00
Taylor Howell 3b11e31572 MuJoCo Warp documentation: Add nworld, nconmax, and njmax section and update introduction.
PiperOrigin-RevId: 824579564
Change-Id: I2f2b81d95e061168646fce12f7c6f7a1268385e9
2025-10-27 10:33:45 -07:00
Haroon Qureshi dbaf35d42c Add CMake configurations for new third_party dependencies.
Adds targets for dear_imgui, implot, filament, sdl2, and webp. These
targets are not currently used.

PiperOrigin-RevId: 824554405
Change-Id: Ibebdd50752d251852a945b6abc230e2c6e65fae9
2025-10-27 09:36:52 -07:00
Copybara-Service d971e5c2df Merge pull request #2908 from davidhozic:doc/fix-comments
PiperOrigin-RevId: 824546229
Change-Id: I9961e7f39d0549ff8b15a1007fb20832a0014bbd
2025-10-27 09:16:01 -07:00
Copybara-Service 23c3001a4c Merge pull request #2875 from google-deepmind:dependabot/pip/mjx/pip-25.2
PiperOrigin-RevId: 824514263
Change-Id: Ifeb956547e23722ea486e1e6da9a953826038626
2025-10-27 07:42:09 -07:00
Taylor Howell 85e9cff0c1 Update mj_geomDistance: don't flip geoms for nativeccd.
PiperOrigin-RevId: 824463375
Change-Id: Ic9c4cac916129b88575e0366e1b95353ce716ca2
2025-10-27 04:48:36 -07:00
Baruch Tabanpour 8c5154c9a3 Fix testspeed for mjx-warp.
PiperOrigin-RevId: 823691704
Change-Id: If90f6137915de134fdda3c7616bc810555c25d87
2025-10-24 15:47:14 -07:00
Saran Tunyasuvunakool 49a3caf84c Modify SimulationState proto to correspond to mj_getState.
PiperOrigin-RevId: 823494487
Change-Id: Ib284e3165ca691f5b690a376f7b28e51122e1bc4
2025-10-24 05:51:07 -07:00
Alessio Quaglino ec8ad21cb5 Normalize triangle coordinates such that their sum rather their norm is one.
This ensures that at e.g. the barycenter of the triangle each vertex has weight 1/3, as one would expect with barycentric coordinates, rather than 1/sqrt(3). This makes it consistent to the finite element interpolation used in the passive elastic forces.

PiperOrigin-RevId: 823458736
Change-Id: Ia5c02cba186a80612de38402f791695c33e991ab
2025-10-24 03:42:55 -07:00
Google DeepMind 7bf065c75b Implement equivalents to mj_getState, mj_setState and mj_stateSize in mjx
PiperOrigin-RevId: 823158825
Change-Id: I06bbf603f61ef2de8f83f32a211e8d468e0b7c5c
2025-10-23 13:09:51 -07:00
Haroon Qureshi 99c18f07d3 Increase buffer size.
The smaller size is a warning/error on some targets:

```
error: ‘ bytes’ directive output may be truncated writing 6 bytes into a region of size between 0 and 15
```
PiperOrigin-RevId: 823047552
Change-Id: Id66b5828cf84a512dffc452753f1881deb685584
2025-10-23 08:16:54 -07:00
Haroon Qureshi 1fd9b47fea Prefix assets path with "assets/".
PiperOrigin-RevId: 823044312
Change-Id: I0bde4428bd1992d6d4356e107dac471fa7cdecc6
2025-10-23 08:07:33 -07:00
Sam Haves 18e60369f3 If building simulate with USD support remove the no-deprecated warning due to deprecated header usage in USD.
PiperOrigin-RevId: 822807399
Change-Id: I2765f4a7260b5ac8b3ef5894c1c5ce7a3a745baf
2025-10-22 17:56:43 -07:00
Sam Haves febe75d54b Add tendon.cpp to mjcPhysics CMake
PiperOrigin-RevId: 822694422
Change-Id: Ic2f7c7a3b85526d49eb98c19118e6936ccb4e0f7
2025-10-22 12:30:16 -07:00
Sam Haves ae33724de1 Set info string on wrap instead of tendon when wrapping a prim in the path.
PiperOrigin-RevId: 822688877
Change-Id: I04f5f5576cc0ed43e0ec77d5fccb19d2d23d7349
2025-10-22 12:13:53 -07:00
Sam Haves c060385505 Add section in mjcPhysics documentation for MjcTendon.
PiperOrigin-RevId: 822602481
Change-Id: Icf2b3accd323ee9506ca1838c9a2bfc0f0d159c7
2025-10-22 08:35:54 -07:00
Haroon Qureshi f217a8f987 Implement FetchPackage; a simple wrapper around FindOrFetch.
FetchPackage calls FindOrFetch, but sets USE_SYSTEM_PACKAGE to OFF
(i.e. do not find, just fetch). It also sets EXCLUDE_FROM_ALL.

PiperOrigin-RevId: 822565180
Change-Id: I70476f57b8d3371cefd02e840add279423913f3f
2025-10-22 06:43:51 -07:00
Sam Haves 160b9480f9 Add support for tendons to mjcPhysics.
PiperOrigin-RevId: 822230926
Change-Id: I232a9fbfb473186ac742d210458ff0221a561126
2025-10-21 12:30:12 -07:00
Sam Haves ac2cd5dfd6 Add support for querying of MjsTendon path from Python.
Fixes #2670

PiperOrigin-RevId: 822215254
Change-Id: Ice5a264e54f963776093511c6e4ac830aae6d4f8
2025-10-21 11:51:24 -07:00
Saran Tunyasuvunakool 2f65e23779 Add mj_extractState as a public API function.
This function allows the caller to extract a subset of components of a state previously obtained via `mj_getState` without having to first write it back into `mjData`.

PiperOrigin-RevId: 822165077
Change-Id: I6433261f4f5ec2e8d024bb7dee8f7dbf1e62666c
2025-10-21 10:01:22 -07:00
Kyle Bayes 25f5be82ff Provide option to disable keyboard events for SDL.
PiperOrigin-RevId: 822154396
Change-Id: Ie4c8537de2c4b01437aae00ed6d6af1a8f419a73
2025-10-21 09:36:16 -07:00
Taylor Howell 9e1ed0720b Revert PDF documentation update to .readthedocs.yml.
PiperOrigin-RevId: 822102488
Change-Id: I223757e80c00421c2ea37c3b30718c93b0a3cee8
2025-10-21 07:09:57 -07:00
Alessio Quaglino 056945df20 Enable frames to create the same children as bodies.
PiperOrigin-RevId: 822097998
Change-Id: I8477d8abe2d6f711421126825fd94d39af1a4e07
2025-10-21 06:57:01 -07:00
Sam Haves 09682ade4b Fix mjcPhysics island flag default.
PiperOrigin-RevId: 822088739
Change-Id: If3a87976dd319502160fd886a1823c12d72bebf1
2025-10-21 06:27:28 -07:00
Yuval Tassa 64add36adb Update documentation to be compatible with PDF generation
PiperOrigin-RevId: 822081040
Change-Id: I935b08751109e973398bc61c21f7217408983494
2025-10-21 06:02:53 -07:00
Alessio Quaglino 01d1ac34e0 Add quadratic interpolation to flex.
PiperOrigin-RevId: 822055781
Change-Id: Ibc252ac560de666b0b28f868e46b88d3ed92f67d
2025-10-21 04:36:36 -07:00
Sam Haves 59f14485e0 Move mjCWrap type to mjsWrap.
PiperOrigin-RevId: 821851540
Change-Id: I53382a8a21312a96aea46eec130f43e7cad70f92
2025-10-20 16:28:41 -07:00
David Hozic b19644bec9 Fix spelling errors 2025-10-21 01:21:47 +02:00
Matija Kecman 88ac02dad3 Add UI to visualize the State
PiperOrigin-RevId: 821641514
Change-Id: I41fd5602d0d52162b374149fb0080f6c387d7847
2025-10-20 07:32:41 -07:00
Haroon Qureshi e75c5aa83c Fix various include paths.
PiperOrigin-RevId: 821564663
Change-Id: Ic84489b7f3e1ba97810f60049dcf2f4a4d31edcf
2025-10-20 02:55:22 -07:00
Taylor Howell 36bed9a9da MuJoCo documentation in PDF format. Fixes #2736, #470.
PiperOrigin-RevId: 820682295
Change-Id: Ib9d6d53594c99a7e80af0fd3f1273ce44f831afd
2025-10-17 07:29:17 -07:00
Taylor Howell 85b5230dc0 MuJoCo Warp API documentation.
PiperOrigin-RevId: 820672892
Change-Id: I1339bdc4772560e69aa2c4b615825e7faffbe2ba
2025-10-17 06:59:19 -07:00
Taylor Howell bd8c921475 Update doc/conf.py.
PiperOrigin-RevId: 820636602
Change-Id: I20d8b44f9b933f14a72cb6e394be149bb459c552
2025-10-17 04:38:10 -07:00