Commit Graph

372 Commits

Author SHA1 Message Date
Saran Tunyasuvunakool db1d51a1f5 Add more fields to mjx.Option and mjx.Statistic for MuJoCo compatibility.
Also add metadata fields to the Python bindings of mjModel and mjOption,
and fix dtype of a number of fields.

PiperOrigin-RevId: 654138876
Change-Id: If2bbe41bf3dfdb350d60b5289afc65fffb397ce9
2024-07-19 15:13:01 -07:00
Tom Erez 796173170c Add support in mjModel for tagging textures with different roles, and use the slot index of a texture to designate its role.
PiperOrigin-RevId: 654030065
Change-Id: I34a5b132a7f91a6bb8f260500c1b9c128a03b596
2024-07-19 09:29:22 -07:00
Tom Erez e92af73cbf Add mjmodel support for textures with different number of channels.
PiperOrigin-RevId: 653974959
Change-Id: Ia280e0bdb21027646249f104f21bedee792ba7e5
2024-07-19 05:22:19 -07:00
Alessio Quaglino 70ac76bb4b Add assets to MjSpec.compile()
PiperOrigin-RevId: 653965318
Change-Id: Ib9ec1c70a7241f7ee547b799a08cc58e7d4bace7
2024-07-19 04:34:38 -07:00
Alessio Quaglino 384ed8097a Various fixes in mujoco/usd
PiperOrigin-RevId: 653610253
Change-Id: Ibe57c19c6a7326266f51c5cda39cd564bd456c54
2024-07-18 07:20:28 -07:00
Saran Tunyasuvunakool 7f46e936f6 Update setuptools to version 70.3.0.
Addresses CVE-2024-6345.

PiperOrigin-RevId: 652857861
Change-Id: Iea5f6cb58b825b226ba61d259775ddbee05acd6d
2024-07-16 08:38:56 -07:00
Gabe Oppenheimer 22ce22ac8a Update the MuJoCo version number ahead of the 3.2.0 release.
PiperOrigin-RevId: 652578624
Change-Id: I8ed6f66ff1247ff7421e3ed0521cf15e1c0b6c79
2024-07-15 13:16:06 -07:00
Gabe Oppenheimer cb4cb7d09b Update version hashes in MuJoCo CMake files ahead of the 3.2.0 release.
PiperOrigin-RevId: 652555501
Change-Id: I4279ea670e837414adbfc69f6e1e96a4c635f17d
2024-07-15 12:00:25 -07:00
Alessio Quaglino 5d51b4cd5f Check that element is a nullptr before casting.
The bug was caused by the fact that the `mjs_as*` functions would return a pointer to a `mjC*` object, even if the input `mjsElement` pointer was null. This would cause a segfault.

PiperOrigin-RevId: 651802736
Change-Id: Ibec00d269a4befadff8a68e0513fd381c7e38a2a
2024-07-12 09:46:16 -07:00
Richard Levasseur a0df72f43f Raise memory limit so test passes with dynamic linking
The memory leak test fails with `RAW: mmap error: 12` when dynamic
linking is enabled. This is probabably because
of the additional memory overhead dynamic linking incurs. Raising it slightly
appears to satisfy the test.

Tested:
    TAP --sample ran all affected tests and none failed
    http://test/OCL:650692833:BASE:650634362:1720548680801:c55c6a68
PiperOrigin-RevId: 651750900
Change-Id: Ia63d153b326ff7451391789e2d7cae50a62be723
2024-07-12 06:10:37 -07:00
Nimrod Gileadi e7301edd20 Copy arena contents in mj_copyData.
Fixes #1710.

