Commit Graph

996 Commits

Author SHA1 Message Date
Google DeepMind 37d7591ce0 Add support for user-defined figures in the MuJoCo viewer.
PiperOrigin-RevId: 726983516
Change-Id: Ifb821f3cafb163d4f3077d76b0668037b4bc5a9c
2025-02-14 10:45:47 -08:00
Tom Power 89253d957d Changes to inertia inference from meshes.
PiperOrigin-RevId: 726051033
Change-Id: I6edfc118280d103a2dd9d07f29f0094858769761
2025-02-12 07:43:13 -08:00
Yuval Tassa ef1ef8ef6a Fix Sphinx-Toolbox dependency issue in documentation.
PiperOrigin-RevId: 725818375
Change-Id: I9f241f9575d4bebceeab62937caf682e455b3816
2025-02-11 16:41:02 -08:00
Google DeepMind ac2a324fbd Reduce "shadow acne" artifacts
PiperOrigin-RevId: 725640931
Change-Id: I95df97d6076b99c12e291f69e8e54bbe70538293
2025-02-11 08:28:12 -08:00
Alessio Quaglino cef5b31a3f Drop find_ prefix in Python MjSpec methods accessing elements by name.
PiperOrigin-RevId: 725594833
Change-Id: Ibf8a9918e98b298751d0ef2e657714e28e5fa460
2025-02-11 05:50:49 -08:00
Yuval Tassa a6dd5f086f Document element name lookup in MjSpec.
PiperOrigin-RevId: 725258206
Change-Id: I5c9a85d25787eb38e9e8c3854eda2581700e188e
2025-02-10 10:10:41 -08:00
Yuval Tassa f73f0e1d0d Fix aspect ratios of embedded videos in docs.
Note that small videos, for some reason, need an aspect ratio that is different  from the actual aspect ratio.

PiperOrigin-RevId: 724879307
Change-Id: I681f071baf4eb09cfda41edeca0d1ee16be4181a
2025-02-09 03:33:10 -08:00
Yuval Tassa 5ee0654830 Roll back recent change to mjData.qLD until some issues are resolved.
PiperOrigin-RevId: 724389161
Change-Id: I1b30ab0950ab5c5e611b1c6fc3bf3f42f964939c
2025-02-07 10:21:42 -08:00
Alessio Quaglino 06758e35ab Fix mjSpec colab after changing the default behavior of attach to be a shallow copy.
PiperOrigin-RevId: 724375710
Change-Id: I5fac7d24c1d0b1ad4d427c021022c47620accf53
2025-02-07 09:41:03 -08:00
Yuval Tassa c27d3758c2 Convert qLD to CSR format.
PiperOrigin-RevId: 723955038
Change-Id: I30c3dc7f59739e89ae5fff8841432bc74717ec1b
2025-02-06 08:59:35 -08:00
Copybara-Service 2680bd3e8b Merge pull request #2395 from hartikainen:main
PiperOrigin-RevId: 721367039
Change-Id: Icb79cb50c2a07e5f10fdece3edc52b40cdcdfbac
2025-01-30 06:28:44 -08:00
Baruch Tabanpour e0664b1bb8 Fix bug with box-box #2356.
PiperOrigin-RevId: 721138760
Change-Id: Ib9548b0bc505a9856176188c91858cff7c9accdf
2025-01-29 16:00:29 -08:00
Kristian Hartikainen 0fda5344c2 Fix typos 2025-01-29 15:31:39 -05:00
Alessio Quaglino 7cdf180641 Introduce trilinear flex parametrization.
These flexes use only 24 DOFs (3 per vertex of the bounding box), while colliding with the full high resolution mesh.

On an 8x8x8 cube, the performance using DOFs at all vertices is

```
 Simulation time      : 18.74 s
 Steps per second     : 533
 Realtime factor      : 0.53 x
 Time per step        : 1874.4 µs

 Contacts per step    : 114.88
 Constraints per step : 3322.51
 Degrees of freedom   : 1536
```

With the new implementation, it is the following:

```
 Simulation time      : 1.82 s
 Steps per second     : 5507
 Realtime factor      : 5.51 x
 Time per step        : 181.6 µs

 Contacts per step    : 38.84
 Constraints per step : 155.36
 Degrees of freedom   : 24
```

