========= Changelog ========= Upcoming version (not yet released) ----------------------------------- General ^^^^^^^ - Added sub-terms of total passive forces in ``mjData.qfrc_passive`` to :ref:`mjData`: ``qfrc_{spring, damper, gravcomp, fluid}``. The sum of these vectors equals ``qfrc_passive``. .. youtube:: H9qG9Zf2W44 :align: right :width: 240px - Added :ref:`actuatorgroupdisable` attribute and associated :ref:`mjOption.disableactuator` integer bitfield, which can be used to disable sets of actuators at runtime according to their :ref:`group`. Fixes :github:issue:`1092`. See :ref:`CActDisable`. - The first 6 actuator groups are toggleable in the :ref:`simulate` viewer. See `example model `__ and associated screen-capture on the right. - Increased ``mjMAXUIITEM`` (maximum number of UI elements per section in Simulate) to 200. MJX ^^^ - Added support for Newton solver (``mjSOL_NEWTON`` in :ref:`mjtSolver`). The Newton solver significantly speeds up simulation on GPU. See updated benchmarks on an Nvidia A100 (reported numbers are steps-per-second): .. list-table:: Steps-per-second, Conjugate Gradient vs. Newton on A100 :header-rows: 1 :align: left * - Model - CG - Newton - Speedup * - `Humanoid `__ - 640,000 - 1,020,000 - **1.6 x** * - `Barkour v0 `__ - 1,290,000 - 1,750,000 - **1.35 x** * - `Shadow Hand `__ - 215,000 - 270,000 - **1.25 x** Humanoid is the standard MuJoCo humanoid, `Google Barkour `__ and the Shadow Hand are both available in the :ref:`MuJoCo Menagerie`. - Added support for joint equality constraints (``mjEQ_JOINT`` in :ref:`mjtEq`). - Fixed bug where mixed ``jnt_limited`` joints were not being constrained correctly. - Made ``device_put`` type validation more verbose (fixes :github:issue:`1113`). - Removed empty EFC rows from ``MJX``, for joints with no limits (fixes :github:issue:`1117`). Python bindings ^^^^^^^^^^^^^^^ - Fix the macOS ``mjpython`` launcher to work with the Python interpreter from Apple Command Line Tools. - Fixed a crash when copying instances of ``mujoco.MjData`` for models that use plugins. Introduced a ``model`` attribute to ``MjData`` which is reference to the model that was used to create that ``MjData`` instance. Simulate ^^^^^^^^ - :ref:`simulate`: correct handling of "Pause update", "Fullscreen" and "VSync" buttons. Documentation ^^^^^^^^^^^^^ - Added documentation for the :ref:`UI` framework. - Fixed typos and supported fields in docs (fixes :github:issue:`1105` and :github:issue:`1106`). Bug fixes ^^^^^^^^^ - Fixed bug relating to welds modified with :ref:`torquescale`. Version 3.0.0 (October 18, 2023) -------------------------------- New features ^^^^^^^^^^^^ 1. Added simulation on GPU and TPU via the new :doc:`mjx` (MJX) Python module. Python users can now natively run MuJoCo simulations at millions of steps per second on Google TPU or their own accelerator hardware. - MJX is designed to work with on-device reinforcement learning algorithms. This Colab notebook demonstrates using MJX along with reinforcement learning to train humanoid and quadruped robots to locomote: |colab| - The MJX API is compatible with MuJoCo but is missing some features in this release. See the outline of :ref:`MJX feature parity ` for more details. .. |colab| image:: https://colab.research.google.com/assets/colab-badge.svg :target: https://colab.research.google.com/github/google-deepmind/mujoco/blob/main/mjx/tutorial.ipynb .. youtube:: QewlEqIZi1o :align: right :width: 240px 2. Added new signed distance field (SDF) collision primitive. SDFs can take any shape and are not constrained to be convex. Collision points are found by minimizing the maximum of the two colliding SDFs via gradient descent. - Added new SDF plugin for defining implicit geometries. The plugin must define methods computing an SDF and its gradient at query points. See the :ref:`documentation` for more details. .. youtube:: ra2bTiZHGlw :align: right :width: 240px 3. Added new low-level model element called ``flex``, used to define deformable objects. These `simplicial complexes `__ can be of dimension 1, 2 or 3, corresponding to stretchable lines, triangles or tetrahedra. Two new MJCF elements are used to define flexes. The top-level :ref:`deformable` section contains the low-level flex definition. The :ref:`flexcomp` element, similar to :ref:`composite` is a convenience macro for creating deformables, and supports the GMSH tetrahedral file format. - Added `shell `__ passive force plugin, computing bending forces using a constant precomputed Hessian (cotangent operator). **Note**: This feature is still under development and subject to change. In particular, deformable object functionality is currently available both via :ref:`deformable` and :ref:`composite`, and both are modifiable by the first-party `elasticity plugins `__. We expect some of this functionality to be unified in the future. .. youtube:: Vc1tq0fFvQA :align: right :width: 240px 4. Added constraint island discovery with :ref:`mj_island`. Constraint islands are disjoint sets of constraints and degrees-of-freedom that do not interact. The only solver which currently supports islands is :ref:`CG`. Island discovery can be activated using a new :ref:`enable flag`. If island discovery is enabled, geoms, contacts and tendons will be colored according to the corresponding island, see video. Island discovery is currently disabled for models that have deformable objects (see previous item). 5. Added :ref:`mjThreadPool` and :ref:`mjTask` which allow for multi-threaded operations within the MuJoCo engine pipeline. If engine-internal threading is enabled, the following operations will be multi-threaded: - Island constraint resolution, if island discovery is :ref:`enabled` and the :ref:`CG solver` is selected. The `22 humanoids `__ model shows a 3x speedup compared to the single threaded simulation. - Inertia-related computations and collision detection will happen in parallel. Engine-internal threading is a work in progress and currently only available in first-party code via the :ref:`testspeed` utility, exposed with the ``npoolthread`` flag. 6. Added capability to initialize :ref:`composite` particles from OBJ files. Fixes :github:issue:`642` and :github:issue:`674`. General ^^^^^^^ .. admonition:: Breaking API changes :class: attention 7. Removed the macros ``mjMARKSTACK`` and ``mjFREESTACK``. **Migration:** These macros have been replaced by new functions :ref:`mj_markStack` and :ref:`mj_freeStack`. These functions manage the :ref:`mjData stack` in a fully encapsulated way (i.e., without introducing a local variable at the call site). 8. Renamed ``mj_stackAlloc`` to :ref:`mj_stackAllocNum`. The new function :ref:`mj_stackAllocByte` allocates an arbitrary number of bytes and has an additional argument for specifying the alignment of the returned pointer. **Migration:** The functionality for allocating ``mjtNum`` arrays is now available via :ref:`mj_stackAllocNum`. 9. Renamed the ``nstack`` field in :ref:`mjModel` and :ref:`mjData` to ``narena``. Changed ``narena``, ``pstack``, and ``maxuse_stack`` to count number of bytes rather than number of :ref:`mjtNum` |-| s. 10. Changed :ref:`mjData.solver`, the array used to collect solver diagnostic information. This array of :ref:`mjSolverStat` structs is now of length ``mjNISLAND * mjNSOLVER``, interpreted as as a matrix. Each row of length ``mjNSOLVER`` contains separate solver statistics for each constraint island. If the solver does not use islands, only row 0 is filled. - The new constant :ref:`mjNISLAND` was set to 20. - :ref:`mjNSOLVER` was reduced from 1000 to 200. - Added :ref:`mjData.solver_nisland`: the number of islands for which the solver ran. - Renamed ``mjData.solver_iter`` to ``solver_niter``. Both this member and ``mjData.solver_nnz`` are now integer vectors of length ``mjNISLAND``. 11. Removed ``mjOption.collision`` and the associated ``option/collision`` attribute. **Migration:** - For models which have ``