PiperOrigin-RevId: 651351384
Change-Id: I56e3204b30bb18f48278117e85e90464177da973
2024-07-11 03:54:44 -07:00
Copybara-Service 60afda949c Merge pull request #1714 from abhihjoshi:tendons
PiperOrigin-RevId: 651048034
Change-Id: If5b7cb55ff0007c3c6f932e62f068d1168778a33
2024-07-10 09:26:54 -07:00
Yuval Tassa 9d0812911c Add a test for type attribute.
PiperOrigin-RevId: 649635359
Change-Id: Ibe5d9fcb5f14371e5f154d645b838a9d012331d5
2024-07-05 06:16:46 -07:00
Abhishek Joshi e734527e7b Fixing formatting for USD scripts 2024-07-04 16:25:44 -05:00
Abhishek Joshi fcb247e35b Merge remote-tracking branch 'upstream/main' into tendons 2024-07-04 15:10:29 -05:00
Abhishek Joshi c79ae6f242 fixing frame rate bug in demo file 2024-07-04 15:06:25 -05:00
Saran Tunyasuvunakool d029e4ff99 Get rid of unnecessary return value policy specification.
PiperOrigin-RevId: 649437250
Change-Id: I61f8db0af526ebf667244124fcd4984881c6ef13
2024-07-04 09:45:22 -07:00
Yuval Tassa 47d25bc4ac Add missing id attributes in Python bindings of mjsElements.
PiperOrigin-RevId: 649435098
Change-Id: I16383958c25cb8fdc16a107d5abef8626a675632
2024-07-04 09:32:33 -07:00
Kyle Bayes 57e6760ec9 Re-implement VFS internals in C++, removing the constraints of the previous implementation.
PiperOrigin-RevId: 649433087
Change-Id: Icaa3e6b7f2ef14f56b04fef2f4360b46d8b5f022
2024-07-04 09:22:23 -07:00
Yuval Tassa 118b6810b3 Make "id" a property rather than a method of mjsElements in Python bindings.
PiperOrigin-RevId: 649424035
Change-Id: I8226b3040aa2001ae9748399257e36ac263b7c8b
2024-07-04 08:35:37 -07:00
Alessio Quaglino a0945e4b5a Add non-tree element lists to python bindings.
Fixes #1752.

PiperOrigin-RevId: 649405039
Change-Id: Ie0b575a3ec912b773141694397ac2f394bff1227
2024-07-04 07:24:02 -07:00
Abhishek Joshi 59303bb161 Fixing formatting for usd files and adding pylint configuration 2024-07-03 18:32:59 -05:00
Alessio Quaglino 9107d3b507 Add mjs_findKeyframe.
PiperOrigin-RevId: 649036650
Change-Id: If514d5c333dd6084af9509324fd658c72576d7b5
2024-07-03 05:17:41 -07:00
Yuval Tassa 8f16b72f44 Rename mjSpec.euler to eulerseq to match MJCF.
PiperOrigin-RevId: 649007737
Change-Id: Iedb53c1d8a6e6a082a6ba30a1fb2bb4516839fa1
2024-07-03 03:10:02 -07:00
Tom Erez df7ea3ed33 Add support for multiple textures in one material (mjModel).
PiperOrigin-RevId: 648732764
Change-Id: I29b60dd62a069789a32017ff0d55e36b57e0052b
2024-07-02 08:50:23 -07:00
Tom Erez 3b73dfe33b Add textured materials to render context, and refactor mjvGeom to refer to those textures.
PiperOrigin-RevId: 648719103
Change-Id: Idb4425bdeea3cbc1133cda3e4366574ed3bb5ccc
2024-07-02 08:01:40 -07:00
Copybara-Service 0676ad499f Merge pull request #1769 from fanminshi:renderer_context
PiperOrigin-RevId: 648508835
Change-Id: Ice87cd1221723ed44ba0ddca97b6aac245dd8975
2024-07-01 15:48:41 -07:00
Alessio Quaglino 9106f40e2b Add mjSpec bindings.
Co-authored-by: Saran Tunyasuvunakool <stunya@google.com>
PiperOrigin-RevId: 648444641
Change-Id: I08ee1d3f4fae1efbc7934ba94702b1c06d8cb92a
2024-07-01 12:05:50 -07:00
fanmin shi 521922f133 Use Renderer context manager format in tutorial.py 2024-06-30 22:44:17 +00:00
Yuval Tassa 62e2842116 Skip deprecated mju_rotVecMat and mju_rotVecMatT in Python bindings.
PiperOrigin-RevId: 647275284
Change-Id: I371236182b22eb399041959901085bb82af3f670
2024-06-27 05:06:01 -07:00
Nimrod Gileadi 2188cba4cd Fix a memory leak when copy.deepcopy(data) is called.
In MjDataWrapper.__deepcopy__ use the Python implementation of MjModelWrapper.__deepcopy__ to make an object that Python knows about and can release later.

Fixes google-deepmind/mujoco#1572.

