Commit Graph

64 Commits

Author SHA1 Message Date
Alessio Quaglino fb30e0e00c Add docs for mjSpec serialization.
PiperOrigin-RevId: 752230683
Change-Id: Id237ccc1b265e99bf15892f8fd208ba38f4c6ded
2025-04-28 02:58:46 -07:00
Alessio Quaglino ebd30493c8 Allow nameless bind in MJX.
PiperOrigin-RevId: 742592221
Change-Id: I9490aebd64e3a31219c552d5b6eb55236680f10d
2025-04-01 01:45:44 -07:00
Alessio Quaglino 6e19035aab Add delete and detach docs.
PiperOrigin-RevId: 741444657
Change-Id: I4207eaf74524e8a3ca46130967c6fb0dd62b4d64
2025-03-28 01:58:54 -07:00
Yuval Tassa 3b27f30827 Added comment regarding numpy slices.
PiperOrigin-RevId: 735681812
Change-Id: I832219bb63c83ecd5115ac1d5755cd35b4362478
2025-03-11 02:36:51 -07:00
Yuval Tassa 010f9bacbb Fix typo in Python API docs.
PiperOrigin-RevId: 732600862
Change-Id: Ie9a8db9555ac3e233d29a10d289b71745d644cb2
2025-03-02 01:20:25 -08:00
Yuval Tassa dc98ae978d Publicize the rollout notebook, small improvements to plotting.
PiperOrigin-RevId: 730841667
Change-Id: Id365f21cee078f28cb3fa797701c3c5a409607cd
2025-02-25 05:20:41 -08:00
Yuval Tassa ef1ef8ef6a Fix Sphinx-Toolbox dependency issue in documentation.
PiperOrigin-RevId: 725818375
Change-Id: I9f241f9575d4bebceeab62937caf682e455b3816
2025-02-11 16:41:02 -08:00
Alessio Quaglino cef5b31a3f Drop find_ prefix in Python MjSpec methods accessing elements by name.
PiperOrigin-RevId: 725594833
Change-Id: Ibf8a9918e98b298751d0ef2e657714e28e5fa460
2025-02-11 05:50:49 -08:00
Yuval Tassa a6dd5f086f Document element name lookup in MjSpec.
PiperOrigin-RevId: 725258206
Change-Id: I5c9a85d25787eb38e9e8c3854eda2581700e188e
2025-02-10 10:10:41 -08:00
Alessio Quaglino 06758e35ab Fix mjSpec colab after changing the default behavior of attach to be a shallow copy.
PiperOrigin-RevId: 724375710
Change-Id: I5fac7d24c1d0b1ad4d427c021022c47620accf53
2025-02-07 09:41:03 -08:00
Kristian Hartikainen 0fda5344c2 Fix typos 2025-01-29 15:31:39 -05:00
Kevin Zakka 1a4b821b6b [doc] Tweak language in asset dict paragraph.
PiperOrigin-RevId: 720994183
Change-Id: Ib99cc3fdd02eefdb2d78d7ac5adf36293c001062
2025-01-29 08:51:26 -08:00
Kevin Zakka f61973601e [docs] Mention asset lookup in MjSpec construction.
PiperOrigin-RevId: 720671094
Change-Id: I6ba343b37893620ba4f3477e57daa4876805156c
2025-01-28 12:33:55 -08:00
Yuval Tassa 8c22181156 Fix documentation typos.
PiperOrigin-RevId: 720232771
Change-Id: I176db4d4168c37b2819df14b439c4cde838e2025
2025-01-27 10:58:22 -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
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
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
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
Levi Burner a7eb6efd4e Copybara import of the project:
--
3a95b62f59e81bfef0f076afb173ecc14b27943d by Levi Burner <leviburner@gmail.com>:

rollout prototype native threadpool for comparing to python threads

--
efd8be1124ac839b902de45973a3ca8b9f2215e6 by Levi Burner <leviburner@gmail.com>:

copy mjpcs threadpool into python bindings

--
75603eea3e8362e354a9675e8a6cd14e56ec3d28 by Levi Burner <leviburner@gmail.com>:

rollout use threadpool as translation unit

--
06b90febd021663f6cc81fd7895e4d6e2008ed97 by Levi Burner <leviburner@gmail.com>:

rollout add chunk_divisor parameter

--
298ab2f3c0d6e12530832c3cdbf784dd92d54806 by Levi Burner <leviburner@gmail.com>:

rollout add native threading test

--
169cf9978e7abad6edd1392b8e6aab995e4f8f10 by Levi Burner <leviburner@gmail.com>:

rollout exchange chunk_divisor arg for chunk_size

--
265af851d74432d261277d3dbda11cdef1841bc8 by Levi Burner <leviburner@gmail.com>:

rollout fix cosmetics

--
1e8bffa88bf36190501b334bef31147e23db39f7 by Levi Burner <leviburner@gmail.com>:

make native rollout a class instead of a function

--
ba788214b047577f58c41ce0ab6c62c277cd8b0d by Levi Burner <leviburner@gmail.com>:

rollout update docs and changelog

--
e4cb7732319e04cba2ab2c2ad848c659f6309808 by Levi Burner <leviburner@gmail.com>:

rollout don't register atexit handler for Rollout objects

--
5a08d2efdbbbb01d4b1231ff9a36a1dc44f4d9ee by Levi Burner <leviburner@gmail.com>:

rollout nthread kwarg, rename shutdown_pool to close, fixups

--
f622378543596a208339af0208fa3a70bf2a8007 by Levi Burner <leviburner@gmail.com>:

rollout add missing .close() calls

--
50f3ebca43c53eac03f03943c34bb1e46967bd4f by Levi Burner <leviburner@gmail.com>:

rollout return immediately

COPYBARA_INTEGRATE_REVIEW=https://github.com/google-deepmind/mujoco/pull/2282 from aftersomemath:rollout-threaded 50f3ebca43c53eac03f03943c34bb1e46967bd4f
PiperOrigin-RevId: 706744277
Change-Id: I1ab2263b7d6ce30cf1908aec8fd5f2eb976a19e6
2024-12-16 09:57:08 -08:00
Yuval Tassa a7fed25fdd Document how to save MjSpec to XML. Fixes #2075
PiperOrigin-RevId: 704712337
Change-Id: I51c1a14c5c48ffc8e37d9e31162a3e70a3b10313
2024-12-10 08:05:01 -08:00
Levi Burner e6eab04dd0 rollout fixups and correctly initialize unspecified controls 2024-11-27 07:04:23 -05:00
Levi Burner 943eb6bc7e rollout accepts a list of models of length nroll 2024-11-25 21:29:14 -05:00
Alessio Quaglino c6ba8f27fd Add bind() method to MjModel and MjData.
This method allows users to bind a spec to a model or data object, making it less verbose to access its arrays.

PiperOrigin-RevId: 699952211
Change-Id: I6b71a88d5a6968bc0f902bd49db7c568b46a4dfb
2024-11-25 05:53:58 -08:00
Alessio Quaglino f909d63cdf Enable to attach a spec to a frame.
PiperOrigin-RevId: 699703988
Change-Id: Idbddcbce1e68286248458eb0bd24d5080451a58a
2024-11-24 07:35:14 -08:00
Yuval Tassa b6037d1759 Improve mjSpec documentation. Fixes #2074.
PiperOrigin-RevId: 692251710
Change-Id: Ia46bbbe5b7eaa890433b38fed66824f716cc9ea0
2024-11-01 12:06:14 -07:00
Yuval Tassa d8494fef3b Remove deprecated mjv_makeConnector function.
PiperOrigin-RevId: 690563333
Change-Id: Ice9c6b6cf41de8a55fa361477f9aee9181d50184
2024-10-28 04:51:47 -07:00
Copybara-Service 7e9481fbeb Merge pull request #2067 from abhihjoshi:documentation
PiperOrigin-RevId: 682364758
Change-Id: I3a5000a2851a560018ae0e04a2b7ad13415cb7c6
2024-10-04 10:15:19 -07:00
Taylor Howell 30cd8cc0e2 Add keyword argument example to code block in model editing section of the documentation.
PiperOrigin-RevId: 678643644
Change-Id: Ie1d5659f01cc882628a669e7be22eff975a888fc
2024-09-25 04:34:03 -07:00
Abhishek Joshi 456dcc150c Updating documentation for comments 2024-09-23 14:10:48 -04:00
Abhishek Joshi 43bf8d5e10 Moving USD documentation under Python page 2024-09-19 07:42:30 -04:00
Nimrod Gileadi f75ead2203 Improve the build instructions for mac.
The app bundle doesn't include mujoco.framework, so the instructions were a bit stale. I verified that with these new instructions I'm able to build the Python bindings from source with a prebuilt MuJoCo binary.

Fixes #313.

PiperOrigin-RevId: 666272041
Change-Id: I8bcf14c8ab6268cdaa617a8b5940b155ef64a8c5
2024-08-22 03:22:17 -07:00
Yuval Tassa 4d9305fbb9 Fix typo.
PiperOrigin-RevId: 663728400
Change-Id: Ifaf266a515bacb7b1598d14eb435561cb2375224
2024-08-16 07:45:38 -07:00
Yuval Tassa e13ddfa2ab Improve compiler-related documentation.
PiperOrigin-RevId: 651827545
Change-Id: I85c12dc12967e49087c342445dbfa049c5cdbcdf
2024-07-12 11:05:16 -07:00
Yuval Tassa 93b57c1421 Update Python documentation.
PiperOrigin-RevId: 631189628
Change-Id: I17d0fbe476fc14bbad525a302f588bf773a2244b
2024-05-06 14:40:59 -07:00
Saran Tunyasuvunakool fe57ae498f Fix typo and improve code snippet in documentation for user_scn.flags.
PiperOrigin-RevId: 603685657
Change-Id: Ia6af7a62db3d8955048fae4cbc30209bb1f7efd7
2024-02-02 07:50:38 -08:00
Saran Tunyasuvunakool 7bb0ce4211 [Python Viewer] Allow users to override rendering flags via user_scn.
Fixes #1190

