Commit Graph

32 Commits

Author SHA1 Message Date
Yuval Tassa 822b03446c Improve pipeline documentation, expose mj_implicit function to public header.
PiperOrigin-RevId: 586380774
Change-Id: I3fafa563ebc852e17e1233288455b96f4499027b
2023-11-29 10:18:57 -08:00
Alessio Quaglino 9ae40e718e Define mj_multiRay bindings explicitly.
Fixes #1184.

PiperOrigin-RevId: 581956413
Change-Id: I6c611ac7537442a65e6961430ec724326ee6095a
2023-11-13 07:31:22 -08:00
Nimrod Gileadi 084facc9ab Python bindings: Store a reference to MjModel in MjDataWrapper.
Before this change, MjDataWrapper contained a custom data structure called MjDataMetadata, which contained the sizes of various arrays needed to create MjData. This was used for serialization and deserialization, as well as copying MjData instances.

This worked fine for native MuJoCo models, but as soon as plugins were used, there was information in the model that was needed and not available in MjDataMetadata. Since plugins are so general, keeping MjDataMetadata was untenable.

PiperOrigin-RevId: 578205355
Change-Id: I11b9ee797d1da5aaf1fecbbe170b3b0f1f1a3e6c
2023-10-31 09:16:40 -07:00
Alessio Quaglino 5a70ad08ab Add Flex component.
PiperOrigin-RevId: 572830650
Change-Id: I6908228087b7b9683be3506c8d9cdc725ed5dcd5
2023-10-12 10:49:35 +01:00
Saran Tunyasuvunakool be75dda8d1 Fix arena memory leak in _realloc_con_efc.
PiperOrigin-RevId: 567093603
Change-Id: I0a00da461b495cc13e54381862d740333a43f82b
2023-09-20 15:16:04 -07:00
Yuval Tassa 9902b73502 Rename mj_stackAlloc to mj_stackAllocByte.
PiperOrigin-RevId: 566351365
Change-Id: I91541168e83b05a730113661cc9f07985ac9ff0c
2023-09-18 10:53:35 -07:00
Saran Tunyasuvunakool daa2ac7f8b Rename nstack to narena, change it and pstack to count bytes.
PiperOrigin-RevId: 561066311
Change-Id: I4d0e645e6c254dd906bfc42159e0e99149a7c6c8
2023-08-29 10:13:33 -07:00
Kyle Bayes ed4bb2aab5 Change _Alignof to alignof in functions.cc
PiperOrigin-RevId: 558388811
Change-Id: I40f394d6dd05215a7499ede5903841a07cd1c9f0
2023-08-19 05:11:40 -07:00
Saran Tunyasuvunakool 488041d362 Add a private function for resizing contact and efc-sized arrays in Python.
This function is currently used for internal experimentation.

PiperOrigin-RevId: 558238153
Change-Id: I32eec8f13ac2d995e90c5421f2a157412e2148f2
2023-08-18 13:53:04 -07:00
Yuval Tassa 3e034e38b2 Add constraint island discovery
PiperOrigin-RevId: 557067599
Change-Id: Ic41e1d0efef02b7a79142518afe49cf9d4e74725
2023-08-15 02:30:05 -07:00
Yuval Tassa 5cfbb6ac8b Add mjd_quatIntegrate, expose mjd_subQuat.
PiperOrigin-RevId: 546252926
Change-Id: I7d6b2bd6536e7e8afc368f3c46037c20f6a1cb5e
2023-07-07 05:33:24 -07:00
Yuval Tassa c50c92ccc8 Add mjv_connector, identical to mjv_makeConnector but with a more convenient "from-to" parameterization.
PiperOrigin-RevId: 542343761
Change-Id: I75f5ff3c404a2a9f65dfed706e590efd7b951f6e
2023-06-21 13:19:36 -07:00
taylor howell b81dfbbc48 fix python type_error mj_differentiatePos, mj_integratePos 2023-06-14 12:19:58 -06:00
Yuval Tassa f67e359532 Add mjtState enum and related mj_stateSize, mj_getState and mj_setState functions.
PiperOrigin-RevId: 539667943
Change-Id: I14c34be8ce4c287e529380257b5c5bffc3ab45ce
2023-06-12 08:56:48 -07:00
Yuval Tassa 466c9aca82 Remove mj_activate and mj_deactivate.
PiperOrigin-RevId: 538799120
Change-Id: I4d6729131e20ab9ae15c94c221ba83ae5732e942
2023-06-08 08:55:39 -07:00
Alessio Quaglino dab49d487c Use mesh BVH for speeding up ray mesh intersection.
PiperOrigin-RevId: 532516008
Change-Id: Ia9cac060279d030221c1a6b4fad457a857701370
2023-05-16 11:10:38 -07:00
Alessio Quaglino 9d1a21f99d Use mesh BVH for speeding up ray mesh intersection.
PiperOrigin-RevId: 532464595
Change-Id: If159c89b93c24e6a7be6310911364cfad7baae81
2023-05-16 08:17:50 -07:00
Yuval Tassa b0bc330b54 Add utility functions for banded-then-dense symmetric matrices.
PiperOrigin-RevId: 528757637
Change-Id: I916d843140322c28e857100a6b305a041f704d53
2023-05-02 05:58:08 -07:00
Alessio Quaglino 2ad82d5998 Add mj_multiRay function to perform multiple ray intersection with the same source.
PiperOrigin-RevId: 528684535
Change-Id: I6e1747a4a0910e6061d6154e19ad8723f56c22e3
2023-05-01 23:02:45 -07:00
Yuval Tassa c50177d301 Add mjd_inverseFD for finite-difference approximations of inverse dynamics Jacobians.
Fixes #703.