PiperOrigin-RevId: 644967999
Change-Id: I95d093c672e136122e1939f69463a4d29dad82e8
2024-06-20 03:46:16 -07:00
Google DeepMind c8cc2d51b0 Allow the viewer handle to return the mjModel/mjData objects from the simulation.
PiperOrigin-RevId: 643982026
Change-Id: Ida5ccb851c46f7352e724798738006be6badad0a
2024-06-17 06:12:22 -07:00
Abhishek Joshi 09b00cec5d updating rotation matrix function for shapes 2024-06-17 12:37:10 +05:30
Abhishek Joshi ea128c15de Merge branch 'google-deepmind:main' into tendons 2024-06-16 23:40:10 -05:00
Yuval Tassa 6067048537 Deprecate mju_rotVecMat and mju_rotVecMatT in favor of mju_mulMatVec3 and mju_mulMatTVec3.
These functions names and argument ordering are more consistent with the rest of the API.

PiperOrigin-RevId: 643788290
Change-Id: I783eda8021b80b82098e23ed95669b102bb82508
2024-06-16 10:02:36 -07:00
Abhishek Joshi 64b64f4169 clearing init file 2024-06-13 19:50:35 +05:30
Yuval Tassa c9bcf8371e Add mj_setKeyframe function to save current state in k-th model keyframe.
Fixes #1719.

Also improve documentation of `mju_sigmoid`, was previously only documented in changelog.

PiperOrigin-RevId: 642637458
Change-Id: I811a0bf8f881c8b76c9a62d2faec8fdec4e7585b
2024-06-12 09:22:52 -07:00
fanmin shi a660051a4c Consistent spacing in python/tutorial.ipynb 2024-06-11 21:07:52 -05:00
Yuval Tassa 07fc95ca9a Add orthographic cameras.
Orthographic cameras are specified by setting the `orthographic` attribute of the `<camera>` element. The `fovy` attribute is still used to specify the field-of-view, but its semantic is different for orthographic cameras. For orthographic cameras, the field-of-view is expressed in units of length, rather than degrees.

Other related changes:

* Fix bug in the ordering of `cam_xxx` elements in `mjModel`.
* Make camera visualization translucent only when the frustum is visualized.
* Added a button to `simulate` to toggle between perspective and orthographic free cameras.

https://youtu.be/ZXBTEIDWHhs

PiperOrigin-RevId: 642293435
Change-Id: Id090a421ad88ab404b5b27ddbbd6bfc81ad49bc5
2024-06-11 09:23:18 -07:00
Meghha Dhoke 1bf90af0e0 Bumping mjVERSIONSTRING from 3.1.6 to next version 3.1.7
PiperOrigin-RevId: 639959152
Change-Id: I7b88bae6ea56b0173f00c6f0899ba4a156614f01
2024-06-04 15:27:47 +01:00
Abhishek Joshi 428ec9caaf fixing imports 2024-06-03 11:38:13 -05:00
Abhishek Joshi 0cfdc89c5b Merge branch 'google-deepmind:main' into tendons 2024-06-03 11:14:21 -05:00
Abhishek Joshi ee82810ad3 removing temp.py 2024-06-02 21:17:23 -05:00
Abhishek Joshi ba842fc0d1 decoupling tendons to subcomponents and fixing tendon scaling issue 2024-06-02 21:16:58 -05:00
Abhishek Joshi 1bbf44c99a adding resolution parameter 2024-05-27 10:26:17 -05:00
Kevin Zakka f0b633de6a Fix typos in least_squares notebook.
PiperOrigin-RevId: 635696410
Change-Id: Iba9a2c8f121ca4994678ba933e19dce5323da27b
2024-05-20 23:48:39 -07:00
Kyle Bayes d58010c3b9 Update numpy sha256 hash in build requirements.txt.
PiperOrigin-RevId: 634546683
Change-Id: I319be1fab020dff2b44658ea402684a268ec6a33
2024-05-16 15:24:14 -07:00
Yuval Tassa 02d015458c Add mj_geomDistance API function and sensors for geometric distance, normal direction and segment between between two geoms. Fixes #51
PiperOrigin-RevId: 632458301
Change-Id: I65b7e5bb0df59008028114cf4a07e0d6365ff3d3
2024-05-10 04:52:43 -07:00
Yuval Tassa 31de1dad9d Update requirements.txt for mujoco and mjx.
PiperOrigin-RevId: 632441444
Change-Id: Ia9ff35b453476b2f1f5a7a8facc819a8925dcd8b
2024-05-10 03:30:53 -07:00
Abhishek Joshi bb2c7ae556 adding initial tendon logic 2024-05-09 08:42:29 -05:00