Commit Graph

106 Commits

Author SHA1 Message Date
Saran Tunyasuvunakool db28c31f05 Rename <required> tag to <plugin>.
PiperOrigin-RevId: 509237786
Change-Id: I35e812830b479004ac5025cbd9477888f51fb43e
2023-02-13 08:41:52 -08:00
Saran Tunyasuvunakool 5e989d18c3 Enable compiler errors for implicit switch case fallthroughs.
Also unify warning options across Clang and GCC and fix minor issues that was surfaced by this.

PiperOrigin-RevId: 508619655
Change-Id: I59b777bf2dfea4422485670e2427c7d3f5cf6405
2023-02-10 03:49:00 -08:00
Saran Tunyasuvunakool 71c5f1794d Remove efc_ fields from joint indexers.
Since the introduction of arena memory, these fields now have dynamic sizes that change between time steps depending on the number of active constraints. This breaks strict correspondence between joints and `efc_` rows.

Note that these fields can still be accessed directly as attributes on the `MjData` object.

PiperOrigin-RevId: 508342388
Change-Id: I610ae6ca462f6bb5cf8bc199a3436bed3d1a5371
2023-02-09 05:02:11 -08:00
Saran Tunyasuvunakool 7d8e810ab1 Fix IPython history corruption when using launch_repl.
PiperOrigin-RevId: 508064761
Change-Id: I58fa2e4f35b57a1ab68c3172ba5c0d4495e40ced
2023-02-08 06:37:42 -08:00
Saran Tunyasuvunakool e4b094732b Update dependency versions in Python requirements files.
PiperOrigin-RevId: 507791787
Change-Id: I2f87842c118ab6ee25857c52b7c02ca3012e964c
2023-02-07 08:40:52 -08:00
Alessio Quaglino dd632b7ccc Bump MuJoCo version to 2.3.2.
PiperOrigin-RevId: 507720557
Change-Id: I7a5b577094ac1a7f468a84c484f62f61dc6b409f
2023-02-07 02:35:17 -08:00
Saran Tunyasuvunakool f1af86cf82 Fix msan failure in __repr__ when upgraded to NumPy 1.24.
PiperOrigin-RevId: 505661236
Change-Id: I37ea339679870d23886e3c95f51451349fa1de2c
2023-01-30 05:11:25 -08:00
Peter Hawkins cd99fbd59d Fix test failures under NumPy 1.24.
The use of `np.empty` triggers an msan use-of-uninitialized-value error when upgraded.

PiperOrigin-RevId: 503975799
Change-Id: I337c8227c8c1e3bd415d7a798fc5e764c88c0875
2023-01-23 07:04:33 -08:00
Nimrod Gileadi d7844aa5be Fix links to documentation.
1. Links to the programming chapter were broken after 69c74f850e. They're now fixed with a redirect in readthedocs.io, but this commit updates them to the latest URL.

2. Most docs links should point to "stable" instead of "latest", since most users will want the docs for the released version, not the upcoming version. The exceptions are the programming chapter, and instructions for building the Python bindings from source.

PiperOrigin-RevId: 502821526
Change-Id: If0a55ab2be4751ba0165bf644030464234083133
2023-01-18 02:55:41 -08:00
Saran Tunyasuvunakool d022cd1a31 Fix broken launch_repl in the Python viewer.
The REPL functionality was broken in 9fcf3b0c2e.

PiperOrigin-RevId: 501818153
Change-Id: I3fe2f14d78839e63deb43c1017527e7a1cf79e3c
2023-01-13 04:59:22 -08:00
Saran Tunyasuvunakool e40775fab3 Abstract out GLFW calls from Simulate.
PiperOrigin-RevId: 500129478
Change-Id: I7ba998e20439575ad9a3fe1a866c3db4c36b9328
2023-01-06 02:45:56 -08:00
Saran Tunyasuvunakool 5fe97403c9 Remove source building instructions from python/README.md.
Most users should be fine with just `pip install mujoco`, so it seems better to keep the installation section in the README succinct to prevent confusion.

