Commit Graph

842 Commits

Author SHA1 Message Date
Kyle Bayes 708fd83a49 Remove goto statement from engine collision code.
PiperOrigin-RevId: 688539516
Change-Id: I29b5dd39acccde59df2dbcaf5e866eb6a0406c43
2024-10-22 07:22:18 -07:00
Taylor Howell 94e9912d28 Add mju_mulMatTVecSparse to multiply transposed sparse matrix and dense vector.
PiperOrigin-RevId: 688535240
Change-Id: I0bacf1e911cde99014b2dcb0a1434e61a4f41d51
2024-10-22 07:06:29 -07:00
Kyle Bayes 2b0629d75f Replace mjQUICKSORT with faster, native sorting function. fixes #1638
PiperOrigin-RevId: 688519096
Change-Id: I05ab1576703c2458968ef81915ac682a8beac391
2024-10-22 06:05:12 -07:00
Yuval Tassa aa91f3c047 Fix bug in slider-crank transmission.
The associated row in `actuator_moment` was not cleared before being updated.

PiperOrigin-RevId: 688207085
Change-Id: I2f925e984c5c493e64ead66667aef57c4844acfe
2024-10-21 11:21:15 -07:00
Google DeepMind ffdb800e45 Update the MuJoCo version for the 3.2.5 release following the 3.2.4 release.
PiperOrigin-RevId: 686641388
Change-Id: I68d5183c9d369b7617f692ab97c12c53f0d2504c
2024-10-16 14:24:06 -07:00
Gabe Oppenheimer c2024ef6d1 Update the MuJoCo version for the 3.2.4 release.
PiperOrigin-RevId: 686261295
Change-Id: Ib59e44a6829a79fd480f2822a68cb05f94c38732
2024-10-15 15:34:09 -07:00
Yuval Tassa 0ffaeb4d56 Improve comments in mju_cholFactorNNZ, clarify that this function reads from the upper triangle of the source matrix.
PiperOrigin-RevId: 686113654
Change-Id: I029f9279d177f4cb9ff60396a26d64821aee3a6c
2024-10-15 08:26:07 -07:00
Kyle Bayes 5a95d601ed Use GJK for geom distance when the nativeccd flag is enabled.
PiperOrigin-RevId: 686035648
Change-Id: Ib6121394b420df4ba431c38443479d33eeaf1dd9
2024-10-15 03:25:18 -07:00
Yuval Tassa 400d2edc21 Clean up mj_transmission.
PiperOrigin-RevId: 685770636
Change-Id: I03d46d136118a5e6da61f6924ccae65bf0d81dfb
2024-10-14 11:15:06 -07:00
Yuval Tassa ee7b994021 Remove Newton Cholesky factor from mjData arena, rollback of b66da3d369.
PiperOrigin-RevId: 685726867
Change-Id: Ic2afd0dd35e38f403164d2cbe4618286abfa51ab
2024-10-14 09:07:22 -07:00
Yuval Tassa 7ec94f46d4 Refactor Newton solver: move Hessian from arena back to the stack.
The changes in 9a0dc20821, moving the Hessian from the stack to the arena, should be rolled back: they prevent future threading over islands. Unlike the stack, arena allocations are not thread-friendly. The reason for the original move was to save memory, but the savings are small: `O(ctx->nH)` and only linear in `nv`. The significant reduction of the Cholesky factor, from quadratic in `nv` to quadratic in the largest dof island — the reduction afforded by 2dd518734f — remains in place.

Also refactor and improve readability.

