Commit Graph

358 Commits

Author SHA1 Message Date
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 507b573763 Throw error if sizes of referenced arrays are near INT_MAX.
PiperOrigin-RevId: 484218386
Change-Id: I07dff633b4911bf296ad8993550509ed7b3dfe53
2022-10-27 04:35:23 -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 da33c5922f Stop issuing "degenerate triangle" warnings in the compiler.
PiperOrigin-RevId: 483665416
Change-Id: Ia52b8ce9575aa887303fdcfa8f7b4a8973cf5998
2022-10-25 07:20:24 -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
Copybara-Service a845223c9e Merge pull request #540 from zxwang96:patch-1
PiperOrigin-RevId: 482707830
Change-Id: I2a7c3cf75a9d2596c8a5019fb233cee1815b2b85
2022-10-21 00:24:26 -07:00
Zixing Wang 28ff96fbd8 Update changelog.rst
I tested the version 2.3.0 and found the two ends of a cable object are exposed as B_first & B_last instead of B_left & B_right.
2022-10-19 12:39:27 -04:00
Yuval Tassa 0ff4f964fd Update LQR colab to use .name and .id attributes of indexers.
PiperOrigin-RevId: 481915877
Change-Id: Iba79523422a442f3ca4793587936e05797d43e40
2022-10-18 07:32:41 -07:00
Yuval Tassa 84d168442a Fix link text in changelog.
PiperOrigin-RevId: 481879587
Change-Id: Ifa5a6062d7e6a9f53e1e6d3e2ecf343cabec9fd9
2022-10-18 04:00:19 -07:00
Saran Tunyasuvunakool 573d331b69 Bump pybind11 and Eigen versions.
PiperOrigin-RevId: 481831731
Change-Id: I29082287c7b716bfb29b25545599f6eca8106c49
2022-10-17 23:37:59 -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 c7c6a870b4 Fix rendering of example attribute in XMLreference.rst
PiperOrigin-RevId: 481614595
Change-Id: Ie582b2ba0b3fc89e3296337b0d43c492ac0d65fa
2022-10-17 05:29:28 -07:00
Saran Tunyasuvunakool 3aaf94f42c Fix Python GIL-not-held issues in python/callbacks.cc.
The GIL bug was introduced in ec6ea6a69e and is resolved by decrementing the refcount before returning from MjWrapperLookup.

PiperOrigin-RevId: 481558798
Change-Id: I2744287d48635a55ae6d2ec46c9e43fe881019d8
2022-10-17 00:05:56 -07:00
Saran Tunyasuvunakool ec6ea6a69e Fix a memory leak when using Python callbacks.
Fixes #527.

PiperOrigin-RevId: 481173711
Change-Id: Ie176a8bda09727b6be8b6641d3be9a75c675d566
2022-10-14 10:12:11 -07:00
Alessio Quaglino af74044e43 Add YouTube cable videos to changelog.
PiperOrigin-RevId: 481138236
Change-Id: Ibabbc312ea265f9193daf01abd8e81876f1dadfb
2022-10-14 15:18:20 +01:00
Alessio Quaglino 844dc504cd Report mesh name in mesh compiler warnings.
PiperOrigin-RevId: 481120561
Change-Id: Id68e5f03d88f85a5637f2cff00b5d3a5a59a9156
2022-10-14 05:14:08 -07:00
Alessio Quaglino ca99ed8664 Check if updating XMLschema is necessary.
PiperOrigin-RevId: 481105158
Change-Id: I7b5199e595a73a4d988d90dee40a8cd759f86218
2022-10-14 03:27:05 -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
Saran Tunyasuvunakool 106a3fc0bb Fix GCC build.
PiperOrigin-RevId: 480677627
Change-Id: If1184e0b3bf0e17cee91c0191bdf6aa84ed7f604
2022-10-12 11:40:07 -07:00
Alessio Quaglino 95fe2fbc40 Add plugin support to Python bindings.
PiperOrigin-RevId: 480675078
Change-Id: I2967654b6662efced8ae62cae9b03c6c8e65c67c
2022-10-12 11:30:15 -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 794ef0b771 Reset arena pointer if memory cannot be allocated for all efc_ arrays.
Startblock:
   diffbase is submitted
