Commit Graph

126 Commits

Author SHA1 Message Date
Yuval Tassa adf71cc6b4 Improve mesh-fitting image in changelog.
PiperOrigin-RevId: 500782543
Change-Id: Iecec45abd3cb1e5a06df58ae32ebe1998584024a
2023-01-09 12:40:10 -08:00
DeepMind 703b33c064 Add geom names to URDF parsing in MuJoCo.
Fixes #566

PiperOrigin-RevId: 500750288
Change-Id: I00f94ee37bb2f15be59df3933d0d4dba583f0921
2023-01-09 10:34:22 -08:00
Alessio Quaglino 19b6c70e13 Use global coordinates for computing the frame position of a primitive geom fitted to a mesh.
PiperOrigin-RevId: 500720200
Change-Id: I0a564aff1fe6943002db14f46f789cfdaef4d2de
2023-01-09 08:29:27 -08:00
Nimrod Gileadi f85f3fba2f Avoid duplicate contact points in compound bodies.
Sometimes broadphase returns the same body pair multiple times. In those cases, avoid creating every contact twice.

PiperOrigin-RevId: 499869235
Change-Id: I58606168b0723d40b4fdd43b1fafad79bf35d76d
2023-01-05 07:28:05 -08:00
Kyle Bayes f1007df013 Implement hash map for mj_name2id using djb2 and linear probing.
PiperOrigin-RevId: 499485127
Change-Id: I5aed6549db18b92d7c8a3b7590e50a00ce13a439
2023-01-04 07:57:55 -08:00
Saran Tunyasuvunakool 05216f183c Fix broken test on MSVC.
Test was broken by 2e6af64b31.

PiperOrigin-RevId: 495196716
Change-Id: I0402b05da2778c54c2761efe5d9977fd091cddd6
2022-12-13 20:22:50 -08:00
Yuval Tassa 30b4309af9 Rename mjpPlugin.capabilities -> mjpPlugin.capabilityflags
PiperOrigin-RevId: 495080532
Change-Id: I81743472b816a331890a7cb05bfb7a89ebf07ff9
2022-12-13 11:33:27 -08:00
Saran Tunyasuvunakool 5c021d042b Modify signature of plugin reset callback.
The `reset` function is called inside `mj_resetData`, before any physics forwarding call has been made. It is therefore an error to read anything from mjData at this stage.

The only valid operation on mjData during `reset` is for a plugin to write into its own state variable slots and data struct. We modify the function signature to only provide access to these.

PiperOrigin-RevId: 495032492
Change-Id: Ic6d2967d2571a9083cbca1ba239ca70a8a51f474
2022-12-13 08:41:35 -08:00
Saran Tunyasuvunakool 2e6af64b31 Change mj_versionString test to not rely on a golden value.
PiperOrigin-RevId: 495026376
Change-Id: I378d2cff1edfe4d49c1bd7c131d92502d0a6b5b2
2022-12-13 08:16:55 -08:00
Alessio Quaglino 3de2873883 Add deprecation warning for the Rope Composite type.
PiperOrigin-RevId: 494985209
Change-Id: I6ce7ca2aeae6f1e798bd4bda9b755852add26a36
2022-12-13 04:35:48 -08:00
Nimrod Gileadi 7076da6909 Correctly validate the size of user sensors in mj_validateReference.
PiperOrigin-RevId: 494877162
Change-Id: I0a070d7813efea6216d15270f62b6009c55e1a54
2022-12-12 17:49:06 -08:00
Alessio Quaglino b712e0757e Define kNumEdges and kNumVerts constants in Solid plugin.
PiperOrigin-RevId: 493587525
Change-Id: Ifa82211a4dfc3b288825b0961c48fc679aae204c
2022-12-07 06:30:40 -08:00
Alessio Quaglino 2d304d65e5 Use memcmp for mju_compare if no AVX. 15% faster on Humanoid.
PiperOrigin-RevId: 493324356
Change-Id: I5f71dc1a8ae40c18864ea80f00a5f86ff952f72c
2022-12-06 09:14:33 -08:00
Alessio Quaglino 7f459ab8ca Print vertex IDs when inconsistent face is found.
PiperOrigin-RevId: 493311839
Change-Id: I0283d86bc6092fbe4f47b845fa8ec212bffdfa1a
2022-12-06 08:24:46 -08:00
Saran Tunyasuvunakool e4f1d584ad Add control plugin API.
PiperOrigin-RevId: 493311715
Change-Id: Iccd99fb26004f39832818e378f01f9149a0e3e3b
2022-12-06 08:23:49 -08:00
Kyle Bayes 73fb61e3e2 Bump version number to 2.3.1.
PiperOrigin-RevId: 493076656
Change-Id: I48c7a45b503c4a7363ea1455a4a3788262d007f7
2022-12-05 12:13:55 -08:00
Yuval Tassa dee1d6020a Make "acc" the default computation stage for sensors of type user.
PiperOrigin-RevId: 492689134
Change-Id: I21c07c74cb4b94d39c091ae98b169fd1235769d4
2022-12-03 07:50:15 -08:00
Alessio Quaglino 89185b4af2 Using full path when adding a file to VFS. Fixes #616.
PiperOrigin-RevId: 492204185
Change-Id: If2b2230c095fe0bb776fcc3ffda48f13d0be5cb2
2022-12-01 08:34:20 -08:00
Alessio Quaglino 26f71e2f6c Check that spacing is greater than geometry size for Composite particles and grid.
PiperOrigin-RevId: 491858371
Change-Id: I03a669286c283a72947705463426badcfc9b0bfd
2022-11-30 02:17:42 -08:00
Alessio Quaglino d0b1a97338 Deformable solid plugin for particles.
Using coordinate-free formula equivalent to linear finite elements.

