Commit Graph

1886 Commits

Author SHA1 Message Date
Yuval Tassa c5cefdc2f6 Remove unidentified entries from mjx/requirements.txt
PiperOrigin-RevId: 648363514
Change-Id: Ia4e60c088a078a9e3fc2e619c1819f4a3f2edcf1
2024-07-01 07:33:40 -07:00
Yuval Tassa 1601ab6078 Remove Makefiles. Fixes #402
These are no longer needed, as the open-source build uses CMake.

PiperOrigin-RevId: 648340374
Change-Id: Ibc704ca3aaab1c48d245e24b071bed6cd846c110
2024-07-01 05:51:47 -07:00
Yuval Tassa 4d4b0bb2c3 Don't normalize mjData->qpos quaternions in-place.
PiperOrigin-RevId: 647927542
Change-Id: I13b0be55498d1da3af2cdc414cfed4c3908a6fe1
2024-06-29 03:07:10 -07:00
Saran Tunyasuvunakool 0e19722c61 Split name2id and id2name into a separate source file.
PiperOrigin-RevId: 647373431
Change-Id: I3bab0ea7157750b79826739e3d739e4114fa0af7
2024-06-27 10:50:21 -07:00
Yuval Tassa 44be878e7e Enable inter-procedural optimization by default in cmake
PiperOrigin-RevId: 647336693
Change-Id: I44acf48ed9825dd3e71b06f2aca581cdb17dce34
2024-06-27 09:05:49 -07:00
Alessio Quaglino f6cc3f4091 Remove classname from mjs* structs.
PiperOrigin-RevId: 647277317
Change-Id: Ic3cb0d3bf890d6be2712c0538e21910a8f12ab44
2024-06-27 05:13:02 -07: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
Yuval Tassa 13fce3e5b0 Use std::array instead of std::vector for a constant array of strings.
PiperOrigin-RevId: 646826439
Change-Id: I7d9462109027ebb64cb52e3265dde87ca23f906f
2024-06-26 04:53:08 -07:00
Yuval Tassa 8c380e7ba4 Don't print the fixed name ("main") of the top-level default class when saving XMLs.
Also insert newlines between top level sections in saved XML.

PiperOrigin-RevId: 646802227
Change-Id: If16b93409bda88aee8ef75f4a78d7ba0419fcfae
2024-06-26 03:22:22 -07:00
Alessio Quaglino 6be4e0697e Simplify mjs_addDefault.
PiperOrigin-RevId: 646534046
Change-Id: I658224e4800849231e68ed02d8fad07b8d796231
2024-06-25 10:51:57 -07:00
Kyle Bayes 5e39fc0564 Improvements to GJK implementation:
- Fix various bugs
- Improve readability
- Add support for recovering witness points.

PiperOrigin-RevId: 646515019
Change-Id: I295cf90d885e32013e595ea7aad07ed6c1869239
2024-06-25 10:00:58 -07:00
Yuval Tassa 5a513a0afb simulate improvements
- Add RGBA color editing for visualization
- Make some separator sections closed by default

PiperOrigin-RevId: 646502122
Change-Id: Id863d983b7fb53e6bbe86a92833876e40b74a5d8
2024-06-25 09:16:25 -07:00
Yuval Tassa d8b85245a7 Informative error if mis-naming the top-level default class.
Also:
- Move the the top-level default class name into the mjCModel constructor.
- Fix bug in default class propagation in frame elements.
PiperOrigin-RevId: 646384669
Change-Id: Icc6154124361a234b84a07e2b5ecaa7c8b18ebf7
2024-06-25 01:46:18 -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
Kyle Bayes 14fe527ea2 Fix small typo/bug in gjk implementation.
PiperOrigin-RevId: 645378191
Change-Id: Icdba53b30c934ac3059bb6f7b6d1081d71823131
2024-06-21 07:04:22 -07:00
Kyle Bayes 1e8454820d Implement initial GJK algorithm.
PiperOrigin-RevId: 645368315
Change-Id: I40a1e1023fd9f14a59e11a9dcc6ac22df241b6ae
2024-06-21 06:17:43 -07:00
Kyle Bayes b0b934cb5f Separate CCD code from support/center logic.
PiperOrigin-RevId: 645355865
Change-Id: I71303ffd7bbee37c5e8ac7e770f810768780c2e6
2024-06-21 05:17:57 -07:00
Nimrod Gileadi 73cd15344e Fix a couple of mjtNum build errors.
PiperOrigin-RevId: 645024056
Change-Id: Id283f550a4e2d927c214a86e77d42b90fb02824e
2024-06-20 07:31:28 -07:00
Kyle Bayes 18634b6726 Add missing mj_deleteVFS to user unit tests.
PiperOrigin-RevId: 645001843
Change-Id: I671514ea4cb7786e5d1f7f55404d4925e446a262
2024-06-20 06:04:32 -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
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 1eb708646d Update the simulate tutorial video.
The new video is more comprehensive and covers more features of MuJoCo.

