Mujoco

Latest version: v3.1.5

Safety actively analyzes 628989 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 5

2.3.3

Not secure
General

1. 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.

<div align="center">

| timing | Euler | implicitfast | implicit (new) | implicit (old) |
| ------------- | ----- | ------------ | -------------- | -------------- |
| one step (ms) | 0.5 | 0.53 | 0.77 | 5.0 |
| steps/second | 2000 | 1900 | 1300 | 200 |

</div>

<img src="https://github.com/deepmind/mujoco/blob/main/doc/images/computation/midphase.gif?raw=true" alt="Animation showing bounding volume hierarchy for humanoid and many small boxes" width="350px" align="right"/>

2. Added a collision mid-phase for pruning geoms in body pairs, see [documentation](https://mujoco.readthedocs.io/en/2.3.3/computation.html#coselection) 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](https://youtu.be/e0babIM8hBo).
3. The `mjd_transitionFD` function no longer triggers sensor calculation unless explicitly requested.
4. Corrected the spelling of the `inteval` attribute to `interval` in the [mjLROpt](https://mujoco.readthedocs.io/en/2.3.3/APIreference/APItypes.html#mjlropt) struct.
5. 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.
6. 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](https://github.com/deepmind/mujoco/blob/main/model/humanoid100/humanoid100.xml) model, which previously required ~500,000 `mjtNum`s, now only requires ~6000. Very large models can now load and run with the CG solver.
7. Modified [`mju_error`](https://mujoco.readthedocs.io/en/2.3.3/APIreference/APIfunctions.html#mju-error) and [`mju_warning`](https://mujoco.readthedocs.io/en/2.3.3/APIreference/APIfunctions.html#mju-warning) to be variadic functions (support for printf-like arguments). The functions `mju_error_i`, `mju_error_s`, `mju_warning_i`, and `mju_warning_s` are now deprecated.
8. Implemented a performant `mju_sqrMatTDSparse` function that doesn't require dense memory allocation.
9. Added `mj_stackAllocInt` to get correct size for allocating ints on mjData stack. Reducing stack memory usage by 10% - 15%.

Python bindings

10. Fixed IPython history corruption when using `viewer.launch_repl`. The `launch_repl` function now provides seamless continuation of an IPython interactive shell session, and is no longer considered experimental feature.
11. Added `viewer.launch_passive` which launches the interactive viewer in a passive, non-blocking mode. Calls to `launch_passive` return 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](https://mujoco.readthedocs.io/en/2.3.3/python.html#pyviewer).)
12. Added the `mjpython` launcher for macOS, which is required for `viewer.launch_passive` to function there.
13. 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 and `efc_` rows.
14. Added a number of missing fields to the bindings of `mjVisual` and `mjvPerturb` structs.

Simulate

<img src="https://github.com/deepmind/mujoco/blob/main/doc/images/changelog/contactlabel.png?raw=true" alt="Screenshot of simulate showing labels for contacts" width="400px" align="right"/>

15. Implemented a workaround for [broken VSync](https://github.com/glfw/glfw/issues/2249) on macOS so that the frame rate is correctly capped when the Vertical Sync toggle is enabled.

16. Added optional labels to contact visualization, indicating which two geoms are contacting (names if defined, ids otherwise). This can be useful in cluttered scenes.

2.3.2

Not secure
General

1. A more performant mju_transposeSparse has been implemented that doesn't require dense memory allocation. For a constraint Jacobian matrix from the [humanoid100.xml](https://github.com/deepmind/mujoco/blob/main/model/humanoid100/humanoid100.xml) model, this function is 35% faster.
2. The function ``mj_name2id`` is now implemented using a hash function instead of a linear search for better performance.
3. Geom names are now parsed from URDF. Any duplicate names are ignored. ``mj_printData`` output now contains contacting geom names.

Bug fixes

4. Fixed a bug that for `shellinertia` equal to ``true`` caused 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.
5. Fixed misalignment bug in mesh-to-primitive fitting when using the bounding box fitting option `fitaabb`.
6. The ``launch_repl`` functionality in the Python viewer has been fixed.
7. Set ``time`` correctly in ``mjd_transitionFD``, to support time-dependent user code.
8. Fixed sensor data dimension validation when ``user`` type sensors are present.
9. Fixed incorrect plugin error message when a null ``nsensordata`` callback is encountered during model compilation.
10. Correctly end the timer (``TM_END``) ``mj_fwdConstraint`` returns early.
11. Fixed an infinite loop in ``mj_deleteFileVFS``.

Simulate

12. Increased precision of simulate sensor plot y-axis by 1 digit [719](https://github.com/deepmind/mujoco/issues/719).
13. Body labels are now drawn at the body frame rather than inertial frame, unless inertia is being visualised.

Plugins

14. The ``reset`` callback now receives instance-specific ``plugin_state`` and ``plugin_data`` as arguments, rather than the entire ``mjData``. Since ``reset`` is called inside ``mj_resetData`` before any physics forwarding call has been made, it is an error to read anything from ``mjData`` at this stage.
15. The ``capabilities`` field in ``mjpPlugin`` is renamed ``capabilityflags`` to more clearly indicate that this is a bit field.

2.3.1

Not secure
Python bindings

1. The `simulate` GUI is now available through the `mujoco` Python package as `mujoco.viewer`. See [documentation](https://mujoco.readthedocs.io/en/2.3.1/python.html#pyviewer) for details. (Contribution by [Levi Burner](https://github.com/aftersomemath).)
1. The ``Renderer`` class from the MuJoCo tutorial Colab is now available directly in the native Python bindings.

General

3. The tendon `springlength` attribute can now take two values. Given two non-decreasing values, `springlength` specifies a [deadband](https://en.wikipedia.org/wiki/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 nearest `springlength` value. 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](https://github.com/deepmind/mujoco/tree/main/test/engine/testdata/tendon_springlength.xml) example model. _This is a minor breaking API change. `mjModel.tendon_lengthspring` now has size `ntendon x 2` rather than `ntendon x 1`._

1. Removed the requirement that stateless actuators come before stateful actuators.
1. Added [mju_fill](https://mujoco.readthedocs.io/en/2.3.1/APIreference.html#mju-fill), [mju_symmetrize](https://mujoco.readthedocs.io/en/2.3.1/APIreference.html#mju-symmetrize) and [mju_eye](https://mujoco.readthedocs.io/en/2.3.1/APIreference.html#mju-eye) utility functions.
1. Added `gravcomp` attribute to [body](https://mujoco.readthedocs.io/en/2.3.1/XMLreference.html#body) implementing gravity compensation and buoyancy. See [balloons.xml](https://github.com/deepmind/mujoco/tree/main/model/balloons/balloons.xml) example model.
1. Renamed the `cable` plugin library to `elasticity`.
1. Added `actdim` attribute to [general actuators](https://mujoco.readthedocs.io/en/2.3.1/XMLreference.html#actuator-general). Values greater than 1 are only allowed for `user`, as native activation dynamics are all scalar. Added example test implementing 2nd-order activation dynamics to [engine_forward_test.cc](https://github.com/deepmind/mujoco/blob/main/test/engine/engine_forward_test.cc).
1. Improved particle [composite](https://mujoco.readthedocs.io/en/2.3.1/XMLreference.html#body-composite) type, which now permits a user-specified geometry and multiple joints. See the two new examples: [particle_free.xml](https://github.com/deepmind/mujoco/tree/main/model/composite/particle_free.xml) and [particle_free2d.xml](https://github.com/deepmind/mujoco/tree/main/model/composite/particle_free2d.xml).
1. Performance improvements for non-AVX configurations:

- 14% faster `mj_solveLD` using [restrict](https://en.wikipedia.org/wiki/Restrict>). See [engine_core_smooth_benchmark_test](https://github.com/deepmind/mujoco/tree/main/test/benchmark/engine_core_smooth_benchmark_test.cc).
- 50% faster `mju_dotSparse` using manual loop unroll. See [engine_util_sparse_benchmark_test](https://github.com/deepmind/mujoco/tree/main/test/benchmark/engine_util_sparse_benchmark_test.cc).
1. Added new `solid` passive force plugin.
- This is new force field compatible with the [composite](https://mujoco.readthedocs.io/en/2.3.1/XMLreference.html#body-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.

1. Added API functions [mj_loadPluginLibrary](https://mujoco.readthedocs.io/en/2.3.1/APIreference.html#mj-loadPluginLibrary) and [mj_loadAllPluginLibraries](https://mujoco.readthedocs.io/en/2.3.1/APIreference.html#mj-loadAllPluginLibraries). The first function is identical to `dlopen` on a POSIX system, and to `LoadLibraryA` on 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.
1. Added an optional `visualize` callback to plugins, which is called during `mjv_updateScene`. This callback allows custom plugin visualizations. Enable stress visualization for the Cable plugin as an example.
1. Sensors of type [user](https://mujoco.readthedocs.io/en/2.3.1/XMLreference.html#sensor-user) no longer require `objtype`, `objname` and `needstage`. If unspecified, the objtype is now [mjOBJ_UNKNOWN](https://mujoco.readthedocs.io/en/2.3.1/APIreference.html#mjtobj). `user` sensors `datatype` default is now `real`, `needstage` default is now `acc`.
1. Added support for capsules in URDF import.
1. On macOS, issue an informative error message when run under [Rosetta 2](https://support.apple.com/en-gb/HT211861) translation on an Apple Silicon machine. Pre-built MuJoCo binaries make use of [AVX](https://en.wikipedia.org/wiki/Advanced_Vector_Extensions) 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

17. Fixed bug in `mj_addFileVFS` that was causing the file path to be ignored (introduced in 2.1.4).

Simulate

18. Renamed the directory in which the `simulate` application searches for plugins from `plugin` to `mujoco_plugin`.
1. 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.viewer` that were causing errors in Python 3.7 and 3.8.

2.3.0

Not secure
General

1. The `contact` array and arrays prefixed with `efc_` in `mjData` were moved out of the `buffer` into a new `arena` memory space. These arrays are no longer allocated with fixed sizes when `mjData` is created. Instead, the exact memory requirement is determined during each call to [`mj_forward`](https://mujoco.readthedocs.io/en/2.3.0/APIreference.html#mj-forward) (specifically, in [`mj_collision`](https://mujoco.readthedocs.io/en/2.3.0/APIreference.html#mj-collision) and [`mj_makeConstraint`](https://mujoco.readthedocs.io/en/latest/APIreference.html#mj-makeconstraint)) and the arrays are allocated from the `arena` space. The `stack` now also shares its available memory with `arena`. This change reduces the memory footprint of `mjData` in models that do not use the PGS solver, and will allow for significant memory reductions in the future. See the [Memory allocation](https://mujoco.readthedocs.io/en/2.3.0/modeling.html#csize) section for details.

1. 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 `Renderer` class, for easy rendering in Python. Try it yourself: [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/deepmind/mujoco/blob/main/python/LQR.ipynb)

1. 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.

1. Added [`mju_boxQP`](https://mujoco.readthedocs.io/en/2.3.0/APIreference.html#mju-boxqp) and allocation function [`mju_boxQPmalloc`](https://mujoco.readthedocs.io/en/2.3.0/APIreference.html#mju-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](https://doi.org/10.1109/ICRA.2014.6907001), converges after 2-5 Cholesky factorisations, independent of problem size.

1. Added [`mju_mulVecMatVec`](https://mujoco.readthedocs.io/en/2.3.0/APIreference.html#mju-mulvecmatvec) to multiply a square matrix $M$ with vectors $x$ and $y$ on both sides. The function returns $x^TMy$.

1. 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.

1. Added `assetdir` compiler option, which sets the values of both `meshdir` and `texturedir`. Values in the latter attributes take precedence over `assetdir`.

1. Added `realtime` option to [`visual`](https://mujoco.readthedocs.io/en/2.3.0/XMLreference.html#visual) for starting a simulation at a slower speed.

1. Added new `cable` composite type:
- Cable elements are connected with ball joints.
- The `initial` parameter specifies the joint at the starting boundary: `free`, `ball`, or `none`.
- The boundary bodies are exposed with the names `B_left` and `B_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.

1. Added new `cable` passive force plugin:
- Twist and bending stiffness can be set separately with the parameters `twist` and `bend`.
- The stress-free configuration can be set to be the initial one or flat with the flag `flat`.
- New [cable.xml](https://github.com/deepmind/mujoco/tree/main/model/plugin/cable.xml) example showing the formation of plectoneme.
- New [coil.xml](https://github.com/deepmind/mujoco/tree/main/model/plugin/coil.xml) example showing a curved equilibrium configuration.
- New [belt.xml](https://github.com/deepmind/mujoco/tree/main/model/plugin/belt.xml) example showing interaction between twist and anisotropy.
- Added test using cantilever exact solution.

Python bindings

11. Added `id` and `name` properties to [named accessor](https://mujoco.readthedocs.io/en/2.3.0/python.html#named-access) objects. These provide more Pythonic API access to `mj_name2id` and `mj_id2name` respectively.

1. The length of `MjData.contact` is now `ncon` rather than `nconmax`, allowing it to be straightforwardly used as
an iterator without needing to check `ncon`.

1. Fix a memory leak when a Python callable is installed as callback ([527](https://github.com/deepmind/mujoco/issues/527)).

2.2.2

Not secure
General

1. Added [adhesion actuators](https://mujoco.readthedocs.io/en/2.2.2/XMLreference.html#adhesion) mimicking vacuum grippers and adhesive biomechanical appendages.
2. Added related [example model](https://github.com/deepmind/mujoco/tree/2.2.2/model/adhesion) and [video](https://youtu.be/BcHZ5BFeTmU).
3. Added `mj_jacSubtreeCom` for computing the translational Jacobian of the center-of-mass of a subtree.
4. Added `torquescale` and `anchor` attributes to `weld` constraints. `torquescale` sets the torque-to-force ratio exerted by the constraint, `anchor` sets the point at which the weld wrench is applied. See [weld](https://mujoco.readthedocs.io/en/2.2.2/XMLreference.html#equality-weld) for more details.
5. Increased `mjNEQDATA`, the row length of equality constraint parameters in `mjModel.eq_data`, from 7 to 11.
6. Added visualisation of anchor points for both `connect` and `weld` constraints (activated by the 'N' key in `simulate`).
7. Added [weld.xml](https://github.com/deepmind/mujoco/tree/main/test/engine/testdata/weld.xml) showing different uses of new weld attributes.
8. Cartesian 6D end-effector control is now possible by adding a reference site to actuators with `site` transmission. See description of new `refsite` attribute in the [actuator](https://mujoco.readthedocs.io/en/latest/XMLreference.html#general) documentation and [refsite.xml](https://github.com/deepmind/mujoco/tree/2.2.2/test/engine/testdata/refsite.xml) example model. [Video](https://youtu.be/s-0JHanqV1A)
9. Added `autolimits` compiler option. If `true`, joint and tendon `limited` attributes and actuator `ctrllimited`, `forcelimited` and `actlimited` attributes will automatically be set to `true` if the corresponding range *is defined* and `false` otherwise.

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.***

10. Added moment of inertia computation for all well-formed meshes. This option is activated by setting the compiler flag `exactmeshinertia` to `true` (defaults to `false`). This default may change in the future.
11. Added parameter `shellinertia` to `geom`, for locating the inferred inertia on the boundary (shell). Currently only meshes are supported.
12. 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.
13. Added [catenary visualisation](https://youtu.be/I2q7D0Vda-A) for hanging tendons. The model seen in the video can be found [here]( https://github.com/deepmind/mujoco/tree/2.2.2/test/engine/testdata/catenary.xml).
14. Added `azimuth` and `elevation` attributes to [visual/global](https://mujoco.readthedocs.io/en/2.2.2/XMLreference.html#global), defining the initial orientation of the free camera at model load time.
15. Added `mjv_defaultFreeCamera` which sets the default free camera, respecting the above attributes.
16. `simulate` now supports taking a screenshot via a button in the File section or via `Ctrl-P`.
17. 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).
18. Added a disable flag for sensors.
19. `mju_mulQuat` and `mju_mulQuatAxis` support in place computation. For example `mju_mulQuat(a, a, b);` sets the quaternion `a` equal to the product of `a` and `b`.
20. Added sensor matrices to `mjd_transitionFD` (note this is an API change).

Deleted/deprecated features

21. Removed `distance` constraints.

Bug fixes

22. Fixed rendering of some transparent geoms in reflection.
23. Fixed `intvelocity` defaults parsing.

2.2.1

Not secure
General

1. Added `mjd_transitionFD` to compute efficient finite difference approximations of the state-transition and control-transition matrices, [see here](https://mujoco.readthedocs.io/en/2.2.1/computation.html#derivatives) for more details.
2. Added derivatives for the ellipsoid fluid model.
3. Added `ctrl` attribute to [keyframes](https://mujoco.readthedocs.io/en/2.2.1/XMLreference.html#keyframe).
4. Added `clock` sensor which [measures time](https://mujoco.readthedocs.io/en/2.2.1/XMLreference.html#sensor-clock).
5. Added visualisation groups to skins.
6. Added actuator visualisation for `free` and `ball` joints and for actuators with `site` transmission.
7. Added visualisation for actuator activations.
8. Added `<intvelocity>` actuator shortcut for "integrated velocity" actuators, documented [here](https://mujoco.readthedocs.io/en/2.2.1/XMLreference.html#intvelocity).
9. Added `<damper>` actuator shortcut for active-damping actuators, documented [here](https://mujoco.readthedocs.io/en/2.2.1/XMLreference.html#damper).
10. `mju_rotVecMat` and `mju_rotVecMatT` now support in-place multiplication.
11. `mjData.ctrl` values are no longer clamped in-place, remain untouched by the engine.
12. Arrays in mjData's buffer now align to 64-byte boundaries rather than 8-byte.
13. 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.buffer` and `mjData.buffer` that do not lie within an array, and for MSAN to detect reads from uninitialised fields in `mjData` following `mj_resetData`.
14. Add a [slider-crank example](https://github.com/deepmind/mujoco/tree/2.2.1/model/slider_crank) to `model/`.

Bug fixes

15. [Activation clamping](https://mujoco.readthedocs.io/en/2.2.1/modeling.html#cactrange) was not being applied in the [implicit integrator](https://mujoco.readthedocs.io/en/2.2.1/computation.html#geintegration).
16. Stricter parsing of orientation specifiers. Before this change, a specification that included both `quat` and an [alternative specifier](https://mujoco.readthedocs.io/en/2.2.1/modeling.html#corientation) e.g., `<geom ... quat=".1 .2 .3 .4" euler="10 20 30">`, would lead to the `quat` being ignored and only `euler` being used. After this change a parse error will be thrown.
17. Stricter parsing of XML attributes. Before this change an erroneous XML snippet like `<geom size="1/2 3 4">` would have been parsed as `size="1 0 0"` and no error would have been thrown. Now throws an error.
18. Trying to load a `NaN` via XML like `<geom size="1 NaN 4">`, while allowed for debugging purposes, will now print a warning.
19. Fixed null pointer dereference in `mj_loadModel`.
20. Fixed memory leaks when loading an invalid model from MJB.
21. Integer overflows are now avoided when computing `mjModel` buffer sizes.
22. Added missing warning string for `mjWARN_BADCTRL`.

Packaging

23. Changed MacOS packaging so that the copy of `mujoco.framework` embedded in `MuJoCo.app` can be used to build applications externally.

Page 3 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.