Advanced users who need to build from source are referred to our documentation, which currently just duplicates the same information.

PiperOrigin-RevId: 499182819
Change-Id: I181fee93c3d2e05b0ca8462bb364f94cf1065517
2023-01-03 04:35:31 -08:00
Kevin Zakka a173e01f42 Prevent division by zero in Ornstein–Uhlenbeck control noise.
PiperOrigin-RevId: 498753494
Change-Id: Ib43e165a4da524c12fab4ea05848b084b2e7713c
2022-12-31 10:29:03 -08:00
Saran Tunyasuvunakool 725b45b577 Internal Python bindings cleanup.
PiperOrigin-RevId: 495868304
Change-Id: Ib9cfe5f7a1d49126659176207bd6b4a314f8516a
2022-12-16 07:22:48 -08:00
Copybara-Service 3a00e025ce Merge pull request #619 from traversaro:fixpypytests
PiperOrigin-RevId: 494129535
Change-Id: I301cb505a224eaa26df4896924d36c623b1a4a26
2022-12-09 03:39:22 -08:00
Nimrod Gileadi 91455b3e1e Add a naive test of mujoco.viewer.
It just tries to import mujoco.viewer and sees that nothing crashes.

PiperOrigin-RevId: 493998120
Change-Id: I56ee696283a3c28f6c8b72de45c8fdbedb41b05f
2022-12-08 14:35:20 -08:00
Silvio Traversaro bfe1017fc8 Skip tests that cannot run on PyPy 2022-12-07 19:19:21 +01:00
Saran Tunyasuvunakool 8f3a771209 Update tutorial notebooks to use the built-in Renderer class.
PiperOrigin-RevId: 493303419
Change-Id: I5ddca087d522e7d43f8880641e8bc8d82d4f07a3
2022-12-06 07:46:16 -08:00
Saran Tunyasuvunakool 0d608282dd Fix viewer.py for Python 3.7 and 3.8.
PiperOrigin-RevId: 493301329
Change-Id: I44ffe5b33595d2dec7cd1aefbdd77d535901d894
2022-12-06 07:36:25 -08:00
Yuval Tassa 687bd15e05 Make comment more precise
PiperOrigin-RevId: 493165357
Change-Id: Ibdd86de67caf0e528e20ff6829e8ed4a8b967d4c
2022-12-05 18:15:14 -08:00
Kyle Bayes 73fb61e3e2 Bump version number to 2.3.1.
PiperOrigin-RevId: 493076656
Change-Id: I48c7a45b503c4a7363ea1455a4a3788262d007f7
2022-12-05 12:13:55 -08:00
Kyle Bayes ef695bb8a8 Add Renderer class to Python native bindings.
PiperOrigin-RevId: 492994751
Change-Id: Iebbe5980668a15b1cd62c0076cc131255462b2eb
2022-12-05 06:54:33 -08:00
Kyle Bayes 341578450f Update dependency versions for Benchmark and Pybind11.
PiperOrigin-RevId: 492978119
Change-Id: Id48037950a6beac2f04f5e08448bd2fb3cb88678
2022-12-05 05:20:08 -08:00
Saran Tunyasuvunakool 0846f38c82 Rename Python mujoco.simulate to mujoco.viewer.
PiperOrigin-RevId: 492701386
Change-Id: I059c572e2a63bd5529e863a9404720973df8ea46
2022-12-03 10:09:42 -08:00
Saran Tunyasuvunakool 9fcf3b0c2e Modify Python simulate so that the Reload button works.
Also allow a `Callable[[], [MjModel, MjData]]` to be provided as an argument to `launch` instead of a fixed MjModel/MjData instance. This allows users to customise the behaviour of the Reload button.

