Metadata-Version: 2.4
Name: MyoSuite
Version: 2.12.2
Summary: Musculoskeletal environments simulated in MuJoCo
Author-email: Vikash Kumar <vikashplus@gmail.com>, Vittorio Caggiano <caggiano@gmail.com>, Balint Hodossy <balint.hodossy16@imperial.ac.uk>
License: Apache 2.0
Project-URL: Homepage, https://sites.google.com/view/myosuite
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Operating System :: OS Independent
Requires-Python: <3.14,>=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click
Requires-Dist: imageio[ffmpeg]
Requires-Dist: gymnasium<1.3
Requires-Dist: termcolor
Requires-Dist: flatten_dict
Requires-Dist: h5py
Requires-Dist: numpy
Requires-Dist: mujoco<3.7,>=3.6
Requires-Dist: Pillow>=12.2.0
Requires-Dist: pink-noise-rl
Requires-Dist: packaging
Requires-Dist: gitpython>=3.1.47
Provides-Extra: examples
Requires-Dist: mink[examples]; python_version >= "3.10" and extra == "examples"
Provides-Extra: mjx
Requires-Dist: mujoco<3.7,>=3.6; (python_version >= "3.10" and sys_platform != "win32") and extra == "mjx"
Requires-Dist: mujoco-mjx[warp]<3.7,>=3.6; (python_version >= "3.10" and sys_platform != "win32") and extra == "mjx"
Requires-Dist: jax>=0.4.20; (python_version >= "3.10" and sys_platform != "win32") and extra == "mjx"
Requires-Dist: jaxlib>=0.4.20; (python_version >= "3.10" and sys_platform != "win32") and extra == "mjx"
Requires-Dist: brax>=0.10.0; (python_version >= "3.10" and sys_platform != "win32") and extra == "mjx"
Requires-Dist: flax>=0.8.0; (python_version >= "3.10" and sys_platform != "win32") and extra == "mjx"
Requires-Dist: optax>=0.1.7; (python_version >= "3.10" and sys_platform != "win32") and extra == "mjx"
Requires-Dist: ml-collections>=0.1.1; (python_version >= "3.10" and sys_platform != "win32") and extra == "mjx"
Requires-Dist: etils[epath]>=1.3.0; (python_version >= "3.10" and sys_platform != "win32") and extra == "mjx"
Requires-Dist: playground>=0.1.0; (python_version >= "3.10" and sys_platform != "win32") and extra == "mjx"
Requires-Dist: mediapy>=1.2.0; (python_version >= "3.10" and sys_platform != "win32") and extra == "mjx"
Requires-Dist: wandb>=0.21.0; (python_version >= "3.10" and sys_platform != "win32") and extra == "mjx"
Provides-Extra: tutorials
Requires-Dist: matplotlib; extra == "tutorials"
Requires-Dist: pandas; extra == "tutorials"
Requires-Dist: tqdm; extra == "tutorials"
Requires-Dist: mink; extra == "tutorials"
Requires-Dist: loop-rate-limiters; extra == "tutorials"
Requires-Dist: osqp; extra == "tutorials"
Requires-Dist: stable-baselines3[extra]; extra == "tutorials"
Provides-Extra: mjx-cuda
Requires-Dist: MyoSuite[mjx]; extra == "mjx-cuda"
Requires-Dist: jax[cuda]>=0.4.20; python_version >= "3.10" and extra == "mjx-cuda"
Provides-Extra: docs
Requires-Dist: sphinx>=7.0; extra == "docs"
Requires-Dist: sphinx-rtd-theme>=2.0; extra == "docs"
Requires-Dist: sphinx-autodoc-typehints>=2.0; extra == "docs"
Dynamic: license-file

<!-- =================================================
# Copyright (c) MyoSuite Authors
Authors  :: Vikash Kumar (vikashplus@gmail.com), Vittorio Caggiano (caggiano@gmail.com)
================================================= -->
<img src="https://github.com/myohub/myosuite/blob/main/docs/source/images/Full%20Color%20Horizontal%20wider.png?raw=true" width=800>

