Commit Graph

2675 Commits

Author SHA1 Message Date
Alessio Quaglino 3dcfad3293 Add qpos to MJX bindings.
PiperOrigin-RevId: 720311208
Change-Id: Iaf5f905e206256f38cd71949bbebd5151b2a2041
2025-01-27 14:36:42 -08:00
Yuval Tassa 8c22181156 Fix documentation typos.
PiperOrigin-RevId: 720232771
Change-Id: I176db4d4168c37b2819df14b439c4cde838e2025
2025-01-27 10:58:22 -08:00
Yuval Tassa 9605990648 Replace custom sort of sparse fixed tendons with mju_combineSparse.
PiperOrigin-RevId: 720219887
Change-Id: I0491b3cb8987c119c3864fc0b5c38ca303d8f7f0
2025-01-27 10:24:58 -08:00
Alessio Quaglino d21f624264 Fix binding issue with scalar attributes.
PiperOrigin-RevId: 720136044
Change-Id: I0846a93ef36a23371d1bd504adff02dcce0abcf9
2025-01-27 05:47:36 -08:00
Yuval Tassa d86900aac1 Speed up mju_cholUpdateSparse by not checking for varying sparsity pattern where it is guaranteed to not vary.
PiperOrigin-RevId: 720126576
Change-Id: I3a43bdd0259656fab462b1cd155cb422982e970d
2025-01-27 05:07:28 -08:00
Google DeepMind 4ab274aea9 Fix missing arg for mj_compile in model-editing doc example code.
PiperOrigin-RevId: 720005405
Change-Id: Idf71a1a12fe4cfcc450cd80c91b13ee8a75e1636
2025-01-26 20:25:50 -08:00
Yuval Tassa 08edde5fd8 Add test for armature, model will be used in upcoming improved documentation for armature.
PiperOrigin-RevId: 719916567
Change-Id: I7f74bd3c3864f43f5f68d458d5b128cfee1d7e6c
2025-01-26 12:01:12 -08:00
Erik Frey 2c3d0becb2 Empty out Model fields restricted to MuJoCo in the same way we do for Data fields.
PiperOrigin-RevId: 719705508
Change-Id: I4b07433481eafaea1d95a5bdd8fd83786939188f
2025-01-25 14:03:20 -08:00
Alessio Quaglino 2546fcefa0 Add mujoco.MjSpec.to_zip()
PiperOrigin-RevId: 719003836
Change-Id: I310ac96b0080b3313c325cee76d3bf7f81fa9df0
2025-01-23 14:01:06 -08:00
Andrea Gesmundo 3d174a4034 internal change
PiperOrigin-RevId: 718782821
Change-Id: I2d2ead2577767587800f3ea69dba61247105e16f
2025-01-23 02:51:51 -08:00
Yuval Tassa f9fd2e4ba4 Add a test showing how to implement scipy's 'soft_l1' loss in minimize.least_squares
PiperOrigin-RevId: 718649580
Change-Id: I5cec0e2850c805301407c9eb543ab3ba69d42e79
2025-01-22 18:25:44 -08:00
Alessio Quaglino 21d97902ee Check keyframe size before appending it during attach.
Fixes #2365.

PiperOrigin-RevId: 718455748
Change-Id: I20c56b7c6fbd868962d19682e72e6294edb6893e
2025-01-22 11:09:49 -08:00
Kyle Bayes aa505a7872 Add support for NativeCCD multiple contacts for box-box collision.
PiperOrigin-RevId: 718352304
Change-Id: Icaa827e716a2d7aa7c0c644e0ccd2913b476e6fb
2025-01-22 06:02:58 -08:00
Yuval Tassa 0090e1e908 Rename rollout variable nroll to nbatch.
PiperOrigin-RevId: 718196100
Change-Id: Ic36b1a96ea1af2de351539115d4eee051d195aaf
2025-01-21 21:04:15 -08:00
Copybara-Service ac76540eb8 Merge pull request #2377 from aftersomemath:rollout-fix-ndata-check
PiperOrigin-RevId: 718181763
Change-Id: Ie88bf1d26c77478ce3a5ca8fdf29ae90e54b5834
2025-01-21 20:11:33 -08:00
Yuval Tassa 67dd4827a6 Improve printing of inertia-like matrices, allow mj_printData to take const mjData*
PiperOrigin-RevId: 718176884
Change-Id: I057dabe6973e19db86e9ff9ce4430c6d17dfce2b
2025-01-21 19:59:45 -08:00
Alessio Quaglino 6a7a7a5f80 Add the override_assets attribute to MjSpec.
When specified, child asset with repeated names will override parent's, rather than throw an error. Default behavior is to override.

