Commit Graph

493 Commits

Author SHA1 Message Date
Yuval Tassa 0bcaa85650 Fixed a bug wherein, for models that have both muscles and stateless actuators and used one of the implicit integrators, wrong derivatives would be computed.
PiperOrigin-RevId: 663680592
Change-Id: I5d72888cab19dd5e51f552f63fe0968db93f5dcd
2024-08-16 04:07:23 -07:00
Alessio Quaglino e0e134ca63 Add plugin tests for mjSpec.
Fixes #1903.

PiperOrigin-RevId: 663352920
Change-Id: I3a9e17aec5694e49c20b542f4b0a4402f88a2f17
2024-08-15 10:19:53 -07:00
Kyle Bayes 64575f399b Add heightfield collision support for GJK + EPA implementation.
PiperOrigin-RevId: 663321119
Change-Id: I01a85ae15386c997bff4e9c6d71555a4380dfffe
2024-08-15 08:50:09 -07:00
Alessio Quaglino 4b88e9bebf Do not delete keyframes during mjs_detachBody.
PiperOrigin-RevId: 663281082
Change-Id: I6eedf8c5a3a422bcd78086f2fe30c2099f0b9d16
2024-08-15 06:10:43 -07:00
Kyle Bayes 7f09a7d8c6 Fix bug in S2D and improve readability of GJK + EPA code.
PiperOrigin-RevId: 663261102
Change-Id: Ibb1d801078cc02bc7ccec246be6dc50fa4f2be18
2024-08-15 04:35:15 -07:00
Alessio Quaglino 4c64e6f036 Add mocap state to SaveState/RestoreState and attached keyframes.
PiperOrigin-RevId: 662975257
Change-Id: I3edb44f34426525813033902caf31db16ad7b2ab
2024-08-14 10:42:49 -07:00
Alessio Quaglino 5927b3d4d9 Add time to attached keyframes.
PiperOrigin-RevId: 662886533
Change-Id: If9118a226250d2e806d184c9715c7e6a1390fd95
2024-08-14 05:47:43 -07:00
Alessio Quaglino 7be4df7e03 Add ctrl to attached keyframes.
PiperOrigin-RevId: 662878508
Change-Id: Ie273fae0220c8b257766cbbd90a880d44b901725
2024-08-14 05:14:49 -07:00
Alessio Quaglino afd7c73f44 Attach multiple keyframes.
Still missing: support for ctrl, mocap, and time.

PiperOrigin-RevId: 662871569
Change-Id: I8a418c4007663e3063d7146bd72db4eba78ddc5d
2024-08-14 04:42:54 -07:00
Alessio Quaglino 19aa68c2b2 Add keyframe support to attach.
Limitations:
- Supports attaching a single keyframe. If multiple keyframes are present in the child, only the first one will be attached.
- Does not support time, ctrl, mpos, mquat.
- If mjs_detachBody is used, all keyframes are removed.
PiperOrigin-RevId: 662517666
Change-Id: If6e3839471e1884afc14e1a75e7ce1957c2f3581
2024-08-13 08:00:01 -07:00
Alessio Quaglino 851bb6eef4 Add option to mjspec for creating a texture directly from a buffer.
PiperOrigin-RevId: 662186527
Change-Id: I469c876681d52964ac971c0bb2ec3517224d3a3d
2024-08-12 12:29:08 -07:00
Alessio Quaglino 648fd56ed1 Preserve time when recompiling a model.
Fixes #1890.

PiperOrigin-RevId: 662084324
Change-Id: I6aed40761cee5044e63426935d102123db295b25
2024-08-12 08:00:36 -07:00
Taylor Howell 466368efc6 Add shellinertia support for primitives: sphere, capsule, cylinder, ellipsoid, and box.
PiperOrigin-RevId: 661407997
Change-Id: Icddac58c540c71ea26ac7a3be874788443bd1122
2024-08-09 14:40:13 -07:00
Alessio Quaglino da15aa6a0e Improve error message for fullinertia and orientation specifiers.
Fixes #1888.

PiperOrigin-RevId: 661359190
Change-Id: Ibe38e88024b4a43922352b42347abf1026f168a2
2024-08-09 12:20:27 -07:00
Kyle Bayes ebd8615554 Internal change.
PiperOrigin-RevId: 661267364
Change-Id: If2249eb1658c5b877a43a4d3c29ebf88d2a42d5a
2024-08-09 08:16:41 -07:00
Kyle Bayes 1c9d609b5b Make mj_gjkPenetration have the same signature as LibCCD penetration functions.
PiperOrigin-RevId: 661256774
Change-Id: If0ae95e27900a9d7b9c63f189837f1315fbbb987
2024-08-09 07:40:17 -07:00
Erik Frey 35a834f0ba Fix engine_sort_test compile error.
PiperOrigin-RevId: 660975517
Change-Id: I6e3d1b041fe60b1ec202391903eff340f787b46d
2024-08-08 14:11:35 -07:00
Taylor Howell 82c27165f2 mjQUICKSORT uses std::sort with C++.
fixes #1638