PiperOrigin-RevId: 479922015
Change-Id: If60d89628e033ff253509f109b2c4d28912a3903
2022-10-09 08:06:39 -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 b2159a8e35 Don't cast memory XML attribute to int prematurely.
PiperOrigin-RevId: 479910328
Change-Id: I40a210852eeced75871361eb6531169ad0f79b6a
2022-10-09 06:02:29 -07:00
Saran Tunyasuvunakool 1a393429ef Fix formatting of large unsigned numbers in mju_warningText.
PiperOrigin-RevId: 479902611
Change-Id: Ia7187478a246b8b068684e75d6f3851d749844c9
2022-10-09 04:55:26 -07:00
Saran Tunyasuvunakool c2f1381f31 Update dependency versions.
PiperOrigin-RevId: 479839325
Change-Id: I44f51ed9fd756cf8c3397489f045492cca0bf54a
2022-10-08 16:55:29 -07:00
Copybara-Service 2a8acf77ed Merge pull request #491 from Balint-H:weld
PiperOrigin-RevId: 479802394
Change-Id: Ieefec4e1ca29fb137947d458837d8ff3c3ee97f3
2022-10-08 09:24:29 -07:00
Bálint Hodossy 0ae8b966e7 Remove stray space in MjEngineTool 2022-10-08 14:04:37 +01:00
Saran Tunyasuvunakool 16c11b9e83 Add metadata to mujoco.dll when building on Windows.
PiperOrigin-RevId: 479695549
Change-Id: I5398e851fd9e5a841c7cc1567dee209e4824ab7c
2022-10-07 16:46:17 -07:00
Alessio Quaglino d55e70b576 Add links automatically to all sections of XMLschema.
PiperOrigin-RevId: 479556475
Change-Id: Ie188ecc5c0801bd6bbe27554afcb5436c19f5fa6
2022-10-07 05:33:52 -07:00
Yuval Tassa eac04ce5e9 Reflow all documentation source files to 120 chars.
PiperOrigin-RevId: 479552166
Change-Id: I777df18cf96d35d5260b4003452b7a6da6707a26
2022-10-07 05:02:21 -07:00
Yuval Tassa 6da125ea37 Standardise tags of MJCF elements in XMLreference.rst
PiperOrigin-RevId: 479541059
Change-Id: I98cb7933469f7010870d04608fbb931539769c2e
2022-10-07 03:45:53 -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
Saran Tunyasuvunakool f0343ff3ed Fix documentation for nstack to more accurately describe what it does now.
PiperOrigin-RevId: 479409986
Change-Id: Ic7cfadb610e6938bdea58cc01b381fd2bbc21a7c
2022-10-06 14:14:50 -07:00
Saran Tunyasuvunakool 58fd72f53d Dynamically allocate contact and efc_ arrays on a new memory arena.
- Add private function `mj_arenaAlloc`. This is used internally to allocate memory from the arena.

- Add private function `mj_nefc` to count constraints. This function returns a tight upper bound on `d->nefc`. The number of counted constraints can be slightly bigger than exact `d->nefc` in the case of constraints with empty Jacobian, as when placing a frictional tendon between two world sites.

- Add new `memory` attribute to the `size` XML element for specification of arena memory size. This attribute is mutually exclusive with `nstack` and `njmax` specifications, which are now deprecated (but left around for the time being for legacy compatibility).

- Move `d->stack` to the end of the new arena space. The stack now grows in reverse from the end.

