Alessio Quaglino
65048d6b8f
Do not use fast lookup for frames.
...
Fast lookup is not possible since mjOBJ_FRAME > mjNOBJECT, which is the size of the objects maps used for the search.
Fixes #2328 .
PiperOrigin-RevId: 712479460
Change-Id: I7bcfa75ff8a1e288183d60ed4a44cab5bc6f4173
2025-01-06 04:17:41 -08:00
Yuval Tassa
daed8f46c8
Don't assume compressed input in mju_transposeSparse, allow NULL pointer for matrix values, to only transpose the structure.
...
PiperOrigin-RevId: 712472432
Change-Id: I6dd34583ab181f0c9677c55230cecdf0aed46f9e
2025-01-06 03:51:35 -08:00
Yuval Tassa
94230a8bee
Fix bad indent.
...
PiperOrigin-RevId: 712267512
Change-Id: I3463b0f53b808b726ff0fe5ea46ec8d30164eac4
2025-01-05 09:12:50 -08:00
Yuval Tassa
abe8ffdee7
Enable AVX for inlined mju_dotSparse.
...
PiperOrigin-RevId: 711858423
Change-Id: Id2d06a9e87085e9f810779fba4e8ed9c19a4cba9
2025-01-03 14:42:00 -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
63e2836f63
Expose mj_printSparsity in engine_print.h.
...
This is useful for debugging sparse operations.
PiperOrigin-RevId: 711765082
Change-Id: I532a5218da0f921dd4b04730d0b12c5136e7ca65
2025-01-03 08:51:46 -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
6c880eb0fa
Clean up mju_sqrMatTDSparse
...
PiperOrigin-RevId: 711486739
Change-Id: I5f9145dcd8522a9cb372cbdf60611d7d05cb524e
2025-01-02 12:02:10 -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
69c9ac074a
Remove mjData.qLDiagSqrtInv, add corresponding argument to mj_solveM2.
...
- `qLDiagSqrtInv` is only required for the dual solvers. It is now computed as-needed rather than unconditionally.
- `mj_solveM2` now requires a new input array `sqrtInvD` which contains the square root of the inverse diagonal D (formerly saved in `qLDiagSqrtInv`).
PiperOrigin-RevId: 710805133
Change-Id: I0622d6a8da3882916824e9c10bad9223c122c321
2024-12-30 15:24:36 -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
e42370c982
Avoid allocation and copying in implicit solver's addJTBJSparse
...
PiperOrigin-RevId: 710679558
Change-Id: Ie75fdcd1127ff619c2668f568ab6a8a11e079dda
2024-12-30 04:19:10 -08:00
Yuval Tassa
8cb253b6ca
Fix typos.
...
PiperOrigin-RevId: 710678815
Change-Id: Iab6f603f8f4d782ac7f34140add39e1f37625167
2024-12-30 04:15:29 -08:00
Yuval Tassa
0336114a88
Add restrict to output variable in mj_solveLDs.
...
PiperOrigin-RevId: 710358020
Change-Id: Ia63048161d7622f21954e98346b7ff4e37ecb342
2024-12-28 16:05:18 -08:00
Yuval Tassa
a8a9607712
Inline mju_dotSparse in engine_util_sparse.h
...
PiperOrigin-RevId: 709577108
Change-Id: I76547122b5780bec76a12384effcb66315f84e13
2024-12-25 08:09:42 -08:00
Yuval Tassa
3f855f32d9
Fix stack allocation leak in mjv_addGeoms()
...
PiperOrigin-RevId: 708356387
Change-Id: If3d227028ea8f809390911b578878d985d9d7b1a
2024-12-20 10:11:18 -08:00
Yuval Tassa
b26d6f0466
Disable tendon catenary visualization when tendon is actuated. Add note about catenary visualization.
...
PiperOrigin-RevId: 706161179
Change-Id: Ifaf571e039306309869078d1a0bcf9a69f1fe9de
2024-12-14 01:54:40 -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
2691887500
Add engine-internal convenience macro for allocating typed arrays, improve error message.
...
PiperOrigin-RevId: 705126655
Change-Id: I2bd8fada6d33a919d2fb82297f93ac57958355a4
2024-12-11 09:04:44 -08:00
Yuval Tassa
049a260102
Remove superfluous newlines in Schema exception messages.
...
PiperOrigin-RevId: 704781176
Change-Id: Ie23ac2deab4a5173e1e7a60ffe9e751fe054a2dc
2024-12-10 11:18:51 -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
Yuval Tassa
537fc2ff45
Use diagonal index to speed up mju_solveLUSparse.
...
PiperOrigin-RevId: 704303282
Change-Id: I72c3fbcd31a5564fc792b73efe9d12a151b4d60f
2024-12-09 08:53:25 -08:00
Yuval Tassa
3a14ada308
Store index of diagonal element for C and D in mjData.
...
PiperOrigin-RevId: 704287869
Change-Id: I15d1faa0b5c3ff54721f692ec6329726456ec318
2024-12-09 08:01:30 -08:00
Alessio Quaglino
f882f4b065
Remove requirement to specify a name prefix or suffix during attach.
...
PiperOrigin-RevId: 703049862
Change-Id: I5fd6da0581331b1b716110292a8160ae16934157
2024-12-05 03:19:57 -08:00
Alessio Quaglino
10239a673b
Change from parent ID to parent pointer in mjCBody.
...
This is required to have parent body info during attach and during body to frame tranformation for uncompiled models.
PiperOrigin-RevId: 703038426
Change-Id: Ib482059ba419a020860c649d6ea1b1088045f2e1
2024-12-05 02:32:56 -08:00
Alessio Quaglino
977fb913cf
Remove hanging vertex from flexcomp circle type.
...
PiperOrigin-RevId: 702777882
Change-Id: I3ce09c0ed81a9b153c606debc8c22fbb47c93e8b
2024-12-04 10:37:42 -08:00
Alessio Quaglino
afc86ac1b3
Associate children of deleted body to the newly created frame in mjs_bodyToFrame.
...
Also associate all children that need a parent body to the parent of the deleted body.
This is a bug that was causing the former children of the body that gets transformed to a frame to not be children of the new frame.
PiperOrigin-RevId: 702702853
Change-Id: I36d48f0446bc87c665b18d34e0b0609d82c70f51
2024-12-04 06:30:21 -08:00
Yuval Tassa
0ba717a653
Print supernode values in mj_printData
...
PiperOrigin-RevId: 702677257
Change-Id: Icecc5dd8604fcadc02bba5fc69c9fd5fd4fbd825
2024-12-04 04:41:10 -08: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
Gabe Oppenheimer
c90a63a926
Update the version number to 3.2.7 following the 3.2.6 release.
...
PiperOrigin-RevId: 702103729
Change-Id: Id5581cc823a17360e7bb98ac0aa4342020c1aefa
2024-12-02 15:30:52 -08:00
Alessio Quaglino
82b6dbeb40
Copy attached spec before attaching anything else.
...
Spec were copied after bodies are attached, so the reference to the source spec got lost during mj_copySpec().
PiperOrigin-RevId: 701287267
Change-Id: I55eff53c7ae9d42b03957be48ea506b80d274e03
2024-11-29 07:41:49 -08:00
Alessio Quaglino
300450f8b8
Add circle to flexcomp and remove rope and loop from composite.
...
Add pulley example to show a circle use case.
Switch on flex edge rendering by default (no effect when flex skin is rendered).
PiperOrigin-RevId: 700738379
Change-Id: I8469bbf194de01c8dab66c9a51c49879013df141
2024-11-27 10:14:25 -08:00
Alessio Quaglino
203602b01f
Move computation of flex_vert0 to user_mesh.cc.
...
This removes the dependency of flex_vert0 from mj_flex and mjData.
PiperOrigin-RevId: 700382297
Change-Id: I0b6d023c2e1ba14fa92417b65bfc288f37c223ae
2024-11-26 10:17:16 -08:00
Alessio Quaglino
e310c23267
Fix return value of mj_saveXML and mj_saveXMLString, fixes #2247
...
PiperOrigin-RevId: 700269761
Change-Id: Ifb7e9c66c70eac7d681cfcf106712d47291cf9e2
2024-11-26 02:32:50 -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
Alessio Quaglino
13b6055098
Add material namespacing to sites.
...
Fixes #2243 .
PiperOrigin-RevId: 699713625
Change-Id: I1b45e43f2a6ccfa64c46489c9426fcc2acdc94c3
2024-11-24 08:39:29 -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
Yuval Tassa
cedd602bc1
Compress dense rows in mjData.actuator_moment
...
PiperOrigin-RevId: 698516133
Change-Id: Idd861c2b63d77748a6282d72f8241eaeeb88006c
2024-11-20 14:10:28 -08:00
Yuval Tassa
1767c11d46
Direct assignment of mjData.moment_rownnz
...
This allows for better sanitizer coverage, errors will be caught upon read rather than upon use.
PiperOrigin-RevId: 698458735
Change-Id: I3003f3a122b83bbf42a6510260abbb8353c56a40
2024-11-20 11:24:36 -08:00
Taylor Howell
a1b18e707a
Compress actuator_moment memory using nJmom <= nu x nv.
...
PiperOrigin-RevId: 698446692
Change-Id: I49c9633e12129a1e690724db82d1f11204e41d9c
2024-11-20 10:53:07 -08:00
Taylor Howell
aae5fd6906
Add nJmom, the number of non-zeros in sparse actuator_moment matrix, to mjModel.
...
PiperOrigin-RevId: 698343986
Change-Id: I3d4a4dea1ec095d4e7b231c2fffc0e6241cee39f
2024-11-20 04:30:47 -08:00
Yuval Tassa
58d68d08d3
Refactor CopyPlugins() out of TryCompile()
...
PiperOrigin-RevId: 698072233
Change-Id: I2138d9d8383838328611eef463448fe2f15bd173
2024-11-19 10:46:53 -08:00
Alessio Quaglino
821f1d3f98
Do not namespace empty actuator strings during attach.
...
Fixes #2233 .
PiperOrigin-RevId: 698070772
Change-Id: I19613acfd407ba6a8ede40dad85324a70db480a8
2024-11-19 10:42:24 -08:00
Yuval Tassa
5c23ae11ef
Fix bug in material texrepeat attribute, fixes #2223 .
...
Was mistakenly cast from float to int, bug introduced in 3.2.0
PiperOrigin-RevId: 697993181
Change-Id: I643a07e2b0866a4af56d7cbd3344e764a7caf56f
2024-11-19 06:30:55 -08:00
Kyle Bayes
0cb35a0fe1
Populate missing fields in mjCCDStatus in GJK code.
...
PiperOrigin-RevId: 696965759
Change-Id: Idf0799a44876e95fc8d688dd39663a34f1808b27
2024-11-15 12:24:37 -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
0a0de6615d
Back out of gjkIntersect when convergence fails due to algorithm oscillating between two support points. Also, fix related bug in box support function.
...
PiperOrigin-RevId: 696482893
Change-Id: Icedaf5489b761b8bf03ec30558b5d1128668a647
2024-11-14 05:12:32 -08:00
Yuval Tassa
536c60a0ac
Print arena usage percentage in mjData print.
...
PiperOrigin-RevId: 696464274
Change-Id: Ib794148e037521118138bd72c021dbe086c9681a
2024-11-14 03:52:41 -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