Commit Graph

948 Commits

Author SHA1 Message Date
Saran Tunyasuvunakool 40ef08c8ed Don't pollute the global namespace when using mjpython.
Fixes #2265

PiperOrigin-RevId: 713442833
Change-Id: If155d9f57d4deef8b848478ebd8077a00417d5c5
2025-01-08 15:48:20 -08:00
Alessio Quaglino 6654d63438 Add spec lookup in the attached spec array using the compiler option pointer.
This enables to find the spec associated with the compiler option stored in the objects, which do not necessarily belong to the model that owns them.

PiperOrigin-RevId: 713259419
Change-Id: I579c770147ff07ed2a5edd20e7a795ee7cc27147
2025-01-08 05:44:00 -08:00
Alessio Quaglino f607d9554e Check that there are no pending keyframes while writing a spec.
This can happen when a body is detached without compiling or recompiling.

Also added error catching when trying to delete a body instead of detaching it.

Fixes #2327

PiperOrigin-RevId: 712526730
Change-Id: I4b48df83120fca12d475c85b3a54893841449653
2025-01-06 07:50:30 -08:00
Yuval Tassa b5df2c10bf Remove mjData.C_diag, no longer required as C is now lower triangular.
PiperOrigin-RevId: 712514204
Change-Id: I8293f65ebc09c6a8fed76b0e59d2e2a667e01a43
2025-01-06 06:58:19 -08:00
Alessio Quaglino ee6f4837f3 Auto-generate 3D mesh from convex OBJ if dim=3 in flex.
This requires the user to explicitly specify an origin.

PiperOrigin-RevId: 712483526
Change-Id: Ie316a5eccb676bb918d4bb746795019145c10f5b
2025-01-06 04:35:59 -08:00
Yuval Tassa 69c9ac074a Remove mjData.qLDiagSqrtInv, add corresponding argument to mj_solveM2.
- `qLDiagSqrtInv` is only required for the dual solvers. It is now computed as-needed rather than unconditionally.
- `mj_solveM2` now requires a new input array `sqrtInvD` which contains the square root of the inverse diagonal D (formerly saved in `qLDiagSqrtInv`).

PiperOrigin-RevId: 710805133
Change-Id: I0622d6a8da3882916824e9c10bad9223c122c321
2024-12-30 15:24:36 -08:00
Yuval Tassa ec322641b7 Fix bug in mj_mulM2.
PiperOrigin-RevId: 710756899
Change-Id: I30c0725859ba0f1a59750dc89eebb9eba84fa71b
2024-12-30 11:14:56 -08:00
Yuval Tassa 8cb253b6ca Fix typos.
PiperOrigin-RevId: 710678815
Change-Id: Iab6f603f8f4d782ac7f34140add39e1f37625167
2024-12-30 04:15:29 -08:00
Yuval Tassa e67599f517 Add weak deprecation notice include in XMLreference.
PiperOrigin-RevId: 710300945
Change-Id: I5a3dd066ef643d606d97ec36ffe1e797bb628659
2024-12-28 08:50:31 -08:00
Kristian Hartikainen edec8c5e3a Copybara import of the project:
--
0e1aae484a1a6d2d52d0b99bf62f116d42ed9a1f by Kristian Hartikainen <kristian.hartikainen@gmail.com>:

Fix typo in `changelog.rst`

COPYBARA_INTEGRATE_REVIEW=https://github.com/google-deepmind/mujoco/pull/2298 from hartikainen:patch-1 0e1aae484a1a6d2d52d0b99bf62f116d42ed9a1f
PiperOrigin-RevId: 707528220
Change-Id: Ie3bc28cf7a8456e4ba8bfc405ab7190a84d5a69e
2024-12-18 06:31:09 -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 b26d6f0466 Disable tendon catenary visualization when tendon is actuated. Add note about catenary visualization.
PiperOrigin-RevId: 706161179
Change-Id: Ifaf571e039306309869078d1a0bcf9a69f1fe9de
2024-12-14 01:54:40 -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
Taylor Howell bd1d94c282 Fix mjx.rst.
PiperOrigin-RevId: 704301576
Change-Id: Ia663f5b7fe224ca3e7865829744379eac38fac3e
2024-12-09 08:47:46 -08:00
Yuval Tassa 3a14ada308 Store index of diagonal element for C and D in mjData.
PiperOrigin-RevId: 704287869
Change-Id: I15d1faa0b5c3ff54721f692ec6329726456ec318
2024-12-09 08:01:30 -08:00
Copybara-Service 15cb1fdfb4 Merge pull request #2271 from xela-95:patch-1
PiperOrigin-RevId: 703493322
Change-Id: I5034ecdbc2e129986bb1e61930637fd2c24b96a6
2024-12-06 07:26:47 -08:00
Yuval Tassa f547d58351 Fix typo in docs
PiperOrigin-RevId: 703449955
Change-Id: I3a5764278406dea4ff013ff82872cc27f5440f5e
2024-12-06 04:16:16 -08:00
Alessandro Croci 342a72839a Fix typo in mjx.rst 2024-12-06 09:16:37 +01:00
Jake Harmon fb8e40208c Update references to JAX's GitHub repo
JAX has moved from https://github.com/google/jax to https://github.com/jax-ml/jax

