Commit Graph

230 Commits

Author SHA1 Message Date
Alessio Quaglino f6cc3f4091 Remove classname from mjs* structs.
PiperOrigin-RevId: 647277317
Change-Id: Ic3cb0d3bf890d6be2712c0538e21910a8f12ab44
2024-06-27 05:13:02 -07:00
Alessio Quaglino 6be4e0697e Simplify mjs_addDefault.
PiperOrigin-RevId: 646534046
Change-Id: I658224e4800849231e68ed02d8fad07b8d796231
2024-06-25 10:51:57 -07:00
Yuval Tassa 9e9a0c637e Fix docstring of mjData.arena. Fixes #1753
PiperOrigin-RevId: 646121139
Change-Id: I46c7fb32b0e705fb3b8301272d7fc55ba0dacd7c
2024-06-24 09:29:12 -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 19388eee0c Fix type errors in engine and plugins.
- Preparation for a float32 build of MuJoCo.
- Fix use of `float`-typed `fabs` in `mju_eig3`.

PiperOrigin-RevId: 643804942
Change-Id: I89f64e8fd39f4e70e78d7607816283e217912383
2024-06-16 12:35:05 -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 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
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
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
Erik Frey 255a59487c Corrects function reference in class comments.
PiperOrigin-RevId: 637070006
Change-Id: I0d9dcf0401a107de67cd0a663df6c876287ba772
2024-05-24 16:53:56 -07:00
Yuval Tassa 65d4f04cd4 Add some missing const qualifiers.
PiperOrigin-RevId: 632463634
Change-Id: Id3e3e53371f8ed53d970ad7c471bbefd2a70cf5a
2024-05-10 05:20:37 -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
Meghha Dhoke 4eca3b048d Bumping mjVERSIONSTRING from 3.1.5 to version 3.1.6
PiperOrigin-RevId: 631544334
Change-Id: Iadf8fa25e30da5b00172c8212786b1f9edb22e1a
2024-05-07 14:11:38 -07:00
Yuval Tassa 8ebc9ed2c8 Add mjModel.ngravcomp, number of bodies with nonzero gravcomp attribute.
PiperOrigin-RevId: 627087335
Change-Id: Ie85ae4150962463b8a8c8435fec068c44877aa16
2024-04-22 10:45:43 -07:00
Yuval Tassa 546a27ca72 Fix memory allocation error when memory size is larger than 2G. Fixes #1606
PiperOrigin-RevId: 627058355
Change-Id: Iebef647a0107d1f112a876d705f5b3ea888b4a41
2024-04-22 09:15:46 -07:00
Yuval Tassa caf215e342 Add metallic and roughness scalar attributes to materials.
Rename `light_radius` -> `light_bulbradius`, make the default value 0.02.

PiperOrigin-RevId: 627032170
Change-Id: I1e01e2eca028c0aefc2e7dc384e8b34abac184aa
2024-04-22 07:39:06 -07:00
Yuval Tassa 0cd28d2423 Add light radius attribute.
Also fix bug: light defaults were not being saved.