PiperOrigin-RevId: 717979621
Change-Id: I18022dc266619b4ba1a8636d1c60f85b0eb5f862
2025-01-21 10:39:02 -08:00
Alessio Quaglino 1412a29dac Merge child asset dictionary into parent spec during attach().
PiperOrigin-RevId: 717939728
Change-Id: I54f8ac87062cf19f55a16af37b777701545ed865
2025-01-21 08:57:09 -08:00
Alessio Quaglino 4bb6aeb19f Change site and frame attach API.
Old API:
```
site.attach(child_spec)
frame.attach(child_spec)
```

New API:
```
parent_spec.attach(child_spec, frame=frame_name_or_object)
parent_spec.attach(site_spec, site=site_name_or_object)
```

This enables accessing the parent object during attach, which will be used in a follow-up CL to automatically append the child assets to the parent.

PiperOrigin-RevId: 717908589
Change-Id: I0fb27e99694c954cb8ba8a8c98484ffd53a4d6db
2025-01-21 07:29:27 -08:00
Kyle Bayes bd1bbfe401 Fix bug where EPA horizon returns zero edges due to numerical inaccuracies in float32.
PiperOrigin-RevId: 717825833
Change-Id: I9fa440816765d4c3eaa0c6c26ec0bd90c774fa01
2025-01-21 02:50:53 -08:00
Levi Burner cee122116e rollout: fix bugs in checking list lengths, add tests 2025-01-21 00:36:52 -05:00
Yuval Tassa 2624d524ba Switch mj_solveM_island to use CSR representation
PiperOrigin-RevId: 717684720
Change-Id: I7d74a5d4aef4aa5b0c0acddf88c5b8591d63e88d
2025-01-20 18:36:04 -08:00
Yuval Tassa a5ab7a9515 Switch mj_solveM2 to use CSR representation.
PiperOrigin-RevId: 717639495
Change-Id: I59eee0f23606481480ec5acb8a3bba2c14b2ea2f
2025-01-20 15:16:26 -08:00
Yuval Tassa baf1c43b3c Fix more misleading line for creating list of models in rollout_test.py
PiperOrigin-RevId: 717628943
Change-Id: I83a314565ce4ec683afeea18c8c8ce9e23d5452e
2025-01-20 14:27:31 -08:00
Google DeepMind 68cd263337 Change type of light_poscom0 and `actuator_acc0'.
This is required for batching over `mjx.Model` in case recompilation is used to change inertial values.

PiperOrigin-RevId: 717596504
Change-Id: I4b6780903ebf12ebbf8b7bc7b8990a01609d4491
2025-01-20 12:11:31 -08:00
Yuval Tassa ff4783482c Fix misleading line for creating list of models in rollout_test.py
PiperOrigin-RevId: 717582208
Change-Id: I1b4e40fc5ccbfe68fb7dc240715c704f1f68d9fe
2025-01-20 11:13:21 -08:00
Alessio Quaglino 699a6765e3 Add find functions for joints, lights, and cameras to mjSpec bindings.
PiperOrigin-RevId: 717578768
Change-Id: I2087ccbb9cf8b3b8ec03e9eb2edb0707d4a4cac1
2025-01-20 11:02:34 -08:00
Kyle Bayes 600f4acb52 Change GJK and EPA return values.
PiperOrigin-RevId: 717549079
Change-Id: I42df5660bcc8336e2e9c8fce71385cbb06104848
2025-01-20 08:59:37 -08:00
Yuval Tassa 5c4c79cd6a Refactor LD back-substitution (CSR version).
PiperOrigin-RevId: 717403904
Change-Id: Idcd5e71f03a960203c22cb737d399fac5a0ba59c
2025-01-19 22:47:25 -08:00
Baruch Tabanpour 2a100547bd Remove match in support.py (introduced in Python 3.10).
https://github.com/google-deepmind/mujoco_playground/issues/16

PiperOrigin-RevId: 717395934
Change-Id: I0be1b8285a79702a1dfc086e15e07bab0f9f6d40
2025-01-19 22:08:51 -08:00
Copybara-Service e2b1cfc3a8 Merge pull request #2249 from Balint-H:docs/unity-tutorial
PiperOrigin-RevId: 717294302
Change-Id: Ief98bd6cd4eac448062e331b6737043f12926ad2
2025-01-19 13:01:07 -08:00
Yuval Tassa f13c107cd7 Workaround to doc build error caused by sphinx-toolbox bug.
See issue for details: https://github.com/sphinx-toolbox/sphinx-toolbox/issues/176

PiperOrigin-RevId: 717282405
Change-Id: I9e02804a3571fcca74eb7f174f3c3e262b0d3b65
2025-01-19 11:58:52 -08:00
Yuval Tassa 1d47a91c19 Add a test for mj_solveM2
PiperOrigin-RevId: 717278730
Change-Id: I7507e569620c34f250482eec8402c08c793f4e48
2025-01-19 11:34:20 -08:00
Bálint Hodossy 203e9bc292 Remove trailing spaces 2025-01-19 13:24:36 +00:00
Yuval Tassa b2d353d062 Document default visible geom groups in XMLreference.
PiperOrigin-RevId: 717050528
Change-Id: I0414495d2f5a17ac2d8ba35c9353ecf0b7e8a18d
2025-01-18 12:42:01 -08:00
Yuval Tassa 463bc47633 Clarify that equality constraints defined using the body-based semantic are assumed to be satisfied at `mjData.qpos0`.
PiperOrigin-RevId: 717050088
Change-Id: I02e82cab5a60f0af48f7f921ba9bca11837f8063
2025-01-18 12:39:40 -08:00
Yuval Tassa 69c66aa1bb Fix typo.
PiperOrigin-RevId: 716820809
Change-Id: I51f8608f0c01f4fc8016b4be779d98c8972bc913
2025-01-17 15:39:56 -08:00
Baruch Tabanpour 1b34246c6e Update MJX notebook to point to playground.
PiperOrigin-RevId: 716778081
Change-Id: Ic99734ba386c4db551766de6f209cb397e7aa967
2025-01-17 13:18:07 -08:00
Yuval Tassa 240a7afdee Add sensors for potential and kinetic energy.
PiperOrigin-RevId: 716775375
Change-Id: Ic8ab7f1a51df970ab551dabe7c797cde13cd97fd
2025-01-17 13:10:12 -08:00
Taylor Howell 688d367733 Modify model loading in MJX tutorial.
PiperOrigin-RevId: 716745232
Change-Id: Ib89f8c00a58b493c89f72c82b47f1c8ff8326536
2025-01-17 11:49:45 -08:00
Yuval Tassa 71e5e376bc Remove units from zero valued size in CSS, fix a typo.
PiperOrigin-RevId: 716345043
Change-Id: I22b28e8e1d6db8ae4e482541169f1ffc46d3db34
2025-01-16 12:55:21 -08:00
Alessio Quaglino 9fc1ac2c7d Fix typo in sensordata binding.
PiperOrigin-RevId: 716257343
Change-Id: I4da12d8cda4342eb9f5a4df664bb43841db8e332
2025-01-16 09:05:01 -08:00
Alessio Quaglino c16f95f62c Add sensordata MJX binding.
PiperOrigin-RevId: 716241711
Change-Id: I11a82f58c41dca93e9a5337f0c573158026fa971
2025-01-16 08:14:58 -08:00
Silvia Cruciani 4903d5321c add find_geom property to mjSpec
PiperOrigin-RevId: 716225290
Change-Id: Ie6e229b0e802e7df06148f994d598334592e8ad1
2025-01-16 07:20:19 -08:00
Alessio Quaglino f899e717d4 Raise error for invalid name in MJX bind.
PiperOrigin-RevId: 716214444
Change-Id: Ie9e3156b32b0c218cdbd0beb93a4a78800e07c43
2025-01-16 06:40:48 -08:00
Bálint Hodossy 394cc61192 Use RST links throughout the Unity doc. 2025-01-16 14:33:08 +00:00
Yuval Tassa 893a993bf6 Fix typos.
PiperOrigin-RevId: 716211176
Change-Id: Ibadfe13db89ed9047832b977e918faa3c5c6d9f1
2025-01-16 06:28:54 -08:00
Kyle Bayes 4da2ddce29 Only correct box-box collisions with the mjc_BoxBox function.
PiperOrigin-RevId: 716209565
Change-Id: I3419ce82f9934606bed80acd8372284fc7ac7ac8
2025-01-16 06:22:20 -08:00
Saran Tunyasuvunakool 26bac8c8af Fix changelog.
PiperOrigin-RevId: 716194356
Change-Id: I23e1717867847c342d7bac82d2fae7d26df48473
2025-01-16 05:21:35 -08:00
Alessio Quaglino c2138c3fb0 Do not copy the spec during attach.
Use a reference count for managing the memory.

PiperOrigin-RevId: 716169486
Change-Id: Id270c4858c17b9250115e9544d5ea143584e2d5f
2025-01-16 03:53:17 -08:00