Matthew Bennice
8ffdee355a
Add new header to correct warning for placement new
...
PiperOrigin-RevId: 562800238
Change-Id: I94c883488391f7e95347eb2fe8dc291125233fff
2023-09-05 09:20:40 -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
Nimrod Gileadi
f976d6d228
Use a raw function pointer instead of std::function objects in thread pool.
...
std::function can have an allocation cost when it's created, and also adds overhead to function calls. Since this API must be used from C, using a raw function pointer is good enough.
PiperOrigin-RevId: 562760324
Change-Id: I2b714a13e07a2b71566d013f21f76c506e817a52
2023-09-05 06:31:05 -07:00
Matthew Bennice
edbe9ce86f
Correct use of number_of_threads_ in an array length definition. It should be max_number_of_threads to allow Windows to compile it, GCC tolerates the variable length array.
...
PiperOrigin-RevId: 562743538
Change-Id: I5dc6dfb54002a996fe129b91e599cccfc9420e9c
2023-09-05 05:06:29 -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
70c5fa50f2
Improve island-constraint testing model.
...
PiperOrigin-RevId: 561931744
Change-Id: I2826d4c5b987cc6edd761026f6734fe40fb31278
2023-09-01 05:52:00 -07:00
Nimrod Gileadi
5279ce6f6f
Fix comment typo in simulate.cc
...
PiperOrigin-RevId: 561921946
Change-Id: I423378df566be7a6ad88fb3526769d298ac32a3b
2023-09-01 04:56:34 -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
43a0bd3646
Formatting improvements to docs Overview chapter.
...
PiperOrigin-RevId: 561586361
Change-Id: Ib529cbd49cebf26d802d023d12d973491e41d3ad
2023-08-31 01:43:44 -07:00
Yuval Tassa
ac150f751d
Clean up mj_mulM.
...
PiperOrigin-RevId: 561404770
Change-Id: Ie802f5d7f1df6bf32d4549d3db6809d0f507d1e1
2023-08-30 11:46:55 -07:00
Alessio Quaglino
f371ca7a4e
Add missing face attribute to the XML schema.
...
PiperOrigin-RevId: 561330536
Change-Id: I693fc5228591e4a26ea0749435a6ce9869afd457
2023-08-30 07:08:10 -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
Alessio Quaglino
273c23038c
MakeParticle and elasticity plugin refactoring.
...
- Removed the explicit dependency on a plugin name.
- Creation of particles from user-defined vertices (if a plugin is present).
- Add skin support for an irregular mesh
- Fixes #642 and #674 .
PiperOrigin-RevId: 561313771
Change-Id: I450f91f0d3b578cc18d97ed7180a0a8944b7dd41
2023-08-30 05:40:27 -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
Saran Tunyasuvunakool
a48e0aa355
Use size_t for the mjMARKSTACK temporary variable.
...
This is necessary since daa2ac7f8b changed the type of mjData pstack from int to size_t.
PiperOrigin-RevId: 561092753
Change-Id: I298507c2c0656c797637b35ee684b73eefaae8f5
2023-08-29 11:39:01 -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
Kyle Bayes
50e968a6e2
Add particle.xml to benchmark tests.
...
PiperOrigin-RevId: 561003057
Change-Id: I73094a135ae006eeb041fe55ebf3e998ebe6b3ab
2023-08-29 05:52:57 -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
55173e58f9
Save <compiler {boundmass/boundinertia}> if nonzero.
...
Fixes #928
PiperOrigin-RevId: 560967976
Change-Id: Idc8c043278362d8925ce41061c65f3e678ad50ce
2023-08-29 02:41:22 -07:00
Yuval Tassa
8ba3291365
Fix typo.
...
PiperOrigin-RevId: 560750842
Change-Id: I11064d43ab43ff0de96997a859bf32d4b0833e05
2023-08-28 10:29:48 -07:00
Yuval Tassa
5fe4850643
Improve mj_jac documentation. Fixes #994
...
PiperOrigin-RevId: 560748977
Change-Id: Ic776d6450175a6620eb32ab8631dcca68c3088df
2023-08-28 10:23:45 -07:00
Yuval Tassa
d1d79f396e
Mention Windows build issue regarding missing C header file.
...
Fixes #862
PiperOrigin-RevId: 560712857
Change-Id: I530f102b645d7d7b8dd168349162a2d38f3ad9be
2023-08-28 08:04:50 -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