From df048e54c080d82b0df1d799e5e1debfd32c387a Mon Sep 17 00:00:00 2001 From: Nimrod Gileadi Date: Wed, 23 Mar 2022 07:00:52 -0700 Subject: [PATCH] Update MuJoCo to version 2.1.3. PiperOrigin-RevId: 436727767 Change-Id: I9b1b0084021e83f790efa46eab9a980cbde4953f --- doc/changelog.rst | 26 +++++++++++++++++-- doc/python.rst | 2 +- include/mujoco.h | 2 +- python/mujoco/CMakeLists.txt | 4 +-- python/mujoco/__init__.py | 4 +-- python/setup.py | 2 +- sample/Makefile.macos | 14 +++++----- .../Runtime/Bindings/MujocoBinaryRetriever.cs | 4 +-- unity/Runtime/Bindings/MujocoBindings.cs | 2 +- 9 files changed, 41 insertions(+), 19 deletions(-) diff --git a/doc/changelog.rst b/doc/changelog.rst index 492cd38a..4a3e75aa 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -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 `_. + + Version 2.1.2 (Mar. 15, 2022) ----------------------------- @@ -76,7 +98,7 @@ General attribute: ````. The parameters are described succinctly :ref:`here`, 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 @@ -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 `_. diff --git a/doc/python.rst b/doc/python.rst index 1a47e5b0..97065ab9 100644 --- a/doc/python.rst +++ b/doc/python.rst @@ -18,7 +18,7 @@ DeepMind’s `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 `__ for detail. +`migration guide `__ for detail. For mujoco-py users, we include :ref:`notes ` below to aid migration. diff --git a/include/mujoco.h b/include/mujoco.h index c2e83d7e..5de35744 100644 --- a/include/mujoco.h +++ b/include/mujoco.h @@ -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" diff --git a/python/mujoco/CMakeLists.txt b/python/mujoco/CMakeLists.txt index a7de3496..1ee5c8e4 100644 --- a/python/mujoco/CMakeLists.txt +++ b/python/mujoco/CMakeLists.txt @@ -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}") @@ -152,7 +152,7 @@ else() GIT_REPO https://github.com/pybind/pybind11 GIT_TAG - 4c4b33f14215f8992e2c67ace2a7a4c114c48bb9 + 08ea85b0ac0d4d46ac081ff24f481b41322d7159 TARGETS pybind11::pybind11_headers EXCLUDE_FROM_ALL diff --git a/python/mujoco/__init__.py b/python/mujoco/__init__.py index be44c156..63e4e598 100644 --- a/python/mujoco/__init__.py +++ b/python/mujoco/__init__.py @@ -41,11 +41,11 @@ if _SYSTEM == 'Linux': 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'): diff --git a/python/setup.py b/python/setup.py index 3350af46..837d5b3e 100644 --- a/python/setup.py +++ b/python/setup.py @@ -30,7 +30,7 @@ from setuptools import find_packages 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' diff --git a/sample/Makefile.macos b/sample/Makefile.macos index 942c7171..592d7c50 100644 --- a/sample/Makefile.macos +++ b/sample/Makefile.macos @@ -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 diff --git a/unity/Runtime/Bindings/MujocoBinaryRetriever.cs b/unity/Runtime/Bindings/MujocoBinaryRetriever.cs index fbbe9e80..8f68fe2d 100644 --- a/unity/Runtime/Bindings/MujocoBinaryRetriever.cs +++ b/unity/Runtime/Bindings/MujocoBinaryRetriever.cs @@ -35,7 +35,7 @@ public class MujocoBinaryRetriever { 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(); } @@ -43,7 +43,7 @@ public class MujocoBinaryRetriever { 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(); } diff --git a/unity/Runtime/Bindings/MujocoBindings.cs b/unity/Runtime/Bindings/MujocoBindings.cs index 52b86024..8a85ec3b 100644 --- a/unity/Runtime/Bindings/MujocoBindings.cs +++ b/unity/Runtime/Bindings/MujocoBindings.cs @@ -83,7 +83,7 @@ public const int mjMAXOVERLAY = 500; 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------------------------------------