Commit Graph

1392 Commits

Author SHA1 Message Date
Baruch Tabanpour 92c161a61b Add ncon to __init__.
PiperOrigin-RevId: 603468404
Change-Id: I20c622b8f6f84ecacb9f3cdd26ac9560cf2788be
2024-02-01 13:38:23 -08:00
Yuval Tassa 58e9fb0baa Docs: fix link to slider-crank example model.
PiperOrigin-RevId: 603400948
Change-Id: I49e4a58ba0cd450950a35cccb749f04d34190cfc
2024-02-01 09:56:37 -08:00
Alessio Quaglino b3f93d436b Convert mjmStruct to a C-struct.
PiperOrigin-RevId: 603357871
Change-Id: I27918b0030fc6a589c361cad965611adc3bf7247
2024-02-01 06:57:47 -08:00
Alessio Quaglino 7a98038e88 Move mjCSite attributes to mjmSite struct.
PiperOrigin-RevId: 603051589
Change-Id: I31eeeccffa15b96e7393b8e64f6be8c964fc5948
2024-01-31 08:07:48 -08:00
Copybara-Service fae1f3e56d Merge pull request #1369 from Balint-H:feature/unity-events
PiperOrigin-RevId: 602671446
Change-Id: I7a21230152a0139e37f44578ca19ec5eaa02296e
2024-01-30 03:33:47 -08:00
Baruch Tabanpour 8be966cdf9 Avoid NaN in gradient of where. Fixes #1349.
PiperOrigin-RevId: 602461299
Change-Id: I7c976d3b7262027bdc63967dcc00674fb2802e70
2024-01-29 12:09:29 -08:00
Baruch Tabanpour 508669a9f2 Raise not implemented for frictionloss for now. #1344
PiperOrigin-RevId: 602453907
Change-Id: I0ea506b54f96c4fadc0f29f9ed0a21b0b6a7e5d9
2024-01-29 11:45:36 -08:00
Copybara-Service 4fe16dd44e Merge pull request #1353 from Balint-H:fix/unity-mesh-import
PiperOrigin-RevId: 602391543
Change-Id: I6d93c2beb672e8de7d5c9d17e77b4185dd137cb3
2024-01-29 08:13:04 -08:00
Yuval Tassa e143b3dbc0 Allow height-field elevation data to be specified in XML.
PiperOrigin-RevId: 602374498
Change-Id: I2d3364d68876a35799b24aca1051e2f5aebdda75
2024-01-29 06:59:28 -08:00
josephrocca e6847f843d Copybara import of the project:
--
18821cb87ded727ef38e1bac8ba8561b19632899 by josephrocca <1167575+josephrocca@users.noreply.github.com>:

Ellipsoid has 3 sizes rather than one

COPYBARA_INTEGRATE_REVIEW=https://github.com/google-deepmind/mujoco/pull/1374 from josephrocca:patch-1 18821cb87ded727ef38e1bac8ba8561b19632899
PiperOrigin-RevId: 602370557
Change-Id: I014226a1cbae926c8ad02f27b706fa0b3e8f2c8e
2024-01-29 06:39:53 -08:00
Yuval Tassa 70021a7236 Improve ordering of asset documentation, sort by category and usefulness.
- Old: texture, hfield, mesh, skin, material.
- New: mesh, hfield, skin, texture, material.

Rationale: First 3D assets, then surface assets. Mesh is the most common asset type. Materials reference textures so should come right after.
PiperOrigin-RevId: 602075615
Change-Id: I13e4404640184fb0717a442827cd76da31705648
2024-01-27 17:24:31 -08:00
Kyle Bayes 3b0a680fa7 Refactor GlobalModel class in the XML API.
PiperOrigin-RevId: 601761425
Change-Id: I9c24f670c1e9766867ec75aab56cec1c0b4f5703
2024-01-26 07:33:47 -08:00
Yuval Tassa 669ee0ee48 Fix migration instructions for option/collision.
Fixes #1367.

