Commit Graph

506 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 7d8d4d398e Make elasticity plugins compatible with flex pins. Fixes #1235.
Before change:
poncho       18.20s
poncho_flex  44.60s
floppy       4.70s
floppy_flex  6.43s

After change:
poncho       18.23s
poncho_flex  44.62s
floppy       4.67s
floppy_flex  6.57s

PiperOrigin-RevId: 585952587
Change-Id: I0e7c1513f64c7ab1e6ad71e2168b4467c042b46f
2023-11-28 06:13:43 -08:00
Baruch Tabanpour 35c90844ae Add sites to MJX.
PiperOrigin-RevId: 585691582
Change-Id: I6cc594daf436231f91534f137ff259e7b39811d9
2023-11-27 10:28:50 -08:00
Yuval Tassa ca046cbf64 Fix rendering bug in changelog.
PiperOrigin-RevId: 585627863
Change-Id: I238b9d7eb13dbc8660f15f45efe6a84ccbb84c66
2023-11-27 05:59:53 -08:00
Alessio Quaglino eb9568a48b Add frame element to MJCF.
PiperOrigin-RevId: 585598244
Change-Id: I4c06be3dd586dab5a4458f05faaf1e7f2b615458
2023-11-27 03:32:18 -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
Kevin Zakka e33adaca9c Fix typos in mju_boxQP documentation.
PiperOrigin-RevId: 585462325
Change-Id: Ib1c15c3d5af8475ec1a62b50c66b729579a23e60
2023-11-26 11:23:52 -08:00
Nimrod Gileadi 002b427a32 PID Controller as an actuator plugin.
Implement a configurable PID controller.

PiperOrigin-RevId: 585282014
Change-Id: I2d884554629101a0a25b5e0979ffb1ff8ed9cab4
2023-11-25 08:41:01 -08:00
Alessio Quaglino d070b1893e Improved SDF objective function.
For two colliding SDFs `A` and `B`, the function is `(A+B)+abs(max(A,B))`. This can also be written as `clearance + abs(intersection)`. This function has the following properties:

- On the penetrating surface, it is equal to `A+B`, i.e. the clearance field which is the penetration depth.
- The object boundary is a set of local minima in 3D space, since `abs(max(A, B))>0` away from the surface.
- Along the penetrating surface, the maximum penetration is a local minimum of the clearance since this field is orthogonal to the midsurface field `A-B`, which acts as a support plane for the contact.

