Skip to content

Commit

Permalink
Update MuJoCo to version 2.1.3.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 436727767
Change-Id: I9b1b0084021e83f790efa46eab9a980cbde4953f
  • Loading branch information
nimrod-gileadi authored and saran-t committed Mar 23, 2022
1 parent d1db62c commit df048e5
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 19 deletions.
26 changes: 24 additions & 2 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@
Changelog
=========

Version 2.1.3 (Mar. 23, 2022)
-----------------------------

General
^^^^^^^

1. ``simulate`` now support cycling through cameras (with ``[`` and ``]`` keys).
#. ``mjVIS_STATIC`` toggles all static bodies, not just direct children of the world.

Python bindings
^^^^^^^^^^^^^^^

3. Add a ``free()`` method to ``MjrContext``.
#. Enums now support arithmetic and bitwise operations with numbers.

Bug fixes
^^^^^^^^^

5. Fix rendering bug for planes, introduced in 2.1.2. This broke maze environments in
`dm_control <https://github.com/deepmind/dm_control>`_.


Version 2.1.2 (Mar. 15, 2022)
-----------------------------

Expand Down Expand Up @@ -76,7 +98,7 @@ General
attribute: ``<geom fluidshape="ellipsoid"/>``. The parameters are described succinctly :ref:`here<geom>`, but we
leave a full description or the model and its parameters to when this feature leaves experimental status.

Bug Fixes
Bug fixes
^^^^^^^^^

16. ``mj_loadXML`` and ``mj_saveLastXML`` are now locale-independent. The Unity plugin should now work correctly for
Expand Down Expand Up @@ -247,7 +269,7 @@ License manager
backward compabitibily, but now they do nothing and it is no longer necessary to call them.
#. Removed the remote license certificate functions ``mj_certXXX``.

Earlier Versions
Earlier versions
----------------

For changelogs of earlier versions please see `roboti.us <https://www.roboti.us/download.html>`_.
Expand Down
2 changes: 1 addition & 1 deletion doc/python.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ DeepMind’s `dm_control <https://github.com/deepmind/dm_control>`__ reinforceme
version 1.0.0 implemented its own MuJoCo bindings based on ``ctypes``) has been updated to depend on the ``mujoco``
package and continues to be supported by DeepMind. Changes in dm_control should be largely transparent to users of
previous versions, however code that depended directly on its low-level API may need to be updated. Consult the
`migration guide <https://github.com/deepmind/dm_control/blob/main/migration_guide_1.0.md>`__ for detail.
`migration guide <https://github.com/deepmind/dm_control/blob/master/migration_guide_1.0.md>`__ for detail.

For mujoco-py users, we include :ref:`notes <PyMjpy_migration>` below to aid migration.