PiperOrigin-RevId: 703126479
Change-Id: Ie50003b4620db767663f2f95be40557cfe0b8dd3
2024-12-05 08:37:01 -08:00
Yuval Tassa 0e7d2ef6df Fix bug in box-sphere collider. Fixes #2206
PiperOrigin-RevId: 702627603
Change-Id: Ie6015b7fa6f8507459325d692581b0f5f83aa159
2024-12-04 01:19:27 -08:00
Yuval Tassa ec9986dcb7 Clean up changelog.
PiperOrigin-RevId: 702369712
Change-Id: I44293f18de54ddc65af31f64c40dfbe608278b6d
2024-12-03 09:39:14 -08:00
Taylor Howell a793a3417a Raise error in mjx.rne_postconstraint for currently unsupported connect and weld constraints and raise error in mjx.put_model for unsupported sensor and equality constraint combinations.
PiperOrigin-RevId: 702119449
Change-Id: I034363db41629f19ef98bea79ec89140052a7a3c
2024-12-02 16:28:23 -08:00
Gabe Oppenheimer c90a63a926 Update the version number to 3.2.7 following the 3.2.6 release.
PiperOrigin-RevId: 702103729
Change-Id: Id5581cc823a17360e7bb98ac0aa4342020c1aefa
2024-12-02 15:30:52 -08:00
Gabe Oppenheimer bbedc7f339 Update the chancelog for the v3.2.6 release
PiperOrigin-RevId: 702021093
Change-Id: I1c748581ad63ae934b043f56b929d7a5a362bb23
2024-12-02 10:56:29 -08:00
Alessio Quaglino 300450f8b8 Add circle to flexcomp and remove rope and loop from composite.
Add pulley example to show a circle use case.

Switch on flex edge rendering by default (no effect when flex skin is rendered).

PiperOrigin-RevId: 700738379
Change-Id: I8469bbf194de01c8dab66c9a51c49879013df141
2024-11-27 10:14:25 -08:00
Copybara-Service 85c6fc1bdb Merge pull request #2250 from aftersomemath:rollout-list
PiperOrigin-RevId: 700715697
Change-Id: Ia3af7c6af8a9fe1eb8b020efedd1755ae606f77b
2024-11-27 08:52:17 -08:00
Levi Burner e6eab04dd0 rollout fixups and correctly initialize unspecified controls 2024-11-27 07:04:23 -05:00
Levi Burner bd361447bb merge items in changelog 2024-11-26 08:22:28 -05:00
Alessio Quaglino e310c23267 Fix return value of mj_saveXML and mj_saveXMLString, fixes #2247
PiperOrigin-RevId: 700269761
Change-Id: Ifb7e9c66c70eac7d681cfcf106712d47291cf9e2
2024-11-26 02:32:50 -08:00
Levi Burner 943eb6bc7e rollout accepts a list of models of length nroll 2024-11-25 21:29:14 -05:00
Levi Burner 96a8f002bc Remove nroll argument from rollout
nroll can always be implied from the other arguments of rollout.

Add tests for nroll inference.
2024-11-25 14:10:42 -05:00
Alessio Quaglino 7e46e21ef3 Add mju_mat2Rot.
This function extracts the 3D rotation from an arbitrary 3x3 matrix by refining the input quaternion. It is based on the paper "A robust method to extract the rotational part of deformations" by Müller, Matthias, Jan Bender, Nuttapong Chentanez, and Miles Macklin.

PiperOrigin-RevId: 700006006
Change-Id: I77550993233dea9cdf68601762a3ae7ded749bdf
2024-11-25 09:19:10 -08: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
Alessio Quaglino 3a12db9ad2 Remove id attribute from mjSpec objects in Python bindings.
Using ids is error prone in scenarios of repeated attachment and detachment. Python users are encouraged to use names for unique identification of model elements.

