Commit Graph

2664 Commits

Author SHA1 Message Date
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
Gabe Oppenheimer 6436055c6c Update the version number to 3.2.8 following the 3.2.7 release.
PiperOrigin-RevId: 715870970
Change-Id: I9fc9a09d959043f3029faa7296a717ea56f75c89
2025-01-15 11:13:27 -08:00
Alessio Quaglino f1d557c125 Support for MJX bind set() for scalars.
PiperOrigin-RevId: 715832281
Change-Id: I217021e81fae95e44e9297a1c447891ff76572bd
2025-01-15 09:38:02 -08:00
Alessio Quaglino ff1ff44e34 Fix typo MjsHfield->MjsHField.
PiperOrigin-RevId: 715808003
Change-Id: Ic510f7a3dc4d2c93789ce27162d004b20762bd12
2025-01-15 08:21:38 -08:00
Alessio Quaglino 05d4c3d670 Add mjs_getParent to retrieve the parent body of an object.
PiperOrigin-RevId: 715794859
Change-Id: Ib9792787cdb966f579938dde3f94ebabca8ef1fc
2025-01-15 07:42:43 -08:00
Alessio Quaglino 10c7207cea Process asset path before adding VFS buffer.
Also, handle VFS errors.

PiperOrigin-RevId: 715755127
Change-Id: Iaf455d448f16e37ab89ceaa5797319135acd73c9
2025-01-15 05:10:00 -08:00
Andrea Gesmundo 66f2758ea5 Minor updates.
Fix a typo and a comment.

PiperOrigin-RevId: 715672977
Change-Id: I281002aad2b40b59544c30f41aa113e13ae9d09e
2025-01-14 23:56:39 -08:00
Gabe Oppenheimer 61973a33c9 Update eigen3 and the changelog ahead of the 3.2.7 release.
PiperOrigin-RevId: 715467319
Change-Id: I4a6a168bc981c976890c46b784e94805afc86323
2025-01-14 11:51:12 -08:00
Alessio Quaglino ba183adb67 Add assets to MjSpec wrapper.
This enables associating assets with a spec object.

Also, remove `spec.compile(assets)` and replace it with the `spec.assets` attribute, which must be be set before compile if assets are present.

PiperOrigin-RevId: 714981385
Change-Id: Ic3a33c3b75d3a7e14868622aadb57b2a8461a649
2025-01-13 08:41:51 -08:00
Taylor Howell 64d0f57c50 Fixes for MJX tendons and muscle actuators. Fixes #2317.
PiperOrigin-RevId: 714951834
Change-Id: I823b3a01b2b76cb4707cb313afd1a187f9bdb333
2025-01-13 06:58:12 -08:00
Andrea Gesmundo 1c32b5d2dd Fix attach logic.
Replace .attach() with .attach_body() where a body is passed as a first argument instead of a spec that is expected by .attach().
+Fix typo.

PiperOrigin-RevId: 714933134
Change-Id: Idb242fbef0fe164075826c01d4e1995c7d4ae565
2025-01-13 05:41:49 -08:00
Yuval Tassa d4ca66a47b Allocate dual-solver memory inside mj_projectConstraint, no more than required.
PiperOrigin-RevId: 714093658
Change-Id: Id7e710c5dffd24871019a72a7bf2aa6eb3f7a36e
2025-01-10 10:19:13 -08:00