PiperOrigin-RevId: 685717356
Change-Id: Ia9ec3e44a62d459a3b9cffb578cf6479d5aa1d7f
2024-10-14 08:34:16 -07:00
Taylor Howell 99259eb0d3 Fix typos in engine_ray.c.
PiperOrigin-RevId: 685273762
Change-Id: I6812a83ef2d84fa07a42812acb87c363a3e1a11d
2024-10-12 16:05:43 -07:00
Taylor Howell 78ade58aff Remove rootid from touch sensor (unused).
PiperOrigin-RevId: 685196948
Change-Id: Ifd574165717f07a58a13ae187bc1c63527c986e7
2024-10-12 08:10:09 -07:00
Yuval Tassa 5fe2b88726 Print ASCII sparse matrix structures in mj_printData.
Also: don't print sparse matrices if they have more than 300 rows.
PiperOrigin-RevId: 684843230
Change-Id: If91d0b56cbbb6565904c3ee55857999e21b0cc62
2024-10-11 08:17:25 -07:00
Kyle Bayes 70d6655434 Add faster support functions for NativeCCD.
PiperOrigin-RevId: 684809392
Change-Id: I5125d4bb74c167d370aa919befba9d356c7162da
2024-10-11 05:59:30 -07:00
Yuval Tassa 2dd518734f Stop over-allocating memory in Newton solver.
PiperOrigin-RevId: 684797464
Change-Id: I3389416cb69a8564b5119f6e3944b579893ea511
2024-10-11 05:09:33 -07:00
Yuval Tassa 9aca4bccac Fix stack usage reporting under ASAN.
PiperOrigin-RevId: 684790558
Change-Id: Ifc206bb0653c1fa3052621f0d3d80cb10671b77f
2024-10-11 04:37:12 -07:00
Kyle Bayes 1d57099e98 Add internal return codes in polytope2 and polytope3 to make debugging in NativeCCD easier.
PiperOrigin-RevId: 684776411
Change-Id: Ie0ab278b449ded0ec67ddc89569443d542bf93e0
2024-10-11 03:36:18 -07:00
Yuval Tassa 9a0dc20821 Move Newton Hessian memory allocation from stack to arena.
PiperOrigin-RevId: 684054446
Change-Id: I4be0b216810ebbd9d7fa119c6a84eb08d3c16b83
2024-10-09 08:54:54 -07:00
Yuval Tassa b66da3d369 Add mjData.L, sparse Cholesky factor of Newton solver Hessian.
PiperOrigin-RevId: 683669555
Change-Id: I18d7530b5d68d1d48cb95d4faa0150c434109638
2024-10-08 10:13:08 -07:00
Kyle Bayes 5bfc7da7de Inline small vector util functions in NativeCCD.
PiperOrigin-RevId: 683121207
Change-Id: Idf83e2d18d725665bf626c2c3269c81048076a1a
2024-10-07 04:11:36 -07:00
Kyle Bayes 6be5decf6c Check for OOM errors once per EPA iteration.
PiperOrigin-RevId: 682447186
Change-Id: I55031da8cf2335d5771bb54b32b7e1f696aa80f2
2024-10-04 14:15:29 -07:00
Yuval Tassa 3f3fe92860 Remove unused argument in mju_sqrMatTDSparseInit
PiperOrigin-RevId: 682375566
Change-Id: If05f5d15a2f8925eee9dd0ebc5d485164d90d787
2024-10-04 10:45:33 -07:00
Kyle Bayes eb095b276c Switch to collision boolean only GJK for contacts instead of using S3D.
PiperOrigin-RevId: 682329224
Change-Id: I3db141b0482610a0a88854f47a46b0b7b694b361
2024-10-04 08:25:14 -07:00
Kyle Bayes dba32e827c Exit recursion gracefully when horizon reaches empty polytope in EPA.
PiperOrigin-RevId: 682050023
Change-Id: I8e04f00e6ab3e15e177d1902889441cdbf11cafd
2024-10-03 15:18:05 -07:00
Kyle Bayes 9d91703871 Replace heap with linear map in EPA.
PiperOrigin-RevId: 681911349
Change-Id: Iffe2d3ff57b9a4cfcc223ea5d5d29e2e6696e1cf
2024-10-03 09:27:02 -07:00
Kyle Bayes a02c37cf12 Use faster cross product in projectOriginPlane for NativeCCD.
PiperOrigin-RevId: 681909044
Change-Id: I5d275a30bce4f24f2e4c205b9a9eb321a5a98b43
2024-10-03 09:20:44 -07:00
Kyle Bayes dc995ad341 Remove unnecessary norm calculation in EPA.
PiperOrigin-RevId: 681906350
Change-Id: Ib6a13ca170a8071adde0771c6ba2b38fb4fd4da4
2024-10-03 09:12:51 -07:00
Yuval Tassa cf13413c0b Clean up dual solver functions.
PiperOrigin-RevId: 680587029
Change-Id: I20c78e96785af94634361d7823b1e5caba08800d
2024-09-30 08:31:40 -07:00
Yuval Tassa 176345b4e1 Remove meaningless const qualifier for scalar arguments in sparse function signatures.
PiperOrigin-RevId: 679568516
Change-Id: I910626cd9555966c3b0a9ffba4064d263b2c16e1
2024-09-27 06:37:18 -07:00
Taylor Howell 6a6e10d779 Add mju_cholFactorNNZ to compute the number of non-zeros per row for sparse Cholesky factorization.
PiperOrigin-RevId: 679553197
Change-Id: I6f92deec347dae97d2e219cfb5376f92e777da1a
2024-09-27 05:39:08 -07:00
Yuval Tassa 84e0e2839d Improve error message when requested stack allocation is larger than 2^64 bytes.
PiperOrigin-RevId: 677851110
Change-Id: Iaef92f7f48f41f3a4bfaae9c517ff6664afed039
2024-09-23 10:34:33 -07:00
Kyle Bayes 04f8403d8e Add unit tests for NativeCCD to produce better test coverage.
PiperOrigin-RevId: 677793306
Change-Id: I435865f00553c74d1d0c0fa86d9c41fb1e5497ff
2024-09-23 07:55:39 -07:00
Yuval Tassa 91cedfd65c Avoid square roots in barycentric coordinate computation.
Also add some `inline` qualifiers.