[![Support Ukraine](https://img.shields.io/badge/Support-Ukraine-FFD500?style=flat&labelColor=005BBB)](https://opensource.facebook.com/support-ukraine)
[![PyPI](https://img.shields.io/pypi/v/myosuite)](https://pypi.org/project/MyoSuite/)
[![Documentation Status](https://readthedocs.org/projects/myosuite/badge/?version=latest)](https://myosuite.readthedocs.io/en/latest/)
![PyPI - License](https://img.shields.io/pypi/l/myosuite)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/myohub/myosuite/blob/main/docs/CONTRIBUTING.md)
[![Downloads](https://static.pepy.tech/badge/myosuite)](https://pepy.tech/project/myosuite)
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1zFuNLsrmx42vT4oV8RbnEWtkSJ1xajEo)
[![Slack](https://img.shields.io/badge/Slack-4A154B?style=for-the-badge&logo=slack&logoColor=white)](https://join.slack.com/t/myosuite/shared_invite/zt-1zkpw2zzk-NhVhVlSDxhoMHbzROD8gMA)
[![Twitter Follow](https://img.shields.io/twitter/follow/MyoSuite?style=social)](https://twitter.com/MyoSuite)

`MyoSuite` is a collection of musculoskeletal environments and tasks simulated with the [MuJoCo](http://www.mujoco.org/) physics engine and wrapped in the OpenAI ``gym`` API to enable the application of Machine Learning to bio-mechanic control problems.



[Documentation](https://myosuite.readthedocs.io/en/latest/) | [Tutorials](https://github.com/myohub/myosuite/tree/main/tutorials) | [Task specifications](https://github.com/myohub/myosuite/blob/main/docs/source/suite.rst#tasks)


Below is an overview of the tasks in the MyoSuite.

<img width="1240" alt="TasksALL" src="https://github.com/myohub/myosuite/blob/main/docs/source/images/myoSuite_All.png?raw=true">



## Installations
You will need Python 3.10 or later versions.

### Using uv
[uv](https://docs.astral.sh/uv/) is a fast Python package manager. Install MyoSuite with:
``` bash
uv sync -p 3.10
```

### Using conda
It is recommended to use [Miniconda](https://docs.conda.io/en/latest/miniconda.html#latest-miniconda-installer-links) and to create a separate environment with:
``` bash
conda create --name myosuite python=3.10
conda activate myosuite
pip install -U myosuite
```

### Using uv (recommended)
For faster installation, you can use [uv](https://github.com/astral-sh/uv), a fast Python package installer:

``` bash
# Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh

# Create and activate a virtual environment
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install MyoSuite
uv pip install -U myosuite
```

For installation from source with uv:
``` bash
git clone --recursive https://github.com/myohub/myosuite.git
cd myosuite
uv pip install -e .
```

For advanced installation options, see [here](https://myosuite.readthedocs.io/en/latest/install.html#alternative-installing-from-source).

Test your installation using the following command (this will return also a list of all the current environments):
``` bash
# With uv:
uv run python -m myosuite.tests.test_myo

# With pip/conda:
python -m myosuite.tests.test_myo
```


You can also visualize the environments with random controls using the command below:
``` bash
# With uv:
uv run python -m myosuite.utils.examine_env --env_name myoElbowPose1D6MRandom-v0

# With pip/conda:
python -m myosuite.utils.examine_env --env_name myoElbowPose1D6MRandom-v0
```
**NOTE:** On MacOS, we moved to mujoco native `launch_passive` which requires that the Python script be run under `mjpython`:
``` bash
mjpython -m myosuite.utils.examine_env --env_name myoElbowPose1D6MRandom-v0
```

It is possible to take advantage of the latest MyoSkeleton. Once added (follow the instructions prompted by `uv run myoapi_init` or `python -m myosuite_init`), run:
``` bash
# With uv:
uv run python -m myosuite.utils.examine_sim -s myosuite/simhive/myo_model/myoskeleton/myoskeleton.xml

# With pip/conda:
python -m myosuite.utils.examine_sim -s myosuite/simhive/myo_model/myoskeleton/myoskeleton.xml
```

## Examples
It is possible to create and interface with MyoSuite environments just like any other OpenAI gym environments. For example, to use the `myoElbowPose1D6MRandom-v0` environment, it is possible simply to run: [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1zFuNLsrmx42vT4oV8RbnEWtkSJ1xajEo)



```python
from myosuite.utils import gym
env = gym.make('myoElbowPose1D6MRandom-v0')
env.reset()
for _ in range(1000):
  env.mj_render()
  env.step(env.action_space.sample()) # take a random action
env.close()
```

You can find our [tutorials](https://github.com/myohub/myosuite/tree/main/tutorials) on the general features and the **ICRA2023 Colab Tutorial** [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1KGqZgSYgKXF-vaYC33GR9llDsIW9Rp-q) **ICRA2024 Colab Tutorial** [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1JwxE7o6Z3bqCT4ewELacJ-Z1SV8xFhKK#scrollTo=QDppGIzHB9Zu)
on how to load MyoSuite models/tasks, train them, and visualize their outcome. Also, you can find [baselines](https://github.com/myohub/myosuite/tree/main/myosuite/agents) to test some pre-trained policies.



## License

MyoSuite is licensed under the [Apache License](LICENSE).

## Citation

If you find this repository useful in your research, please consider giving a star ⭐ and cite our [arXiv paper](https://arxiv.org/abs/2205.13600)  by using the following BibTeX entrys.

```BibTeX
@Misc{MyoSuite2022,
  author =       {Vittorio, Caggiano AND Huawei, Wang AND Guillaume, Durandau AND Massimo, Sartori AND Vikash, Kumar},
  title =        {MyoSuite -- A contact-rich simulation suite for musculoskeletal motor control},
  publisher = {arXiv},
  year = {2022},
  howpublished = {\url{https://github.com/myohub/myosuite}},
  doi = {10.48550/ARXIV.2205.13600},
  url = {https://arxiv.org/abs/2205.13600},
}
```
