Commit Graph

144 Commits

Author SHA1 Message Date
Yuval Tassa e14aebfd16 Expose mju_sparse2dense to public API.
PiperOrigin-RevId: 688985153
Change-Id: I9559f1d47363d0afada80c86abdc729cd1910b63
2024-10-23 09:01:25 -07:00
Alessio Quaglino dcf2816543 Remove copy_back from Python bindings and mj_copyBack from the C API.
PiperOrigin-RevId: 687377331
Change-Id: I355493d92857418b08b5aa90ea38cebe5c475314
2024-10-18 11:55:04 -07:00
Google DeepMind ffdb800e45 Update the MuJoCo version for the 3.2.5 release following the 3.2.4 release.
PiperOrigin-RevId: 686641388
Change-Id: I68d5183c9d369b7617f692ab97c12c53f0d2504c
2024-10-16 14:24:06 -07:00
Gabe Oppenheimer c2024ef6d1 Update the MuJoCo version for the 3.2.4 release.
PiperOrigin-RevId: 686261295
Change-Id: Ib59e44a6829a79fd480f2822a68cb05f94c38732
2024-10-15 15:34:09 -07:00
Alessio Quaglino 766cd20273 Add mjs_bodyToFrame() to convert a body to a frame.
Also add test for attaching the world body.

PiperOrigin-RevId: 685603933
Change-Id: I3cfe7d226d6f032b5a587e44d0f4f18207977188
2024-10-14 00:39:20 -07:00
Alessio Quaglino cdb167f275 Add mjs_attachToSite for attaching a body to a site.
PiperOrigin-RevId: 684432183
Change-Id: I7100bebfb6521f9dbfbb07f31490b2b9298bf18c
2024-10-10 07:12:49 -07:00
Alessio Quaglino a26ba2012e Return 0 on success from mjs_activatePlugin instead of using mju_error.
PiperOrigin-RevId: 684102823
Change-Id: I86b7702094ae886539e1dfb6294381952d507bc1
2024-10-09 11:09:33 -07:00
Alessio Quaglino 1f9dca8bc4 Do not expose plugin_slot.
PiperOrigin-RevId: 683215401
Change-Id: Ic64f7221ed83ca3b0c8cca16eb680ea67c67b564
2024-10-07 09:38:01 -07:00
Alessio Quaglino 6e66cafe76 Capture mjs_attach error message in the Python bindings.
PiperOrigin-RevId: 682409212
Change-Id: I391ee48626e7dcd985f65a231370ef5ec16124d7
2024-10-04 12:19:42 -07:00
Alessio Quaglino 89aea5e217 Add body.find_all() to Python bindings.
This enables to generate a list of all body children of a given type.

Also, add recursive option to mjs_firstChild and mjs_nextChild. Fixes #2112.

PiperOrigin-RevId: 681039348
Change-Id: Iebbb26fd5ec314150206edfdddd88633baa0bec6
2024-10-01 08:57:25 -07:00
Alessio Quaglino 6832df3091 Replace mjs_setActivePlugins with mjs_activatePlugin.
PiperOrigin-RevId: 680613007
Change-Id: Ic03e0dc42a1f5f083e313672bc6e3ccebadc58b3
2024-09-30 09:46:47 -07:00
Alessio Quaglino 25e4d75a07 Return attached body/frame in mjs_attachBody/Frame.
PiperOrigin-RevId: 679601525
Change-Id: Icdc4616808e14bf0a3ebc17d89392382d084c31b
2024-09-27 08:34:00 -07:00
Yuval Tassa 41ea95f077 Add a section for element casting in the function API reference, move these functions to the end.
PiperOrigin-RevId: 677783917
Change-Id: I5042e7df20f2a2e0ecfe01a85a1969ccfc2307cd
2024-09-23 07:26:01 -07:00
Alessio Quaglino 0ba11b9623 Add plugins list to mjSpec Python API.
Fixes #2061.

PiperOrigin-RevId: 677762985
Change-Id: I8e407373e7b505d9b0f1c023e97c5ea92169bbf6
2024-09-23 06:13:42 -07:00
Yuval Tassa be00fafc43 Various documentation improvements.
- Replace two "below" instances in `XMLreference.rst` with proper links (there are many more that need fixing).
- Discuss friction cones and 32-bit floats in Performance Tuning.
- Delete Damping subsection in Tips and Tricks, no longer relevant after the introduction of the implicit/fast integrators.
- Simplify discussion of free bodies, mention free joint alignment.
- Clarify frame used by kinematic Jacobians.