PiperOrigin-RevId: 660887790
Change-Id: Ia3b493feda98b246d963aa749bc81b96c42fddaa
2024-08-08 10:24:34 -07:00
Kyle Bayes a1d9b47e2f Initial (unoptimized) implementation of EPA.
PiperOrigin-RevId: 659938320
Change-Id: I72c6c6bd7504bce36e4788d90b06b2cb3849b4db
2024-08-06 06:53:55 -07:00
Google DeepMind 881b777ffd Fix a build error in engine_util_solve_test.cc.
PiperOrigin-RevId: 659668840
Change-Id: I56b0604628d54e149092201ff19c3318b75429a6
2024-08-05 13:47:28 -07:00
Nimrod Gileadi 0610c1d0e9 Use std::abs instead of mju_abs to compare integerst in fixture.cc.
PiperOrigin-RevId: 659534808
Change-Id: I4eb9f72078f2d7224bcfd3b537e4053d220750c8
2024-08-05 06:35:07 -07:00
Nimrod Gileadi 6a8e28f0e9 Prevent integer overflow when computing texture sizes and allocating memory for them.
Correctly check for failed allocations when resizing std::vector

PiperOrigin-RevId: 659488680
Change-Id: I7bf4c0b416e96eda2baec32b21be78456604f4b0
2024-08-05 02:58:46 -07:00
Yuval Tassa a29f67c850 Add test models for tendon wrapping.
PiperOrigin-RevId: 657208035
Change-Id: Ib82bd2b31a15d1386f8096b280def9e7325c8e46
2024-07-29 08:24:37 -07:00
Yuval Tassa a4bd2bec0a Skip disabled actuators in mjd_actuator_vel.
Fixes a bug where the derivative of the actuator force with respect to the generalized velocities (used in implicit and implicitfast integrators) was failing to take into account disabled actuators.

Fixes #1838

PiperOrigin-RevId: 657193960
Change-Id: Id8c0ab863a39e2a01cd2703774f460e9731b4807
2024-07-29 07:31:58 -07:00
Kyle Bayes 5ac5cfb618 Support directories in VFS via mj_addBufferVFS.
PiperOrigin-RevId: 655286683
Change-Id: I846376a0571d8df28d979beb5981a0cbccd7a04f
2024-07-23 13:39:18 -07:00
Kyle Bayes 2746cb8559 Support FilePaths instead of raw strings in XML code.
PiperOrigin-RevId: 655177026
Change-Id: I55b055551384b01ba7a4baa5d75fbe3329b7d25d
2024-07-23 08:36:53 -07:00
Tom Erez 33e5960653 Allow multiple textures per material in MJCF.
PiperOrigin-RevId: 654795013
Change-Id: I418b72533484d00accaf801a342aa183e602a2d0
2024-07-22 09:57:51 -07:00
Alessio Quaglino e79efa60d6 Reset tree indices before recompiling.
Fixes #1822.

PiperOrigin-RevId: 654762203
Change-Id: I7f656f7dad376d4899229a8741315c8f821bfa56
2024-07-22 08:30:29 -07:00
Kyle Bayes 8a8a44a4db Refactor numerical parsing in XML.
PiperOrigin-RevId: 653979240
Change-Id: I4d39f4041b88396193eb35f0cc393141d64f6fc0
2024-07-19 05:42:02 -07:00
Tom Erez e92af73cbf Add mjmodel support for textures with different number of channels.
PiperOrigin-RevId: 653974959
Change-Id: Ia280e0bdb21027646249f104f21bedee792ba7e5
2024-07-19 05:22:19 -07:00
Alessio Quaglino c198a69bbf Return null pointer from mjs_firstChild and mjs_firstElement when the requested list is empty.
Fixes #1824.

PiperOrigin-RevId: 653758711
Change-Id: I6ede762cafd88dcbb0dfc9c2999b7aee24bd2e2a
2024-07-18 14:35:36 -07:00
Alessio Quaglino 67922f41b9 Exclude nbuffer from CompareModel.
This will give more informative errors when the test fails.

PiperOrigin-RevId: 653571444
Change-Id: I78b0a2bfc7794dae81607a9dbbdb91439af48b0c
2024-07-18 04:50:25 -07:00
Alessio Quaglino 2664cc1391 Allow passing a null pointer in mj_recompile.
Fixes #1819.