Expand Down
2 changes: 1 addition & 1 deletion include/mujoco.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ extern "C" {
#endif

// header version; should match the library version as returned by mj_version()
#define mjVERSION_HEADER 212
#define mjVERSION_HEADER 213

// needed to define size_t, fabs and log10
#include "stdlib.h"
Expand Down
4 changes: 2 additions & 2 deletions python/mujoco/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ include(FindOrFetch)

# ==================== MUJOCO LIBRARY ==========================================
if(NOT TARGET mujoco)
find_library(MUJOCO_LIBRARY mujoco mujoco.2.1.2 HINTS ${MUJOCO_LIBRARY_DIR} REQUIRED)
find_library(MUJOCO_LIBRARY mujoco mujoco.2.1.3 HINTS ${MUJOCO_LIBRARY_DIR} REQUIRED)
find_path(MUJOCO_INCLUDE mujoco.h HINTS ${MUJOCO_INCLUDE_DIR} REQUIRED)
message("MuJoCo is at ${MUJOCO_LIBRARY}")
message("MuJoCo headers are at ${MUJOCO_INCLUDE}")
Expand Down Expand Up @@ -152,7 +152,7 @@ else()
GIT_REPO
https://github.com/pybind/pybind11
GIT_TAG
4c4b33f14215f8992e2c67ace2a7a4c114c48bb9
08ea85b0ac0d4d46ac081ff24f481b41322d7159
TARGETS
pybind11::pybind11_headers
EXCLUDE_FROM_ALL
Expand Down
4 changes: 2 additions & 2 deletions python/mujoco/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
ctypes.CDLL(os.path.join(os.path.dirname(__file__), libglew_name),
ctypes.RTLD_GLOBAL)
ctypes.CDLL(
os.path.join(os.path.dirname(__file__), 'libmujoco.so.2.1.2'),
os.path.join(os.path.dirname(__file__), 'libmujoco.so.2.1.3'),
ctypes.RTLD_GLOBAL)
else:
ctypes.CDLL(
os.path.join(os.path.dirname(__file__), 'libmujoco_nogl.so.2.1.2'),
os.path.join(os.path.dirname(__file__), 'libmujoco_nogl.so.2.1.3'),
ctypes.RTLD_GLOBAL)
elif _SYSTEM == 'Windows':
if _MUJOCO_GL in _MUJOCO_GL_ENABLE + ('glfw', 'wgl'):
Expand Down
2 changes: 1 addition & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from setuptools import setup
from setuptools.command import build_ext

__version__ = '2.1.2.post2'
__version__ = '2.1.3'

MUJOCO_CMAKE = 'MUJOCO_CMAKE'
MUJOCO_CMAKE_ARGS = 'MUJOCO_CMAKE_ARGS'
Expand Down
14 changes: 7 additions & 7 deletions sample/Makefile.macos
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ CFLAGS=-O2 -I$(MUJOCO_INCLUDEDIR) -I$(HOMEBREW)/include -pthread
ALLFLAGS=$(CFLAGS) -L$(MUJOCO_LIBDIR) -L$(HOMEBREW)/lib -std=c++11 -stdlib=libc++

all:
clang++ $(ALLFLAGS) testxml.cc -lmujoco.2.1.2 -o testxml
clang++ $(ALLFLAGS) testspeed.cc -lmujoco.2.1.2 -o testspeed
clang++ $(ALLFLAGS) compile.cc -lmujoco.2.1.2 -o compile
clang++ $(ALLFLAGS) derivative.cc -lmujoco.2.1.2 -o derivative
clang++ $(ALLFLAGS) basic.cc -lmujoco.2.1.2 -lglfw -o basic
clang++ $(ALLFLAGS) record.cc -lmujoco.2.1.2 -lglfw -o record
clang++ $(ALLFLAGS) testxml.cc -lmujoco.2.1.3 -o testxml
clang++ $(ALLFLAGS) testspeed.cc -lmujoco.2.1.3 -o testspeed
clang++ $(ALLFLAGS) compile.cc -lmujoco.2.1.3 -o compile
clang++ $(ALLFLAGS) derivative.cc -lmujoco.2.1.3 -o derivative
clang++ $(ALLFLAGS) basic.cc -lmujoco.2.1.3 -lglfw -o basic
clang++ $(ALLFLAGS) record.cc -lmujoco.2.1.3 -lglfw -o record
clang -c $(CFLAGS) uitools.c
clang++ $(ALLFLAGS) uitools.o simulate.cc -lmujoco.2.1.2 -lglfw -o simulate
clang++ $(ALLFLAGS) uitools.o simulate.cc -lmujoco.2.1.3 -lglfw -o simulate
rm *.o
4 changes: 2 additions & 2 deletions unity/Runtime/Bindings/MujocoBinaryRetriever.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ static void RegisteredPackagesEventHandler(
if (AssetDatabase.LoadMainAssetAtPath(mujocoPath + "/mujoco.dylib") == null) {
File.Copy(
"/Applications/MuJoCo.app/Contents/Frameworks" +
"/MuJoCo.framework/Versions/Current/libmujoco.2.1.2.dylib",
"/MuJoCo.framework/Versions/Current/libmujoco.2.1.3.dylib",
mujocoPath + "/mujoco.dylib");
AssetDatabase.Refresh();
}
} else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) {
if (AssetDatabase.LoadMainAssetAtPath(mujocoPath + "/libmujoco.so") == null) {
File.Copy(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) +
"/.mujoco/mujoco-2.1.2/lib/libmujoco_nogl.so.2.1.2",
"/.mujoco/mujoco-2.1.3/lib/libmujoco_nogl.so.2.1.3",
mujocoPath + "/libmujoco.so");
AssetDatabase.Refresh();
}
Expand Down
2 changes: 1 addition & 1 deletion unity/Runtime/Bindings/MujocoBindings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static class MujocoLib {
public const int mjMAXLINE = 100;
public const int mjMAXLINEPNT = 1000;
public const int mjMAXPLANEGRID = 200;
public const int mjVERSION_HEADER = 212;
public const int mjVERSION_HEADER = 213;


// ------------------------------------Enums------------------------------------
Expand Down

0 comments on commit df048e5

Please sign in to comment.