Context: https://github.com/deepmind/mujoco/discussions/576#discussioncomment-4161429
PiperOrigin-RevId: 492296268
Change-Id: Ic4b797d2ea8a6967f7e3e7316f2184ea94a86d8b
2022-12-01 14:12:35 -08:00
Saran Tunyasuvunakool df25d7d602 Raise an informative error when running on macOS under Rosetta 2.
Current users only get a cryptic "Illegal instruction" crash.

Context: https://github.com/deepmind/mujoco/issues/611
PiperOrigin-RevId: 491705647
Change-Id: I1285897a36e858300ee3d125957e90754be9a7f7
2022-11-29 12:19:06 -08:00
Yuval Tassa b0665fe2f9 Fix link inside the tutorial notebook.
PiperOrigin-RevId: 491544042
Change-Id: Ic11ffcdc06583937520ec0e5eb998557ece6a3d5
2022-11-28 23:56:53 -08:00
Kyle Bayes fdb81f3388 Fix location of MuJoCo tutorial Colab notebook.
PiperOrigin-RevId: 491436998
Change-Id: I93c1ea3ae142d69dc8a8fe893f014e539cb33746
2022-11-28 14:00:57 -08:00
Kyle Bayes 5a8e861152 Add MuJoCo tutorial Colab using the native Python bindings.
PiperOrigin-RevId: 491424124
Change-Id: I5bdeb68fd1bd1b4bc92fb40e0b876d9dcfc568cb
2022-11-28 13:09:51 -08:00
Kevin Zakka b13d6ae7bd Nit fix in LQR notebook.
PiperOrigin-RevId: 489419396
Change-Id: I3770377f4961f4a991dae5e738597c05aec1b146
2022-11-18 01:54:21 -08:00
Saran Tunyasuvunakool fa0f6399d5 Make Python bindings buildable with older versions of CMake.
Context: https://discourse.cmake.org/t/alias-and-not-globally-visible-targets/6305
PiperOrigin-RevId: 489051335
Change-Id: I1bbe189413d6f8abe97d3d8ceccf6541de69e2ae
2022-11-16 15:12:01 -08:00
Saran Tunyasuvunakool 9ecade0707 Move plugin loading and scanning logic from Simulate to MuJoCo library.
PiperOrigin-RevId: 489020177
Change-Id: I1c29d931b47d5252e57e1d797cc7c17645859ffc
2022-11-16 13:15:51 -08:00
Saran Tunyasuvunakool 6175b508c0 Also run pip install --require-hashes on GitHub Actions.
PiperOrigin-RevId: 487625303
Change-Id: Ib65ff23faa33a95e077952e275cf466cec44fb93
2022-11-10 13:31:18 -08:00
Saran Tunyasuvunakool 985b3f1c9e Remove custom code path when run under type checking.
PiperOrigin-RevId: 487584485
Change-Id: I1b1c773240bb033e50205648f4611f4702c0e6e8
2022-11-10 10:56:32 -08:00
Saran Tunyasuvunakool fd139276bc Run pip install with --require-hashes.
PiperOrigin-RevId: 487569781
Change-Id: I0a810403f789415a3f884531617801ae111c957b
2022-11-10 10:07:38 -08:00
Kyle Bayes 601963beb2 Automated rollback of 39d20f20ea.
*** Reason for rollback ***

Breakage at https://github.com/deepmind/mujoco/actions/runs/3427459759

*** Original change description ***

Add test to catch missing Python function bindings.

***