PiperOrigin-RevId: 672615057
Change-Id: Ib59b71e3c09cdd13415519fc4a964131b155718f
2024-09-09 11:36:07 -07:00
Kyle Bayes 81618f95f9 Update doc for mj_addFileVFS and mj_addBufferVFS as VFS is no longer memory limited.
PiperOrigin-RevId: 671087960
Change-Id: I0b022554f4f47fe2e64c8201cd855b63d514c344
2024-09-04 13:51:43 -07:00
Yuval Tassa b502ceef00 Add note that XML saving requires that the spec first be compiled. Fixes #1832
PiperOrigin-RevId: 671046666
Change-Id: If5885545d5316537147d293fbe854caa568558b2
2024-09-04 11:47:34 -07:00
Yuval Tassa 8954a088ce Add automatic free-joint alignment.
PiperOrigin-RevId: 671010083
Change-Id: Ib7d60f75c7f545b1886703715663db8de77feeef
2024-09-04 10:07:33 -07:00
Alessio Quaglino d3dfa6f970 Add mjs_findElement() to find any element in a spec by name.
Also, remove mjs_findMesh() and mjs_findKeyframe().

PiperOrigin-RevId: 670978980
Change-Id: Id88b800eb8a4c5efc40866f72a4442bf1d1437d0
2024-09-04 08:24:22 -07:00
Yuval Tassa 2d3d5415b7 Add mj_jacDot: Time derivative of kinematic Jacobian.
PiperOrigin-RevId: 670505417
Change-Id: Icf30cff5dc955e002bd2f5d5fb3a04f8388d0780
2024-09-03 04:49:47 -07:00
Alessio Quaglino 505d01a1c1 Add error handling to mj_recompile.
This CL adds error handling to the mj_recompile function. If the recompile fails, the function will return -1 and set the error message in the spec. The Python wrapper for mj_recompile will catch the error and raise a ValueError exception.

PiperOrigin-RevId: 666784579
Change-Id: I225eca1769ea839c782be3c03fc4ff1ea5885a48
2024-08-23 07:18:28 -07:00
Yuval Tassa 8b03daa09b Add mjtSameFrame enum to specify frame alignment of bodies with their children.
PiperOrigin-RevId: 666303674
Change-Id: I53dc56e1ca52afa280ae5abaf4158edc465fb1e0
2024-08-22 05:17:06 -07:00
Yuval Tassa 5d91231d31 Rename mjBuffer to mjByteVec.
PiperOrigin-RevId: 664872558
Change-Id: I7b003374c390958667635fb21089faf2ece54b14
2024-08-19 10:40:26 -07:00
Alessio Quaglino cfc7dc9848 Clarify that keyframes are not replicated in nested attachments.
PiperOrigin-RevId: 663683684
Change-Id: Id180b3a6afad6809d8189a7a525c474bd3a91fc1
2024-08-16 04:22:21 -07:00
Yuval Tassa 2cb601c98d Improve documentation w.r.t smoothness, differentiability and finite-differencing.
PiperOrigin-RevId: 662848709
Change-Id: Icb7dc03a2c53d43d0d3a9e4ac95d963e5bc6853c
2024-08-14 03:11:38 -07:00
Alessio Quaglino 851bb6eef4 Add option to mjspec for creating a texture directly from a buffer.
PiperOrigin-RevId: 662186527
Change-Id: I469c876681d52964ac971c0bb2ec3517224d3a3d
2024-08-12 12:29:08 -07:00
Taylor Howell 2c56946547 Increase mjVERSIONSTRING to 3.2.3 after release.
PiperOrigin-RevId: 660891033
Change-Id: I2bda69d11cab60a83b0c77bb53214240eacaea62
2024-08-08 10:31:57 -07:00
Gabe Oppenheimer ebc48d2783 Update the MuJoCo version to v3.2.2 following the 3.2.1 release.
PiperOrigin-RevId: 660036707
Change-Id: I7e649e5a0ce6db863bcb99dc4fc1aa851b3f5140
2024-08-06 11:39:30 -07:00
Kyle Bayes 5287359022 Update docs for VFS.
PiperOrigin-RevId: 659968022
Change-Id: I3b6c9befc8ca0dacaee5ef6da34d537dd439b7f3
2024-08-06 08:33:21 -07:00
Taylor Howell 20011a2f53 Disable RK4 integrator in mjd_transitionFD by throwing an error and improve documentation for mjd_transitionFD and mjd_inverseFD.
PiperOrigin-RevId: 659492713
Change-Id: I84ab7ebfba34742f239f60311d8f0a55559995fb
2024-08-05 03:18:31 -07:00
Gabe Oppenheimer d538bf994d Update version to 3.2.1 following the 3.2.0 release.
PiperOrigin-RevId: 658412236
Change-Id: I4bd6ccb5dee18059eb6fc0d187afe62598845793
2024-08-01 08:35:42 -07:00
Google DeepMind 70d70bc3b7 Fix typos in MuJoCo documentation.
PiperOrigin-RevId: 656068822
Change-Id: I5ebbb3701148ea4d978a6a1ad3f762ffcc7e57cb
2024-07-25 13:31:13 -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
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
Yuval Tassa 39b22ebc26 Remove dangling section header from function docs.
PiperOrigin-RevId: 652456322
Change-Id: Ib1d7aa387b7ba8957c93f0227f530aa0b37f2668
2024-07-15 06:11:25 -07:00
Yuval Tassa 22a10fd2ff Minor documentation improvements.
PiperOrigin-RevId: 652064694
Change-Id: I13009410fbd3ce5ac90788f61e32354474a8e19e
2024-07-13 08:36:47 -07:00
Yuval Tassa e13ddfa2ab Improve compiler-related documentation.
PiperOrigin-RevId: 651827545
Change-Id: I85c12dc12967e49087c342445dbfa049c5cdbcdf
2024-07-12 11:05:16 -07:00
Yuval Tassa d0f86bc2c5 Correct API documentation of mjvSceneState. Fixes #1793
PiperOrigin-RevId: 650662466
Change-Id: Ie887a63ca9136bbc688db6a79036701b9516c1d6
2024-07-09 09:49:07 -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
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
Alessio Quaglino 9107d3b507 Add mjs_findKeyframe.
PiperOrigin-RevId: 649036650
Change-Id: If514d5c333dd6084af9509324fd658c72576d7b5
2024-07-03 05:17: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
Emo Todorov ee6a1dba28 UI improvements. Fixes #1274.
Copybara import of the project:

