|
a |
|
b/docs/source/install.rst |
|
|
1 |
Installation |
|
|
2 |
============ |
|
|
3 |
|
|
|
4 |
.. _installation: |
|
|
5 |
|
|
|
6 |
MyoSuite uses git submodules to resolve dependencies. |
|
|
7 |
Please follow steps exactly as below to install correctly. |
|
|
8 |
|
|
|
9 |
Requirements |
|
|
10 |
~~~~~~~~~~~~ |
|
|
11 |
* python >= 3.8 (if needed follow instructions `here <https://docs.conda.io/en/latest/miniconda.html>`_ for installing python and conda) |
|
|
12 |
* mujoco >= 2.3.6 |
|
|
13 |
|
|
|
14 |
|
|
|
15 |
Installing the pip package |
|
|
16 |
~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
|
17 |
|
|
|
18 |
.. code-block:: bash |
|
|
19 |
|
|
|
20 |
conda create --name MyoSuite python=3.8 |
|
|
21 |
conda activate MyoSuite |
|
|
22 |
pip install -U myosuite |
|
|
23 |
|
|
|
24 |
|
|
|
25 |
(alternative) Installing from source |
|
|
26 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
|
27 |
|
|
|
28 |
To get started with MyoSuite, clone this repo with pre-populated submodule dependencies |
|
|
29 |
|
|
|
30 |
.. code-block:: bash |
|
|
31 |
|
|
|
32 |
git clone --recursive https://github.com/facebookresearch/myosuite.git |
|
|
33 |
cd myosuite |
|
|
34 |
pip install -e . |
|
|
35 |
|
|
|
36 |
Testing the installation |
|
|
37 |
~~~~~~~~~~~~~~~~~~~~~~~~ |
|
|
38 |
|
|
|
39 |
You can test the installation using |
|
|
40 |
|
|
|
41 |
.. code-block:: bash |
|
|
42 |
|
|
|
43 |
python -m myosuite.tests.test_myo |
|
|
44 |
|
|
|
45 |
You can visualize the environments with random controls using the below command |
|
|
46 |
|
|
|
47 |
.. code-block:: bash |
|
|
48 |
|
|
|
49 |
python -m myosuite.utils.examine_env --env_name myoElbowPose1D6MRandom-v0 |
|
|
50 |
|
|
|
51 |
.. note:: |
|
|
52 |
On MacOS, the need of a launch_passive option might require that the Python script be run under `mjpython` i.e. |
|
|
53 |
`mjpython -m myosuite.utils.examine_env --env_name myoElbowPose1D6MRandom-v0` |
|
|
54 |
|
|
|
55 |
Examples |
|
|
56 |
~~~~~~~~~ |
|
|
57 |
|
|
|
58 |
It is possible to create and interface with MyoSuite environments like any other OpenAI gym environments. |
|
|
59 |
For example, to use the ``myoElbowPose1D6MRandom-v0`` environment it is possible simply to run: |
|
|
60 |
|
|
|
61 |
.. code-block:: python |
|
|
62 |
|
|
|
63 |
from myosuite.utils import gym |
|
|
64 |
env = gym.make('myoElbowPose1D6MRandom-v0') |
|
|
65 |
env.reset() |
|
|
66 |
for _ in range(1000): |
|
|
67 |
env.mj_render() |
|
|
68 |
env.step(env.action_space.sample()) # take a random action |
|
|
69 |
env.close() |
|
|
70 |
|
|
|
71 |
By default it will activate the simulator and the following visualization is expected: |
|
|
72 |
|
|
|
73 |
.. image:: images/test_env.png |
|
|
74 |
:width: 300 |