MuJoCo: Difference between revisions

From Alliance Doc
Jump to navigation Jump to search
(Created installation instructions for MuJoCo.)
 
(translation markup)
Line 1: Line 1:
<languages />
[[Category:Software]]
<translate>
<!--T:1-->
'''MuJoCo''' "''stands for Multi-Joint dynamics with Contact. It is a physics engine aiming to facilitate research and development in robotics, biomechanics, graphics and animation, and other areas where fast and accurate simulation is needed.''"
'''MuJoCo''' "''stands for Multi-Joint dynamics with Contact. It is a physics engine aiming to facilitate research and development in robotics, biomechanics, graphics and animation, and other areas where fast and accurate simulation is needed.''"


Line 7: Line 12:
==Installation==
==Installation==


=== Base Files ===
=== Base Files === <!--T:2-->


First, the .mujoco folder in your home directory must be set up. MuJoCo '''requires a licence key''' to be placed in
First, the .mujoco folder in your home directory must be set up. MuJoCo '''requires a licence key''' to be placed in
Line 21: Line 26:
}}
}}


=== mujoco_py ===
=== mujoco_py === <!--T:3-->


The python interface to MuJoCo is the <code>mujoco_py</code> module. Getting it to work re somequires special steps because library paths need to be patched.
The python interface to MuJoCo is the <code>mujoco_py</code> module. Getting it to work re somequires special steps because library paths need to be patched.
Line 52: Line 57:
After that last command, mujoco_py should be ready to use in the virtual environment. If everything installed correctly, the command below should run without any errors:
After that last command, mujoco_py should be ready to use in the virtual environment. If everything installed correctly, the command below should run without any errors:
{{Command|python -c "import mujoco_py"}}
{{Command|python -c "import mujoco_py"}}
</translate>

Revision as of 14:12, 1 June 2018

Other languages:

MuJoCo "stands for Multi-Joint dynamics with Contact. It is a physics engine aiming to facilitate research and development in robotics, biomechanics, graphics and animation, and other areas where fast and accurate simulation is needed."

It is frequently used with the associated Python module mujoco_py as an environment for Reinforcement Learning research.

Installation

Base Files

First, the .mujoco folder in your home directory must be set up. MuJoCo requires a licence key to be placed in ~/.mujoco/mjkey.txt. This key obtained by e-mail after registration.

The appropriate (linux) MuJoCo distribution must also be downloaded and unzipped into the ~/.mujoco directory from the Download section of the MuJoCo website.

Your ~/.mujoco folder should now look like this (the version might differ):

Question.png
[name@server ~]$ ls ~/.mujoco
mjkey.txt mjproj150

mujoco_py

The python interface to MuJoCo is the mujoco_py module. Getting it to work re somequires special steps because library paths need to be patched.

After using module to load the desired python version, you should set up a clean virtualenv and install the mujoco_py module:

[name@server ~]$ mkdir mujoco_env
[name@server ~]$ virtualenv mujoco_env
[name@server ~]$ source mujoco_env/bin/activate
[name@server ~]$ pip install mujoco_py


Now the paths need to be patched with setrpaths.sh. Use the appropriate python version in the commands below if it is not 3.5:

[name@server ~]$ setrpaths.sh --path $VIRTUAL_ENV/lib/python3.5/site-packages/mujoco_py
[name@server ~]$ setrpaths.sh --add_origin --path $HOME/.mujoco


Now run the following command:

Question.png
[name@server ~]$ python -c "import mujoco_py"

It should have crashed. However, it created the necessary paths to run:

Question.png
[name@server ~]$ setrpaths.sh --path $VIRTUAL_ENV/lib/python3.5/site-packages/mujoco_py

After that last command, mujoco_py should be ready to use in the virtual environment. If everything installed correctly, the command below should run without any errors:

Question.png
[name@server ~]$ python -c "import mujoco_py"