Releases: google-deepmind/mujoco
3.1.3
3.1.2
3.1.1
3.1.0
3.0.1
3.0.0
New features
-
Added simulation on GPU and TPU via the new MuJoCo XLA (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:
- The MJX API is compatible with MuJoCo but is missing some features in this release. See the outline of MJX feature parity for more details.
- 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:
-
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 documentation for more details.
-
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 deformable section contains the low-level flex definition. The flexcomp element, similar to 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 deformable and composite, and both are modifiable by the first-party elasticity plugins. We expect some of this functionality to be unified in the future.
-
-
Added constraint island discovery with
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 CG. Island discovery can be activated using a new 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). -
Added
mjThreadPoolandmjTaskwhich 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 enabled and the 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 testspeed utility, exposed with the
npoolthreadflag. -
Added capability to initialize
compositeparticles from OBJ files. Fixes #642 and #674.
General
Important
Breaking API changes
-
Removed the macros
mjMARKSTACKandmjFREESTACK.Migration: These macros have been replaced by new functions
mj_markStackandmj_freeStack. These functions manage themjDatastack in a fully encapsulated way (i.e., without introducing a local variable at the call site). -
Renamed
mj_stackAlloctomj_stackAllocNum. The new functionmj_stackAllocByteallocates an arbitrary number of bytes and has an additional argument for specifying the alignment of the returned pointer.Migration: The functionality for allocating
mjtNumarrays is now available viamj_stackAllocNum. -
Renamed the
nstackfield inmjModelandmjDatatonarena. Changednarena,pstack, andmaxuse_stackto count number of bytes rather than number ofmjtNums. -
Changed
mjData.solver, the array used to collect solver diagnostic information. This array ofmjSolverStatstructs is now of lengthmjNISLAND * mjNSOLVER, interpreted as as a matrix. Each row of lengthmjNSOLVERcontains separate solver statistics for each constraint island. If the solver does not use islands, only row 0 is filled.- The new constant
mjNISLANDwas set to 20. mjNSOLVERwas reduced from 1000 to 200.- Added
mjData.solver_nisland: the number of islands for which the solver ran. - Renamed
mjData.solver_itertosolver_niter. Both this member andmjData.solver_nnzare now integer vectors of lengthmjNISLAND.
- The new constant
-
Removed
mjOption.collisionand the associatedoption/collisionattribute.Migration:
- For models which have
<option collision="all"/>, delete the attribute. - For models which have
<option collision="dynamic"/>, delete allpairelements. - For models which have
<option collision="pair"/>, disable all dynamic collisions (determined via contype/conaffinity) by first deleting allcontypeandconaffinityattributes in the model and then setting them globally to0using
<default> <geom contype="0" conaffinity="0"/> </default>.
- For models which have
-
Removed the
ropeandclothcomposite objects.Migration: Users should use the
cableandshellelasticity plugins. -
Added
mjData.eq_activeuser input variable, for enabling/disabling the state of equality constraints. RenamedmjModel.eq_activetomjModel.eq_active0, which now has the semantic of "initial value ofmjData.eq_active". Fixes #876.Migration: Replace uses of
mjModel.eq_activewithmjData.eq_active. -
Changed the default of
autolimitsfrom "false" to "true". This is a minor breaking change. The potential breakage applies to models which have elements with "range" defined and "limited" not set. Such models cannot be loaded since version 2.2.2 (July 2022).
-
Added a new
dyntype,filterexact, which updates first-order filter states with the exact formula rather than with Euler integration. -
Added an actuator attribute,
actearly, which uses semi-implicit integration for actuator forces: using the next step's actuator state to compute the current actuator forces. -
Renamed
actuatorforcerangeandactuatorforcelimited, introduced in the previous ve...
2.3.7
General
- Added primitive collider for sphere-cylinder contacts, previously this pair used the generic convex-convex collider.
- Added
joint-actuatorforcerangefor clamping total actuator force at joints andsensor-jointactuatorfrc<sensor-jointactuatorfrc>for measuring total actuation force applied at a joint. The most important use case for joint-level actuator force clamping is to ensure that Cartesian actuator forces are realizable by individual motors at the joints. See Actuator force clamping for details. - Added an optional
content_typeattribute tohfield,texture, andmeshassets. This attribute supports a formatted Media Type (previously known as MIME type) string used to determine the type of the asset file without resorting to pulling the type from the file extension. - Added analytic derivatives for quaternion subtraction and integration (rotation with an angular velocity). Derivatives are in the 3D tangent space.
- Added
mjv_connectorwhich has identical functionality tomjv_makeConnector, but with more convenient "from-to" argument parametrization.mjv_makeConnectoris now deprecated. - Bumped oldest supported MacOS from version 10.12 to 11. MacOS 11 is the oldest version still maintained by Apple.
Python bindings
- The passive viewer handle now exposes
update_hfield,update_mesh, andupdate_texturemethods to allow users to update renderable assets. (#812 , #958, #965) - Allow a custom keyboard event callback to be specified in the passive viewer. (#766)
- Fix GLFW crash when Python exits while the passive viewer is running. (#790)
Models
- Added simple car example model.
2.3.6
NOTE: MuJoCo 2.3.6 is the last version to officially support Python 3.7.
Models
- Added 3x3x3 cube example model. See README for details.
Bug fixes
- Fixed a bug that was causing an incorrect computation of the mesh bounding box and coordinate frame if the volume was invalid. In such case, now MuJoCo only accepts a non-watertight geometry if
shellinertiais equal totrue. - Fixed the sparse Jacobian multiplication logic that is used to compute derivatives for tendon damping and fluid force, which affects the behaviour of the implicit and implicitfast integrators.
- Fixes to
mj_ray, in line with geom visualisation conventions:- Planes and height-fields respect the
geom_groupandflg_staticarguments. Before this change, rays would intersect planes and height-fields unconditionally. flg_staticnow applies to all static geoms, not just those which are direct children of the world body.
- Planes and height-fields respect the
Plugins
- Added touch-grid sensor plugin. See documentation for details, and associated touch_grid.xml example model. The plugin includes in-scene visualisation.
- Added Visualization tab to simulate UI, corresponding to elements of the
visualMJCF element. After modifying values in the GUI, a saved XML will contain the new values. The modifiable members ofmjStatistic(extent,meansizeandcenter) are computed by the compiler and therefore do not have defaults. In order for these attributes to appear in the saved XML, a value must be specified in the loaded XML. - Increased text width for UI elements in the default spacing.
General
- Added
mj_getStateandmj_setStatefor getting and setting the simulation state as a concatenated vector of floating point numbers. See the State section for details. - Added
mjContact.solreffriction, allowing differentsolrefparameters for the normal and frictional axes of contacts when using elliptic friction cones. This attribute is required for elastic frictional collisions, see associated example model mimicking the spin-bounce recoil behaviour of elastic rubber balls. This is an advanced option currently only supported by explicit contact pairs, using thesolreffrictionattribute. - Added
mjd_inverseFDfor finite-differenced inverse-dynamics derivatives. - Added functions for operations on banded-then-dense “arrowhead” matrices. Such matrices are common when doing direct trajectory optimization. See
mju_cholFactorBanddocumentation for details. - Added
mj_multiRayfunction for intersecting multiple rays emanating from a single point. This is significantly faster than callingmj_raymultiple times. - Ray-mesh collisions are now up to 10x faster, using a bounding volume hierarchy of mesh faces.
- Increased
mjMAXUIITEM(maximum number of UI elements per section in Simulate) to 100. - Added documentation for resource providers.
- Changed the formula for
mju_sigmoid, a finite-support sigmoid$s: \mathbf{R} \rightarrow [0, 1]$ . Previously, the smooth part consisted of two stitched quadratics, once continuously differentiable. It is now a single quintic, twice continuously differentiable:
- Added optional
tausmoothattribute to muscle actuators. When positive, the time-constant$\tau$ of muscle activation/deactivation usesmju_sigmoidto transition smoothly between the two extremal values given by the Millard et al. (2013) muscle model, within a range of widthtausmooth. See Muscle actuators for more details. Relatedly,mju_muscleDynamicsnow takes 3 parameters instead of 2, adding the new smoothing-width parameter. - Moved public C macro definitions out of mujoco.h into a new public header file called mjmacro.h. The new file is included by mujoco.h so this change does not break existing user code.
- Added instrumentation for the Address Sanitizer (ASAN) and Memory Sanitizer (MSAN) to detect memory bugs when allocating from the mjData stack and arena.
- Removed
pstackandparenafrom the output ofmj_printData, since these are implementation details of themjDataallocators that are affected by diagnostic paddings in instrumented builds. - Removed the
mj_activateandmj_deactivatefunctions. These had been kept around for compatibility with old user code from when MuJoCo was closed source, but have been no-op functions since open sourcing.
2.3.5
Bug fixes
-
Fix asset loading bug that prevented OBJ and PNG files from being read from disk when
mjVFSis used. -
Fix occasional segmentation faults on macOS when mouse perturbations are applied in the Python passive viewer.
Plugins
2.3.4
24 April 2023: This version is affected by an asset loading bug that prevents OBJ and PNG files from being read from disk when mjVFS is used. Users are advised to skip to version 2.3.5 instead.
General
- Removed the "global" setting of the compiler/coordinate attribute. This rarely-used setting complicates the compiler logic and is blocking future improvements. In order to convert older models which used this option, load and save them in MuJoCo 2.3.3 or older.
- Added
visual-globalflagellipsoidinertiato visualize equivalent body inertias with ellipsoids instead of the default boxes. - Added midphase and broadphase collision statistics to
mjData. - Added documentation for engine plugins.
- Added struct information to the
introspectmodule. - Added a new extension mechanism called "resource provider" . This extensible mechanism allows MuJoCo to read assets from data sources other than the local OS filesystem or the Virtual file system.
Python bindings
- Offscreen rendering on macOS is no longer restricted to the main thread. This is achieved by using the low-level Core OpenGL (CGL) API to create the OpenGL context, rather than going via GLFW which relies on Cocoa's NSOpenGL. The resulting context is not tied to a Cocoa window, and is therefore not tied to the main thread.
- Fixed a race condition in
viewer.launch_passiveandviewer.launch_repl. These functions could previously return before an internal call tomj_forward. This allows user code to continue and potentially modify physics state concurrently with the internalmj_forward, resulting in e.g. MuJoCo stack overflow error or segmentation fault. - The
viewer.launch_passivefunction now returns a handle which can be used to interact with the viewer. The passive viewer now also requires an explicit call tosyncon its handle to pick up any update to the physics state. This is to avoid race conditions that can result in visual artifacts. See documentation for details. - The
viewer.launch_replfunction has been removed since its functionality is superceded bylaunch_passive. - Added a small number of missing struct fields discovered through the new
introspectmetadata.
Bug fixes
- Fixed bug in the handling of ellipsoid-based fluid model forces in the new implicitfast integrator.
- Removed spurious whole-arena copying in
mj_copyData, which can considerably slow down the copying operation (#568). - Make
shellinertiaignoreexactmeshinertia, which is only used for legacy volume computations (#759).