Skip to content

Commit

Permalink
Switch to furo Sphinx theme
Browse files Browse the repository at this point in the history
  • Loading branch information
KolinGuo committed Feb 14, 2024
1 parent 17b8dc2 commit 44a5237
Show file tree
Hide file tree
Showing 23 changed files with 100 additions and 84 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MPlib
# MPlib: a Lightweight Motion Planning Library

<p align="center">
<img src="https://raw.githubusercontent.com/haosulab/MPlib/main/docs/demo.gif">
Expand Down
3 changes: 2 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
myst-parser
sphinx-rtd-theme
furo
sphinx-copybutton
sphinxext-opengraph
15 changes: 13 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
"sphinx.ext.duration",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx_rtd_theme",
"myst_parser",
"sphinx_copybutton",
"sphinxext.opengraph",
]

templates_path = ["_templates"]
Expand All @@ -31,5 +32,15 @@
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "sphinx_rtd_theme"
# https://pradyunsg.me/furo/customisation/
html_theme = "furo"
# html_theme = "sphinx_book_theme"
html_static_path = []
html_theme_options = {
# "announcement": "<em>Important</em> announcement!",
# Comment out for Read the Docs
# "top_of_page_button": "edit",
# "source_repository": "https://github.com/haosulab/MPlib",
# "source_branch": "main",
# "source_directory": "docs/source/",
}
13 changes: 1 addition & 12 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,9 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to mplib's documentation!
=================================

.. include:: ../../README.md
:parser: myst_parser.sphinx_

Planner Documentation
---------------------

.. toctree::
:maxdepth: 1

mplib

Examples
-----------

Expand All @@ -31,7 +20,7 @@ API Reference
.. toctree::
:maxdepth: 2

pymp/index
reference/index

Indices and tables
==================
Expand Down
4 changes: 0 additions & 4 deletions docs/source/pymp/collision_detection/index.rst

This file was deleted.

44 changes: 0 additions & 44 deletions docs/source/pymp/index.rst

This file was deleted.

4 changes: 0 additions & 4 deletions docs/source/pymp/pymp.rst

This file was deleted.

7 changes: 7 additions & 0 deletions docs/source/reference/ArticulatedModel.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
``ArticulatedModel``
-------------------------

.. autoclass:: mplib.pymp.ArticulatedModel
:members:
:undoc-members:
:show-inheritance:
7 changes: 2 additions & 5 deletions docs/source/mplib.rst → docs/source/reference/Planner.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
Planner
=======

mplib.planner
--------------------
``Planner``
-------------

.. automodule:: mplib.planner
:members:
Expand Down
7 changes: 7 additions & 0 deletions docs/source/reference/PlanningWorld.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
``PlanningWorld``
-------------------

.. autoclass:: mplib.pymp.PlanningWorld
:members:
:undoc-members:
:show-inheritance:
12 changes: 12 additions & 0 deletions docs/source/reference/collision_detection/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
collision_detection
------------------------------------------

.. automodule:: mplib.pymp.collision_detection
:members:
:undoc-members:
:show-inheritance:

.. toctree::
:maxdepth: 2

fcl
24 changes: 24 additions & 0 deletions docs/source/reference/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
API Reference
======================

.. toctree::
:maxdepth: 2

Planner
ArticulatedModel
PlanningWorld

.. toctree::
:maxdepth: 3

collision_detection/index

.. toctree::
:maxdepth: 4

kinematics/index

.. toctree::
:maxdepth: 4

planning/index
10 changes: 10 additions & 0 deletions docs/source/reference/kinematics/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
kinematics
-------------------------------------------

Kinematics submodule

.. toctree::
:maxdepth: 3

pinocchio
kdl
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions docs/source/reference/planning/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
planning
--------------------------

Planning submodule

.. toctree::
:maxdepth: 3

ompl
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/source/tutorials/collision_avoidance.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _collision_avoidance:
.. _collision_avoidance:

Collision Avoidance
====================
Expand Down Expand Up @@ -69,4 +69,4 @@ You can use ``planner.update_attached_box()`` again to update the box once it's
As shown in the above figure (the right one), after adding the point cloud of the blue box and attaching the red box to the ``move_group`` link, there is no collision.

.. note::
There are also a family of update attach functions. One can attach a sphere or a general mesh. Please see the planner API for more details.
There are also a family of update attach functions. One can attach a sphere or a general mesh. Please see the planner API for more details.
1 change: 1 addition & 0 deletions docs/source/tutorials/constrained_planning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Constrained Planning

.. image:: assets/constrained_planning.gif
:width: 50%
:align: center

This is a simple implementation of a constrained planner. It is based on OMPL's projection-based planner. Roughly, OMPL does sampling based planning and projects a joint configuration into a valid configuration using the constrained function we provide. The above gif shows the robot execute two trajectories. The first one generated with constraint that the z-axis of the endeffector pointing downwards. The second one generated without any constraints. We can see that the second trajectory tilts the endeffector sideways.

Expand Down
4 changes: 2 additions & 2 deletions docs/source/tutorials/getting_started.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _motion_planning_getting_started:
.. _motion_planning_getting_started:

Getting Started
==================
Expand Down Expand Up @@ -38,4 +38,4 @@ To use ``mplib``, we need to first set up a planner for the robot with the follo

After setting up the planner, we can use it to solve many motion planning tasks.

.. [1] ``mplib`` currently only supports a single link as ``move_group``.
.. [1] ``mplib`` currently only supports a single link as ``move_group``.
2 changes: 1 addition & 1 deletion docs/source/tutorials/inverse_kinematics.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _inverse_kinematics:
.. _inverse_kinematics:

Inverse Kinematics
==================
Expand Down
12 changes: 6 additions & 6 deletions docs/source/tutorials/plan_a_path.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _plan_a_path:
.. _plan_a_path:

Plan a Path
==================
Expand All @@ -9,7 +9,7 @@ In this tutorial, we will talk about how to plan paths for the agent. As shown i

.. figure:: assets/RRT.gif
:width: 320px
:align: left
:align: center

plan with RRTConnect

Expand All @@ -34,9 +34,9 @@ The second argument is the current joint positions of all the active joints (not

- ``status``: a string indicates the status:

- ``Success``: planned a path successfully.
- ``IK Failed``: failed to solve the inverse kinematics. This may happen when the target pose is not reachable.
- ``RRT Failed``: failed to find a valid path in the joint space. This may happen when there is no valid path or the task is too complicated.
- ``Success``: planned a path successfully.
- ``IK Failed``: failed to solve the inverse kinematics. This may happen when the target pose is not reachable.
- ``RRT Failed``: failed to find a valid path in the joint space. This may happen when there is no valid path or the task is too complicated.
- ``position``: a NumPy array of shape :math:`(n \times m)` describes the joint positions of the waypoints. :math:`n` is the number of waypoints in the path, and each row describes a waypoint. :math:`m` is the number of active joints that affect the pose of the ``move_group`` link. For example, for our panda robot arm, each row includes the positions for the first seven joints.
- ``duration``: a scalar indicates the duration of the output path. ``mplib`` returns the optimal duration considering the velocity and acceleration constraints.
- ``time``: a NumPy array of shape :math:`(n)` describes the time step of each waypoint. The first element is equal to 0, and the last one is equal to the ``duration``. Argument ``time_step`` determines the interval of the elements.
Expand Down Expand Up @@ -108,6 +108,6 @@ Then, we plan and execute the motion:

.. figure:: assets/screw.gif
:width: 320px
:align: left
:align: center

plan with screw motion

0 comments on commit 44a5237

Please sign in to comment.