--
a1297d997d0b3cc624bbd1e704ffb7fbb2c5db9d by Emo Todorov <etodorov@gmail.com>:

UI imrovements

When OpenGL buffer size is too small to hold entire UI with all sections open, older sections (as determined by latest mouse click) are automatically closed as needed.

To test this new functionality, uncomment the test near the top of mjui_resize().

UI items now have userid, which can be used for event handling.  It is set through the (new) last field of mjuiDef, called otherint.

Sections titles can now have a checkmark - in which case they are rendered differently. Set via mjuiDef.otherint: 0- none (as before), 1- rendering changed but box not shown, 2- box shown.  This can be used to label sections of special interest to the application.

--
b0405bfb3005586ef1d2656ea9cc43c608225927 by Emo Todorov <etodorov@gmail.com>:

more ui improvements

Implemented mjPRESERVE state for adding sections and separators, so you don't have to keep track of old states.

simulate.cc is now modified to use this new functionality.  I also made the separators in the Physics section collapsible. If you don't like it, change them back to state 1.

Also added functionality for handling section checkboxes.

--
10f4c49be62a6605a38b7c0c7bfae1629024ba31 by Emo Todorov <etodorov@gmail.com>:

even more ui improvements

Selection boxes that extend below the current UI height are finally rendered in full.

Sections and collapsible separators now have rounded corners. The radius can be controlled from theme spacing.

More theme color settings were added. In particular, color gradients can now be disabled (the two end colors are set independently).

--
96c2dc601a25d31c93b21f8e089d349e729e829e by Emo Todorov <etodorov@gmail.com>:

final ui improvements

Cleaned up the code a bit.

Added more control for color gradients.

--
c9eddb679f36df3f0745d37e3fa90c4e66ee6b98 by Emo Todorov <etodorov@gmail.com>:

bug fix

Fixed some rendering bugs in the new functionality.

COPYBARA_INTEGRATE_REVIEW=https://github.com/google-deepmind/mujoco/pull/1749 from emotodorov:ui_improve ddfc21dbcf0482b8f0d5eacab21847c302f71440
PiperOrigin-RevId: 646060325
Change-Id: Idb27aae7cd0311d00f26387bcadf5891175e867d
2024-06-24 05:33:51 -07:00
Kyle Bayes e66b9a36b2 Remove mj_makeEmptyFileVFS and mj_findFileVFS from MuJoCo API.
PiperOrigin-RevId: 645393666
Change-Id: Iabe939c88f60b80dce20f84c7ff9a6396717cc84
2024-06-21 08:12:51 -07:00
Yuval Tassa 3f3b39bbb1 Fix type-related issues in dependent code. Remove hardcoded mjUSEDOUBLE. Add mjUSESINGLE compiler flag.
This CL does not change the default build behavior of MuJoCo. To use single-precision floating-point, build MuJoCo with `-DmjUSESINGLE`.

PiperOrigin-RevId: 644782648
Change-Id: Ie815df9916798ca8054306437b39a33f84ce9e08
2024-06-19 10:52:18 -07:00
Alessio Quaglino 7bd7065e0e Renamed mjs_fullInertia to mjuu_fullInertia and moved it to user_util.
PiperOrigin-RevId: 644769379
Change-Id: I83511eeb4c0972ce9f46f0e3443d438cccdd4d9f
2024-06-19 09:39:02 -07: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
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
Yuval Tassa 171b0d6e06 Improve order and categorization in function API reference.
Also, move macros to the globals section.

PiperOrigin-RevId: 641936967
Change-Id: I5b1f6aa52c69e68cc6310093c5811f0f20828bab
2024-06-10 10:01:09 -07:00
Alessio Quaglino 7a06bcfdaf Make model editing API public, fixes #364
Still missing:

- Detailed documentation.
- Python bindings.

PiperOrigin-RevId: 641445626
Change-Id: I20e67b707cf1bebae7e0cc94d17f7b76a89171f0
2024-06-07 22:28:01 -07:00