PiperOrigin-RevId: 601754379
Change-Id: Ifb0b8fab4da44e161e463a71eec050c6635f3340
2024-01-26 07:03:00 -08:00
Bálint Hodossy ee071242c6 Constrain MjScene EventHandlers as events, consistently use MjStepArgs 2024-01-26 14:35:03 +00:00
Alessio Quaglino fb8f77df74 Throw error if qhull is called with NaNs.
PiperOrigin-RevId: 601745538
Change-Id: I590673ca7975e4abc171f98704a6c8f8d08f8327
2024-01-26 06:13:27 -08:00
Alessio Quaglino 076db5d366 Copy face_ into facetexcoord_ if not specified and needed.
PiperOrigin-RevId: 601732448
Change-Id: Iffe01076db22201dba2611ea36174f808ae00c1e
2024-01-26 04:54:43 -08:00
Kyle Bayes 4f53d9a0d7 Add AddVector and GetVector to user cache.
PiperOrigin-RevId: 601485067
Change-Id: I1a31f15c2495de4f057316022dcddf4df39afd64
2024-01-25 10:13:13 -08:00
Baruch Tabanpour a1e5ede266 Allow Brax data structures to inherit from MJX data structures.
PiperOrigin-RevId: 601290735
Change-Id: I6dad1b6d7e6b3e71acecc36189ab59cc81ab90b4
2024-01-24 18:03:17 -08:00
Erik Frey e59605135a Make benchmarks and viewer more accessible.
- Drop google_benchmark module dependency, wasn't really using it.
- Move benchmark models into test_data
- Rename benchmark => testspeed, make default output more like MJ testspeed.
- Update viewer to use new io functions and add get_data_into.
- Add "mjx-testspeed" and "mjx-viewer" bin scripts

PiperOrigin-RevId: 601277135
Change-Id: I782f666c58a96ac1a0a1c5ffc8ecf29d9fcd810f
2024-01-24 17:04:02 -08:00
Bálint Hodossy 64b042369b Readd axis swizzling to the mesh writer 2024-01-24 18:32:55 +00:00
Alessio Quaglino c8e839a666 Do not create contact if there are no DOFs.
PiperOrigin-RevId: 601146599
Change-Id: I68b1975a3217b266bbbfb0a15c85a65cfa46facb
2024-01-24 09:37:40 -08:00
Kyle Bayes aede8cf5cf Rename user_asset_cache to user_cache.
PiperOrigin-RevId: 601097322
Change-Id: Iea3d6481cd214028ef63ed72868999ecb0b1eeb4
2024-01-24 06:05:56 -08:00
Erik Frey 0a7be1732c Adds support for explicit dense/sparse mass matrices to MJX.
This increases performance, particularly for the Newton solver on TPU.

PiperOrigin-RevId: 600696483
Change-Id: If69bb9a2e21ba8dad6ca23f093ce7b7ceae644ff
2024-01-23 00:32:07 -08:00
Yuval Tassa aceb52bd09 Improvements to mujoco.rollout:
- `mjSTATE_FULLPHYSICS` as state spec, enabling divergence detection by inspecting time.
- User-defined control spec.
- Stop squeezing: outputs always have dim=3.

PiperOrigin-RevId: 600445256
Change-Id: I4466e88929cb7081e1c94968a5cfe10485bb7475
2024-01-22 07:01:53 -08:00
Bálint Hodossy 042e3c9c4c Reuse indices in mesh parsing, remove trailing nulls in mesh writing 2024-01-20 19:06:15 +00:00
Erik Frey 5cbaa23388 Remove TEST_FILES from MJX test_util.py.
PiperOrigin-RevId: 599886327
Change-Id: I4d166e09db22fffc959dbe34fa3469bd4a1b9f84
2024-01-19 11:15:06 -08:00
Kyle Bayes a1ddbdf7f8 Add an implementation of a cache for assets for compilation speedups.
PiperOrigin-RevId: 599850003
Change-Id: I83e299e127058a5657d7b262aa98d36451b530f6
2024-01-19 09:04:01 -08:00
Yuval Tassa a23a368778 clean up rollout.cc
PiperOrigin-RevId: 599849967
Change-Id: I899b28bf78bf0414b07314c24cfe6e24441eba30
2024-01-19 09:03:10 -08:00
Yuval Tassa e0864ab7f2 Fix formatting bugs in changelog.
PiperOrigin-RevId: 599815807
Change-Id: I67d3eb2fd30c94a9d498ba605243e0b87b1d4ca8
2024-01-19 06:29:26 -08:00
Yuval Tassa fea7c10b95 Add bvhactive flag to visual/global. Fixes #1279.
PiperOrigin-RevId: 599778272
Change-Id: If5530629035cc68b198447503388f59a04041b13
2024-01-19 02:59:56 -08:00
Yuval Tassa 2feefbc5d2 Remove fine-grained timing from narrow-phase collision functions, delete mjTIMER_COL_MID.
PiperOrigin-RevId: 599225419
Change-Id: Ieca166753c20a0abf660e2821b2844dda8758951
2024-01-17 10:54:23 -08:00
Baruch Tabanpour edc254b213 Update MJX doc for #1344.
PiperOrigin-RevId: 599220357
Change-Id: I532f42ed086da59632eeaac0dcd3de6ffcf93cd4
2024-01-17 10:38:53 -08:00
Yuval Tassa a14a584f1d Fix bug in muscle length-gain curve. Fixes #1342
PiperOrigin-RevId: 599165049
Change-Id: Ic5ef77b4349a8a9c343eacfd781195bfebea9aca
2024-01-17 07:20:01 -08:00
Yuval Tassa 67a00a3a51 Rename mjMAXTHREADS -> mjMAXTHREAD (consistency).
PiperOrigin-RevId: 599130235
Change-Id: Ia80379b8ae0574a7cd8fbc668657f806e90d6c5c
2024-01-17 04:33:44 -08:00
Kyle Bayes 71b0561758 Clean up formatting issues in user_objects.h
PiperOrigin-RevId: 599127766
Change-Id: If752c00038818fb21476eb98be891ead467aad56
2024-01-17 04:21:10 -08:00
Baruch Tabanpour a02fc405af Add naive ray mesh implementation.
PiperOrigin-RevId: 598993152
Change-Id: I708505bf20a89d5a4840451a11b99771195003e6
2024-01-16 16:29:11 -08:00
Erik Frey ee922be393 Benchmark improvements.
- Use multiple devices if present
- FLAGS more agnostic to diverse platforms

