Yuval Tassa
de48f4178f
Add missing term in mj_jacDot
...
PiperOrigin-RevId: 735686836
Change-Id: I813ca46f71e368ddc97a6d2e540102137b31dbcf
2025-03-11 03:01:29 -07:00
Kyle Bayes
4d024f9421
Convert internal representation of vertices to double. Also replace remove duplicate vertices with fast hash implementation.
...
PiperOrigin-RevId: 734516595
Change-Id: Ic78556688d5f2b75d69cd286b8d060e2cdeb7c48
2025-03-07 05:17:49 -08:00
Yuval Tassa
0f563ecf31
Switch mjData.{qH,qLD} from reduced ("C") to full ("M") inertia matrix structure. No performance impact of extra zeros because of existing "simple dof" skipping mechanism.
...
PiperOrigin-RevId: 733523931
Change-Id: Ic8d8a152dda5532331c239cb6b4ce7d8d09b7fff
2025-03-04 17:34:35 -08:00
Kyle Bayes
fbe0990b17
Fix bugs in nativeccd with collisions with margin.
...
PiperOrigin-RevId: 730903745
Change-Id: I45ddb674f32cb1f28ff37c587ea953ec595241b3
2025-02-25 08:51:21 -08:00
Alessio Quaglino
14c8dc62f0
Add termination character to flattened plugin attributes if empty.
...
Fixes #2450 .
PiperOrigin-RevId: 730521722
Change-Id: Iec3fa377c65693d782eeb766a144a1c89096d1f3
2025-02-24 11:07:18 -08:00
Kyle Bayes
024616345d
Support edge contacts with multiccd in nativeccd.
...
PiperOrigin-RevId: 730489114
Change-Id: I02847d84bbc15a1526391d5e1b7109ab83ea4a59
2025-02-24 09:48:43 -08:00
Kyle Bayes
ae1c3b7ec0
Support multi-contact with meshes in nativeccd. Contacts are pruned to up to 4 per geom.
...
PiperOrigin-RevId: 730457036
Change-Id: Ib2368f3a7def4fdb94673620df3603e372c35745
2025-02-24 08:14:04 -08:00
Yuval Tassa
81b1948b46
Clean up engine_derivative_test.cc
...
PiperOrigin-RevId: 730166629
Change-Id: I3418be9f7b289f4109ae43c221b89199d2ccf325
2025-02-23 10:59:20 -08:00
Alessio Quaglino
c52d1b3941
Remove the particle composite (replaced by replicate).
...
PiperOrigin-RevId: 730089997
Change-Id: If8d18fb56ae01241e76f84dbf7951e034026d829
2025-02-23 03:14:11 -08:00
Alessio Quaglino
0fcd20f0da
Remove grid from composite types.
...
Replaced it with flexcomp in the models.
PiperOrigin-RevId: 730070619
Change-Id: Icbc69e4c6784c6252743f689a1eafb6482d0c393
2025-02-23 01:31:41 -08:00
Yuval Tassa
b516edae1b
Rename inertia factorization routines:
...
```
mj_factorI -> mj_factorI_legacy
mj_solveLD -> mj_solveLD_legacy
mj_factorIs -> mj_factorI
mj_solveLDs -> mj_solveLD
```
PiperOrigin-RevId: 728246367
Change-Id: I3bc7804cb96faac2ae5419ba9abfc3c1648ed4c6
2025-02-18 09:42:05 -08:00
Yuval Tassa
fb07e0d1f7
Convert qLD to CSR format.
...
PiperOrigin-RevId: 728196818
Change-Id: I31bdf32e251293284426ed345019f27fd051a0e1
2025-02-18 07:14:45 -08:00
Yuval Tassa
e39a5df06a
mju_compressSparse(): add option to compress away small elements.
...
PiperOrigin-RevId: 726010576
Change-Id: Ib6458037a5cf9a9d82abb364b7dda7aab2f36807
2025-02-12 05:08:20 -08:00
Yuval Tassa
5ee0654830
Roll back recent change to mjData.qLD until some issues are resolved.
...
PiperOrigin-RevId: 724389161
Change-Id: I1b30ab0950ab5c5e611b1c6fc3bf3f42f964939c
2025-02-07 10:21:42 -08:00
Yuval Tassa
c27d3758c2
Convert qLD to CSR format.
...
PiperOrigin-RevId: 723955038
Change-Id: I30c3dc7f59739e89ae5fff8841432bc74717ec1b
2025-02-06 08:59:35 -08:00
Kyle Bayes
3235f69afc
Make polytope2 and polytope4 more numerically robust in nativeccd.
...
PiperOrigin-RevId: 723412555
Change-Id: Id262a3c19bcd30b74b1495591bdc95f951bfca50
2025-02-05 01:40:41 -08:00
Alessio Quaglino
7cdf180641
Introduce trilinear flex parametrization.
...
These flexes use only 24 DOFs (3 per vertex of the bounding box), while colliding with the full high resolution mesh.
On an 8x8x8 cube, the performance using DOFs at all vertices is
```
Simulation time : 18.74 s
Steps per second : 533
Realtime factor : 0.53 x
Time per step : 1874.4 µs
Contacts per step : 114.88
Constraints per step : 3322.51
Degrees of freedom : 1536
```
With the new implementation, it is the following:
```
Simulation time : 1.82 s
Steps per second : 5507
Realtime factor : 5.51 x
Time per step : 181.6 µs
Contacts per step : 38.84
Constraints per step : 155.36
Degrees of freedom : 24
```
PiperOrigin-RevId: 721008829
Change-Id: I833df027527db578d86667cc4b24295bcf6f7d22
2025-01-29 09:38:22 -08:00
Yuval Tassa
9605990648
Replace custom sort of sparse fixed tendons with mju_combineSparse.
...
PiperOrigin-RevId: 720219887
Change-Id: I0491b3cb8987c119c3864fc0b5c38ca303d8f7f0
2025-01-27 10:24:58 -08:00
Yuval Tassa
08edde5fd8
Add test for armature, model will be used in upcoming improved documentation for armature.
...
PiperOrigin-RevId: 719916567
Change-Id: I7f74bd3c3864f43f5f68d458d5b128cfee1d7e6c
2025-01-26 12:01:12 -08:00
Kyle Bayes
aa505a7872
Add support for NativeCCD multiple contacts for box-box collision.
...
PiperOrigin-RevId: 718352304
Change-Id: Icaa827e716a2d7aa7c0c644e0ccd2913b476e6fb
2025-01-22 06:02:58 -08:00
Yuval Tassa
2624d524ba
Switch mj_solveM_island to use CSR representation
...
PiperOrigin-RevId: 717684720
Change-Id: I7d74a5d4aef4aa5b0c0acddf88c5b8591d63e88d
2025-01-20 18:36:04 -08:00
Yuval Tassa
1d47a91c19
Add a test for mj_solveM2
...
PiperOrigin-RevId: 717278730
Change-Id: I7507e569620c34f250482eec8402c08c793f4e48
2025-01-19 11:34:20 -08:00
Yuval Tassa
240a7afdee
Add sensors for potential and kinetic energy.
...
PiperOrigin-RevId: 716775375
Change-Id: Ic8ab7f1a51df970ab551dabe7c797cde13cd97fd
2025-01-17 13:10:12 -08:00
Yuval Tassa
2409a6e537
Add mjData.nA the number of non-zeros in the constraint inverse inertia matrix.
...
PiperOrigin-RevId: 714076988
Change-Id: I4c323a6e81dfb23f7972b662719bbcb688bacf4a
2025-01-10 09:23:55 -08:00
Yuval Tassa
00010f5848
Compute diagonal indices in mj_sqrMatTDSparse
...
PiperOrigin-RevId: 713714087
Change-Id: Icc8eae74e6e47ba1d12a6e9aa0d774ab006cfe38
2025-01-09 10:17:31 -08:00
Kyle Bayes
daba00ca9d
Fix a box-box bad collision in NativeCCD.
...
PiperOrigin-RevId: 713683497
Change-Id: I0c4cfd55d00faa196d8759046c87ee4ef74f01ab
2025-01-09 08:35:50 -08:00
Yuval Tassa
8a5f092081
Allow CSR back-substitution to handle multiple vectors.
...
PiperOrigin-RevId: 713229673
Change-Id: I7a5b43fe966cf9e482bd41e2eea6c30dd3ffa1d4
2025-01-08 03:32:16 -08:00
Yuval Tassa
4d82ab5762
Add function to merge chains of indices.
...
PiperOrigin-RevId: 712863690
Change-Id: I15652bec03dc9ce90e230788bd12b44b1a2b8217
2025-01-07 04:42:11 -08:00
Yuval Tassa
674d227050
Standardize names of sparse fill-in pre-counting functions
...
PiperOrigin-RevId: 712835830
Change-Id: I8e90dfa52af56ede917e1fd90b8d551898c244e5
2025-01-07 02:39:46 -08:00
Yuval Tassa
ac11e5faa6
Add CSR implementation of mj_factorI
...
PiperOrigin-RevId: 712498431
Change-Id: I13b52e53482ed97da8788875d4d95e2beb5ca7c1
2025-01-06 05:48:14 -08:00
Yuval Tassa
7eb8231fda
Represent only the lower triangle in Newton solver's reduced dof-dof matrix.
...
PiperOrigin-RevId: 712488529
Change-Id: Iad91c72654376539791d7856765a0d0ac9088251
2025-01-06 04:58:55 -08:00
Kyle Bayes
340c0d7c97
Fix a box-box bad collision in NativeCCD.
...
PiperOrigin-RevId: 711773153
Change-Id: I8a526ef5933be19d863e67f40edeb95b0b1249cd
2025-01-03 09:23:57 -08:00
Yuval Tassa
923f75fd23
Use only lower triangle in CSR back-substitution.
...
PiperOrigin-RevId: 711686157
Change-Id: I4fc98cdfb927e5608ce3a99ea34890ce556fcfd7
2025-01-03 02:33:59 -08:00
Yuval Tassa
4510c6d290
Further speedup to CSR back-substitution using dof_simplenum.
...
PiperOrigin-RevId: 711440268
Change-Id: I81cd9a6a8b8ec78d08cfbc34f60a9216ea753833
2025-01-02 09:04:51 -08:00
Yuval Tassa
ec322641b7
Fix bug in mj_mulM2.
...
PiperOrigin-RevId: 710756899
Change-Id: I30c0725859ba0f1a59750dc89eebb9eba84fa71b
2024-12-30 11:14:56 -08:00
Yuval Tassa
273ced428a
Add simple unit test for mjv_updateScene.
...
PiperOrigin-RevId: 709334033
Change-Id: I69adc1d3ad0565f3684346749a372894d12ce99a
2024-12-24 06:44:02 -08:00
Copybara-Service
526637f118
Merge pull request #2276 from traversaro:reducetestboilerplate
...
PiperOrigin-RevId: 707613522
Change-Id: Ic945c6b057b77f3462dbdb758139af12133f6a8f
2024-12-18 11:22:59 -08:00
Kyle Bayes
ec230fa4b6
Prune face linear map in EPA.
...
PiperOrigin-RevId: 705138358
Change-Id: I835ce7094d066b19ee39af48e0b83b51f7a0954e
2024-12-11 09:44:19 -08:00
Yuval Tassa
3ca97248a3
Fix comparison in engine_core_constraint_test.
...
(was comparing number to itself)
PiperOrigin-RevId: 705053943
Change-Id: I3d179ab4bb2ed1bc1b74b4edec7ce1114ad16b37
2024-12-11 04:11:13 -08:00
Kyle Bayes
a364308d5a
Use GJK to recover contact points for sphere and capsule geoms in nativeccd.
...
PiperOrigin-RevId: 704727907
Change-Id: Iff641b6a32637c48e9892dbaa60826617c54ed06
2024-12-10 08:53:27 -08:00
Yuval Tassa
1c4c7b012c
CSR implementation of mj_solveLD.
...
PiperOrigin-RevId: 704316200
Change-Id: Ibaff0284e40b3ebbe43bb489b6211ce739270e27
2024-12-09 09:34:17 -08:00
Silvio
756a8d716a
Reduce cmake test boilerplate
...
All instances of mujoco_test in the code base were followed by
a call to target_link_libraries(<testname> fixture gmock).
As anyhow mujoco_test already was calling target_link_libraries
to some predefined list of targets (mujoco and gtest_main),
this PR adds to the list of default linked targets also fixture
and gmock, to reduce the boilerplate.
Furthermore, to completly remove the need for calling
target_link_libraries after a call to mujoco_test, this PR also
add to the mujoco_test macro the ADDITIONAL_LINK_LIBRARIES
argument, that can be used if a given test needs to link some
additional targets beside the default ones.
To permit to use these new features also for mujoco benchmarks,
this PR adds a MAIN_TARGET parameter to mujoco_test, to select
if gtest_main or another target is used to provide the main
entry point to the test executable.
2024-12-07 17:14:20 +01:00
Yuval Tassa
0e7d2ef6df
Fix bug in box-sphere collider. Fixes #2206
...
PiperOrigin-RevId: 702627603
Change-Id: Ie6015b7fa6f8507459325d692581b0f5f83aa159
2024-12-04 01:19:27 -08:00
Yuval Tassa
13d3bdedad
Add debugging method for printing matrices to stderr to fixture.h
...
PiperOrigin-RevId: 702301299
Change-Id: I01738b6634a91cde6b146475d06731471dcf3764
2024-12-03 05:20:54 -08:00
Alessio Quaglino
7e46e21ef3
Add mju_mat2Rot.
...
This function extracts the 3D rotation from an arbitrary 3x3 matrix by refining the input quaternion. It is based on the paper "A robust method to extract the rotational part of deformations" by Müller, Matthias, Jan Bender, Nuttapong Chentanez, and Miles Macklin.
PiperOrigin-RevId: 700006006
Change-Id: I77550993233dea9cdf68601762a3ae7ded749bdf
2024-11-25 09:19:10 -08:00
Yuval Tassa
1d64362adc
Add mjv_copyModel to copy mjModel, skipping large arrays not required for abstract visualization.
...
This functionality is meant for fast copying of `mjModel` when synchronizing the visualization state, as in the Python passive viewer.
PiperOrigin-RevId: 699199743
Change-Id: I13a5160063eb09139ec1aee9c4969bc1c6f547f1
2024-11-22 09:38:08 -08:00
Kyle Bayes
cd84011d7b
Default to nativeccd for geomDistance test.
...
PiperOrigin-RevId: 698340192
Change-Id: I814286903e1726462b24390eb2c3dc5b3b76899e
2024-11-20 04:14:24 -08:00
Kyle Bayes
867e8b8adb
Fix ARM issues with tests with nativeccd.
...
Note: frameless_contact_hfield.xml doesn't work with libccd nor nativeccd on ARM as expected.
PiperOrigin-RevId: 698317464
Change-Id: I4c57e04639b9870b416c67d79a16a313c5276cf6
2024-11-20 02:30:15 -08:00
Kyle Bayes
f91588a171
Fallback to polytope3 if tetrahedron from GJK has the origin on a face (most likely due to a numerical issue).
...
PiperOrigin-RevId: 696872633
Change-Id: I58edb0fdc30ad472c8f1338df728e8d42c25fc39
2024-11-15 06:53:00 -08:00
Kyle Bayes
0e8cca93e1
Refactor nativeccd interface.
...
- Update mj_ccd interface for multi-contacts,
- Support GJK cutoff distance, and
- Remove mjc_fixNormal from nativeccd (causes bug with cylindar box collisions).
PiperOrigin-RevId: 696185362
Change-Id: I4828b7ee1bde078268220172a4937cd553f6187e
2024-11-13 10:28:45 -08:00