PiperOrigin-RevId: 625142278
Change-Id: I8ec3a5a06e9f314e98b7c34346db3c24b34d7e0b
2024-04-15 17:55:15 -07:00
Yuval Tassa 7b3f1a0261 Add mjModel.mesh_scale: scaling applied to asset vertices.
PiperOrigin-RevId: 625083195
Change-Id: I36290282379e57ad23ec771d65d1bd6bf2a75b07
2024-04-15 14:26:06 -07:00
Gabe Oppenheimer 225619c964 Update MuJoCo internal version to be the external version +1
PiperOrigin-RevId: 623607403
Change-Id: Ia8f6516bb6b2fb6a3ecb8273b59e61667098f308
2024-04-10 14:32:54 -07:00
Yuval Tassa 5a365603f8 Add mju_euler2Quat.
PiperOrigin-RevId: 623469398
Change-Id: Ia86b29a764018cd4c3bc57d23616bed7393081f5
2024-04-10 06:02:50 -07:00
Yuval Tassa 5d26b50fce Remove native sensor noise sampling.
PiperOrigin-RevId: 620075316
Change-Id: I6a0a1d63834e7c8bfd290f89d86fea791d794739
2024-03-28 15:33:03 -07:00
Yuval Tassa 47ba72ea59 Add actuatorgravcomp joint attribute, to treat gravity compensation forces as applied by actuators, rather than passive buoyancy.
PiperOrigin-RevId: 620049593
Change-Id: I2c8a9dc152c087b408e4f904838034271a7dd910
2024-03-28 14:01:52 -07:00
Alessio Quaglino bda03af49a Add childclass support to frames.
PiperOrigin-RevId: 615487831
Change-Id: I0e4d2efd52211701b4286a0b0de84424470a3a47
2024-03-13 11:31:22 -07:00
Meghha Dhoke 106453fa2b Updated version number to be (v3.1.4) ahead of current release (v3.1.3)
PiperOrigin-RevId: 613236845
Change-Id: I3ee759493f27cfa1e367c71e3e073b54738b73d4
2024-03-06 09:07:25 -08:00
Copybara-Service 6b7d714291 Merge pull request #1450 from v-r-a:angmomMat
PiperOrigin-RevId: 612835207
Change-Id: I8e7b01cc433563556a3ae4bbdd0c53612cc15e97
2024-03-05 07:35:15 -08:00
Saran Tunyasuvunakool b04de39e4e Fix false positives from mjData stack leakage detection.
When built and run under address sanitizer (asan), `mj_markStack` and `mj_freeStack` are instrumented to detect leakage of mjData stack frames. When the compiler inlines several callees that call into mark/free in the same function, this instrumentation requires that the compiler retains separate mark/free calls for each original callee.

This change adds necessary optimization barriers to ensure that this is the case.

PiperOrigin-RevId: 609373993
Change-Id: I30dfd998fb66530735348e9715d92ee713f28210
2024-02-22 08:03:51 -08:00
Kyle Bayes a4a621f6e3 Add checksums (used as a timestamp) to VFS.
Deprecate mj_makeEmptyFileVFS in favor of mj_addBufferVFS.

PiperOrigin-RevId: 608915388
Change-Id: Id9e9b042799bc1bf547f0795ae6f386447d53cdd
2024-02-21 02:25:36 -08:00
Nimrod Gileadi f1d4f8f0a1 Test that mj_resetDataKeyframe treats negative keyframe IDs as a normal reset.
PiperOrigin-RevId: 607655812
Change-Id: Ia9bb1031468f04e8f9563b9228a46983356dafef
2024-02-16 05:09:05 -08:00
Yuval Tassa b6873ec8a2 Move mjModel.mesh_{pos,quat} before mesh_pathadr so all attributes related to original asset data are next to each other.
PiperOrigin-RevId: 606277473
Change-Id: Ia4f6df552192c8a2847126975b6a1a31df63cf65
2024-02-12 09:37:48 -08:00
Meghha Dhoke f763254a00 Updating Mujoco Release version number to v3.1.3
PiperOrigin-RevId: 604459311
Change-Id: I766f704c28740cf751cb935bb48fb6954fccf024
2024-02-05 15:59:20 -08:00
Yuval Tassa fea7c10b95 Add bvhactive flag to visual/global. Fixes #1279.
PiperOrigin-RevId: 599778272
Change-Id: If5530629035cc68b198447503388f59a04041b13
2024-01-19 02:59:56 -08:00
Yuval Tassa 2feefbc5d2 Remove fine-grained timing from narrow-phase collision functions, delete mjTIMER_COL_MID.
PiperOrigin-RevId: 599225419
Change-Id: Ieca166753c20a0abf660e2821b2844dda8758951
2024-01-17 10:54:23 -08:00
Yuval Tassa 67a00a3a51 Rename mjMAXTHREADS -> mjMAXTHREAD (consistency).
PiperOrigin-RevId: 599130235
Change-Id: Ia80379b8ae0574a7cd8fbc668657f806e90d6c5c
2024-01-17 04:33:44 -08:00
Yuval Tassa 6860e953ed Improve docstring of mju_eig3.
PiperOrigin-RevId: 595380013
Change-Id: Ia3663c11ff1cd50a35d5d72ba01e09ff3d9054d0
2024-01-03 06:04:08 -08:00
Google DeepMind 7fb448613f Post release version update: Update to V3.1.2
PiperOrigin-RevId: 592019826
Change-Id: I64fd7da628bf3312ede4970b9b10ef5d0cc75b45
2023-12-18 15:03:37 -08:00
Nimrod Gileadi 7cb7c87f70 Fix a few issues with the passive viewer.
1. Create an arena for the mjData instance used by the passive viewer visualization.