PiperOrigin-RevId: 598990299
Change-Id: Ifbd454ca521a788324f2b62f1c79e7d4b8305a30
2024-01-16 16:17:56 -08:00
Yuval Tassa 45208a5fe0 Update Sphinx from 4.5.0 to 5.3.0 fixing broken docs build.
PiperOrigin-RevId: 598875231
Change-Id: I3295e9aa94087d44a695c7d380bbf9691a3d82b3
2024-01-16 10:04:16 -08:00
Alessio Quaglino 80674149ce Allow pinning flexes to non-simple bodies. Fixes #1270.
PiperOrigin-RevId: 598865882
Change-Id: I105ff1910a7d67f5b7bcb46bcef0e5e388ec08ea
2024-01-16 09:32:26 -08:00
Yuval Tassa 3c1907e678 Fix rendering of links in documentation.
PiperOrigin-RevId: 598855374
Change-Id: I19c1ef73d23f0c2fedb8f0a6754bb9edd91f4c20
2024-01-16 08:54:38 -08:00
Copybara-Service 3b440921df Merge pull request #1268 from Balint-H:feature/unity-hmap-dyn
PiperOrigin-RevId: 598652839
Change-Id: I3285f041c5c2e3e9286f1bb106825ee20e7147e3
2024-01-15 12:54:06 -08:00
Tom Erez 2388b651e8 Unity plug-in: Fix for when xml file has no <compiler> section.
PiperOrigin-RevId: 598646137
Change-Id: Id27635dc3064f8568ae0d86c2cdee8c2d414dd2f
2024-01-15 12:04:26 -08:00
Copybara-Service c77f984d9b Merge pull request #1330 from Balint-H:fix/unity-joint-limits
PiperOrigin-RevId: 598603093
Change-Id: I441631e33e812988694f8eed48c719c6bab86148
2024-01-15 07:08:03 -08:00
Alessio Quaglino 1e2e0b3053 Remove all visual-only assets if discardvisual is selected, not only the geoms.
PiperOrigin-RevId: 598598250
Change-Id: I12e60ce41ad436d037b4877d197decf6bdce0fc8
2024-01-15 06:39:25 -08:00
Alessio Quaglino acf698e2df Store pointer to index in mjCBoundingVolume if possible.
PiperOrigin-RevId: 598592242
Change-Id: I8dc20a8d8a9a0e967688839fa22d75263c226958
2024-01-15 06:04:20 -08:00
Alessio Quaglino cab1c6bb39 Preallocate mjCBoundingVolumeHierarchy and avoid copies during MakeBVH.
PiperOrigin-RevId: 598579741
Change-Id: Iac154affa6ee22994c571f2ec00ac602bfe7f4d6
2024-01-15 04:48:44 -08:00
Alessio Quaglino 5d46c39529 Increased SdfLib bounding box by 10% to prevent querying outside it during collision detection.
In case a query outside is performed, add SDF gradient computation using finite differences.

For SDFs generated from meshes, when the query point lies outside of the bounding box, the gradient provided by SdfLib ignores the SDF and is equivalent to the gradient of the distance from the bounding box, causing local minima in the contact point optimization. This CL increased the size of the bounding boxes and replaces the SdfLib gradient with a finite difference approximation of the gradient if a point lies outside it.

PiperOrigin-RevId: 597839637
Change-Id: I79dfddbe25288eca7eb235db51781fc2bb2c3c5f
2024-01-12 07:54:10 -08:00
Bálint Hodossy 66a0cd3b0b Perform autolimit check on actuators 2024-01-11 16:29:08 +00:00
Bálint Hodossy 3a00450d00 Rephrase condition for default limited definition so it's more intuitive 2024-01-11 16:20:13 +00:00
Bálint Hodossy 56b30d9d15 Check the autolimits attribute before assigning default values for joint limitedness 2024-01-11 16:09:06 +00:00