PiperOrigin-RevId: 487505205
Change-Id: Iec3b588380b4b6fc7a3249ccdef08e48b42a7892
2022-11-10 05:07:24 -08:00
Copybara-Service f7b256de91 Merge pull request #419 from aftersomemath:simulate-python
PiperOrigin-RevId: 487496285
Change-Id: I17d15bd2a3886e5ce1631f4eb78afa94830d08cc
2022-11-10 04:12:34 -08:00
Kyle Bayes 39d20f20ea Add test to catch missing Python function bindings.
PiperOrigin-RevId: 487187845
Change-Id: Iddf8afd16abb9a22bba6a53a0ecc0423208f41e6
2022-11-09 02:45:11 -08:00
Nimrod Gileadi 9ffde761e8 Add support for Python 3.11 to MuJoCo build.
PiperOrigin-RevId: 486911779
Change-Id: I57a043ed9cbdf84cddf776f4654941370f050a8c
2022-11-08 04:22:36 -08:00
Alessio Quaglino fd4d47e4a5 Format memory warning in human-friendly way.
PiperOrigin-RevId: 486610408
Change-Id: I6beecb12059e69f4407e921d20efc54ce6b3f491
2022-11-07 02:56:07 -08:00
Yuval Tassa 36b30e4500 Allow more than 1 activation state per actuator, but only for dyntype user.
Fixes #305.

PiperOrigin-RevId: 486597273
Change-Id: I3eb806f60949e68ebe6cbe35a6e66218a167ed45
2022-11-07 01:43:02 -08:00
Nimrod Gileadi 0514010928 Disable deprecated-builtins warnings in clang.
Since upgrading to Clang 15, abseil fails to build, because of abseil/abseil-cpp#1201.

PiperOrigin-RevId: 486190797
Change-Id: Ibaa1c03b8d21ae4a83c3825c8d56363aa2f89505
2022-11-04 11:35:49 -07:00
Yuval Tassa c83be2bc05 Add mju_clip, mju_fill, mju_eye and mju_symmetrize to python bindings.
- Also change signatures of `mju_fill` and `mju_symmetrize` to conform to standard.

PiperOrigin-RevId: 485613824
Change-Id: I8dd618bac92ef40aa6c76380fa73302e81968687
2022-11-02 09:22:28 -07:00
Yuval Tassa 0eb7f871b9 Remove requirement that stateless actuators come before stateful actuators.
PiperOrigin-RevId: 484332415
Change-Id: I1dae92c0f8e027e4ca71c20ea3f68b2926526f53
2022-10-27 13:18:57 -07:00
Yuval Tassa 0ff4f964fd Update LQR colab to use .name and .id attributes of indexers.
PiperOrigin-RevId: 481915877
Change-Id: Iba79523422a442f3ca4793587936e05797d43e40
2022-10-18 07:32:41 -07:00
Saran Tunyasuvunakool 573d331b69 Bump pybind11 and Eigen versions.
PiperOrigin-RevId: 481831731
Change-Id: I29082287c7b716bfb29b25545599f6eca8106c49
2022-10-17 23:37:59 -07:00
Saran Tunyasuvunakool 57b0b36699 Bump version number to 2.3.0.
PiperOrigin-RevId: 481823754
Change-Id: Ie8c2c65b11178952355830ef019fe2efdf774189
2022-10-17 22:36:59 -07:00
Saran Tunyasuvunakool 3aaf94f42c Fix Python GIL-not-held issues in python/callbacks.cc.
The GIL bug was introduced in ec6ea6a69e and is resolved by decrementing the refcount before returning from MjWrapperLookup.

PiperOrigin-RevId: 481558798
Change-Id: I2744287d48635a55ae6d2ec46c9e43fe881019d8
2022-10-17 00:05:56 -07:00
Saran Tunyasuvunakool ec6ea6a69e Fix a memory leak when using Python callbacks.
Fixes #527.

PiperOrigin-RevId: 481173711
Change-Id: Ie176a8bda09727b6be8b6641d3be9a75c675d566
2022-10-14 10:12:11 -07:00
Alessio Quaglino 95fe2fbc40 Add plugin support to Python bindings.
PiperOrigin-RevId: 480675078
Change-Id: I2967654b6662efced8ae62cae9b03c6c8e65c67c
2022-10-12 11:30:15 -07:00