PiperOrigin-RevId: 721008829
Change-Id: I833df027527db578d86667cc4b24295bcf6f7d22
2025-01-29 09:38:22 -08:00
Kevin Zakka 1a4b821b6b [doc] Tweak language in asset dict paragraph.
PiperOrigin-RevId: 720994183
Change-Id: Ib99cc3fdd02eefdb2d78d7ac5adf36293c001062
2025-01-29 08:51:26 -08:00
Kevin Zakka f61973601e [docs] Mention asset lookup in MjSpec construction.
PiperOrigin-RevId: 720671094
Change-Id: I6ba343b37893620ba4f3477e57daa4876805156c
2025-01-28 12:33:55 -08:00
Taylor Howell f4096bcab9 Add sphere and cylinder internal wrapping for spatial tendons to MJX.
PiperOrigin-RevId: 720507688
Change-Id: I49fda2839e68623ff5e1f3c46bdc3d77acfc36ef
2025-01-28 03:22:14 -08:00
Yuval Tassa 8c22181156 Fix documentation typos.
PiperOrigin-RevId: 720232771
Change-Id: I176db4d4168c37b2819df14b439c4cde838e2025
2025-01-27 10:58:22 -08:00
Google DeepMind 4ab274aea9 Fix missing arg for mj_compile in model-editing doc example code.
PiperOrigin-RevId: 720005405
Change-Id: Idf71a1a12fe4cfcc450cd80c91b13ee8a75e1636
2025-01-26 20:25:50 -08:00
Yuval Tassa 0090e1e908 Rename rollout variable nroll to nbatch.
PiperOrigin-RevId: 718196100
Change-Id: Ic36b1a96ea1af2de351539115d4eee051d195aaf
2025-01-21 21:04:15 -08:00
Yuval Tassa 67dd4827a6 Improve printing of inertia-like matrices, allow mj_printData to take const mjData*
PiperOrigin-RevId: 718176884
Change-Id: I057dabe6973e19db86e9ff9ce4430c6d17dfce2b
2025-01-21 19:59:45 -08:00
Alessio Quaglino 4bb6aeb19f Change site and frame attach API.
Old API:
```
site.attach(child_spec)
frame.attach(child_spec)
```

New API:
```
parent_spec.attach(child_spec, frame=frame_name_or_object)
parent_spec.attach(site_spec, site=site_name_or_object)
```

This enables accessing the parent object during attach, which will be used in a follow-up CL to automatically append the child assets to the parent.

PiperOrigin-RevId: 717908589
Change-Id: I0fb27e99694c954cb8ba8a8c98484ffd53a4d6db
2025-01-21 07:29:27 -08:00
Copybara-Service e2b1cfc3a8 Merge pull request #2249 from Balint-H:docs/unity-tutorial
PiperOrigin-RevId: 717294302
Change-Id: Ief98bd6cd4eac448062e331b6737043f12926ad2
2025-01-19 13:01:07 -08:00
Yuval Tassa f13c107cd7 Workaround to doc build error caused by sphinx-toolbox bug.
See issue for details: https://github.com/sphinx-toolbox/sphinx-toolbox/issues/176

PiperOrigin-RevId: 717282405
Change-Id: I9e02804a3571fcca74eb7f174f3c3e262b0d3b65
2025-01-19 11:58:52 -08:00
Bálint Hodossy 203e9bc292 Remove trailing spaces 2025-01-19 13:24:36 +00:00
Yuval Tassa b2d353d062 Document default visible geom groups in XMLreference.
PiperOrigin-RevId: 717050528
Change-Id: I0414495d2f5a17ac2d8ba35c9353ecf0b7e8a18d
2025-01-18 12:42:01 -08:00
Yuval Tassa 463bc47633 Clarify that equality constraints defined using the body-based semantic are assumed to be satisfied at `mjData.qpos0`.
PiperOrigin-RevId: 717050088
Change-Id: I02e82cab5a60f0af48f7f921ba9bca11837f8063
2025-01-18 12:39:40 -08:00
Yuval Tassa 69c66aa1bb Fix typo.
PiperOrigin-RevId: 716820809
Change-Id: I51f8608f0c01f4fc8016b4be779d98c8972bc913
2025-01-17 15:39:56 -08:00
Yuval Tassa 240a7afdee Add sensors for potential and kinetic energy.
PiperOrigin-RevId: 716775375
Change-Id: Ic8ab7f1a51df970ab551dabe7c797cde13cd97fd
2025-01-17 13:10:12 -08:00
Yuval Tassa 71e5e376bc Remove units from zero valued size in CSS, fix a typo.
PiperOrigin-RevId: 716345043
Change-Id: I22b28e8e1d6db8ae4e482541169f1ffc46d3db34
2025-01-16 12:55:21 -08:00
Bálint Hodossy 394cc61192 Use RST links throughout the Unity doc. 2025-01-16 14:33:08 +00:00
Saran Tunyasuvunakool 26bac8c8af Fix changelog.
PiperOrigin-RevId: 716194356
Change-Id: I23e1717867847c342d7bac82d2fae7d26df48473
2025-01-16 05:21:35 -08:00
Alessio Quaglino c2138c3fb0 Do not copy the spec during attach.
Use a reference count for managing the memory.