PiperOrigin-RevId: 491317615
Change-Id: I096b9a56075bbb630f64bfffac8a8d66457e5e2d
2022-11-28 05:32:30 -08:00
Alessio Quaglino c17375fa32 Stop profiling mju_halton in testspeed and bechmarks.
PiperOrigin-RevId: 490239351
Change-Id: Id73c101672e5b974f16b6b4da3aae757a657de15
2022-11-22 07:41:02 -08:00
Yuval Tassa 165e72f798 Apply force perturbations at selection point rather than body center-of-mass.
PiperOrigin-RevId: 489996756
Change-Id: I87870a0c1d173449f15a7249f2459a6b726ff417
2022-11-21 09:13:16 -08:00
Alessio Quaglino 638c9a6994 Support capsules in URDF import.
PiperOrigin-RevId: 489980760
Change-Id: I1c21e736a86f6637a00e2062727d2e6fd5694c42
2022-11-21 07:58:42 -08:00
Yuval Tassa 221c63d744 Sensors of type user no longer require objtype and objname. If unspecified, the objtype will be mjOBJ_UNKNOWN. Also, `user sensors datatype default is now "real"`.
PiperOrigin-RevId: 489652972
Change-Id: I0a8f21ee1a2f5292e6bbcfe3785536cfd1498b85
2022-11-19 02:05:42 -08:00
Alessio Quaglino 043ed273a7 Automated g4 rollback of changelist 489207765.
*** Reason for rollback ***

Corrected logic in CMake

*** Original change description ***

Automated g4 rollback of changelist 489183597.

*** Reason for rollback ***

GitHub path is different

*** Original change description ***

Activate plugin tests on Windows.

***

***

PiperOrigin-RevId: 489228199
Change-Id: Ic0ee9114e9680fc0aef9f668fc172c73fe74cd38
2022-11-17 09:15:40 -08:00
Alessio Quaglino 17c82e2f02 Automated g4 rollback of changelist 489183597.
*** Reason for rollback ***

GitHub path is different

*** Original change description ***

Activate plugin tests on Windows.

***

