Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rtd documentation #1

Merged
merged 31 commits into from
Feb 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6cc60e6
first commit of documentation
Feb 19, 2022
b9114b8
remove .DS_Store file
Feb 19, 2022
135aab8
Delete .DS_Store
Vittorio-Caggiano Feb 19, 2022
657abb7
remove .DS_Store file
Feb 19, 2022
20abd29
.DS_Store removed!
Feb 19, 2022
f0201c7
Merge branch 'rtd_documentation' of github.com:facebookresearch/myoSu…
Feb 19, 2022
96dd13a
Delete .gitignore
Vittorio-Caggiano Feb 19, 2022
93c83ed
.DS_Store removed!
Feb 19, 2022
c4bd70f
Merge branch 'rtd_documentation' of github.com:facebookresearch/myoSu…
Feb 19, 2022
0bc86c7
fix code block
Feb 19, 2022
0b1aeb3
update files/dirs to ignore
Feb 19, 2022
2dd8322
update files/dirs to ignore
Feb 19, 2022
9d5b29d
update files/dirs to ignore
Feb 19, 2022
3918e36
first commit of code of conduct
Feb 19, 2022
cf9f8f3
first commit of contributing guidelines
Feb 19, 2022
96b0669
Update CONTRIBUTING.md
Vittorio-Caggiano Feb 19, 2022
03b5036
Update .gitignore
Vittorio-Caggiano Feb 19, 2022
23abef4
Update baselines.rst
Vittorio-Caggiano Feb 19, 2022
3340554
Update conf.py
Vittorio-Caggiano Feb 19, 2022
62486ba
Update index.rst
Vittorio-Caggiano Feb 19, 2022
a035ac1
Update install.rst
Vittorio-Caggiano Feb 19, 2022
b6300ff
Update tutorials.rst
Vittorio-Caggiano Feb 19, 2022
f3db91b
Delete 2b_Test policy to reproduce ASL numbers-checkpoint.ipynb
Vittorio-Caggiano Feb 19, 2022
01059b2
Delete 1_Get_Started-checkpoint.ipynb
Vittorio-Caggiano Feb 19, 2022
0a55331
Delete 4_Load Angles-checkpoint.ipynb
Vittorio-Caggiano Feb 19, 2022
86c045a
Delete 3_Analyse movements-checkpoint.ipynb
Vittorio-Caggiano Feb 19, 2022
d4fecef
Delete 2_Load a policy and play it-checkpoint.ipynb
Vittorio-Caggiano Feb 19, 2022
1f609b5
add copy function
Feb 19, 2022
8dcc13e
edit install info
Feb 19, 2022
779a5b9
update notebooks
Feb 19, 2022
cf597ef
fix conflicts
Feb 19, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
__pycache__/
*.py[cod]
*$py.class
*.pyc

# C extensions
*.so
Expand Down Expand Up @@ -67,6 +68,7 @@ instance/

# Sphinx documentation
docs/_build/
docs/build/

# PyBuilder
target/
Expand Down Expand Up @@ -104,3 +106,8 @@ venv.bak/

# mypy
.mypy_cache/

# release files #
_build
dist
tags
80 changes: 80 additions & 0 deletions docs/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to make participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies within all project spaces, and it also applies when
an individual is representing the project or its community in public spaces.
Examples of representing a project or community include using an official
project e-mail address, posting via an official social media account, or acting
as an appointed representative at an online or offline event. Representation of
a project may be further defined and clarified by project maintainers.

This Code of Conduct also applies outside the project spaces when there is a
reasonable belief that an individual's behavior may have a negative impact on
the project or its community.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at <opensource-conduct@fb.com>. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
37 changes: 37 additions & 0 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Contributing to Facebook Open Source Projects

We want to make contributing to Facebook Open Source Projects as easy and
transparent as possible.

## Pull Requests

We actively welcome your pull requests.

1. Fork the repo and create your branch from `main`.
2. If you've added code that should be tested, add tests.
3. If you've changed APIs, update the documentation.
4. Ensure the test suite passes.
5. Make sure your code lints.
6. If you haven't already, complete the Contributor License Agreement ("CLA").

## Contributor License Agreement ("CLA")

In order to accept your pull request, we need you to submit a CLA. You only
need to do this once to work on any of Facebook's open source projects.

Complete your CLA here: <https://code.facebook.com/cla>

## Issues

We use GitHub issues to track public bugs. Please ensure your description is
clear and has sufficient instructions to be able to reproduce the issue.

Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the
safe disclosure of security bugs. In those cases, please go through the process
outlined on that page and do not file a public issue.

## License

By contributing to Facebook Open Source Projects, you agree that your
contributions will be licensed under the LICENSE file in the root directory of
each project's source tree.
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
3 changes: 3 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sphinx==4.0.2
sphinx-autobuild
sphinx-rtd-theme==0.5.2
32 changes: 32 additions & 0 deletions docs/source/baselines.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
RL Baselines
============

.. _baselines:


Installation
~~~~~~~~~~~~

1. We use `mjrl <https://github.com/aravindr93/mjrl>`_ for our baselines. Please install it with ``python -m pip install git+https://github.com/aravindr93/mjrl.git``
2. install hydra ``pip install hydra-core --upgrade``
3. install `submitit <https://github.com/facebookincubator/submitit>`_ launcher hydra plugin to launch jobs on cluster/ local ``pip install hydra-submitit-launcher --upgrade``

