diff --git a/.gitignore b/.gitignore index b239dd8..8fbacc9 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,17 @@ urdfs/ .vscode/ # sphinx -docs/build/ \ No newline at end of file +docs/build/ + +# Generated documentation +_build/ +docs/build/ +docs/source/**/generated/ +docs/_site +_site +docs/dev + +# MACOS +.ds_store +.DS_Store +.DS_STORE diff --git a/docs/source/_templates/autosummary/class.rst b/docs/source/_templates/autosummary/class.rst new file mode 100644 index 0000000..e9bd0c7 --- /dev/null +++ b/docs/source/_templates/autosummary/class.rst @@ -0,0 +1,33 @@ +{{ fullname | escape | underline}} + +.. currentmodule:: {{ module }} + +.. autoclass:: {{ objname }} + :members: + :show-inheritance: + :inherited-members: + :undoc-members: + + {% block methods %} + .. automethod:: __init__ + + {% if methods %} + .. rubric:: {{ _('Methods') }} + + .. autosummary:: + {% for item in methods %} + ~{{ name }}.{{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block attributes %} + {% if attributes %} + .. rubric:: {{ _('Attributes') }} + + .. autosummary:: + {% for item in attributes %} + ~{{ name }}.{{ item }} + {%- endfor %} + {% endif %} + {% endblock %} diff --git a/docs/source/planner/armour.rst b/docs/source/planner/armour.rst index 77dfda2..808b6f1 100644 --- a/docs/source/planner/armour.rst +++ b/docs/source/planner/armour.rst @@ -1,2 +1,58 @@ Example RTD Planner Implementation of ARMOUR -============================================ \ No newline at end of file +============================================ + +ArmourPlanner and these related components define the ARMOUR planner as described by Michaux et. al. in https://arxiv.org/abs/2301.13308. +This planner requires the use of the matching robust controller. +Currently a kinematics-only minimal version of this is implemented. + +The Base ARMOUR Planner +----------------------- +.. autoclass:: armour.ArmourPlanner.ArmourPlanner + :show-inheritance: + :members: + :undoc-members: + +Reachable Set Generation +------------------------ +.. automodule:: armour.reachsets + :show-inheritance: + :members: + :undoc-members: +.. currentmodule:: armour.reachsets + +Generation of reachable sets are implemented as constraint generating classes, with the following classes generating instances for the constraints. + +.. autosummary:: + :toctree: generated + :nosignatures: + + JRSGenerator + JLSGenerator + FOGenerator + IRSGenerator + +.. autosummary:: + :toctree: generated + :nosignatures: + + JRSInstance + JLSInstance + FOInstance + IRSInstance + +Trajectory Types and Factory +---------------------------- +.. automodule:: armour.trajectory + :show-inheritance: + :members: + :undoc-members: +.. currentmodule:: armour.trajectory + +.. autosummary:: + :toctree: generated + :nosignatures: + + ZeroHoldArmTrajectory + PiecewiseArmTrajectory + BernsteinArmTrajectory + ArmTrajectoryFactory diff --git a/docs/source/planner/rtd.rst b/docs/source/planner/rtd.rst index b729463..c68129e 100644 --- a/docs/source/planner/rtd.rst +++ b/docs/source/planner/rtd.rst @@ -1,2 +1,67 @@ RTD Planner Interfaces and Base Classes -======================================= \ No newline at end of file +======================================= + +The core components to any mid-level RTD Planner. + +The RTD Planner +--------------- + +This is an interface to specify the midlevel planner. +It's written to be relatively isolated from the rest of the simulation package. + +.. autoclass:: rtd.planner.RtdPlanner + :show-inheritance: + :members: + :undoc-members: + +Reachable Sets Generation Interfaces +------------------------------------ +.. automodule:: rtd.planner.reachsets + :show-inheritance: + :members: + :undoc-members: +.. currentmodule:: rtd.planner.reachsets + +.. autosummary:: + :toctree: generated + :nosignatures: + + ReachSetGenerator + ReachSetInstance + +Trajectory Interfaces +--------------------- +.. automodule:: rtd.planner.trajectory + :show-inheritance: + :members: + :undoc-members: +.. currentmodule:: rtd.planner.trajectory + +.. autosummary:: + :toctree: generated + :nosignatures: + + Trajectory + InvalidTrajectory + TrajectoryFactory + TrajectoryContainer + BadTrajectoryException + +Trajectory Optimization Interfaces & Components +----------------------------------------------- +.. automodule:: rtd.planner.trajopt + :show-inheritance: + :members: + :undoc-members: +.. currentmodule:: rtd.planner.trajopt + +.. autosummary:: + :toctree: generated + :nosignatures: + + TrajOptProps + Objective + GenericArmObjective + OptimizationEngine + ScipyOptimizationEngine + RtdTrajOpt diff --git a/docs/source/setup.rst b/docs/source/setup.rst index ff0c2eb..c79604e 100644 --- a/docs/source/setup.rst +++ b/docs/source/setup.rst @@ -3,10 +3,38 @@ Setup Guide *rtd-code-python requires Python 3 or higher. For best results, use Python 3.11.3* +General Setup +------------- + 1. Clone the repository and open a terminal in the root directory -2. Install *virtualenv* with `py -m pip install virtualenv` -3. Create a new Virtual Environment with `py -m venv rtd_venv` -4. Activate the Virtual Environment with `rtd_venv\scripts\activate` -5. Install *rtd-code-python* and its dependencies with `py -m pip install -r requirements.txt` -6. Optionally, open a terminal inside `scripts\demos` and run the demo scripts +2. Install *virtualenv* with ``py -m pip install virtualenv`` +3. Create a new Virtual Environment with ``py -m venv rtd_venv`` +4. Activate the Virtual Environment with ``rtd_venv\scripts\activate`` +5. Install *rtd-code-python* and its dependencies with ``py -m pip install -r requirements.txt`` +6. Optionally, open a terminal inside ``scripts\demos`` and run the demo scripts + +(Alternative) Conda Quickstart +------------------------------ + +Another way to setup rtd-code-python is through the creation and use of a conda environment. +In your desired folder, run the following commands to get a conda environment called ``rtd-code`` setup + +.. code-block:: bash + + # Create conda environment and install python 3.11.3 & pytorch 2.0.1 + # Adjust the torch packages according to your system + conda create -n rtd-code python==3.11.3 pytorch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 pytorch-cuda=11.8 -c pytorch -c nvidia + conda activate rtd-code + + # Clone zonopy dependencies and RTD-Code, and install + git clone git@github.com:roahmlab/zonopy.git + git clone git@github.com:roahmlab/zonopy-robots.git + git clone git@github.com:roahmlab/rtd-code-python.git + pip install -r rtd-code-python/requirements.txt -e zonopy/ -e zonopy-robots/ -e rtd-code-python/ + + +Obtaining URDFs +--------------- +To obtain the URDFs used in the demos, please visit the `ARMOUR `_ repository and download the ``urdfs`` folder. +Place the ``urdfs`` folder in the parent directory of the rtd-code-python repository in order to run ``scripts\demos\planner_demo.py``.