Matthew Bennice
071af3b015
Implement threading for island constraint solving.
...
Humanoids22 No threads:
Benchmark Execution Time: 9.475905812s
Humanoids22 with 10 Threads:
Benchmark Execution Time: 4.871352s
PiperOrigin-RevId: 571214307
Change-Id: I1f4f2c761b4ae6bc8fac1f28c6c695f6c499f339
2023-10-05 21:05:19 -07:00
Yuval Tassa
ee78b8f76b
Added mjData.eq_active user input variable, for enabling/disabling the state of equality constraints.
...
Renamed `mjModel.eq_active` to `mjModel.eq_active0`, which now has the semantic of "initial value of `mjData.eq_active`".
Fixes #876 .
PiperOrigin-RevId: 570410643
Change-Id: Id03171e751377c7cc453f143abee64239ee2e2ed
2023-10-03 09:32:24 -07:00
Alessio Quaglino
36d2ffe4f2
Specify camera parameters using standard robotics conventions.
...
PiperOrigin-RevId: 569147555
Change-Id: I3443f95e5de56a17024f5e5c03f33888dd583edb
2023-09-28 05:19:19 -07:00
Matthew Bennice
0dfeedb320
fix open source build failure by switching C's _Alignof for C++'s alignof
...
PiperOrigin-RevId: 568400917
Change-Id: I90eff5e149d491f181370d72e43fdee9d4a3a20e
2023-09-25 20:43:59 -07:00
Matthew Bennice
ff4158efff
Modify memory allocation in MuJoCo to be thread safe:
...
1) protect mj_arenaAllocBytes with mutexes
2) create shards for each thread in the stack and update mj_stackAllocBytes to allocate memory within each shard for a given thread
PiperOrigin-RevId: 568315726
Change-Id: I0dee6694f2a5200fa4df22ade0e68dfaebf637fc
2023-09-25 13:53:28 -07:00
Alessio Quaglino
dd5a7115cf
Add shell plugin.
...
- Add bending passive force
- Add two examples (plate and poncho)
- Add stretching constraints for particles using tendons on mesh edges
PiperOrigin-RevId: 566980584
Change-Id: Id0cd8e1084c05560f1008518a8afbd5311d563e2
2023-09-20 09:00:20 -07:00
Yuval Tassa
9cf1f6eba4
Remove mjOption.collision and associated option/collision attribute.
...
PiperOrigin-RevId: 566427090
Change-Id: I6e5873b8db707586820b17b53c7ab4bbff0f0b2b
2023-09-18 15:15:54 -07:00
Yuval Tassa
9902b73502
Rename mj_stackAlloc to mj_stackAllocByte.
...
PiperOrigin-RevId: 566351365
Change-Id: I91541168e83b05a730113661cc9f07985ac9ff0c
2023-09-18 10:53:35 -07:00
Yuval Tassa
2cc1205498
Add island support to CG solver.
...
BEGIN_PUBLIC
Add island support to CG solver.
END_PUBLIC
PiperOrigin-RevId: 565653886
Change-Id: Ib971ae37dd011b8f2cbe1f88d8875e0ed657c7af
2023-09-15 05:47:24 -07:00
Alessio Quaglino
1afd98ec4b
Add [SdfLib]( https://github.com/UPC-ViRVIG/SdfLib ) plugin to first-party SDFs.
...
The following dependencies are disabled with a cmake patch file.
- Enoki
- OpenMP
- Assimp
- FCPW
PiperOrigin-RevId: 565352386
Change-Id: Icff9de68408e0afa2032bb83b24491fc4e41d181
2023-09-14 06:42:42 -07:00
Alessio Quaglino
b0abafe3bb
Set camera origin at top-left of the first pixel.
...
PiperOrigin-RevId: 564768176
Change-Id: Ieef632f0f6888390acca91b6de01c8951c747fe4
2023-09-12 10:44:51 -07:00
Alessio Quaglino
8064ad59c8
Add camera projection sensor.
...
BEGIN_PUBLIC
Add camera projection sensor.
END_PUBLIC
PiperOrigin-RevId: 564726114
Change-Id: I33b8e5562eff29c21538bf8f38ce3116c7dfc5a9
2023-09-12 08:16:20 -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
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
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
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
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
Yuval Tassa
feb8aa2fbb
Fix bugs in engine_island.c
...
PiperOrigin-RevId: 562519702
Change-Id: I3075e539ccc1cef92485152721a9344f180aa4b1
2023-09-04 04:06:39 -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
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
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
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
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
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
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
Nimrod Gileadi
dae74030fe
Handle initial_capacity = 0 in mju_arrayListCreate.
...
Add const to ArrayList function arguments where appropriate.
PiperOrigin-RevId: 559064386
Change-Id: I8763974a60a05f34dadd56e953cefa40fe78df42
2023-08-22 04:04:02 -07:00
Matthew Bennice
1d36b57d83
Switch from max_align_t to mjtNum until we sort out the git builds
...
PiperOrigin-RevId: 558982369
Change-Id: I24d9fd6400dae5e1bc1753ee74484da635ea8ecd
2023-08-21 21:30:49 -07:00
Matthew Bennice
4b983e8439
Add an ArrayList container type.
...
PiperOrigin-RevId: 558887266
Change-Id: I201978bfa5e6cfa2f4e495feaecf61374baf7b7b
2023-08-21 13:38:45 -07:00
Yuval Tassa
b1ecc943bb
Fix multiple bugs related to mjvSceneState.
...
PiperOrigin-RevId: 557864131
Change-Id: I47d9692930c54b1304a5cc161f99bbd81d992a7c
2023-08-17 10:25:39 -07:00
Alessio Quaglino
fdb041580c
Add Signed Distance Field to collision geometries.
...
PiperOrigin-RevId: 557507088
Change-Id: I358a642407aee1ba8dfc9d405eb9a4f609435fe9
2023-08-16 09:15:23 -07:00
Yuval Tassa
6245edae28
Improve island discovery performance
...
PiperOrigin-RevId: 557444755
Change-Id: I22a2093b563e8e144de9534917955ac403fa5599
2023-08-16 04:55:42 -07:00
Kyle Bayes
8ea690ed70
Remove unused parameters from mju_sqrMatTDSparseInit.
...
PiperOrigin-RevId: 557114227
Change-Id: Ia7d3fedfba612a68ff01d68f1b9dadb45bd76e85
2023-08-15 06:30:19 -07:00
Yuval Tassa
3e034e38b2
Add constraint island discovery
...
PiperOrigin-RevId: 557067599
Change-Id: Ic41e1d0efef02b7a79142518afe49cf9d4e74725
2023-08-15 02:30:05 -07:00
Kyle Bayes
f34cb22bd3
Reuse sparse Dof-Dof matrix to make compressed sparse M in mj_addM.
...
PiperOrigin-RevId: 556823353
Change-Id: I650ac83767d60c69859aae6e38aa331f43814378
2023-08-14 09:49:34 -07:00
Yuval Tassa
a276c49c30
Rename `actuatorforcerange and actuatorforcelimited, to actuatorfrcrange and actuatorfrclimited`, respectively.
...
PiperOrigin-RevId: 556780590
Change-Id: Ide12cf390920f9efe6f79cc9f864a480ce5f256d
2023-08-14 07:18:57 -07:00
Nimrod Gileadi
2c3297b3e7
Add filterexact and actearly options to MuJoCo.
...
When filterexact is a new dyntype which is just like the existing `filter`, but the activation state is integrated with exact integration, instead of simple Euler integration.
When actearly is specified on a general actuator, `qfrc_actuator` is computed using the next timestep's `act` value, instead of the current value.
PiperOrigin-RevId: 554438423
Change-Id: If901e4988fa6b518d6f3097f149770665a189a4b
2023-08-07 04:50:33 -07:00
Yuval Tassa
a063e2f0ef
Add private functions and associated tests related to constraint island discovery.
...
PiperOrigin-RevId: 553156672
Change-Id: Ifd73e3df443f7955359c5243d5f7756069335c05
2023-08-02 08:43:11 -07:00