Nimrod Gileadi
71faea0e62
BEGIN_PUBLIC
...
Don't update actuator state when actuation is disabled.
END_PUBLIC
PiperOrigin-RevId: 564712814
Change-Id: I3cb656e81c9018a48d46348960cc07b14ae15b4a
2023-09-12 07:17:57 -07:00
Nimrod Gileadi
fbcd96d03f
BEGIN_PUBLIC
...
Zero all of act_dot when there are custom actuator dynamics, but no callback.
END_PUBLIC
PiperOrigin-RevId: 564712105
Change-Id: I107481727a42eb2577d62e29ac4e1496c56bb634
2023-09-12 07:14:15 -07:00
Saran Tunyasuvunakool
2f14a7c102
Make asan instrumentation in mj_(mark|free)Stack cheaper.
...
Symbolization and string comparison results are now cached.
PiperOrigin-RevId: 564697198
Change-Id: I0447f283a90143e2f67ecd90d895a36a078b3981
2023-09-12 06:06:04 -07:00
Yuval Tassa
2b192cebb6
PUBLIC: In mju_normalize4, don't normalize if norm is less than mjMINVAL away from 1.
...
This makes mj_forward calls idempotent if warmstart is disabled and quats in qpos are normalized.
PiperOrigin-RevId: 564442666
Change-Id: I9c43add82bcfb4101c19fbfbfc8c30091b8906d5
2023-09-11 11:09:53 -07:00
Saran Tunyasuvunakool
a07e172770
Make MuJoCo work with -fsanitize=alignment.
...
PiperOrigin-RevId: 563702045
Change-Id: Ieca69595b7e2fc1e35ca69754d7cc7971825f48b
2023-09-08 03:29:34 -07:00
Google DeepMind
040d3efce2
Add options for controlling early termination criteria of CG/Newton linesearch.
...
Useful for performance tuning models.
PiperOrigin-RevId: 563175078
Change-Id: Id64a510d6080038ea8d5876dabbf0b2b311435bb
2023-09-06 12:02:58 -07:00
Saran Tunyasuvunakool
48d0bfde44
Replace glfw.get_time with time.time in the Python viewer timing logic.
...
PiperOrigin-RevId: 563134207
Change-Id: Ic548701fc78336d8d87e94ea48833f94ee6395b8
2023-09-06 09:52:12 -07:00
Saran Tunyasuvunakool
4929077211
Remove mjMARKSTACK and mjFREESTACK macros.
...
PiperOrigin-RevId: 562844184
Change-Id: Id2f57f5d132c47094dad75c6dab7297d7aa73458
2023-09-05 11:41:43 -07:00
Saran Tunyasuvunakool
329ed193ac
Disallow variable-length arrays and turn on -Wpedantic in Clang and GCC.
...
PiperOrigin-RevId: 562832747
Change-Id: I0532624cee31e089a47426305d885687eb0fc5c5
2023-09-05 11:05:04 -07:00
Yuval Tassa
d5292976de
Add internal utility for zeroing int vectors.
...
Remove unnecessary branches in related functions.
PiperOrigin-RevId: 562768873
Change-Id: I3964a7a953d95bcd4e29137a7b590be5ffa6e311
2023-09-05 07:15:14 -07:00
Matthew Bennice
6225186964
Add threading primitives.
...
PiperOrigin-RevId: 562649644
Change-Id: I9c35b270e4b3b50cc7eb5a152f24d71def8e2fcd
2023-09-04 20:09:19 -07:00
Saran Tunyasuvunakool
94a8705ad0
Add mj_markStack and mj_freeStack as public API functions.
...
Also add asan instrumentation to detect stack frame leakages (i.e. `mj_markStack` without a corresponding `mj_freeStack` in the same caller function).
PiperOrigin-RevId: 562625645
Change-Id: I4e3ff66ca0b9d08ed0a95cef45393db8e3053e22
2023-09-04 17:04:11 -07:00
Yuval Tassa
9308e1d383
Add internal utility for zeroing int vectors.
...
PiperOrigin-RevId: 562608956
Change-Id: I25ff1bbf9abf8fe2a636ed1d728d10ae862e04c9
2023-09-04 14:27:11 -07:00
Yuval Tassa
1aa375ef9a
Allow RHS vector in mj_mulM_island to use uncompressed memory.
...
PiperOrigin-RevId: 562605681
Change-Id: If34bceed9eade59957ac9fd9b6a41fb736b58024
2023-09-04 13:56:54 -07:00
Yuval Tassa
600c12533d
Add mj_constraintUpdate_island.
...
PiperOrigin-RevId: 562581620
Change-Id: If156a02873168127e2c5f2f377532fd45f7eec1c
2023-09-04 10:33:34 -07:00
Yuval Tassa
b7686440d1
Indent a couple of #ifdef bodies.
...
PiperOrigin-RevId: 562572883
Change-Id: I44e2d6dc486ed7a181ca4614b1bf3f2f762f52f9
2023-09-04 09:32:35 -07:00
Yuval Tassa
5cef4708f2
Allow mj_mulJac(T)Vec_island to read and write from uncompressed vectors (length nv or nefc).
...
PiperOrigin-RevId: 562547310
Change-Id: Id517c1842e711639f4113d23cc364945839a3759
2023-09-04 06:51:51 -07:00
Saran Tunyasuvunakool
0e36f00857
Fix more mjData stack leakages.
...
PiperOrigin-RevId: 562545230
Change-Id: I2facf25b00878669dc12d5865767a44229d2ca48
2023-09-04 06:38:50 -07:00
Saran Tunyasuvunakool
5a21e202ed
Eliminate mjContact copying during collision detection.
...
This results in approximately 4-5% speedup in collision detection for particle.xml.
PiperOrigin-RevId: 562526634
Change-Id: Ia6487b1908618064d858bac484fe6861ed37a402
2023-09-04 04:46:26 -07:00
Yuval Tassa
feb8aa2fbb
Fix bugs in engine_island.c
...
PiperOrigin-RevId: 562519702
Change-Id: I3075e539ccc1cef92485152721a9344f180aa4b1
2023-09-04 04:06:39 -07:00
Saran Tunyasuvunakool
89f47c33e4
Fix mjData stack frame leakages.
...
PiperOrigin-RevId: 562091591
Change-Id: Ia7bb8a70ccba6bd40edc06ad8ebfac16e4286836
2023-09-01 17:57:39 -07:00
Saran Tunyasuvunakool
33f51856c1
Check that alignment is power of 2 in mj_stackAlloc.
...
PiperOrigin-RevId: 562024496
Change-Id: I9230c6dc05ebb78e935f9b2f606aa77c921d67e5
2023-09-01 12:45:35 -07:00
Yuval Tassa
29aa5e4a41
Allow dot products with sparse vectors to specify that one vector uses uncompressed memory.
...
PiperOrigin-RevId: 561951337
Change-Id: I1310d7c09d9a85ad9b43877155844a9d0ce6edab
2023-09-01 07:40:16 -07:00
Yuval Tassa
02e819e76a
Tighten const qualifiers of mjData in Jacobian multiplication functions.
...
PiperOrigin-RevId: 561711229
Change-Id: I66dc1d2fbcfbf8e935b244fe496ada314d53b135
2023-08-31 11:27:15 -07:00
Yuval Tassa
f9c57f6213
Refactor a loop in mj_constraintUpdate.
...
PiperOrigin-RevId: 561684763
Change-Id: Ifbca1793760ecb49f4b48a1a236bd7c1c6e73d0e
2023-08-31 09:59:40 -07:00
Yuval Tassa
eaa2572a8b
Add private function mj_mulJacTVec_island for Jacobian transpose multiplication with sub indices corresponding to one island.
...
PiperOrigin-RevId: 561672392
Change-Id: Ic72fd7de2a542603cc42e1c15ecb4edd27a9a986
2023-08-31 09:12:34 -07:00
Yuval Tassa
85fd922b37
Add private function mj_mulJacVec_island for Jacobian multiplication with sub indices corresponding to one island.
...
PiperOrigin-RevId: 561648540
Change-Id: I8080a620807e824b40b5d6ba484beb06d081d444
2023-08-31 07:28:24 -07:00
Yuval Tassa
9fd186ac2b
Add private function mj_mulM_island for mass matrix multiplication with sub indices corresponding to one island.
...
PiperOrigin-RevId: 561639405
Change-Id: I3777cea51ef22f6847b3cf3e17bdac5cf621c019
2023-08-31 06:42:33 -07:00
Yuval Tassa
129abc6bca
Add private function mj_solveM_island for mass matrix solve with sub indices corresponding to one island.
...
PiperOrigin-RevId: 561622962
Change-Id: Ib43f03b3dd0c7456c57d4ba45a68e0708bf1c91c
2023-08-31 05:11:00 -07:00
Google DeepMind
ba5cf4d54d
Address -Wint-conversion issues.
...
PiperOrigin-RevId: 561604684
Change-Id: I31af8621f8506d2e029c4ca630982f82ea4cfca9
2023-08-31 03:25:02 -07:00
Yuval Tassa
ac150f751d
Clean up mj_mulM.
...
PiperOrigin-RevId: 561404770
Change-Id: Ie802f5d7f1df6bf32d4549d3db6809d0f507d1e1
2023-08-30 11:46:55 -07:00
Kyle Bayes
16ee0dfde5
Add modified callback to resource providers (for caching purposes).
...
PiperOrigin-RevId: 561327623
Change-Id: Id6683f6d6d32ee91019aba46599c28cbffe29df6
2023-08-30 06:53:20 -07:00
Kyle Bayes
f86e8b449f
Refactor VFS logic out of ResourceProvider plugin code.
...
PiperOrigin-RevId: 561302536
Change-Id: I952f9e76e85a7e3a111e0338f307378a6ff58197
2023-08-30 04:47:24 -07:00
Saran Tunyasuvunakool
215433f5f7
Implement mj_stackAlloc and mj_arenaAlloc alignment using bitwise-and.
...
This implementation explicitly avoids calling division instructions (which are generally expensive) even when link-time optimization is not active or if the alloc functions aren't inlined for some reason.
Also make mj_stackAlloc cheaper for external callers who may be linking against MuJoCo dynamically (and therefore cannot benefit from inlining).
PiperOrigin-RevId: 561299565
Change-Id: Iea4be5bf6d351ddf0c9d1fd8bd89a0c207b39309
2023-08-30 04:29:18 -07:00
Saran Tunyasuvunakool
4c899b92cc
Rename mj_stackAllocByte to mj_stackAlloc and make it public.
...
PiperOrigin-RevId: 561133040
Change-Id: I4f5ffe51c1287aa0c82af68bfe17ed6dd2ad09da
2023-08-29 14:07:54 -07:00
Yuval Tassa
d3ed16e78f
Add mjData.dof_islandind, indexing from dofs into islands.
...
Also fix bug in allocation for constraint islands, added allocation for limit constraints.
PiperOrigin-RevId: 561083128
Change-Id: I9e01d5a5b7454ec3cf60bccadaa0f96f2c0d87d1
2023-08-29 11:06:17 -07:00
Saran Tunyasuvunakool
daa2ac7f8b
Rename nstack to narena, change it and pstack to count bytes.
...
PiperOrigin-RevId: 561066311
Change-Id: I4d0e645e6c254dd906bfc42159e0e99149a7c6c8
2023-08-29 10:13:33 -07:00
Saran Tunyasuvunakool
b979a26b10
Rename mj_stackAlloc to mj_stackAllocNum.
...
PiperOrigin-RevId: 561040193
Change-Id: I49ea21ffb5b596471d2aacefb1961c11c5c905d0
2023-08-29 08:43:03 -07:00
Kyle Bayes
ea5e00cad8
Move mju_combineSparseCount into engine_util_sparse.
...
PiperOrigin-RevId: 561025741
Change-Id: I0bdc48554928fc4545a38a8cea3bdeb593bd7ecd
2023-08-29 07:40:53 -07:00
Yuval Tassa
df1b3515c7
Add mjData.nl: number of active limit constraints.
...
PiperOrigin-RevId: 561012367
Change-Id: I9a01fec55502f8a90d7435972e477455ae29df15
2023-08-29 06:32:18 -07:00
Kyle Bayes
389736f5a1
Add Base64, defined by RFC 4648, encoding and decoding to MuJoCo engine.
...
PiperOrigin-RevId: 561008882
Change-Id: I494eb163bc82e8a5c9ad2116ef119072b08a9f48
2023-08-29 06:14:02 -07:00
Yuval Tassa
5f3e22a45f
Refactor a loop in engine_solver.c
...
PiperOrigin-RevId: 560997065
Change-Id: I26540e4f750eb18d9497bf35396adbb15cc3a122
2023-08-29 05:17:14 -07:00
Yuval Tassa
8ba3291365
Fix typo.
...
PiperOrigin-RevId: 560750842
Change-Id: I11064d43ab43ff0de96997a859bf32d4b0833e05
2023-08-28 10:29:48 -07:00
Yuval Tassa
f44c657544
Restore acceleration after mj_inverse with invdiscrete flag.
...
PiperOrigin-RevId: 560647025
Change-Id: If51f721426be7ecf2b7aa53048ad8c897b51e76e
2023-08-28 02:17:20 -07:00
Tom Erez
819b5cb982
Add invdiscrete flag to enable discrete-time inverse dynamics with mj_inverse.
...
PiperOrigin-RevId: 560161140
Change-Id: If3e30be5e9af4982571dd310172f2fc0d8d1c551
2023-08-25 12:08:37 -07:00
Yuval Tassa
4db3377467
Don't use mj_stackAlloc for int allocations.
...
PiperOrigin-RevId: 559846094
Change-Id: I43eeec0b1970b2c6047be4e7c3548a4ce9aa6f5f
2023-08-24 13:09:51 -07:00
Alessio Quaglino
b0077e4052
Use geom margin in the midphase.
...
At the leaves of the midphase trees in `mj_collideTree`, a bounding sphere test is performed. The margin was incorrectly set to zero instead of reading it from `geom_margin`.
PiperOrigin-RevId: 559782262
Change-Id: Icfceb8445bbf6977582e0061566d7bd4def2f0ae
2023-08-24 09:45:10 -07:00
Yuval Tassa
1dad5993f0
Refactor constraint island representation.
...
Required for constraint solver islanding.
Replace linked lists with `island_{dof,efc}_{num,adr,ind}`, corresponding to the standard `{rownnz,rowadr,colind}` sparse matrix representation. By effectively defining two sparse matrix structures of dimensions `nisland x nv` and `nisland x nefc`, respectively, this representation is more conducive to reuse of existing sparse matrix utility functions, while being cache-friendlier by making sequential indices adjacent in memory.
PiperOrigin-RevId: 559704957
Change-Id: I919362cbef0d5fe5acc4aa2bb4ffb17eee8223a2
2023-08-24 03:48:57 -07:00
Saran Tunyasuvunakool
1f5a9e8c70
Reinstate max_align_t alignment in mj_stackAllocByte.
...
PiperOrigin-RevId: 559433104
Change-Id: I891a6a0562cab1c3af0e3dc395304207ca3a3190
2023-08-23 08:22:31 -07:00
Yuval Tassa
b7cf479abe
Add flag for disabling implicit integration of joint damping in the Euler integrator.
...
PiperOrigin-RevId: 559398414
Change-Id: I43b23c5e75a2830a64b1898daeaa16f19e011718
2023-08-23 05:51:37 -07:00