PiperOrigin-RevId: 527899700
Change-Id: I10e41a381dcecf62c53b3b9aa72a4ce666161366
2023-04-28 09:04:41 -07:00
Saran Tunyasuvunakool 9ecade0707 Move plugin loading and scanning logic from Simulate to MuJoCo library.
PiperOrigin-RevId: 489020177
Change-Id: I1c29d931b47d5252e57e1d797cc7c17645859ffc
2022-11-16 13:15:51 -08:00
Alessio Quaglino fd4d47e4a5 Format memory warning in human-friendly way.
PiperOrigin-RevId: 486610408
Change-Id: I6beecb12059e69f4407e921d20efc54ce6b3f491
2022-11-07 02:56:07 -08:00
Yuval Tassa c83be2bc05 Add mju_clip, mju_fill, mju_eye and mju_symmetrize to python bindings.
- Also change signatures of `mju_fill` and `mju_symmetrize` to conform to standard.

PiperOrigin-RevId: 485613824
Change-Id: I8dd618bac92ef40aa6c76380fa73302e81968687
2022-11-02 09:22:28 -07:00
Alessio Quaglino e250ff0d5a - Added passive forces plugins
- Added new `cable` composite type:
  * The `initial` parameter specifies the joint at the starting boundary: `free`, `ball`, or `none`.
  * The boundary bodies are exposed with the names:`B_left` and `B_right`.
  * The vertex initial positions can be specified directly in the XML with the parameter `vertex`.
  * The orientation of the body frame **is** the orientation of the material frame of the curve.

- Added new `cable` passive force plugin:
  * Twist and bending stiffness can be set separately with the parameters `twist` and `bend`.
  * The stress-free configuration can be set to be the initial one or flat with the flag `flat`.
  * New cable example showing the formation of plectoneme.
  * New coil example.
  * New belt example showing interaction between twist and anisotropy.
  * Added test using cantilever exact solution.

PiperOrigin-RevId: 480033694
Change-Id: I491271bce8fccb185961477e903e5a72d172c8a3
2022-10-10 02:46:51 -07:00
Yuval Tassa f4e7fa97af Add mju_mulVecMatVec, mutiplies a square matrix M by a vector x on both sides. Returns x^T * M * x.
PiperOrigin-RevId: 474292806
Change-Id: I3432469dbe1f02ccf5a13241c7aa12d824cbe034
2022-09-14 08:05:28 -07:00
Yuval Tassa 8957976674 Add mju_boxQP solving box-constrained quadratic programs.
PiperOrigin-RevId: 474256629
Change-Id: I87d70fe6899608122fe0688b017420a3e81afae2
2022-09-14 04:31:34 -07:00
Yuval Tassa e3a82247c2 Add sensor matrices to mjd_transitionFD.
- Also add missing `mj_jacSubtreeCom` to Python bindings.

PiperOrigin-RevId: 471610181
Change-Id: I31410d194527ce6a7bdbd01e176f3a41efa52d84
2022-09-01 13:00:36 -07:00
Yuval Tassa 7b7cf0c27a Add mjd_transitionFD to Python bindings.
PiperOrigin-RevId: 468731887
Change-Id: I2152e10bc0f50a6c6a6b6832b1e7ef7c413976f7
2022-08-19 10:27:40 -07:00
Yuval Tassa b966a37855 Add optional azimuth and elevation to initial free camera.
- Add `azimuth` and `elevation` to `visual.global`.
- Add `mjv_defaultFreeCamera`.
- Use `mjv_defaultFreeCamera` in `simulate`.

PiperOrigin-RevId: 465505244
Change-Id: I61e60f14a990d4e2d220958adb75c325001978ee
2022-08-05 01:04:02 -07:00
Yuval Tassa 3d77eb1ef4 Add adhesion actuators.
- Adhesion actuators using contact normals as force transmission mechanism.
- Related video: https://youtu.be/HdBue4MUZys

Closes #229

PiperOrigin-RevId: 464389367
Change-Id: I9f69b3cd152d957e8f65870d208788463c036a6d
2022-07-31 08:54:06 -07:00
Kevin Zakka 6048a55daf Add intvelocity actuator shortcut.
PiperOrigin-RevId: 454899823
Change-Id: I9b5494baacfab5a7d03bd680d0ded06a7790e75e
2022-06-14 10:36:58 -07:00
Saran Tunyasuvunakool 3577e2cf8b Version 2.1.2: Python bindings, OBJ assets support, bugfixes.
PiperOrigin-RevId: 434731612
Change-Id: I0cfda3e7a3d1c72036764986efc252ffa1b8c6b0
2022-03-15 14:04:44 +00:00