Yuval Tassa
864b805a6e
Fix multiple bugs related to connect and weld constraints with site semantics. Fixes #2179
...
The introduction of site specification to connects and welds in 3.2.3 conditionally changed the semantics of `mjData.eq_obj1id` and `mjData.eq_obj2id`. These changes were not properly propagated in several places leading to incorrect computations of constraint inertia, readings of affected force/torque sensors and runtime enabling/disabling of such constraints.
PiperOrigin-RevId: 690670420
Change-Id: I55ee8a013cbee8457f8d6c7f33c2981aedafbab6
2024-10-28 10:44:04 -07:00
Copybara-Service
d95befaddd
Merge pull request #2180 from pschmutz:schmutz/error_handling_when_loading_plugins
...
PiperOrigin-RevId: 690567811
Change-Id: I2d2c4e37e74ab4d97c0add5633feb766ef66dd08
2024-10-28 05:11:14 -07:00
Yuval Tassa
d8494fef3b
Remove deprecated mjv_makeConnector function.
...
PiperOrigin-RevId: 690563333
Change-Id: Ice9c6b6cf41de8a55fa361477f9aee9181d50184
2024-10-28 04:51:47 -07:00
Taylor Howell
a36f2cccb6
Add nnz argument for size of allocated memory to mju_dense2sparse and check if this number is too small for number of non-zeros.
...
PiperOrigin-RevId: 690545825
Change-Id: I0e31cb907a1151cb2e4766d5f0cdfecb5629a2a6
2024-10-28 03:46:50 -07:00
Philipp Schmutz
7cf457286d
Print error instead of failing silently when loading plugins
...
Previously the return value of dlopen was ignored, meaning a failed load of a shared library would stay unnoticed
2024-10-26 16:22:47 +02:00
Yuval Tassa
a3ea01e57e
Remove deprecated mju_rotVecMat and mju_rotVecMatT functions.
...
PiperOrigin-RevId: 689405782
Change-Id: I0281376d5d6f5c31ea2603d61c03c7b94aaa6312
2024-10-24 09:15:23 -07:00
Yuval Tassa
e14aebfd16
Expose mju_sparse2dense to public API.
...
PiperOrigin-RevId: 688985153
Change-Id: I9559f1d47363d0afada80c86abdc729cd1910b63
2024-10-23 09:01:25 -07:00
Kyle Bayes
0c97dcf1fd
Avoid overflowing the stack when allocating memory for polytope in EPA.
...
PiperOrigin-RevId: 688641864
Change-Id: I3eef7e821ffbfa8d97a946ecf86d098cb4f0c233
2024-10-22 12:11:22 -07:00
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