.. code-block:: bash

pip install git+https://github.com/aravindr93/mjrl.git
pip install hydra-core --upgrade
pip install hydra-submitit-launcher --upgrade
pip install submitit

Launch training
~~~~~~~~~~~~~~~~

1. Get commands to lunch training by running `train_myosuite.sh` located in the `myosuite/agents` folder:

.. code-block:: bash

sh train_myosuite.sh myo # runs natively
sh train_myosuite.sh myo local # use local launcher
sh train_myosuite.sh myo slurm # use slurm launcher

2. Further customize the prompts from the previous step and execute.
47 changes: 47 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright (c) Facebook, Inc. and its affiliates
# Authors :: Vikash Kumar (vikashplus@gmail.com), Vittorio Caggiano (caggiano@gmail.com)
#
# This source code is licensed under the Apache 2 license found in the
# LICENSE file in the root directory of this source tree.

import os
import sys

sys.path.insert(0, os.path.abspath("../.."))
sys.path.insert(0, os.path.abspath("../../myosuite"))

# -- Project information

project = 'myoSuite'
copyright = "Copyright © 2022 Meta Platforms, Inc"
author = "Meta AI Research"

release = '0.1'
version = '0.1.0'

# -- General configuration

extensions = [
'sphinx.ext.duration',
'sphinx.ext.doctest',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.intersphinx',
'sphinx_copybutton',
'RunNotebook',
]

intersphinx_mapping = {
'python': ('https://docs.python.org/3/', None),
'sphinx': ('https://www.sphinx-doc.org/en/master/', None),
}
intersphinx_disabled_domains = ['std']

templates_path = ['_templates']

# -- Options for HTML output

html_theme = 'sphinx_rtd_theme'

# -- Options for EPUB output
epub_show_urls = 'footnote'
Binary file added docs/source/images/Fatigue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/elbow_exo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/elbow_joint_pose.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/finger_joint_pose.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/finger_tip_reach.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/hand_baoding_balls.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/hand_joint_pose.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/hand_key_turn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/hand_object_hold.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/hand_pen_twirl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/hand_tip_reach.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/myoElbow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/myoFinger.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/myoHand.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/myoSuite_All.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/images/tendon_transfer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Welcome to myoSuite's documentation!
=====================================

**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

.. note::

This project is under active development.

.. toctree::
:maxdepth: 1
:caption: Get started

install
suite
tutorials
baselines

.. toctree::
:maxdepth: 1
:caption: References

publications


How to cite
-----------
78 changes: 78 additions & 0 deletions docs/source/install.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
Installation
============

.. _installation:

myoSuite uses git submodules to resolve dependencies.
Please follow steps exactly as below to install correctly.

Requirements
~~~~~~~~~~~~
* python >= 3.7.1 (if needed follow instructions `here <https://docs.conda.io/en/latest/miniconda.html>`_ for installing python and conda)
* free-mujoco-py >= 2.1.6


Installing the pip package
~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code-block:: bash

conda create --name myoSuite python=3.7.1
conda activate myoSuite
pip install -U myosuite


(alternative) Installing from source
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
❗IMPORTANT❗ Install MuJoCo 2.1 before installing myoSuite

To get started with myoSuite, clone this repo with pre-populated submodule dependencies

.. code-block:: bash

git clone --recursive https://github.com/facebookresearch/myosuite.git
cd myosuite
pip install -e -r requirements

OR Add repo to pythonpath by updating `~/.bashrc` or `~/.bash_profile`

.. code-block:: bash

export PYTHONPATH="<path/to/myoSuite>:$PYTHONPATH"

Testing the installation
~~~~~~~~~~~~~~~~~~~~~~~~

You can test the installation using

.. code-block:: bash

python myoSuite/tests/test_myo.py

You can visualize the environments with random controls using the below command

.. code-block:: bash

python myosuite/utils/visualize_env.py --env_name myoElbowPose1D6MRandom-v0

.. note::
If the visualization results in a GLFW error, this is because ``mujoco-py`` does not see some graphics drivers correctly.
This can usually be fixed by explicitly loading the correct drivers before running the python script.
See `this page <https://github.com/aravindr93/mjrl/tree/master/setup#known-issues>`_ for details.

Examples
~~~~~~~~~

It is possible to create and interface with myoSuite environments like any other OpenAI gym environments.
For example, to use the ``myoElbowPose1D6MRandom-v0`` environment it is possible simply to run:

.. code-block:: python

import myosuite
import gym
env = gym.make('myoElbowPose1D6MRandom-v0')
env.reset()
for _ in range(1000):
env.sim.render(mode='window')
env.step(env.action_space.sample()) # take a random action
env.close()
5 changes: 5 additions & 0 deletions docs/source/publications.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Publications
============


* Huawei Wang*, Vittorio Caggiano*, Guillaume Durandau, Massimo Sartori, Vikash Kumar, `AdeptSim: A fast and physiologically realistic simulation framework for musculoskeletal and exoskeletal studies`, 2022 IEEE International Conference on Robotics and Automation (ICRA).
Loading