PiperOrigin-RevId: 716169486
Change-Id: Id270c4858c17b9250115e9544d5ea143584e2d5f
2025-01-16 03:53:17 -08:00
Gabe Oppenheimer 6436055c6c Update the version number to 3.2.8 following the 3.2.7 release.
PiperOrigin-RevId: 715870970
Change-Id: I9fc9a09d959043f3029faa7296a717ea56f75c89
2025-01-15 11:13:27 -08:00
Alessio Quaglino 05d4c3d670 Add mjs_getParent to retrieve the parent body of an object.
PiperOrigin-RevId: 715794859
Change-Id: Ib9792787cdb966f579938dde3f94ebabca8ef1fc
2025-01-15 07:42:43 -08:00
Gabe Oppenheimer 61973a33c9 Update eigen3 and the changelog ahead of the 3.2.7 release.
PiperOrigin-RevId: 715467319
Change-Id: I4a6a168bc981c976890c46b784e94805afc86323
2025-01-14 11:51:12 -08:00
Yuval Tassa d4ca66a47b Allocate dual-solver memory inside mj_projectConstraint, no more than required.
PiperOrigin-RevId: 714093658
Change-Id: Id7e710c5dffd24871019a72a7bf2aa6eb3f7a36e
2025-01-10 10:19:13 -08:00
Yuval Tassa 2409a6e537 Add mjData.nA the number of non-zeros in the constraint inverse inertia matrix.
PiperOrigin-RevId: 714076988
Change-Id: I4c323a6e81dfb23f7972b662719bbcb688bacf4a
2025-01-10 09:23:55 -08:00
Copybara-Service 6f7fba794b Merge pull request #2336 from xela-95:patch-2
PiperOrigin-RevId: 713991183
Change-Id: I0869a068f463513e89fe2f88bca4b82177cfffa3
2025-01-10 03:46:20 -08:00
Copybara-Service d3a0c28457 Merge pull request #2334 from jjyyxx:patch-3
PiperOrigin-RevId: 713952754
Change-Id: Ic388f4dc05389fbe3e5a20b365b27f800d4147ab
2025-01-10 01:12:43 -08:00
Yuval Tassa b0f885ead0 Minor edits to the Programming/Simulation docs page.
PiperOrigin-RevId: 713952376
Change-Id: I5b7230a001bd49954d401846f40cd122ee4e748c
2025-01-10 01:11:27 -08:00
Saran Tunyasuvunakool 40ef08c8ed Don't pollute the global namespace when using mjpython.
Fixes #2265

PiperOrigin-RevId: 713442833
Change-Id: If155d9f57d4deef8b848478ebd8077a00417d5c5
2025-01-08 15:48:20 -08:00
Alessio Quaglino 6654d63438 Add spec lookup in the attached spec array using the compiler option pointer.
This enables to find the spec associated with the compiler option stored in the objects, which do not necessarily belong to the model that owns them.

PiperOrigin-RevId: 713259419
Change-Id: I579c770147ff07ed2a5edd20e7a795ee7cc27147
2025-01-08 05:44:00 -08:00
Alessandro Croci 7a6bf06706 Update simulation.rst
Add missing backticks to `mjData.xfrc_applied`
2025-01-08 14:27:46 +01:00
Alessandro Croci 661c3e01dc Update simulation.rst
Add missing backticks to `mjData.mocap_quat` in simulation.rst
2025-01-08 14:21:24 +01:00
Yuxuan Jiang df1d15fa38 Fix typo in modeling.rst 2025-01-08 09:53:36 +08:00
Alessio Quaglino f607d9554e Check that there are no pending keyframes while writing a spec.
This can happen when a body is detached without compiling or recompiling.

Also added error catching when trying to delete a body instead of detaching it.

Fixes #2327

PiperOrigin-RevId: 712526730
Change-Id: I4b48df83120fca12d475c85b3a54893841449653
2025-01-06 07:50:30 -08:00
Yuval Tassa b5df2c10bf Remove mjData.C_diag, no longer required as C is now lower triangular.
PiperOrigin-RevId: 712514204
Change-Id: I8293f65ebc09c6a8fed76b0e59d2e2a667e01a43
2025-01-06 06:58:19 -08:00
Alessio Quaglino ee6f4837f3 Auto-generate 3D mesh from convex OBJ if dim=3 in flex.
This requires the user to explicitly specify an origin.

PiperOrigin-RevId: 712483526
Change-Id: Ie316a5eccb676bb918d4bb746795019145c10f5b
2025-01-06 04:35:59 -08:00
Bálint Hodossy 364ab5947d Fix typo 2025-01-04 11:21:54 +00:00