Recent Releases of mujoco
mujoco - 3.2.0
See the changelog.
Introduced a major new feature: procedural model creation and editing, using a new top-level data-structure mjSpec. See the Model Editing chapter for details. Note that as of this release this feature is still in testing and subject to future breaking changes. Fixes #364.
- C++
Published by erikfrey over 1 year ago
mujoco - 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 npoolthread flag.
- 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 [`mjNISLAND`](https://mujoco.readthedocs.io/en/3.0.0/APIreference/APIglobals.html#glnumeric) was set to 20. - [`mjNSOLVER`](https://mujoco.readthedocs.io/en/3.0.0/APIreference/APIglobals.html#glnumeric) was reduced from 1000 to 200. - Added [`mjData.solver_nisland`](https://mujoco.readthedocs.io/en/3.0.0/APIreference/APItypes.html#mjdata): 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`.
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 all [`pair`](https://mujoco.readthedocs.io/en/3.0.0/XMLreference.html#contact-pair) elements. - For models which have `<option collision="pair"/>`, disable all dynamic collisions (determined via contype/conaffinity) by first deleting all [`contype`](https://mujoco.readthedocs.io/en/3.0.0/XMLreference.html#body-geom-contype) and [`conaffinity`](https://mujoco.readthedocs.io/en/3.0.0/XMLreference.html#body-geom-conaffinity) attributes in the model and then setting them globally to `0` using `<default> <geom contype="0" conaffinity="0"/> </default>`.
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 version toactuatorfrcrangeandactuatorfrclimited, respectively.Added the flag
eulerdamp, which disables implicit integration of joint damping in the Euler integrator. See the Numerical Integration section for more details.Added the flag
invdiscrete, which enables discrete-time inverse dynamics for all integrators other thanRK4. See the flag documentation for more details.Added
ls_iterationsandls_toleranceoptions for adjusting linesearch stopping criteria in CG and Newton solvers. These can be useful for performance tuning.Added
mesh_posandmesh_quatfields tomjModelto store the normalizing transformation applied to mesh assets. Fixes #409.Added camera
resolutionattribute andcamprojectionsensor. If camera resolution is set to positive values, the camera projection sensor will report the location of a target site, projected onto the camera image, in pixel coordinates.Added
cameracalibration attributes:
- The new attributes are [`resolution`](https://mujoco.readthedocs.io/en/3.0.0/XMLreference.html#body-camera-resolution), [`focal`](https://mujoco.readthedocs.io/en/3.0.0/XMLreference.html#body-camera-focal), [`focalpixel`](https://mujoco.readthedocs.io/en/3.0.0/XMLreference.html#body-camera-focalpixel), [`principal`](https://mujoco.readthedocs.io/en/3.0.0/XMLreference.html#body-camera-principal), [`principalpixel`](https://mujoco.readthedocs.io/en/3.0.0/XMLreference.html#body-camera-principalpixel) and [`sensorsize`](https://mujoco.readthedocs.io/en/3.0.0/XMLreference.html#body-camera-sensorsize).
- Visualize the calibrated frustum using the [`mjVIS_CAMERA`](https://mujoco.readthedocs.io/en/3.0.0/APIreference/APItypes.html#mjtvisflag) visualization flag when these attributes are specified. See the following [example model](https://github.com/deepmind/mujoco/blob/main/test/engine/testdata/vis_visualize/frustum.xml).
- Note that these attributes only take effect for offline rendering and do not affect interactive visualisation.
Implemented reversed Z rendering for better depth precision. An enum
mjtDepthMapwas added with valuesmjDEPTH_ZERONEARandmjDEPTH_ZEROFAR, which can be used to set the newreadDepthMapattribute inmjrContextto control how the depth returned bymjr_readPixelsis mapped fromzneartozfar. Contribution #978 by @aftersomemath.Deleted the code sample
testxml. The functionality provided by this utility is implemented in the WriteReadCompare test.Deleted the code sample
derivative. Functionality provided bymjd_transitionFD.
Python bindings
- Fixed #870 where calling
update_scenewith an invalid camera name used the default camera. - Added
user_scnto the passive viewer handle, which allows users to add custom visualization geoms (#1023). - Added optional boolean keyword arguments
show_left_uiandshow_right_uito the functionsviewer.launchandviewer.launch_passive, which allow users to launch a viewer with UI panels hidden.
Simulate
Added state history mechanism to
simulateand the managed Python viewer. State history can be viewed by scrubbing the History slider and (more precisely) with the left and right arrow keys.The
LOADING...label is now shown correctly. Contribution #1070 by @aftersomemath.
Documentation
- Added detailed documentation of fluid force modeling, and an illustrative example model showing tumbling cards using the ellipsoid-based fluid model.
Bug fixes
Fixed a bug that was causing geom margin to be ignored during the construction of midphase collision trees.
Fixed a bug that was generating incorrect values in
efc_diagApproxfor weld equality constraints.
- C++
Published by saran-t over 2 years ago
mujoco - 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.
- C++
Published by saran-t over 2 years ago
mujoco - 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:
$$ s(x) = \begin{cases} 0, & & x \le 0 \ 6x^5 - 15x^4 + 10x^3, & 0 \lt & x \lt 1 \ 1, & 1 \le & x \qquad \end{cases} $$
- 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.
- C++
Published by saran-t over 2 years ago
mujoco - 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).
- C++
Published by saran-t almost 3 years ago
mujoco - 2.3.3
General
- Improvements to implicit integration:
- The derivatives of the RNE algorithm are now computed using sparse math, leading to significant speed improvements for large models when using the [implicit integrator](https://mujoco.readthedocs.io/en/2.3.3/computation.html#geintegration).
- A new integrator called `implicitfast` was added. It is similar to the existing implicit integrator, but skips the derivatives of Coriolis and centripetal forces. See the [numerical integration](https://mujoco.readthedocs.io/en/2.3.3/computation.html#geintegration) section for a detailed motivation and discussion. The implicitfast integrator is recommended for all new models and will become the default integrator in a future version.
The table below shows the compute cost of the 627-DoF [humanoid100](https://github.com/deepmind/mujoco/blob/main/model/humanoid100/humanoid100.xml) model using different integrators. \"implicit (old)\" uses dense RNE derivatives, \"implicit (new)\" is after the sparsification mentioned above. Timings were measured on a single core of an AMD 3995WX CPU.

- Added a collision mid-phase for pruning geoms in body pairs, see documentation for more details. This is based on static AABB bounding volume hierarchy (a BVH binary tree) in the body inertial frame. The GIF on the right is cut from this longer video.
- The
mjd_transitionFDfunction no longer triggers sensor calculation unless explicitly requested. - Corrected the spelling of the
intevalattribute tointervalin the mjLROpt struct. - Mesh texture and normal mappings are now 3-per-triangle rather than 1-per-vertex. Mesh vertices are no longer duplicated in order to circumvent this limitation as they previously were.
- The non-zeros for the sparse constraint Jacobian matrix are now precounted and used for matrix memory allocation.
For instance, the constraint Jacobian matrix from the humanoid100 model, which previously required ~500,000
mjtNums, now only requires ~6000. Very large models can now load and run with the CG solver. - Modified
mju_errorandmju_warningto be variadic functions (support for printf-like arguments). The functionsmju_error_i,mju_error_s,mju_warning_i, andmju_warning_sare now deprecated. - Implemented a performant
mju_sqrMatTDSparsefunction that doesn't require dense memory allocation. - Added
mj_stackAllocIntto get correct size for allocating ints on mjData stack. Reducing stack memory usage by 10% - 15%.
Python bindings
- Fixed IPython history corruption when using
viewer.launch_repl. Thelaunch_replfunction now provides seamless continuation of an IPython interactive shell session, and is no longer considered experimental feature. - Added
viewer.launch_passivewhich launches the interactive viewer in a passive, non-blocking mode. Calls tolaunch_passivereturn immediately, allowing user code to continue execution, with the viewer automatically reflecting any changes to the physics state. (Note that this functionality is currently in experimental/beta stage, and is not yet described in our viewer documentation.) - Added the
mjpythonlauncher for macOS, which is required forviewer.launch_passiveto function there. - Removed
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, breaking strict correspondence between joints andefc_rows. - Added a number of missing fields to the bindings of
mjVisualandmjvPerturbstructs.
Simulate

Implemented a workaround for broken VSync on macOS so that the frame rate is correctly capped when the Vertical Sync toggle is enabled.
Added optional labels to contact visualization, indicating which two geoms are contacting (names if defined, ids otherwise). This can be useful in cluttered scenes.
- C++
Published by nimrod-gileadi almost 3 years ago
mujoco - 2.3.2
General
- A more performant mju_transposeSparse has been implemented that doesn't require dense memory allocation. For a constraint Jacobian matrix from the humanoid100.xml model, this function is 35% faster.
- The function
mj_name2idis now implemented using a hash function instead of a linear search for better performance. - Geom names are now parsed from URDF. Any duplicate names are ignored.
mj_printDataoutput now contains contacting geom names.
Bug fixes
- Fixed a bug that for
shellinertiaequal totruecaused the mesh orientation to be overwritten by the principal components of the shell inertia, while the vertex coordinates are rotated using the volumetric inertia. Now the volumetric inertia orientation is used also in the shell case. - Fixed misalignment bug in mesh-to-primitive fitting when using the bounding box fitting option
fitaabb. - The
launch_replfunctionality in the Python viewer has been fixed. - Set
timecorrectly inmjd_transitionFD, to support time-dependent user code. - Fixed sensor data dimension validation when
usertype sensors are present. - Fixed incorrect plugin error message when a null
nsensordatacallback is encountered during model compilation. - Correctly end the timer (
TM_END)mj_fwdConstraintreturns early. - Fixed an infinite loop in
mj_deleteFileVFS.
Simulate
- Increased precision of simulate sensor plot y-axis by 1 digit #719.
- Body labels are now drawn at the body frame rather than inertial frame, unless inertia is being visualised.
Plugins
- The
resetcallback now receives instance-specificplugin_stateandplugin_dataas arguments, rather than the entiremjData. Sinceresetis called insidemj_resetDatabefore any physics forwarding call has been made, it is an error to read anything frommjDataat this stage. - The
capabilitiesfield inmjpPluginis renamedcapabilityflagsto more clearly indicate that this is a bit field.
- C++
Published by quagla about 3 years ago
mujoco - 2.3.1
## Python bindings
- The
simulateGUI is now available through themujocoPython package asmujoco.viewer. See documentation for details. (Contribution by Levi Burner.) - The
Rendererclass from the MuJoCo tutorial Colab is now available directly in the native Python bindings.
General
The tendon
springlengthattribute can now take two values. Given two non-decreasing values,springlengthspecifies a deadband range for spring stiffness. If the tendon length is between the two values, the force is 0. If length is outside this range, the force behaves like a regular spring, with the spring resting length corresponding to the nearestspringlengthvalue. This can be used to create tendons whose limits are enforced by springs rather than constraints, which are cheaper and easier to analyse. See tendon_springlength.xml example model. This is a minor breaking API change. `mjModel.tendonlengthspringnow has sizentendon x 2rather thanntendon x 1`._Removed the requirement that stateless actuators come before stateful actuators.
Added mju_fill, mju_symmetrize and mju_eye utility functions.
Added
gravcompattribute to body implementing gravity compensation and buoyancy. See balloons.xml example model.Renamed the
cableplugin library toelasticity.Added
actdimattribute to general actuators. Values greater than 1 are only allowed foruser, as native activation dynamics are all scalar. Added example test implementing 2nd-order activation dynamics to engineforwardtest.cc.Improved particle composite type, which now permits a user-specified geometry and multiple joints. See the two new examples: particle_free.xml and particle_free2d.xml.
Performance improvements for non-AVX configurations:
- 14% faster
mj_solveLDusing restrict. See enginecoresmoothbenchmarktest.- 50% faster
mju_dotSparseusing manual loop unroll. See engineutilsparsebenchmarktest. - Added new
solidpassive force plugin. - This is new force field compatible with the composite particles.
- Generates a tetrahedral mesh having particles with mass concentrated at vertices.
- Uses a piecewise-constant strain model equivalent to finite elements but expressed in a coordinate-free formulation. This implies that all quantities can be precomputed except edge elongation, as in a mass-spring model.
- Only suitable for small strains (large displacements but small deformations). Tetrahedra may invert if subject to large loads.
- 50% faster
- Added API functions mj_loadPluginLibrary and mj_loadAllPluginLibraries. The first function is identical to
dlopenon a POSIX system, and toLoadLibraryAon Windows. The second function scans a specified directory for all dynamic libraries file and loads each library found. Dynamic libraries opened by these functions are assumed to register one or more MuJoCo plugins on load. - Added an optional
visualizecallback to plugins, which is called duringmjv_updateScene. This callback allows custom plugin visualizations. Enable stress visualization for the Cable plugin as an example. - Sensors of type user no longer require
objtype,objnameandneedstage. If unspecified, the objtype is now mjOBJ_UNKNOWN.usersensorsdatatypedefault is nowreal,needstagedefault is nowacc. - Added support for capsules in URDF import.
- On macOS, issue an informative error message when run under Rosetta 2 translation on an Apple Silicon machine. Pre-built MuJoCo binaries make use of AVX instructions on x86-64 machines, which is not supported by Rosetta 2. (Before this version, users only get a cryptic "Illegal instruction" message.)
Bug fixes
- Fixed bug in
mj_addFileVFSthat was causing the file path to be ignored (introduced in 2.1.4).
Simulate
- Renamed the directory in which the
simulateapplication searches for plugins fromplugintomujoco_plugin. - Mouse force perturbations are now applied at the selection point rather than the body center of mass.
Python bindings 2.3.1.post1 (6 December 2022)
- Fix type annotations in
mujoco.viewerthat were causing errors in Python 3.7 and 3.8.
- C++
Published by kbayes about 3 years ago
mujoco - 2.3.0
General
The
contactarray and arrays prefixed withefc_inmjDatawere moved out of thebufferinto a newarenamemory space. These arrays are no longer allocated with fixed sizes whenmjDatais created. Instead, the exact memory requirement is determined during each call tomj_forward(specifically, inmj_collisionandmj_makeConstraint) and the arrays are allocated from thearenaspace. Thestacknow also shares its available memory witharena. This change reduces the memory footprint ofmjDatain models that do not use the PGS solver, and will allow for significant memory reductions in the future. See the Memory allocation section for details.Added colab notebook tutorial showing how to balance the humanoid on one leg with a Linear Quadratic Regulator. The notebook uses MuJoCo's native Python bindings, and includes a draft
Rendererclass, for easy rendering in Python. Try it yourself:Updates to humanoid model:
- Added two keyframes (stand-on-one-leg and squat).
- Increased maximum hip flexion angle.
- Added hamstring tendons which couple the hip and knee at high hip flexion angles.
- General cosmetic improvements, including improved use of defaults and better naming scheme.
Added
mju_boxQPand allocation functionmju_boxQPmallocfor solving the box-constrained Quadratic Program: $x^* = \text{argmin} \; \tfrac{1}{2} x^T H x + x^T g \quad \text{s.t.} \quad l \le x \le u$ The algorithm, introduced in Tassa et al. 2014, converges after 2-5 Cholesky factorisations, independent of problem size.Added
mju_mulVecMatVecto multiply a square matrix $M$ with vectors $x$ and $y$ on both sides. The function returns $x^TMy$.Added new plugin API. Plugins allow developers to extend MuJoCo's capability without modifying core engine code. The plugin mechanism is intended to replace the existing callbacks, though these will remain for the time being as an option for simple use cases and backward compatibility. The new mechanism manages stateful plugins and supports multiple plugins from different sources, allowing MuJoCo extensions to be introduced in a modular fashion, rather than as global overrides. Note the new mechanism is currently undocumented except in code, as we test it internally. If you are interested in using the plugin mechanism, please get in touch first.
Added
assetdircompiler option, which sets the values of bothmeshdirandtexturedir. Values in the latter attributes take precedence overassetdir.Added
realtimeoption tovisualfor starting a simulation at a slower speed.Added new
cablecomposite type:- Cable elements are connected with ball joints.
- The
initialparameter specifies the joint at the starting boundary:free,ball, ornone. - The boundary bodies are exposed with the names
B_leftandB_right. - The vertex initial positions can be specified directly in the XML with the parameter
vertex. - The orientation of the body frame is the orientation of the material frame of the curve.
Added new
cablepassive force plugin:- Twist and bending stiffness can be set separately with the parameters
twistandbend. - The stress-free configuration can be set to be the initial one or flat with the flag
flat. - New cable.xml example showing the formation of plectoneme.
- New coil.xml example showing a curved equilibrium configuration.
- New belt.xml example showing interaction between twist and anisotropy.
- Added test using cantilever exact solution.
- Twist and bending stiffness can be set separately with the parameters
Python bindings
Added
idandnameproperties to named accessor objects. These provide more Pythonic API access tomj_name2idandmj_id2namerespectively.The length of
MjData.contactis nownconrather thannconmax, allowing it to be straightforwardly used as an iterator without needing to checkncon.Fix a memory leak when a Python callable is installed as callback (#527).
- C++
Published by saran-t over 3 years ago
mujoco - 2.2.2
General
- Added adhesion actuators mimicking vacuum grippers and adhesive biomechanical appendages.
- Added related example model and video.
- Added
mj_jacSubtreeComfor computing the translational Jacobian of the center-of-mass of a subtree. - Added
torquescaleandanchorattributes toweldconstraints.torquescalesets the torque-to-force ratio exerted by the constraint,anchorsets the point at which the weld wrench is applied. See weld for more details. - Increased
mjNEQDATA, the row length of equality constraint parameters inmjModel.eq_data, from 7 to 11. - Added visualisation of anchor points for both
connectandweldconstraints (activated by the 'N' key insimulate). - Added weld.xml showing different uses of new weld attributes.
- Cartesian 6D end-effector control is now possible by adding a reference site to actuators with
sitetransmission. See description of newrefsiteattribute in the actuator documentation and refsite.xml example model. Video - Added
autolimitscompiler option. Iftrue, joint and tendonlimitedattributes and actuatorctrllimited,forcelimitedandactlimitedattributes will automatically be set totrueif the corresponding range is defined andfalseotherwise.
If autolimits="false" (the default) models where a range attribute is specified without the limited attribute will fail to compile. A future release will change the default of autolimits to true, and this compilation error allows users to catch this future change of behavior.
***This is a breaking change. In models where a range was defined but `limited` was unspecified, explicitly set limited to `false` or remove the range to maintain the current behavior of your model.***
- Added moment of inertia computation for all well-formed meshes. This option is activated by setting the compiler flag
exactmeshinertiatotrue(defaults tofalse). This default may change in the future. - Added parameter
shellinertiatogeom, for locating the inferred inertia on the boundary (shell). Currently only meshes are supported. - For meshes from which volumetric inertia is inferred, raise error if the orientation of mesh faces is not consistent. If this occurs, fix the mesh in e.g., MeshLab or Blender.
- Added catenary visualisation for hanging tendons. The model seen in the video can be found here.
- Added
azimuthandelevationattributes to visual/global, defining the initial orientation of the free camera at model load time. - Added
mjv_defaultFreeCamerawhich sets the default free camera, respecting the above attributes. simulatenow supports taking a screenshot via a button in the File section or viaCtrl-P.- Improvements to time synchronisation in
simulate, in particular report actual real-time factor if different from requested factor (if e.g., the timestep is so small that simulation cannot keep up with real-time). - Added a disable flag for sensors.
mju_mulQuatandmju_mulQuatAxissupport in place computation. For examplemju_mulQuat(a, a, b);sets the quaternionaequal to the product ofaandb.- Added sensor matrices to
mjd_transitionFD(note this is an API change).
Deleted/deprecated features
- Removed
distanceconstraints.
Bug fixes
- Fixed rendering of some transparent geoms in reflection.
- Fixed
intvelocitydefaults parsing.
- C++
Published by saran-t over 3 years ago
mujoco - 2.2.1
General
- Added
mjd_transitionFDto compute efficient finite difference approximations of the state-transition and control-transition matrices, see here for more details. - Added derivatives for the ellipsoid fluid model.
- Added
ctrlattribute to keyframes. - Added
clocksensor which measures time. - Added visualisation groups to skins.
- Added actuator visualisation for
freeandballjoints and for actuators withsitetransmission. - Added visualisation for actuator activations.
- Added
<intvelocity>actuator shortcut for "integrated velocity" actuators, documented here. - Added
<damper>actuator shortcut for active-damping actuators, documented here. mju_rotVecMatandmju_rotVecMatTnow support in-place multiplication.mjData.ctrlvalues are no longer clamped in-place, remain untouched by the engine.- Arrays in mjData's buffer now align to 64-byte boundaries rather than 8-byte.
- Add memory poisoning when building with Address Sanitizer (ASAN) and Memory Sanitizer (MSAN). This allows ASAN to detect reads and writes to regions in
mjModel.bufferandmjData.bufferthat do not lie within an array, and for MSAN to detect reads from uninitialised fields inmjDatafollowingmj_resetData. - Add a slider-crank example to
model/.
Bug fixes
- Activation clamping was not being applied in the implicit integrator.
- Stricter parsing of orientation specifiers. Before this change, a specification that included both
quatand an alternative specifier e.g.,<geom ... quat=".1 .2 .3 .4" euler="10 20 30">, would lead to thequatbeing ignored and onlyeulerbeing used. After this change a parse error will be thrown. - Stricter parsing of XML attributes. Before this change an erroneous XML snippet like
<geom size="1/2 3 4">would have been parsed assize="1 0 0"and no error would have been thrown. Now throws an error. - Trying to load a
NaNvia XML like<geom size="1 NaN 4">, while allowed for debugging purposes, will now print a warning. - Fixed null pointer dereference in
mj_loadModel. - Fixed memory leaks when loading an invalid model from MJB.
- Integer overflows are now avoided when computing
mjModelbuffer sizes. - Added missing warning string for
mjWARN_BADCTRL.
Packaging
- Changed MacOS packaging so that the copy of
mujoco.frameworkembedded inMuJoCo.appcan be used to build applications externally.
- C++
Published by saran-t over 3 years ago
mujoco - 2.2.0
Open Sourcing
MuJoCo is now fully open-source software. Newly available top level directories are:
src/: All source files. Subdirectories correspond to the modules described in the Programming chapter introduction:src/engine/: Core engine.src/xml/: XML parser.src/user/: Model compiler.src/visualize/: Abstract visualizer.src/ui/: UI framework.
test/: Tests and corresponding asset files.dist/: Files related to packaging and binary distribution.
Added contributor's guide and style guide.
General
Added analytic derivatives of smooth (unconstrained) dynamics forces, with respect to velocities:
- Centripetal and Coriolis forces computed by the Recursive Newton-Euler algorithm.
- Damping and fluid-drag passive forces.
- Actuation forces.
Added
implicitintegrator. Using the analytic derivatives above, a new implicit-in-velocity integrator was added. This integrator lies between the Euler and Runge Kutta integrators in terms of both stability and computational cost. It is most useful for models which use fluid drag (e.g. for flying or swimming) and for models which use velocity actuators. For more details, see the Numerical Integration section.Added
actlimitedandactrangeattributes to general actuators, for clamping actuator internal states (activations). This clamping is useful for integrated-velocity actuators, see the Activation clamping section for details.mjDatafieldsqfrc_unc(unconstrained forces) andqacc_unc(unconstrained accelerations) were renamedqfrc_smoothandqacc_smooth, respectively. While "unconstrained" is precise, "smooth" is more intelligible than "unc".Public headers have been moved from
/includeto/include/mujoco/, in line with the directory layout common in other open source projects. Developers are encouraged to include MuJoCo public headers in their own codebase via#include <mujoco/filename.h>.The default shadow resolution specified by the shadowsize attribute was increased from 1024 to 4096.
Saved XMLs now use 2-space indents.
Bug fixes
Antialiasing was disabled for segmentation rendering. Before this change, if the offsamples attribute was greater than 0 (the default value is 4), pixels that overlapped with multiple geoms would receive averaged segmentation IDs, leading to incorrect or non-existent IDs. After this change
offsamplesis ignored during segmentation rendering.The value of the enable flag for the experimental multiCCD feature was made sequential with other enable flags. Sequentiality is assumed in the
simulateUI and elsewhere.Fix issue of duplicated meshes when saving models with OBJ meshes using
mj_saveLastXML.
Update 1 (27 May 2022): Replaced Linux tarball to fix RPATH on the sample binaries. No change in functionality.
- C++
Published by saran-t almost 4 years ago
mujoco - 2.1.5
General
- Added an experimental feature: multi-contact convex collision detection, activated by an enable flag. See full description here.
Bug fixes
GLAD initialization logic on Linux now calls
dlopento load a GL platform dynamic library if a*GetProcAddressfunction is not already present in the process' global symbol table. In particular, processes that use GLFW to set up a rendering context that are not explicitly linked againstlibGLX.so(this applies to the Python interpreter, for example) will now work correctly rather than fail with agladLoadGLerror whenmjr_makeContextis called. Fixes https://github.com/deepmind/dm_control/issues/283.In the Python bindings, named indexers for scalar fields (e.g. the
ctrlfield for actuators) now return a NumPy array of shape(1,)rather than(). This allows values to be assigned to these fields more straightforwardly. Fixes https://github.com/deepmind/mujoco/issues/238.
- C++
Published by saran-t almost 4 years ago
mujoco - 2.1.4
General
MuJoCo now uses GLAD to manage OpenGL API access instead of GLEW. On Linux, there is no longer a need to link against different GL wrangling libraries depending on whether GLX, EGL, or OSMesa is being used. Instead, users can simply use GLX, EGL, or OSMesa to create a GL context and
mjr_makeContextwill detect which one is being used.Add visualisation for contact frames. This is useful when writing or modifying collision functions, when the actual direction of the x and y axes of a contact can be important.
Binary build
- The
_nogldynamic library is no longer provided on Linux and Windows. The switch to GLAD allows us to resolve OpenGL symbols whenmjr_makeContextis called rather than when the library is loaded. As a result, the MuJoCo library no longer has an explicit dynamic dependency on OpenGL, and can be used on system where OpenGL is not present.
Simulate
Fix a bug in simulate where pressing '[' or ']' when a model is not loaded causes a crash.
Contact frame visualisation is added to the Simulate GUI.
Rename "set key", "reset to key" to "save key" and "load key", respectively.
Change bindings of F6 and F7 from the not very useful "vertical sync" and "busy wait" to the more useful cycling of frames and labels.
Bug fixes
mj_resetDatanow zeroes out thesolver_nnzfield.Remove a special branch in
mju_quat2matfor unit quaternions. Previously,mju_quat2matskipped all computation if the real part of the quaternion equals 1.0. For very small angles (e.g. when finite differencing), the cosine can evaluate to exactly 1.0 at double precision while the sine is still nonzero.
- C++
Published by saran-t almost 4 years ago
mujoco - 2.1.3
This is a minor release, handling issues discovered after the launch of 2.1.2.
General
simulatenow support cycling through cameras (with[and]keys).mjVIS_STATICtoggles all static bodies, not just direct children of the world.
Python bindings
- Added a
free()method toMjrContext, rather than relying on the object destructor. - Enums now support arithmetic and bitwise operations with numbers.
Bug fixes
- Fixed a rendering bug for planes, introduced in 2.1.2. This broke maze environments in
dm_control.
- C++
Published by nimrod-gileadi almost 4 years ago
mujoco - 2.1.2
New modules
- Added new Python bindings, which can be installed via
pip install mujoco, and imported asimport mujoco. - Added new Unity plug-in.
- Added a new
introspectmodule, which provides reflection-like capability for MuJoCo's public API, currently describing functions and enums. While implemented in Python, this module is expected to be generally useful for automatic code generation targeting multiple languages. (This is not shipped as part of themujocoPython bindings package.)
API changes
- Moved definition of
mjtNumfloating point type into a new header mjtnum.h. - Renamed header
mujoco_export.hto mjexport.h. - Added
mj_printFormattedData, which accepts a format string for floating point numbers, for example to increase precision.
General
- MuJoCo can load OBJ mesh files.
- Meshes containing polygons with more than 4 vertices are not supported.
- In OBJ files containing multiple object groups, any groups after the first one will be ignored.
- Added optional frame-of-reference specification to:
framepos,framequat,framexaxis,frameyaxis,framezaxis,framelinvel, andframeangvelsensors. The frame-of-reference is specified by newreftypeandrefnameattributes. - Sizes of user parameters are now automatically inferred.
- Declarations of user parameters in the top-level size clause (e.g.
nuser_body,nuser_jnt, etc.) now accept a value of -1, which is the default. This will automatically set the value to the length of the maximum associateduserattribute defined in the model. - Setting a value smaller than -1 will lead to a compiler error (previously a segfault).
- Setting a value to a length smaller than some
userattribute defined in the model will lead to an error (previously additional values were ignored).
- Declarations of user parameters in the top-level size clause (e.g.
- Increased the maximum number of lights in an
mjvScenefrom 8 to 100. - Saved XML files only contain explicit inertial elements if the original XML included them. Inertias that were automatically inferred by the compiler's inertiafromgeom mechanism remain unspecified.
- User-selected geoms are always rendered as opaque. This is useful in interactive visualizers.
- Static geoms now respect their geom group for visualisation. Until this change rendering of static geoms could only be toggled using the
mjVIS_STATICvisualisation flag . After this change, both the geom group and the visualisation flag need to be enabled for the geom to be rendered. - Pointer parameters in function declarations in mujoco.h that are supposed to represent fixed-length arrays are now spelled as arrays with extents, e.g.
mjtNum quat[4]rather thanmjtNum* quat. From the perspective of C and C++, this is a non-change since array types in function signatures decay to pointer types. However, it allows autogenerated code to be aware of expected input shapes. - Experimental stateless fluid interaction model. As described here, fluid forces use sizes computed from body inertia. While sometimes convenient, this is very rarely a good approximation. In the new model forces act on geoms, rather than bodies, and have a several user-settable parameters. The model is activated by setting a new attribute:
<geom fluidshape="ellipsoid"/>. The parameters are described succinctly here, but we leave a full description or the model and its parameters to when this feature leaves experimental status.
Bug Fixes
mj_loadXMLandmj_saveLastXMLare now locale-independent. The Unity plugin should now work correctly for users whose system locales use commas as decimal separators.- XML assets in VFS no longer need to end in a null character. Instead, the file size is determined by the size parameter of the corresponding VFS entry.
- Fix a vertex buffer object memory leak in
mjrContextwhen skins are used. - Camera quaternions are now normalized during XML compilation.
Binary build
- Windows binaries are now built with Clang.
Python bindings 2.1.2.post1 (16 March 2022)
- Removed a stray print statement in
__init__.py. - Bundled
libglewegl.sofor Linux now has aDT_NEEDEDentry onlibOpenGL.so.0. (The download packages for Linux below have also been updated with this.) - The sdist can now be built with GCC.
- C++
Published by saran-t almost 4 years ago
mujoco - 2.1.1
API changes
- Added
mj_printFormattedModel, which accepts a format string for floating point numbers, for example to increase precision. - Added
mj_versionString, which returns human-readable string that represents the version of the MuJoCo binary. - Converted leading underscores to trailing underscores in private instances of API struct definitions, to conform to reserved identifier directive, see C standard: Section 7.1.3.
This is a minor breaking change. Code which references private instances will break. To fix, replace leading underscores with trailing underscores, e.g. struct _mjModel becomes struct mjModel_.
General
- Safer string handling: replaced
strcat,strcpy, andsprintfwithstrncat,strncpy, andsnprintfrespectively. - Changed indentation from 4 spaces to 2 spaces everywhere.
Bug Fixes
- Fixed reading from uninitialized memory in PGS solver.
- Computed capsule inertias are now exact. Until this change, capsule masses and inertias computed by the
compiler'sinertiafromgeommechanism were approximated by a cylinder, formed by the capsule's cylindrical middle section, extended on both ends by half the capsule radius. Capsule inertias are now computed with the Parallel Axis theorem, applied to the two hemispherical end-caps.
This is a minor breaking change. Simulation of a model with automatically-computed capsule inertias will be numerically different, leading to, for example, breakage of golden-value tests.
8. Fixed bug related to force and torque sensors. Until this change, forces torques reported by F/T sensors ignored out-of-tree constraint wrenches except those produced by contacts. Force and and torque sensors now correctly take into account the effects of connect and weld constraints.
Forces generated by spatial tendons which are outside the kinematic tree (i.e. between bodies which have no ancestral relationship) are still not taken into account by force and torque sensors. This remains a future work item.
Code samples
testspeed: Added injection of pseudo-random control noise, turned on by default. This is to avoid settling into some fixed contact configuration and providing an unrealistic timing measure.simulate:
- Added slower-than-real-time functionality, which is controlled via the '+' and '-' keys.
- Added sliders for injecting Brownian noise into the controls.
- Added "Print Camera" button to print an MJCF clause with the pose of the current camera.
- The camera pose is not reset when reloading the same model file.
Updated dependencies
TinyXMLwas replaced withTinyXML26.2.0.qhullwas upgraded to version 8.0.2.libCCDwas upgraded to version 1.4.- On Linux,
libstdc++was replaced withlibc++.
Binary build
- MacOS packaging. We now ship Universal binaries that natively support both Apple Silicon and Intel CPUs.
- MuJoCo library is now packaged as a [Framework Bundle](https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/FrameworkAnatomy.html), allowing it to be incorporated more easily into Xcode projects (including Swift projects). Developers are encouraged to compile and link against MuJoCo using the `-framework mujoco` flag, however all header files and the ``libmujoco.2.1.1.dylib` library can still be directly accessed inside the framework.
- Sample applications are now packaged into an Application Bundle called `MuJoCo.app`. When launched via GUI, the bundle launches the `simulate` executable. Other precompiled sample programs are shipped inside that bundle (in `MuJoCo.app/Contents/MacOS`) and can be launched via command line.
- Binaries are now signed and the disk image is notarized.
- Windows binaries and libraries are now signed.
- Link-time optimization is enabled on Linux and macOS, leading to an average of ~20% speedup when benchmarked on
three test models (
cloth.xml,humanoid.xml, andhumanoid100.xml). - Linux binaries are now built with LLVM/Clang instead of GCC.
- An AArch64 (aka ARM64) Linux build is also provided.
- Private symbols are no longer stripped from shared libraries on Linux and MacOS.
Sample models
- Clean-up of the
model/directory.
- Rearranged into subdirectories which include all dependencies.
- Added descriptions in XML comments, cleaned up XMLs.
- Deleted some composite models: `grid1`, `grid1pin`, `grid2`, `softcylinder`, `softellipsoid`.
- Added descriptive animations in
docs/images/models/
EDIT (30/12/2021 21:45 UTC): Added import libraries mujoco.lib and mujoco_nogl.lib to the Windows release package.
EDIT (16/12/2021 21:10 UTC): We've updated the download packages to reflect minor changes in https://github.com/deepmind/mujoco/commit/ee39340ae783f6944f74168d852d7ac1664268c0. These changes only affect the bundled code and asset files. The libraries and binaries behave identically to the original packages released earlier today.
- C++
Published by saran-t about 4 years ago
mujoco - 2.1.0
New features
- Keyframes now have
mocap_posandmocap_quatfields (mpos and quat attributes in the XML) allowing mocap poses to be stored in keyframes. - New utility functions:
mju_insertionSortInt(integer insertion sort) andmju_sigmoid(constructing a sigmoid from two half-quadratics).
General
- The pre-allocated sizes in the virtual file system (VFS) increased to 2000 and 1000, to allow for larger projects.
- The C structs in the
mjuiItemunion are now named, for compatibility. - Fixed:
mjcb_contactfiltertype ismjfConFilt(wasmjfGeneric). - Fixed: The array of sensors in
mjCModelwas not cleared. - Cleaned up cross-platform code (internal changes, not visible via the API).
- Fixed a bug in parsing of XML
texcoorddata (related to number of vertices). - Fixed a bug in
simulate.ccrelated tonkey(the number of keyframes). - Accelerated collision detection in the presence of large numbers of non-colliding geoms (with
contype==0 and conaffinity==0).
UI
- Figure selection type changed from
inttofloat. - Figures now show data coordinates, when selection and highlight are enabled.
- Changed
mjMAXUIMULTIto 35,mjMAXUITEXTto 300,mjMAXUIRECTto 25. - Added collapsable sub-sections, implemented as separators with state:
mjSEPCLOSEDcollapsed,mjSEPCLOSED+1expanded. - Added
mjITEM_RADIOLINEitem type. - Added function
mjui_addToSectionto simplify UI section construction. - Added subplot titles to
mjvFigure.
Rendering
render_gl2guards against non-finite floating point data in the axis range computation.render_gl2draws lines from back to front for better visibility.- Added function
mjr_label(for text labels). mjr_renderexits immediately ifngeom==0, to avoid errors from uninitialized scenes (e.g.frustrum==0).- Added scissor box in
mjr_render, so we don't clear the entire window at every frame.
License manager
- Removed the entire license manager. The functions
mj_activateandmj_deactivateare still there for backward compabitibily, but now they do nothing and it is no longer necessary to call them. - Removed the remote license certificate functions
mj_certXXX.
- C++
Published by saran-t over 4 years ago