PiperOrigin-RevId: 479341539
Change-Id: Ie019c202e0908577ffc6f833a37920858116f667
2022-10-06 10:03:05 -07:00
Copybara-Service 4d85a464cc Merge pull request #515 from stonfute:main
PiperOrigin-RevId: 479296643
Change-Id: Id510d76892d59c8d819c4115610fb7ea8a0efe27
2022-10-06 06:16:11 -07:00
Alessio Quaglino 3e378e2c37 Autogeneration of XML schema in documentation.
BEGIN_PUBLIC

Add script for the autogeneration of the XML schema in the documentation.

ENG_PUBLIC

PiperOrigin-RevId: 479289884
Change-Id: I49423195fbd1067d4a4d7be78018d446575bc7e1
2022-10-06 05:43:36 -07:00
stonfute 401e5daf82 Update float parsing
Update float parsing using InvariantCulture to not depend on OS language to parse float value.
Usefull for French, German, ... users where comma is default notations for the decimal point parsing.
2022-10-06 12:14:18 +02:00
Tom Erez d995787cb7 Use angle brackets for standard-library imports.
PiperOrigin-RevId: 479168997
Change-Id: Ib6820f159c35fff4be9169679cde344855a9cd53
2022-10-05 16:16:58 -07:00
Kevin Zakka af7f48d9e6 Fix video embedding in simulate README.
PiperOrigin-RevId: 478823401
Change-Id: Ie3c6b94621dcfdcf4a27b7d6ddb1c2be08353d0a
2022-10-04 10:24:17 -07:00
Saran Tunyasuvunakool 5ef8cb6bbc Disable contact in the temporary mjData created during mjCModel::TryCompile.
PiperOrigin-RevId: 478793238
Change-Id: I28ed324b70931eb416ca57574570bf02c977f337
2022-10-04 08:21:11 -07:00
Alessio Quaglino bc1490b7a8 Add realtime parameter to visual global.
PiperOrigin-RevId: 478775714
Change-Id: Ic2d178a5c57d298d005215219ce8470392c4651b
2022-10-04 07:09:15 -07:00
Kevin Zakka f85cfb8ed2 Fix broken simulate links.
PiperOrigin-RevId: 478775551
Change-Id: I1c4f43c7cbe01f267948f5915a7511744eb0d158
2022-10-04 07:07:57 -07:00
Saran Tunyasuvunakool f9b4593d11 Add macro for dynamic library plugin initializer definition.
PiperOrigin-RevId: 478544478
Change-Id: Idc899eef25261f2cb0b8317a84989cea2d8c2243
2022-10-03 10:40:30 -07:00
Saran Tunyasuvunakool 7072b61cc5 Make Simulate app scan for plugin libraries on launch.
PiperOrigin-RevId: 478502151
Change-Id: I9057e74af4d207cfc551e701134820100bdeee78
2022-10-03 07:47:42 -07:00
Kevin Zakka 7e89d8dab0 In simulate UI, clear shortcut string for flags with no shortcuts.
PiperOrigin-RevId: 478467279
Change-Id: Icc4317d9e35b41871143572275d03adf7e13d956
2022-10-03 04:31:17 -07:00
Alessio Quaglino 52c415eb80 Move schema from XMLReference to the new XMLschema RST file.
PiperOrigin-RevId: 478436495
Change-Id: Ib1db879eef2720f897360810eccb198bb9946f72
2022-10-03 01:18:57 -07:00
Kevin Zakka cce35e1816 Add assetdir compiler option.
PiperOrigin-RevId: 478117894
Change-Id: I4a93108e00558034aa02d22047da80adfa4232b2
2022-09-30 17:59:25 -07:00
Nimrod Gileadi 8a8305d3ca Avoid unnecessary copies after of mju_mulQuat.
Since fdbbc8bbe0, mju_mulQuat allows in-place computations.
There were a few places where the result was unnecessarily assigned to a temporary variable.

PiperOrigin-RevId: 477746005
Change-Id: I7351ef4796e7d70a4a54b930037bfaadee781f12
2022-09-29 09:33:50 -07:00