PiperOrigin-RevId: 699227286
Change-Id: Ifd83e6d85d36ff72ea43caf8b82eab9e4d552440
2024-11-22 11:05:14 -08:00
Yuval Tassa 1d64362adc Add mjv_copyModel to copy mjModel, skipping large arrays not required for abstract visualization.
This functionality is meant for fast copying of `mjModel` when synchronizing the visualization state, as in the Python passive viewer.

PiperOrigin-RevId: 699199743
Change-Id: I13a5160063eb09139ec1aee9c4969bc1c6f547f1
2024-11-22 09:38:08 -08:00
Yuval Tassa 74dcd51d83 Update changelog with Python 3.13 support (upcoming release)
PiperOrigin-RevId: 699127095
Change-Id: I098d1e91e59642f27a764d055c6ae9b77a8b1000
2024-11-22 04:34:33 -08:00
Alessio Quaglino 38ee55a957 Remove unused userfacenormal field from mjSpec.
PiperOrigin-RevId: 698739284
Change-Id: I6407356ac12ad49454d15ecf9056f2c0bef713d5
2024-11-21 05:08:39 -08:00
Taylor Howell aae5fd6906 Add nJmom, the number of non-zeros in sparse actuator_moment matrix, to mjModel.
PiperOrigin-RevId: 698343986
Change-Id: I3d4a4dea1ec095d4e7b231c2fffc0e6241cee39f
2024-11-20 04:30:47 -08:00
Yuval Tassa 5c23ae11ef Fix bug in material texrepeat attribute, fixes #2223.
Was mistakenly cast from float to int, bug introduced in 3.2.0

PiperOrigin-RevId: 697993181
Change-Id: I643a07e2b0866a4af56d7cbd3344e764a7caf56f
2024-11-19 06:30:55 -08:00
Yuval Tassa 9f51ba50db Fix field ordering in mjModel.
`nnames_map` is not required for `mjModel` construction, it is set during construction.

PiperOrigin-RevId: 696462793
Change-Id: Ie722e2a04d7fd7ed96634d3304cc94e895ed713b
2024-11-14 03:45:34 -08:00
Taylor Howell 0f381a9ebd Add muscle actuators to MJX.
PiperOrigin-RevId: 695334356
Change-Id: I6590ed6bdd4a8adc53d5c4e2641f472f7439cedc
2024-11-11 07:46:20 -08:00
Yuval Tassa d6d3d6bb25 Fix typo in changelog.
PiperOrigin-RevId: 694009875
Change-Id: I0ecafe467347a54b54c29c486b98516d1a53e5ea
2024-11-07 00:19:42 -08:00
Kevin Sayed 276f5b04cd Bump MuJoCo version to 3.2.6.
PiperOrigin-RevId: 693472991
Change-Id: Ic202f52dd42c55c43ba05ca21b5cc6a4024b0c72
2024-11-05 14:13:08 -08:00
Baruch Tabanpour f9569cdab0 Fix #2212.
PiperOrigin-RevId: 693294401
Change-Id: Ifef2b268f61b90f557580f61316786c50dc9698d
2024-11-05 04:17:48 -08:00
Google DeepMind b7bbb2b25c Update the MuJoCo changelog for the 3.2.5 release
PiperOrigin-RevId: 693032354
Change-Id: I675424a3feeda8037a9559753dc93c05b812257c
2024-11-04 11:19:46 -08:00
Yuval Tassa 298ce31e39 Update docs to highlight nativeccd
PiperOrigin-RevId: 692918061
Change-Id: I9e44bc3123fe6b8a41b769c7de01b20e3c56d758
2024-11-04 04:34:53 -08:00
Kyle Bayes c168ac3397 Add source code links in docs for remaining API functions.
PiperOrigin-RevId: 692728907
Change-Id: I145eb47453e6aa017505d53d3e17215959252e3d
2024-11-03 11:09:56 -08:00
Yuval Tassa efa5709c94 Fix broken link in XMLreference.
PiperOrigin-RevId: 692669798
Change-Id: I8f61d1032d11c63945264a1b9dc1c034b7401d98
2024-11-03 04:18:43 -08:00
Alessio Quaglino 831d9881d3 Remove box, cylinder and ellipsoid composite types.
Also, fix a bug with Flex textures that was causing an incorrect allocation of the textures in mjModel. Fixes #2013.

PiperOrigin-RevId: 692510858
Change-Id: If781716216974e085244da27bc3aa57d91c3458c
2024-11-02 11:14:13 -07:00