Yuval Tassa
fd17b2144a
Replace double- or single-precision-denominated function calls in the engine with the equivalent mjtNum-denominated calls. This avoids unnecessary casting or precision loss when MuJoCo is compiled for 32-bit float precision. Accordingly, remove #include <math.h> from all engine source files.
...
build / windows-2022 (push) Has been cancelled
build / macos-12 (push) Has been cancelled
build / ubuntu-20.04-clang-10 (push) Has been cancelled
build / ubuntu-20.04-clang-11 (push) Has been cancelled
build / ubuntu-20.04-clang-12 (push) Has been cancelled
build / ubuntu-22.04-clang-13 (push) Has been cancelled
build / ubuntu-22.04-clang-14 (push) Has been cancelled
build / ubuntu-22.04-gcc-10 (push) Has been cancelled
build / ubuntu-22.04-gcc-11 (push) Has been cancelled
build / ubuntu-22.04-gcc-12 (push) Has been cancelled
build / ubuntu-22.04-gcc-9 (push) Has been cancelled
Also, minor type-related fixes in `user_mesh.cc`.
PiperOrigin-RevId: 675082329
Change-Id: Icc5eb9f9eb4fbf09b08d7d4b9b2929f414e4a75c
2024-09-16 03:40:17 -07:00
Kyle Bayes
9f8f6947fc
Remove global linear search in favor of (almost constant time) local search when finding the convex hull of the polytope and new point in EPA for NativeCCD.
...
PiperOrigin-RevId: 673852140
Change-Id: Ib2ab64bad3cd2aa7d252b4016754f37ea30e1077
2024-09-12 08:11:30 -07:00
Kyle Bayes
8d165d5cc7
Fix early termination in GJK. It's possible for x_k to be the origin, so we should run the previous test to conclude that the objects are colliding.
...
PiperOrigin-RevId: 673834101
Change-Id: I596b30d2847670261f8067840b34dc13de401ecb
2024-09-12 07:17:53 -07:00
Kyle Bayes
14f420069e
Make projectOriginPlane in NativeCCD numerically robust.
...
PiperOrigin-RevId: 673761409
Change-Id: I64304c89f768414d60e2dcf2e71feb8a6f9b2635
2024-09-12 03:01:15 -07:00
Yuval Tassa
e4d4153352
Move sanitizer instrumentation to a separate header file. Fixes #2049 .
...
PiperOrigin-RevId: 672986547
Change-Id: I42522f4925237a73168e965364a2dd65c0f067cb
2024-09-10 09:05:35 -07:00
Kyle Bayes
44145742a7
Exit GJK early if geom distance doesn't need to be recovered.
...
PiperOrigin-RevId: 672334991
Change-Id: I4af582c799140ccf3ac4d51952e547b08ab5d55e
2024-09-08 14:57:50 -07:00
Kyle Bayes
61721f8d3c
Set tolerance in GJK to zero for colliding discrete geoms.
...
PiperOrigin-RevId: 672326091
Change-Id: Iddec335272461c9aee13c1960640a453ff59f841
2024-09-08 13:49:58 -07:00
Kyle Bayes
4fc6fb179b
Remove libccd compatibility layer from native ccd.
...
PiperOrigin-RevId: 671740643
Change-Id: If3c1097df5c505f70c2dc0c090a7f5a93a43c683
2024-09-06 06:56:01 -07:00
Kyle Bayes
b9822e4347
Check hexahedron in polytope3 to make sure it contains the origin. Otherwise, EPA can return invalid results.
...
PiperOrigin-RevId: 671057312
Change-Id: Ieb21a77ea679ee5c18972d3a0375578d9a98405e
2024-09-04 12:17:54 -07:00
Kyle Bayes
79a5bd0915
Add better boundary tests in polytope3 for EPA.
...
PiperOrigin-RevId: 671038835
Change-Id: I259260a7b40e825678b52187bee4791266ae10c4
2024-09-04 11:25:44 -07:00
Kyle Bayes
e9a85764ea
Native CCD: Replace mju_malloc with C standard malloc, fix bug in computing v5 in polytope3, and add another warning in EPA.
...
PiperOrigin-RevId: 670939250
Change-Id: Ia0d8b7c78ed2ef7019f2a691c066b20e98dc1889
2024-09-04 05:53:31 -07:00
Yuval Tassa
3437361bfb
Add reduced sparse dof-dof matrix structures to mjData.
...
PiperOrigin-RevId: 670919263
Change-Id: I3592de802ae84648d97230115c2e9c3437424968
2024-09-04 04:24:02 -07:00
Yuval Tassa
42eb669e4e
Precompute mappings between M <-> D sparse representations.
...
PiperOrigin-RevId: 670898353
Change-Id: I4b15477b1b6eb4a64cf7d4a0bb5af8fcb95d4e45
2024-09-04 02:57:13 -07:00
Yuval Tassa
2d3d5415b7
Add mj_jacDot: Time derivative of kinematic Jacobian.
...
PiperOrigin-RevId: 670505417
Change-Id: Icf30cff5dc955e002bd2f5d5fb3a04f8388d0780
2024-09-03 04:49:47 -07:00
Taylor Howell
9cab5a42a4
Remove unnecessary normal vector computation from mju_wrap cylinder case.
...
PiperOrigin-RevId: 669010760
Change-Id: Ie3869a9f112ca88b2a7ec4990c402ef3e92d36a8
2024-08-29 11:46:38 -07:00
Yuval Tassa
a1036b86d3
Allow connect constraints to be specified using sites.
...
PiperOrigin-RevId: 668925419
Change-Id: I10cb71e6706e617c830cd90d6d0836b94a5a8cfa
2024-08-29 07:10:51 -07:00
Yuval Tassa
f3cfe7a84a
Minor clean up in mj_jac.
...
PiperOrigin-RevId: 668395751
Change-Id: I5c3104ad59a5a709cf1639df663c864fa9d02399
2024-08-28 04:45:40 -07:00
Taylor Howell
3e701b2125
Fix tendon sphere wrapping when using external sidesite.
...
PiperOrigin-RevId: 668391942
Change-Id: I78b44e1f90bb26fa6f5544eeb884c8ea22e41d33
2024-08-28 04:30:07 -07:00
Yuval Tassa
72a0ab145d
Refactor frustum drawing to use a local makeTriangle function.
...
PiperOrigin-RevId: 668168658
Change-Id: I0ee9038c36eb28e2c4a0a8c94bea7430f68c6b77
2024-08-27 15:42:31 -07:00
Kyle Bayes
ddb29e9293
Fix bug in computing pos in EPA by replacing S2D with computing affine coordinates directly to recover the witness points.
...
PiperOrigin-RevId: 668006152
Change-Id: I1de33c5bb94de1a14523a88a5dff7d6ec984628e
2024-08-27 08:55:40 -07:00
Kyle Bayes
cad8ca6ffd
Do pre-checking when creating initial polytope for EPA.
...
PiperOrigin-RevId: 666807572
Change-Id: I64c3715dc72c24f9b6b2206b3568951bd8c2384a
2024-08-23 08:37:34 -07:00
Yuval Tassa
9d4f8edad9
Avoid pointer access in loop conditionals in engine_core_smooth.c
...
PiperOrigin-RevId: 666800203
Change-Id: Iec6ce752d0cac1a98809ab085ed8f94416f79e95
2024-08-23 08:13:52 -07:00
Kyle Bayes
d360ea1ce6
Minor GJK + EPA improvements:
...
1. Correct stopping criteria for GJK.
2. Store witness points from EPA in mjCCDObj,
3. Get dir directly from EPA instead of computing dir from witness points.
PiperOrigin-RevId: 666791852
Change-Id: I6a168f635b57c17692d31da6f6076b48c32ff2e3
2024-08-23 07:44:30 -07:00
Yuval Tassa
088079eff0
Rename mpr_tolerance and mpr_iterations to ccd_tolerance and ccd_iterations.
...
PiperOrigin-RevId: 666438658
Change-Id: I23dbdf939b9ab581f0fca4445f95c5bb36f6b463
2024-08-22 12:01:54 -07:00
Yuval Tassa
2efbd31762
Add mjSAMEFRAME_BODYROT and mjSAMEFRAME_INERTIAROT frame alignment shortcuts.
...
PiperOrigin-RevId: 666318799
Change-Id: I0af1824d2bd9eaca7b48a9e33e09f873dd33b22d
2024-08-22 06:08:25 -07:00
Yuval Tassa
8b03daa09b
Add mjtSameFrame enum to specify frame alignment of bodies with their children.
...
PiperOrigin-RevId: 666303674
Change-Id: I53dc56e1ca52afa280ae5abaf4158edc465fb1e0
2024-08-22 05:17:06 -07:00
Kyle Bayes
f986a52e1e
Compute witness points from EPA, and use witness points to determine pos and dir for contact.
...
PiperOrigin-RevId: 665791337
Change-Id: If33ca1f455804c4cda534508803f5c3e99c3c52a
2024-08-21 03:06:17 -07:00
Yuval Tassa
0fa39164f7
Speed up mesh support function with warmstarts.
...
PiperOrigin-RevId: 664807396
Change-Id: I9124e65efd9140a8e858b7b6be0867c26961477b
2024-08-19 07:54:50 -07:00
Kyle Bayes
0bffd744f9
Add nativeccd flag. When this flag is enabled, general convex collision detection is handled natively, as opposed to using libccd.
...
PiperOrigin-RevId: 663859009
Change-Id: Ife18bb1de62f2154e4725fdf764484a18586b836
2024-08-16 14:08:35 -07:00
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
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
Yuval Tassa
b2018ff506
Replace function with static array in engine_forward.c
...
PiperOrigin-RevId: 663268322
Change-Id: Ibd161a8eda55fc04cf37e465f0d0ac0adcfc7847
2024-08-15 05:11:38 -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
Saran Tunyasuvunakool
1132632627
Fix for benign UBsan signed-integer-overflow complaints.
...
When counting nl and nc, the nnz is optionally also counted when in sparse mode. However, the functions mj_nl and mj_nc unconditionally counts nnz into a temporary accumulator, then only afterwards check whether the output nnz pointer is NULL.
When not in sparse mode, ten_J_rownnz does not get initialized by mj_tendon, however mj_nl and mj_nc are accumulating potentially spurious data from ten_J_rownnz into the temporary accumulator. While the spurious result eventually gets discarded, UBsan nevertheless detects an integer overflow in the temporary accumulator.
PiperOrigin-RevId: 662443910
Change-Id: I78a9a088d4db7f16be779c7d669167d6fb3e4401
2024-08-13 03:08: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
Taylor Howell
2c56946547
Increase mjVERSIONSTRING to 3.2.3 after release.
...
PiperOrigin-RevId: 660891033
Change-Id: I2bda69d11cab60a83b0c77bb53214240eacaea62
2024-08-08 10:31:57 -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
Gabe Oppenheimer
ebc48d2783
Update the MuJoCo version to v3.2.2 following the 3.2.1 release.
...
PiperOrigin-RevId: 660036707
Change-Id: I7e649e5a0ce6db863bcb99dc4fc1aa851b3f5140
2024-08-06 11:39:30 -07:00
Kyle Bayes
a1d9b47e2f
Initial (unoptimized) implementation of EPA.
...
PiperOrigin-RevId: 659938320
Change-Id: I72c6c6bd7504bce36e4788d90b06b2cb3849b4db
2024-08-06 06:53:55 -07:00
Taylor Howell
20011a2f53
Disable RK4 integrator in mjd_transitionFD by throwing an error and improve documentation for mjd_transitionFD and mjd_inverseFD.
...
PiperOrigin-RevId: 659492713
Change-Id: I84ab7ebfba34742f239f60311d8f0a55559995fb
2024-08-05 03:18:31 -07:00
Gabe Oppenheimer
d538bf994d
Update version to 3.2.1 following the 3.2.0 release.
...
PiperOrigin-RevId: 658412236
Change-Id: I4bd6ccb5dee18059eb6fc0d187afe62598845793
2024-08-01 08:35:42 -07:00
Nimrod Gileadi
70a3a541ea
Unpoison destination arena when copying mjData.
...
PiperOrigin-RevId: 658312528
Change-Id: Ie6d3497793ef70b89eaa64dcc7aed4130678f06c
2024-08-01 01:38:14 -07:00
Yuval Tassa
24a555062d
Rename mjDSBL_AUTORESETNAN to mjDSBL_AUTORESET.
...
- Expose in MJCF.
- Add documentation.
- Improve handling in simulate.
PiperOrigin-RevId: 657606140
Change-Id: I6a27c2f4842d7d4ae32642f2a6255e5f8f1f605a
2024-07-30 08:41:59 -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
Saran Tunyasuvunakool
f62792594f
Add a new disable flag mjDSBL_AUTORESETNAN.
...
PiperOrigin-RevId: 654677473
Change-Id: Id92383fe413729bf6697353aa6e0bc8a946ec7e8
2024-07-22 03:22:41 -07:00
Kyle Bayes
b3f79e561d
Fix bug in pre-counting equality constraints.
...
PiperOrigin-RevId: 654031345
Change-Id: If8c660b3e6fed78d8fd8de470f1cf2a709ac1244
2024-07-19 09:33:59 -07:00
Tom Erez
796173170c
Add support in mjModel for tagging textures with different roles, and use the slot index of a texture to designate its role.
...
PiperOrigin-RevId: 654030065
Change-Id: I34a5b132a7f91a6bb8f260500c1b9c128a03b596
2024-07-19 09:29:22 -07:00
Yuval Tassa
ffb50b7b67
Improve readability of body transmission code.
...
(code block mentioned in #1790 )
PiperOrigin-RevId: 653601254
Change-Id: Ibee727ab668b690c3b9a55c39110c6219cca17fa
2024-07-18 06:43:40 -07:00
Gabe Oppenheimer
22ce22ac8a
Update the MuJoCo version number ahead of the 3.2.0 release.
...
PiperOrigin-RevId: 652578624
Change-Id: I8ed6f66ff1247ff7421e3ed0521cf15e1c0b6c79
2024-07-15 13:16:06 -07:00
Nimrod Gileadi
e7301edd20
Copy arena contents in mj_copyData.
...
Fixes #1710 .
PiperOrigin-RevId: 651351384
Change-Id: I56e3204b30bb18f48278117e85e90464177da973
2024-07-11 03:54:44 -07:00