PiperOrigin-RevId: 676873457
Change-Id: I76f57dc870a8714bd86749a7dee1f10fc5e4be1c
2024-09-20 09:37:40 -07:00
Yuval Tassa 78832db53f Use designated initializers for mjCCDObj.
PiperOrigin-RevId: 676794693
Change-Id: Ie8a35415232e8a9f619713763c5d5a37a6f82935
2024-09-20 04:32:10 -07:00
Kyle Bayes 7a92423cf2 Add height fields to list of discrete objects in NativeCCD.
PiperOrigin-RevId: 676452215
Change-Id: I5d6a0d1e26ee852c774b44f550c1d0531b7a269b
2024-09-19 09:48:41 -07:00
Alessio Quaglino 4998e7b392 Move flex damping to the engine and remove membrane and solid plugins.
PiperOrigin-RevId: 676434954
Change-Id: I24e8dbaa90afcffd613a9cf106ef8b7262195328
2024-09-19 09:01:30 -07:00
Alessio Quaglino 1a5536ce5b Make edges array const.
PiperOrigin-RevId: 676046588
Change-Id: Ica4bcdb49311bae8ccbf071717d7eb1c7cb55b87
2024-09-18 10:40:38 -07:00
Alessio Quaglino 66a9cacc90 Move elasticity force computation to the engine.
PiperOrigin-RevId: 676028775
Change-Id: I994e3dda8d6470815763c04df0c276e265aa1f54
2024-09-18 09:55:00 -07:00
Kyle Bayes e439b748a4 Replace calls to floor/ceil with mju_floor/mju_ceil.
PiperOrigin-RevId: 675988982
Change-Id: I5f4d09d957ac7030cd4ce70e72f78dd4f07a6090
2024-09-18 07:49:23 -07:00
Kyle Bayes 0657e3e871 Fix bug in DeleteFace in NativeCCD.
PiperOrigin-RevId: 675948504
Change-Id: If9d967c8e75580a3a002fce9c10a2e1bfd0b5d46
2024-09-18 05:20:11 -07:00
Kyle Bayes 317f480224 Properly initialize hfield mjCCDObj for collisions.
PiperOrigin-RevId: 675580798
Change-Id: I119258c46562f73af4b7a5d100f69d0e52fbe71c
2024-09-17 08:37:59 -07:00
Kyle Bayes bd811a44e7 Remove redundant copying in NativeCCD and refactor code for readability.
PiperOrigin-RevId: 675573079
Change-Id: If9f7bc21d9ee7806997f05a8985ebe6b1b3c8332
2024-09-17 08:14:10 -07:00
Yuval Tassa 7f7c5ec943 Fix mismatch in mju_wrap function signature definition.
PiperOrigin-RevId: 675204328
Change-Id: I820f10237b6d3bfd36067a9c3aef82cb1908ef6a
2024-09-16 10:34:22 -07:00
Kyle Bayes e94bd8348c Store polytope faces in heap in NativeCCD.
PiperOrigin-RevId: 675197250
Change-Id: Ibe9194d777d68729bffd085e36313fb33ee2756d
2024-09-16 10:17:20 -07:00
Yuval Tassa 48fee9487e Clean up tendon wrapping code.
PiperOrigin-RevId: 675185000
Change-Id: I3d93d7ce65b617c4869eb002dfe9440efa9abf66
2024-09-16 09:47:22 -07:00
Yuval Tassa ce3681a26d Replace hard-coded mjNCATENARY with mjVisual.quality.numslices.
PiperOrigin-RevId: 675157138
Change-Id: I87ea16e4df8ed63b301ceaeac6e1b1d0513b77a0
2024-09-16 08:25:19 -07:00
Kyle Bayes 4628a5e438 Remove vertex struct from NativeCCD and allocate fixed memory for vertices on MuJoCo stack.
PiperOrigin-RevId: 675144892
Change-Id: I23d3316b9346ce7137bcfe84265717b60950898a
2024-09-16 07:45:53 -07:00
Alessio Quaglino 31abd7900a Add edge ids to flex elements in mjModel.
PiperOrigin-RevId: 675130981
Change-Id: If2ccfb268142d235273b7a50e15740f6399903b2
2024-09-16 06:58:10 -07:00
Taylor Howell 60a1921b34 Add site semantics to weld constraint. Fixes #1896
PiperOrigin-RevId: 675112981
Change-Id: Ie4c01440d54116075df89f480591700762892cbd
2024-09-16 05:46:01 -07:00