[Level sets of the improved function for two colliding circles](https://www.wolframalpha.com/input?i=plot+sqrt%28x%5E2%2By%5E2%29-1+%2B+sqrt%28%28x-1%29%5E2%2B%28y-1%29%5E2%29-1+%2B+max%28max%28sqrt%28x%5E2%2By%5E2%29-1%2C+sqrt%28%28x-1%29%5E2%2B%28y-1%29%5E2%29-1%29%2C+0%29+-+min%28max%28sqrt%28x%5E2%2By%5E2%29-1%2C+sqrt%28%28x-1%29%5E2%2B%28y-1%29%5E2%29-1%29%2C+0%29+).

PiperOrigin-RevId: 585106580
Change-Id: I5b18a1ef262ceb0a1ab8abcad8acfd6dc1992e2c
2023-11-24 09:07:17 -08:00
Yuval Tassa 6a83b86553 Update M1 Pro with M3 Max benchmarks in MJX docs
PiperOrigin-RevId: 584918133
Change-Id: I442972cdc1f19020e6b5bbc7ff3e98fd556cf125
2023-11-23 10:46:54 -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
Yuval Tassa b41f6d0942 Correct documentation of eulerseq attribute w.r.t URDF conventions.
PiperOrigin-RevId: 584394256
Change-Id: I0afcb6ced81b98898988cc66f46742175a9a55c5
2023-11-21 12:11:05 -08:00
Yuval Tassa 2bc2bc902f Clarify that the contact disable flag also disables collision detection.
PiperOrigin-RevId: 584300974
Change-Id: I740fd6833b2ea1b77bdb70dc210a1bd1f7eb6f17
2023-11-21 05:57:51 -08:00
Yuval Tassa cd56a41f83 Fix bug in Cartesian actuation with movable refsite.
PiperOrigin-RevId: 584035818
Change-Id: I005f6bbbe02f8b36d287ecada0406a6ae4d720ba
2023-11-20 08:37:29 -08:00
Alessio Quaglino 8ca51b5318 Backtracking line search for SDF collisions.
Increased tolerance above zero in nutbolt.xml since now the two parts lock otherwise. Measured speedup of 2x in this example.

This solves the issue of scale-dependent step sizes. Tested on gears with 10cm diameter and 2cm thickness.

PiperOrigin-RevId: 584009449
Change-Id: Ied2f62dbbbc592470b91cf910f3553802a57c752
2023-11-20 06:33:01 -08:00
Alessio Quaglino dbf44fe2b4 New SDF objective function.
This solves the jittery behavior observed with the gear example in the case of small applied torques (~0.5).

The new quadratic option has the form max(A, 0)^2/2 + max(B, 0)^2/2 - min(A, 0)*min(B, 0). This function has a minimum in the intersections of two SDFs A and B, while avoiding the flat areas which would be generated if only the clearance field A+B were employed. See for example [the function resulting from two colliding circles](https://www.wolframalpha.com/input?i=minimize+max%28sqrt%28x%5E2%2By%5E2%29-1%2C0%29%5E2+%2B+max%28sqrt%28%28x-1%29%5E2%2B%28y-1%29%5E2%29-1%2C0%29%5E2+-+2*min%28sqrt%28x%5E2%2By%5E2%29-1%2C0%29*min%28sqrt%28%28x-1%29%5E2%2B%28y-1%29%5E2%29-1%2C0%29)

PiperOrigin-RevId: 583992855
Change-Id: I135a1b5931cd136d7d33cc275f8d361a8b7e290c
2023-11-20 05:06:33 -08:00
Yuval Tassa 98082ae7f9 Add description of eq_active state variable to documentation. Fixes #1208.
PiperOrigin-RevId: 583712793
Change-Id: I6f4adca5692fd181bb8f6c0f34ae09a756a84fc1
2023-11-18 20:06:33 -08:00
Yuval Tassa 530058cadb Clarify support for muscles/tendons in future MJX. Add details to the large scene benchmark.
PiperOrigin-RevId: 583018058
Change-Id: I3d93a73b4bd71ade1ecf28b8cff9a114259e71e1
2023-11-16 06:10:34 -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
Yuval Tassa 8d5966eec9 Update changelog for 3.0.1 release.
PiperOrigin-RevId: 582705280
Change-Id: I6d2a8df7bccfa2ecb76b7ef3ef8d5a7377927589
2023-11-15 09:30:35 -08:00
Yuval Tassa 2d2b6ecf93 Fix formatting bugs in XMLreference doc page.
PiperOrigin-RevId: 582661350
Change-Id: I85a67b1286e9d70dc253e541d95fdfc58ce8f451
2023-11-15 07:00:37 -08:00
Alessio Quaglino e3b3f96373 Add flex_texcoordadr to mjvSceneState. Fixes #1193.
PiperOrigin-RevId: 582630943
Change-Id: I113b135752268773e0afafe004b8f27c1e96ffc7
2023-11-15 05:02:05 -08:00
Alessio Quaglino f5285e0b23 Add flex to dm_control schema.
PiperOrigin-RevId: 582323853
Change-Id: I4ce25bf29d0a883bca286954a14c4a07a500f145
2023-11-14 08:05:29 -08:00
Erik Frey c8146372cf Simplify pendula test data. Fix bug in `scan.body_tree` that led to incorrect smooth dynamics for some kinematic tree layouts.
PiperOrigin-RevId: 582125477
Change-Id: I47505ceb4be4c88052bc670f401b8c45ff320bbd
2023-11-13 16:48:49 -08:00
Nimrod Gileadi f1bf394415 Add missing commas in attribute lists in XML reference.
PiperOrigin-RevId: 581984255
Change-Id: Ie834a9578357bba68839d5172892cd9d6329122e
2023-11-13 09:08:43 -08:00
Saran Tunyasuvunakool cdf55e2ae9 Do not override search bar text color when data-theme="auto" in light mode.
PiperOrigin-RevId: 580546595
Change-Id: If39cd937e9288c860b8b713911f0ef5114aee5f5
2023-11-08 08:46:08 -08:00
Yuval Tassa 1881c2d881 Improve sorting of samples in documentation.
PiperOrigin-RevId: 579847239
Change-Id: I392cd87b9a3e5616fcb10657db4ac81a38e430ed
2023-11-06 08:12:24 -08:00
Yuval Tassa 8a5e2b19a8 Improve mjContact documentation. Fixes #1136
PiperOrigin-RevId: 579836970
Change-Id: Ife8dd73eecdbdaacecc1e48460cf6efcf4f7b487
2023-11-06 07:28:51 -08:00
Yuval Tassa dafd041ad8 Minor documentation improvements.
PiperOrigin-RevId: 579825348
Change-Id: Iba81616fe9fc7d57a640775efd46afb5fc2f27bf
2023-11-06 06:36:13 -08:00
Yuval Tassa 0f37deca0d Documentation improvements.
Fixes #598 #691 #1071 #1072

PiperOrigin-RevId: 579816915
Change-Id: Ica5e62516e2888d47030b0f44619efa2621f329a
2023-11-06 05:56:02 -08:00
Yuval Tassa 5a9239e11c Improve inline documentation of mj_passive and mj_subtreeVel.
PiperOrigin-RevId: 579808998
Change-Id: I2cff167c3813964f42a30b06f1adf38b57d62196
2023-11-06 05:12:11 -08:00
Yuval Tassa c45996bba8 Add cell to tutorial colab demonstrating procedural camera control.
https://youtu.be/cE3s_IfO4g4

PiperOrigin-RevId: 579466532
Change-Id: I433db285bcfa2b9fab0c11e1fef1e25af8187901
2023-11-04 07:43:06 -07:00
Kevin Zakka 7b9a0cdce6 Correct passive viewer pane argument documentation. Resolves #1166.
PiperOrigin-RevId: 579360444
Change-Id: I9fffa9d466f57eed1cfd5b4b86110739e8e66399
2023-11-03 18:57:07 -07:00
Yuval Tassa f70cec5775 Remove temporary banner
PiperOrigin-RevId: 579317175
Change-Id: I26444eb467919e40d249ee5befee0164250a28d7
2023-11-03 15:07:40 -07:00
Alessio Quaglino 7a7cfc0f60 Improve flex docs.
Fixes #1141 and #1152.

PiperOrigin-RevId: 578855375
Change-Id: I44746c3ae331edcb22b7e16744fb38369039e888
2023-11-02 08:05:12 -07:00
Erik Frey 3c0a56c1e5 Adds support for Newton solver to MJX.
PiperOrigin-RevId: 578738033
Change-Id: Id0e68c7b961380cb1ed88b40d99f202c3fa8e228
2023-11-01 22:05:10 -07:00
Yuval Tassa e82cb9f420 Delete mentions of MuJoCo 2.0 in the docs.
PiperOrigin-RevId: 578501679
Change-Id: Ie1fdd1d11d2e1e12b3f9f1e59bd4da705b3a7c7e
2023-11-01 06:44:20 -07:00
Yuval Tassa 893c404230 Runtime disabling of actuators according to group.
Added `option-actuatorgroupdisable` attribute and associated `mjOption.disableactuator` integer bitfield, used to disable sets of actuators at runtime according to their group.

- The first 6 actuator groups are toggleable in the `simulate` viewer.
- Minor refactor and cleanup of actuator documentation.

https://youtu.be/H9qG9Zf2W44

Fixes #1092.

PiperOrigin-RevId: 578335600
Change-Id: I4cf663b90ea768e4380acfa2fe3b8c15c7cbb568
2023-10-31 16:24:38 -07:00
Baruch Tabanpour 45878b7eef Raise an exception in MJX if given a model with tendons.
Fixes #1149

PiperOrigin-RevId: 578278430
Change-Id: Ie633975b830379ca554438307a6e674675eaf8e7
2023-10-31 13:09:27 -07:00
Google DeepMind 7e419276ca Increase maximum number of UI elements per section in Simulate.
PiperOrigin-RevId: 578268786
Change-Id: Ia584fb1782a6f20cdb64ec13bfa0bbcb211b1165
2023-10-31 12:36:39 -07: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
Erik Frey 7069976557 Implement joint equality constraint. Streamline constraint functions.
PiperOrigin-RevId: 577905570
Change-Id: I70580d21e3c612606b967cdd84ad22794c672397
2023-10-30 11:38:15 -07:00
Alessio Quaglino 50843cad30 Add defaults to SDF plugin attributes.
Expose diameter and number of teeth for the gear SDF.

PiperOrigin-RevId: 577779297
Change-Id: Iec5890ab7f39080b395cf06a76f9c2216f4f39ed
2023-10-30 03:09:25 -07:00
Yuval Tassa 0f94b4a5ad Documentation improvements.
PiperOrigin-RevId: 577620389
Change-Id: Ib104a57a2b2b35c334855782d548ff064e74e9d2
2023-10-29 06:56:59 -07:00
Yuval Tassa 86d9c84e59 Fix bug in implementation of torquescale
PiperOrigin-RevId: 577466789
Change-Id: I3c8e5dd9b4af9a629e777f7ccad8417075b0046c
2023-10-28 08:25:25 -07:00
Saran Tunyasuvunakool 4c24be9ee3 Make mjpython.py work with Python from CommandLineTools.
PiperOrigin-RevId: 577305478
Change-Id: Iec4b23c97f80462e5c16aca5ac4450faf3181a0c
2023-10-27 14:26:16 -07:00
Saran Tunyasuvunakool 621487bd92 Reorganise the changelog.
PiperOrigin-RevId: 577290399
Change-Id: Idb831c48dddf9384cfae23a11bcb7dce6899fb47
2023-10-27 13:31:03 -07:00
Kevin Zakka 88d67fd6f6 Add CoRL event as a temporary banner in docs.
PiperOrigin-RevId: 577246026
Change-Id: I0615eb6ee8d6ac928785877db0ba6703c01e301b
2023-10-27 10:51:57 -07:00
Alessio Quaglino 034bb62986 Add cam_intrinsic to mjvSceneState.
Add `frustum.xml` to engine_vis_state_test models.

Fixes #1115.

PiperOrigin-RevId: 576567292
Change-Id: I642c32a87427507580046d2d260263c689d50c99
2023-10-25 10:17:42 -07:00
Alessio Quaglino 1a47a97040 Disable shadows for geoms of category mjCAT_DECOR. Fixes #1114.
Added `frustum` to `rgba` and `scale` in the `visual` section.

PiperOrigin-RevId: 576547599
Change-Id: I69bf528680e3d4a59d6e04f6db99a6d345001d1d
2023-10-25 09:08:20 -07:00