PiperOrigin-RevId: 489207765
Change-Id: If48dede94c8623b92526375a567edcd49c548e63
2022-11-17 07:38:49 -08:00
Alessio Quaglino a9781d9bea Activate plugin tests on Windows.
PiperOrigin-RevId: 489183597
Change-Id: I1e5212777514fbc5a246f02a4446a9dbb8a0dbd3
2022-11-17 05:06:00 -08:00
Alessio Quaglino 7b0fbc63f8 Speed improvement with no AVX. 40% on Linux Intel Xeon and 60% on ARM Mac.
PiperOrigin-RevId: 488360660
Change-Id: I423269cd362fdcc2434393b691638ac6ed778ef2
2022-11-14 07:31:32 -08:00
Alessio Quaglino ae29a22d55 Add flag benchmark.
PiperOrigin-RevId: 487788256
Change-Id: Iefab760cafc0123368e5bcd4ec4a579b170f1aba
2022-11-11 04:26:32 -08:00
Alessio Quaglino 9fc9823a8c Speed improvements in mj_solveLD (14% on Intel Skylake Xeon 36 cores).
PiperOrigin-RevId: 486960670
Change-Id: I8fce96427158ec36069dea893500059e93bd40db
2022-11-08 08:38:45 -08:00
Yuval Tassa 5004a4c8c5 Better memory setting and reporting, updated example models.
- Memory heuristic rounds up to the nearest MB.
- `simulate` reports total memory currently allocated in the info box.
- All example models use `<size memory/>` rather than legacy attributes.
- Regenerated `example_saved.xml` and reformatted original model in [overview chapter](https://mujoco.readthedocs.io/en/latest/overview.html?#examples).
- `<size>` top-level section does not get written if empty.

PiperOrigin-RevId: 486702670
Change-Id: I0306e335f32344c59562ba606664ec9d2101f8a8
2022-11-07 10:36:37 -08:00
Alessio Quaglino 9370039015 Use a non-symmetric tetrahedron for user_mesh_test.
PiperOrigin-RevId: 486658331
Change-Id: I96edd3b2aba916f9215661a7ba94271696690807
2022-11-07 07:43:08 -08:00
Alessio Quaglino 3b89b0fd30 Particles with arbitrary geoms and joints.
Fixes #553

PiperOrigin-RevId: 486614769
Change-Id: I9a09bf73da97b6b9746800a72ac6c97cce2efa92
2022-11-07 03:22:25 -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
Alessio Quaglino fc24097b92 Compute nonzero default mass value only if geom is not in the default section.
Fixes #561.

PiperOrigin-RevId: 486604407
Change-Id: Ie62578808f96f0de3a2353c6bc4cc8bd3ae3afbc
2022-11-07 02:18:31 -08:00
Yuval Tassa 36b30e4500 Allow more than 1 activation state per actuator, but only for dyntype user.
Fixes #305.

PiperOrigin-RevId: 486597273
Change-Id: I3eb806f60949e68ebe6cbe35a6e66218a167ed45
2022-11-07 01:43:02 -08:00
Alessio Quaglino 9833f912c1 Renamed Elasticity to Cable and libcable to libelasticity for consistency.
PiperOrigin-RevId: 485642970
Change-Id: I279df4233963a6e514459e55a9c2d36d975da92c
2022-11-02 11:08:44 -07: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
Kyle Bayes 23092a11d7 Add per-body gravity compensation (buoyancy) passive force.
PiperOrigin-RevId: 485342531
Change-Id: Icb3e6bb5080b6ef17a3d3b1cc67e0503cfeaeffb
2022-11-01 09:48:06 -07:00
Yuval Tassa 893942a729 Allow tendon springlength attribute to take two values between which the spring produces no force (a deadband).
If given two non-decreasing values, `springlength` specifies a deadband for spring stiffness, inside of which the force is 0 and outside of which force behaves like a regular spring, with the setpoint corresponding to the nearest value. This can be used to create tendons whose limits are enforced by springs rather than constraints, which are cheaper and easier to analyse. See test/engine/testdata/tendon_springlength.xml example model.

Spring-limited spatial tendons whose lower range value is 0 are rendered as catenaries.

Fixes #520.

PiperOrigin-RevId: 484509706
Change-Id: I6698e94ee36168f52d501e83057559805e05172d
2022-10-28 05:57:37 -07:00
Yuval Tassa 0eb7f871b9 Remove requirement that stateless actuators come before stateful actuators.
PiperOrigin-RevId: 484332415
Change-Id: I1dae92c0f8e027e4ca71c20ea3f68b2926526f53
2022-10-27 13:18:57 -07:00
Yuval Tassa f905c7fb7f Add mju_fill, mju_symmetrize and mju_eye utility functions.
PiperOrigin-RevId: 484226916
Change-Id: I79593d54e903ddacab0f859bfc6d17eccad7d3a1
2022-10-27 05:28:26 -07:00
Alessio Quaglino f695f55253 Do not infer inertia if geom is not in inertiagrouprange.
PiperOrigin-RevId: 483994271
Change-Id: Ia663cd30e93d9c3a2e32408a658f091af4d1ca1a
2022-10-26 09:45:18 -07:00
Yuval Tassa 79dc5056eb mjcb_control respects the mjDSBL_ACTUATION flag
PiperOrigin-RevId: 483339817
Change-Id: I0b74e4c03a129f26b3cf2bb991a46f0a263b254b
2022-10-24 04:16:00 -07:00
Saran Tunyasuvunakool 57b0b36699 Bump version number to 2.3.0.
PiperOrigin-RevId: 481823754
Change-Id: Ie8c2c65b11178952355830ef019fe2efdf774189
2022-10-17 22:36:59 -07:00
Yuval Tassa 6e004d7413 Fix bugs in adhesion default parsing.
- `gain` was not inherited, either from `<adhesion gain>` default or from `<general gainprm>` default.
- `dyntype` was not inherited from `<general dyntype>` default.
- Reported by @vaxenburg.

PiperOrigin-RevId: 480707156
Change-Id: I0160531d48186e7658952e72923ceb6cb034be9b
2022-10-12 13:44:56 -07:00
Alessio Quaglino 23e4c03efc Add plugin subdirectory to the tests.
PiperOrigin-RevId: 480631088
Change-Id: I7e80f942efed56d47f503c773f3e9ed5295c4917
2022-10-12 08:33:40 -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
Saran Tunyasuvunakool 5af11ca083 Add XML parsing test case for large memory specification without suffix.
Startblock:
   diffbase is submitted
PiperOrigin-RevId: 479914967
Change-Id: I574612bf875c929803cf5abc3b1885e9855dee29
2022-10-09 06:39:50 -07:00
Saran Tunyasuvunakool 077acb1c8f Revert test fixture name in user_{model,objects}_test.cc.
These were inadvertently renamed to XMLReaderTest by an overzealous auto-renamer in 58fd72f53d.

PiperOrigin-RevId: 479520906
Change-Id: Ia50ec659f21a92cbcd4b953cde54dd98f0adb67a
2022-10-07 01:42:55 -07:00