PiperOrigin-RevId: 644758072
Change-Id: I1f114746833e00cd61b27659c816316c0e72c46c
2024-06-19 08:41:53 -07:00
Yuval Tassa 44417f0059 Update mjx/requirements.txt
PiperOrigin-RevId: 644744086
Change-Id: Ie6733ddbd1af9da43785b35c06e465e90267d9a3
2024-06-19 07:35:27 -07:00
Yuval Tassa 8e2f830fd2 Fix type errors in compiler and tests.
In preparation for a float32 build of MuJoCo.

PiperOrigin-RevId: 644407674
Change-Id: I60069f0f865ef89fbf613f5a2ca0c336cc63461e
2024-06-18 09:12:44 -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
Alessio Quaglino f15b6e5e21 Set orientation type in composite box. Fixes #1732.
PiperOrigin-RevId: 643937520
Change-Id: I9ba9d9a8feae6815df35c5d21b0314165713c9d6
2024-06-17 03:07:16 -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
Tom Erez 739512a0e4 Fix comment typos.
PiperOrigin-RevId: 643762423
Change-Id: I98289ed4053e635b863b029f239b14a232e505e3
2024-06-16 05:54:33 -07:00
Yuval Tassa 86ef1746b0 Add convex collision test models.
PiperOrigin-RevId: 643567019
Change-Id: I233553f04ea7d67216a2440f834362965d9e8c58
2024-06-15 01:38:13 -07:00
Yuval Tassa 6a532fc53e Fix bug in simulate noise injection logic.
Noise injection was occurring at every iteration of the physics thread, rather than before every call to `mj_step`, leading to time-step-dependent noise rate.

- Moved the logic from main.cc to a `Simulate::` method, called before `mj_step`.
- Reduced the maximum time-scale slider value back to 4 seconds (recent increase was due to this bug).

PiperOrigin-RevId: 643350296
Change-Id: I96832905e6614f92ac725298b16fcabe64ea1df1
2024-06-14 08:13:24 -07:00
Yuval Tassa 3d63c873aa Improve 2D texture documentation.
PiperOrigin-RevId: 643347176
Change-Id: Ice83a723776092c762dac6e6bc440ef1b1d673b5
2024-06-14 08:04:09 -07:00
Taylor Howell 28e5ba2d29 Copybara import of the project:
--
8857485483508e2c82c6a827daee8b457f88d1c8 by Taylor <taylor.athaniel.howell@gmail.com>:

velcoity -> velocity

COPYBARA_INTEGRATE_REVIEW=https://github.com/google-deepmind/mujoco/pull/1733 from thowell:docs 8857485483508e2c82c6a827daee8b457f88d1c8
PiperOrigin-RevId: 642779993
Change-Id: I84d15237314af8b823fe616f72bd79a088a21d61
2024-06-12 16:42:30 -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 f37f840880 Improvements to control noise in simulate:
- Use `ctrl` as filter state rather than external preallocated buffer.
- Scale and clip to control ranges.
- Exponential decay to the middle of the range.
- Scale is now [0 1] (scaled to range).
- Rate is now [0 20].

PiperOrigin-RevId: 642586333
Change-Id: Id45a0420736a6edcf09be1db53d9320e7df2c668
2024-06-12 05:35:41 -07:00
Copybara-Service 64cd44252f Merge pull request #1713 from fanminshi:style_fix
PiperOrigin-RevId: 642579885
Change-Id: I322157d6c04889932c868df25af1b41661bd398b
2024-06-12 05:02:02 -07:00
fanmin shi a660051a4c Consistent spacing in python/tutorial.ipynb 2024-06-11 21:07:52 -05:00
Baruch Tabanpour 5ed464b489 Support spherical joint in URDF.
PiperOrigin-RevId: 642326650
Change-Id: Iec766800bc9ab7e022bd586fc5881df576d01331
2024-06-11 11:08:00 -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
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
Google DeepMind 238736393b #mjx Make Data.time strongly typed.
PiperOrigin-RevId: 641774798
Change-Id: I5e13e3cefeb7942083f623f29757a459656062dd
2024-06-09 20:56:33 -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
Erik Frey 4c3d9461ae Elliptic friction in MJX.
PiperOrigin-RevId: 641384367
Change-Id: I510c565940324fbbf392ce537ce27e0cb9af3eb1
2024-06-07 16:05:58 -07:00
Saran Tunyasuvunakool 5b6800116a Workaround for https://github.com/actions/runner-images/issues/10004.
PiperOrigin-RevId: 641250258
Change-Id: I00509dc21c568a05d6cba346437194a7e80badd4
2024-06-07 07:58:38 -07:00
Baruch Tabanpour c136f3d6e8 Fix barkour path.
PiperOrigin-RevId: 641093437
Change-Id: I92b8193c8458461e1a1f80b1e4c099067ed2099a
2024-06-06 19:09:58 -07:00
Baruch Tabanpour ace0c8f0a3 Add maxhullvert.
PiperOrigin-RevId: 641092710
Change-Id: Ib4fa828a9c82531614f0a67de9990340dbb25406
2024-06-06 19:05:16 -07:00
Baruch Tabanpour fb8bf206d9 Update MJX colab with hfield example.
PiperOrigin-RevId: 641061897
Change-Id: Ia1002173adce7b7b12203857abed18568ae236f1
2024-06-06 16:43:34 -07:00