PiperOrigin-RevId: 603672602
Change-Id: I3ff1bb0dca7e913b36f1b241aaea8b8bb95cadff
2024-02-02 06:39:08 -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
Kevin Zakka 7b9a0cdce6 Correct passive viewer pane argument documentation. Resolves #1166.
PiperOrigin-RevId: 579360444
Change-Id: I9fffa9d466f57eed1cfd5b4b86110739e8e66399
2023-11-03 18:57:07 -07:00
Saran Tunyasuvunakool a1d0cbd654 Add show_{left,right}_ui kwarg to viewer.launch(_passive).
Fixes #857

PiperOrigin-RevId: 572333909
Change-Id: I12247fe856afddf808eb8f386a594acac47c34b5
2023-10-10 12:31:11 -07:00
Saran Tunyasuvunakool 2e15574b58 Allow user-defined visualization geoms to be added to the passive viewer.
Fixes #1023, #1082

PiperOrigin-RevId: 572303635
Change-Id: Ia8399f816f311b38a7b137f5bd4f359f77a1da1c
2023-10-10 10:52:21 -07:00
Saran Tunyasuvunakool 7e5a7b76fc Change GitHub org name to google-deepmind.
PiperOrigin-RevId: 563512242
Change-Id: Ife98501e95bb3459d96c7c73e5fb53be5513dd4b
2023-09-07 12:34:20 -07:00
Kevin Zakka 65c827d422 Fix typo in key_callback example.
PiperOrigin-RevId: 550013932
Change-Id: I418f49eee97e73d1b0218acc7e9259acaefb5edd
2023-07-21 12:12:53 -07:00
Saran Tunyasuvunakool 06b70832ce Add keyboard event callback for Python passive viewer.
Fixes #766
Fixes #846

PiperOrigin-RevId: 549449372
Change-Id: I37d17f1162c66d0e8482d402aae22d9a16b59deb
2023-07-19 15:54:44 -07:00
Saran Tunyasuvunakool 0ccfef7314 Add update_{hfield,mesh,texture} methods to the passive viewer.
Fixes #812.
Fixes #958.
Fixes #965.

PiperOrigin-RevId: 548181282
Change-Id: I6eb0cd2ce52c66083e83dd08d69e0cfb4178dbba
2023-07-14 11:43:36 -07:00
Taylor Howell 52aa5b645c Update python.rst 2023-06-19 14:12:08 -07:00
Saran Tunyasuvunakool c9e9cd8b35 Change org name to "Google DeepMind" in various docs.
PiperOrigin-RevId: 540691205
Change-Id: I9eb99eb18893e6748892334470211dbd9d5808db
2023-06-15 14:28:25 -07:00
Yuval Tassa d65bffd8ff Shorten section title
PiperOrigin-RevId: 526727580
Change-Id: Ibfeb752e5cde480beee04032df047c1124983d54
2023-04-24 12:47:34 -07:00
Yuval Tassa 62a675ba28 Improve Python bindings documentation.
PiperOrigin-RevId: 526658768
Change-Id: Ife5640ed4328427e24e9f0302ee8a5424d82a974
2023-04-24 09:00:58 -07:00
Saran Tunyasuvunakool b362cb4972 Expose a handle for the Python viewer.
This change also requires user scripts to explicitly synchronize changes to physics state to the viewer. The Simulate class was reconfigured so that certain UI events are handled during this sync operation, outside of the render loop on the main thread. These correspond to operations that require access to the full mjModel/mjData.

To support other, more interactive operations (e.g. camera movements), a new mjvSceneState struct is introduced which captures only the portion of the physics state required for scene re-rendering. The mjvSceneState is updated from mjModel/mjData during the viewer sync operation, and is significantly cheaper than a full mj_copyModel and mj_copyData.

Fixes https://github.com/deepmind/mujoco/issues/796

PiperOrigin-RevId: 525723636
Change-Id: Id08d0210a2c067d5afe85e2bf104f276aeddd75e
2023-04-20 05:59:19 -07:00
Nimrod Gileadi 0e1f948c0a Change some redirecting links to direct links.
Files in github should be linked to using /blob/ rather than /tree/ URLs, while directories should be linked with /tree/.

PiperOrigin-RevId: 524796430
Change-Id: I72492a6acde0709b55d8d8620ad9b538619e7606
2023-04-17 03:06:06 -07:00