Releases: google-deepmind/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.
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 _mjModelbecomesstruct mjModel_.
General
- Safer string handling: replaced
strcat,strcpy, andsprintfwithstrncat,strncpy, and
snprintfrespectively. - 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.
-
Fixed bug related to
forceandtorquesensors. 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 ofconnectandweldconstraints.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, 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 mujocoflag, 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 thesimulateexecutable. Other precompiled sample programs are shipped inside that bundle (inMuJoCo.app/Contents/MacOS) and can be launched via command line. - Binaries are now signed and the disk image is notarized.
- MuJoCo library is now packaged as a Framework Bundle, allowing it to be incorporated more easily into Xcode projects (including Swift projects). Developers are encouraged to compile and link against MuJoCo using the
-
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 ee39340. These changes only affect the bundled code and asset files. The libraries and binaries behave identically to the original packages released earlier today.
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.