|
6 | 6 | "id": "MpkYHwCqk7W-" |
7 | 7 | }, |
8 | 8 | "source": [ |
9 | | - "# **MuJoCo** tutorial\n", |
10 | | - "### using `dm_control` Python bindings\n", |
| 9 | + "# **MuJoCo** tutorial with `dm_control` Python bindings\n", |
11 | 10 | "\n", |
12 | 11 | "[](https://colab.research.google.com/github/deepmind/dm_control/blob/main/dm_control/mujoco/tutorial.ipynb)\n", |
13 | 12 | "\n", |
|
77 | 76 | " 'Make sure you are using a GPU Colab runtime. '\n", |
78 | 77 | " 'Go to the Runtime menu and select Choose runtime type.')\n", |
79 | 78 | "\n", |
80 | | - "mujoco_dir = \"$HOME/.mujoco\"\n", |
81 | | - "\n", |
82 | | - "print('Installing OpenGL dependencies...')\n", |
83 | | - "!apt-get update -qq\n", |
84 | | - "!apt-get install -qq -y --no-install-recommends libglew2.0 \u003e /dev/null\n", |
85 | | - "\n", |
86 | | - "print('Downloading MuJoCo...')\n", |
87 | | - "MUJOCO_VERSION = 210\n", |
88 | | - "MUJOCO_ARCHIVE = (\n", |
89 | | - " f'mujoco{MUJOCO_VERSION}-{distutils.util.get_platform()}.tar.gz')\n", |
90 | | - "!wget -q \"https://mujoco.org/download/{MUJOCO_ARCHIVE}\"\n", |
91 | | - "!wget -q \"https://mujoco.org/download/{MUJOCO_ARCHIVE}.sha256\"\n", |
92 | | - "check_result = !shasum -c \"{MUJOCO_ARCHIVE}.sha256\"\n", |
93 | | - "if _exit_code:\n", |
94 | | - " raise RuntimeError(\n", |
95 | | - " 'Downloaded MuJoCo archive is corrupted (checksum mismatch)')\n", |
96 | | - "\n", |
97 | | - "print('Unpacking MuJoCo...')\n", |
98 | | - "MUJOCO_DIR = '$HOME/.mujoco'\n", |
99 | | - "!mkdir -p \"{MUJOCO_DIR}\"\n", |
100 | | - "!tar -zxf {MUJOCO_ARCHIVE} -C \"{MUJOCO_DIR}\"\n", |
| 79 | + "print('Installing dm_control...')\n", |
| 80 | + "!pip install -q dm_control\u003e=1.0.2\n", |
101 | 81 | "\n", |
102 | 82 | "# Configure dm_control to use the EGL rendering backend (requires GPU)\n", |
103 | 83 | "%env MUJOCO_GL=egl\n", |
104 | 84 | "\n", |
105 | | - "print('Installing dm_control...')\n", |
106 | | - "# TODO(b/211110746): Upgrade to the latest version once PyPI package is out.\n", |
107 | | - "!pip install -q dm_control==0.0.403778684\n", |
108 | | - "\n", |
109 | 85 | "print('Checking that the dm_control installation succeeded...')\n", |
110 | 86 | "try:\n", |
111 | 87 | " from dm_control import suite\n", |
|
118 | 94 | " 'If using a hosted Colab runtime, make sure you enable GPU acceleration '\n", |
119 | 95 | " 'by going to the Runtime menu and selecting \"Choose runtime type\".')\n", |
120 | 96 | "else:\n", |
121 | | - " del suite, env, pixels" |
| 97 | + " del suite, pixels\n", |
| 98 | + "print('dm_control installation succeeded.')" |
122 | 99 | ] |
123 | 100 | }, |
124 | 101 | { |
|
1308 | 1285 | "physics.model.vis.scale.contactwidth = 0.1\n", |
1309 | 1286 | "physics.model.vis.scale.contactheight = 0.03\n", |
1310 | 1287 | "physics.model.vis.scale.forcewidth = 0.05\n", |
1311 | | - "physics.model.vis.map_.force = 0.3\n", |
| 1288 | + "physics.model.vis.map.force = 0.3\n", |
1312 | 1289 | "\n", |
1313 | 1290 | "# random initial rotational velocity:\n", |
1314 | 1291 | "with physics.reset_context():\n", |
|
0 commit comments