2.3.0
General
-
The
contact
array and arrays prefixed withefc_
inmjData
were moved out of thebuffer
into a newarena
memory space. These arrays are no longer allocated with fixed sizes whenmjData
is created. Instead, the exact memory requirement is determined during each call tomj_forward
(specifically, inmj_collision
andmj_makeConstraint
) and the arrays are allocated from thearena
space. Thestack
now also shares its available memory witharena
. This change reduces the memory footprint ofmjData
in 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 draftRenderer
class, 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_boxQP
and allocation functionmju_boxQPmalloc
for 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_mulVecMatVec
to 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
assetdir
compiler option, which sets the values of bothmeshdir
andtexturedir
. Values in the latter attributes take precedence overassetdir
. -
Added
realtime
option tovisual
for starting a simulation at a slower speed. -
Added new
cable
composite type:- Cable elements are connected with ball joints.
- The
initial
parameter specifies the joint at the starting boundary:free
,ball
, ornone
. - The boundary bodies are exposed with the names
B_left
andB_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
cable
passive force plugin:- Twist and bending stiffness can be set separately with the parameters
twist
andbend
. - 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
id
andname
properties to named accessor objects. These provide more Pythonic API access tomj_name2id
andmj_id2name
respectively. -
The length of
MjData.contact
is nowncon
rather 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).