PiperOrigin-RevId: 653242587
Change-Id: I36dbd6ed54abdf21abeb62cf41ee88f159008d01
2024-07-17 08:29:01 -07:00
Yuval Tassa a2fd34caee Modify test/testdata/model.xml so the wrapping is stable. Fixes #1795
PiperOrigin-RevId: 653202132
Change-Id: I90ccff840a0b98d44dbee8888cb37ff5195caaa6
2024-07-17 05:46:04 -07:00
Kyle Bayes 2cf352c2e6 Add VFS handling logic to mj_openResource.
PiperOrigin-RevId: 653124909
Change-Id: I4d031eb0bfb0070f8493753d2aeaac60ac283b85
2024-07-17 00:41:18 -07:00
Alessio Quaglino 6e64dd10e8 Fix bug in RemoveFromList.
The function was interpreting that the elements that were expected to be detached contained useful user errors, and therefore it was not detaching them. Also, the function tried to compare the namespace between two models, but the namespace is already fused in the references at detach time.

PiperOrigin-RevId: 651738364
Change-Id: Ifdaa9bd5b658bfd18b544b7138a5c2c56b66e936
2024-07-12 05:08:00 -07:00
Kyle Bayes 9c9faa02d5 Add FilePath utility class for handling resource / file paths in MuJoCo user code.
PiperOrigin-RevId: 651716008
Change-Id: I250b8cec32aab538f5862f8a05f42d1fae698307
2024-07-12 03:21:21 -07:00
Alessio Quaglino 2f46dec669 Fix bug in frame saving. Fixes #1802
PiperOrigin-RevId: 651696068
Change-Id: Ie1e2e1de4e83c42f2b5ebcc3afd0540b9afe7bbd
2024-07-12 01:56:38 -07:00
Yuval Tassa 3d1d1d0718 Multithreaded mesh compilation.
PiperOrigin-RevId: 651358120
Change-Id: Id6272aac84ec6ac1b709d2f4a44b7593307bd158
2024-07-11 04:21:49 -07:00
Kyle Bayes f9ab89b205 Refactor user cache to just support void pointers so user objects can be cached whole.
PiperOrigin-RevId: 651307384
Change-Id: I92c058a900727070235d00b6d2165c29fd12e7b0
2024-07-11 01:01:27 -07:00
Alessio Quaglino 27b9ddda5b Add attach tag to MJCF.
PiperOrigin-RevId: 651117953
Change-Id: I57b0e53ed44607d479b3785d908e0837c0804cf3
2024-07-10 12:41:43 -07:00
Copybara-Service 5b080bacc4 Merge pull request #1799 from JewelryForge:main
PiperOrigin-RevId: 651069985
Change-Id: I758e27e2f4bf19bba38d9e1189a41accae40d028
2024-07-10 10:29:22 -07:00
Alessio Quaglino 7f9f8b5429 Catch errors in attach during replicate.
PiperOrigin-RevId: 651041336
Change-Id: I59986e157b4e22c74f8b8493899cdd4a3d5df839
2024-07-10 09:04:37 -07:00
Chengrui Zhu 1a47860577 Add a xml test file whose mesh has a default class. user_api_test will have a segmentation fault before #1799. 2024-07-10 23:10:22 +08:00
Yuval Tassa 7e97caaafd Add a test for lengthrange computation, with and without threading.
PiperOrigin-RevId: 650997405
Change-Id: I45c3725dacb6ccf17977953a9ffed717c927b786
2024-07-10 06:39:18 -07:00
Alessio Quaglino 462cfa5ceb Attach the tree of defaults recursively and with namespacing.
PiperOrigin-RevId: 650664018
Change-Id: I17751a02a406dcb2a2ca218c316b5eb0370071b8
2024-07-09 09:54:09 -07:00
Nimrod Gileadi 393895bb29 Explicitly specify actdim on PID plugin actuators, to allow them to be used with keyframes.
Support actdim attribute on plugin actuators.

Remove the actuator_actdim callback. This callback leads to crashes when loading keyframes for models that have a stateful plugin.

PiperOrigin-RevId: 650649505
Change-Id: I40d1994d02ae4e20ce631b2702a984766cf2628e
2024-07-09 09:08:48 -07:00
Nimrod Gileadi c5f958bdff When reporting compilation errors, include warning strings.
This allows plugins to call mju_warning, and have the string propagate to users.

PiperOrigin-RevId: 650621601
Change-Id: I608e7a3a1ad126ab8da2ff0634fa708458fb9ccc
2024-07-09 07:33:11 -07:00
Kyle Bayes 450e7ff777 Move user_resource.c to C++.
PiperOrigin-RevId: 650592110
Change-Id: I5e043970e3aa722e3961e478334cad4f3f1c191e
2024-07-09 05:33:38 -07:00
Kyle Bayes c6fd002f87 Move engine/engine_resource.{c,h} to user/user_resource.{c,h}.
PiperOrigin-RevId: 649628768
Change-Id: Id90c983cf70c0f92c3b033ac1b1654c53696955d
2024-07-05 05:41:55 -07:00