When using the passive viewer, stuff gets copied from the real mjData into a minimal struct.
That struct didn't have a stack, and now visualization for Flex does stack allocs.

2. Add missing a missing field in scene state for flex visualization.

3. Fix a memory leak where mjvScene wasn't released on exit in the passive viewer.

4. Add some locks in places where the render thread and Simulate::Sync collide.

This fixes #1280.

PiperOrigin-RevId: 591891676
Change-Id: I592f286cab9719c8d9af84e42f9756ea1f9f1971
2023-12-18 07:33:19 -08:00
Yuval Tassa 38fa756a20 Add mjGEOM_LINEBOX, used in visualization of collision trees.
PiperOrigin-RevId: 591224734
Change-Id: I09ad8c4b711021ff4dd5548ba5381d25d5a3d7f8
2023-12-15 05:36:35 -08:00
Google DeepMind c2c76195dd Updating Mujoco Release version number to v3.1.1
PiperOrigin-RevId: 590712172
Change-Id: Ibf32322222212c1bf098e75bbb2e145344c57b93
2023-12-13 14:26:08 -08:00
Google DeepMind fcebdf4d09 Update MuJoCo to v3.1.0 for release.
PiperOrigin-RevId: 590256664
Change-Id: I42ad788d609dde0ff00b13a2e456b2a8d3d9e952
2023-12-12 10:37:47 -08:00
Yuval Tassa 28a9e6d9a2 Add mjNOBJECT value to mjtObj enum.
PiperOrigin-RevId: 590164716
Change-Id: I500741aa4fb97fe2c4f5d2086188bb2c9fdfd1a0
2023-12-12 05:15:00 -08:00
Yuval Tassa 1885d518eb Use the string (rot:lin) in mjdata.h to clarify where 6D motion vectors use the Featherstone convention. Also add clarifying text to the appropriate note in the documentation.
Fixes #982.

PiperOrigin-RevId: 589556339
Change-Id: I3e7ff185a089715a386694321d4b89d09d481cf9
2023-12-10 03:27:44 -08:00
Matthew Bennice c0b7b9873d Store paths for hfields, textures, and skins similar to meshes.
PiperOrigin-RevId: 587283093
Change-Id: Ie6d8d2ecb185697a27d1b6f7fca1312df006af12
2023-12-02 03:51:25 -08:00
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 8010aad7be Add flex_elemlayer to mjvSceneState. Fixes #1193 and #1219.
PiperOrigin-RevId: 585581657
Change-Id: Iec4da74437544184c19765a2feee1cca4c368d34
2023-11-27 02:25:05 -08:00
Nimrod Gileadi f2025c6abf Allow plugin actuators to have activation state.
Accept new attributes on the plugin/actuator tag:
  - dyntype
  - dynprm
  - actlimited
  - actrange
  - actearly

This addresses some of the requests in #1098.

PiperOrigin-RevId: 584866281
Change-Id: I4f7559e446888216093efba4ced9119cfc0528a4
2023-11-23 05:14:03 -08:00
Baruch Tabanpour 1554048856 Bump dev version number to 3.0.2.
PiperOrigin-RevId: 582773849
Change-Id: I07a70911578fabb556eec1a4d8aa6fcb6557513f
2023-11-15 12:51:04 -08:00