Skip to content

Commit

Permalink
Point to examples in docs (sea-bass#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
sea-bass committed Apr 30, 2024
1 parent 725adb7 commit caa95ef
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 4 deletions.
11 changes: 10 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
extensions = [
"sphinx_rtd_theme",
"sphinx.ext.autodoc",
"sphinx.ext.extlinks",
"sphinx.ext.napoleon",
]

Expand All @@ -32,8 +33,16 @@
templates_path = ["_templates"]
exclude_patterns = ["build", "Thumbs.db", ".DS_Store"]

# External links
extlinks = {
"examples": ("https://github.com/sea-bass/pyroboplan/tree/main/examples/%s", ""),
"source": (
"https://github.com/sea-bass/pyroboplan/tree/main/src/pyroboplan/%s",
"",
),
}

# -- Options for HTML output -------------------------------------------------
# Options for HTML output
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "sphinx_rtd_theme"
Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pyroboplan
This library extensively uses the `Pinocchio <https://github.com/stack-of-tasks/pinocchio>`_ Python bindings for modeling robot kinematics and dynamics.

Note the **educational** in this library description.
It is not designed for performance, but rather to teach newcomers the fundamentals of motion planning in an easy-to-use environment.
It is not designed for performance, but rather to teach newcomers the fundamentals of motion planning in an easy-to-use environment with :examples:`many examples <>`.

.. image:: _static/gifs/pyroboplan_rrt_traj.gif
:width: 640
Expand Down
8 changes: 7 additions & 1 deletion docs/source/motion_planning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ Some tools like the `MoveIt Setup Assistant <https://moveit.picknik.ai/main/doc/
model, data, collision_model, collision_data, q, False,
)
The `pyroboplan.core module <api/pyroboplan.core.html>`_ contains several tools that abstract away such common Pinocchio operations for motion planning.
The :examples:`Introduction to Pinocchio examples folder <intro_pinocchio>` includes code examples for robot models that are manually created and automatically imported from URDF.

Additionally, the `pyroboplan.core module <api/pyroboplan.core.html>`_ contains several tools that abstract away such common Pinocchio operations for motion planning.
One example can be found :examples:`here <example_collision_along_path.py>`.

.. image:: _static/images/collision_checking.png
:width: 600
Expand All @@ -73,6 +76,7 @@ However, for most robotics applications, we rely on **numerical methods** instea
* Additional constraints, such as joint limits, Cartesian pose limits, or collision avoidance, are difficult to enforce analytically.

The `pyroboplan.ik module <api/pyroboplan.ik.html>`_ contains implementations for IK solvers.
You can also try running the :examples:`differential IK example <example_differential_ik.py>`.

.. image:: _static/images/inverse_kinematics.png
:width: 600
Expand Down Expand Up @@ -100,6 +104,7 @@ Currently, all the planners in ``pyroboplan`` (such as RRT and Cartesian interpo
Online planning and control is often done through optimization techniques like Model Predictive Control (MPC).

The `pyroboplan.planning module <api/pyroboplan.planning.html>`_ contains implementations for motion planners.
You can also try running the :examples:`RRT example <example_rrt.py>` and :examples:`Cartesian planning example <example_cartesian_path.py>`.

.. image:: _static/images/bidirectional_rrt_star.png
:width: 600
Expand All @@ -118,6 +123,7 @@ Often, a fixed set of kinematic (position/velocity/acceleration/jerk) and dynami
Sometimes, these limits can also be task-dependent; for example, if manipulating fragile objects or objects that cannot be placed in certain configurations (e.g., moving a glass of water without spilling).

The `pyroboplan.trajectory module <api/pyroboplan.trajectory.html>`_ contains trajectory generation implementations.
You can also try running the :examples:`trajectory generation example <example_trajectory.py>`.

.. image:: _static/images/trajectory_generation.png
:width: 720
Expand Down
6 changes: 5 additions & 1 deletion examples/example_cartesian_path.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""
This example shows PyRoboPlan capabilities for Cartesian planning to track
task-space, or operational space, motions with straight-line interpolation.
"""

import matplotlib.pyplot as plt
import numpy as np
import pinocchio
Expand Down Expand Up @@ -53,7 +58,6 @@
options=DifferentialIkOptions(max_retries=5),
)


# Create the Cartesian Planner over the entire desired path.
options = CartesianPlannerOptions(
use_trapezoidal_scaling=True,
Expand Down
7 changes: 7 additions & 0 deletions examples/example_collision_along_path.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""
This example shows PyRoboPlan capabilities around Pinocchio to import a model
and perform collision checking along a predefined path.
These capabilities form the basis of collision checking for validating other
motion planning components such as inverse kinematics and path planning.
"""

import hppfcl
import pinocchio
from pinocchio.visualize import MeshcatVisualizer
Expand Down
6 changes: 6 additions & 0 deletions examples/example_differential_ik.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
"""
This example shows PyRoboPlan capabilities for inverse kinematics (IK).
IK defines the task of finding a set of joint positions for a robot model to
achieve a desired target pose for a specific coordinate frame.
"""

from pinocchio.visualize import MeshcatVisualizer
import numpy as np

Expand Down
5 changes: 5 additions & 0 deletions examples/example_rrt.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""
This example shows PyRoboPlan capabilities for path planning using
Rapidly-Expanding Random Tree (RRT) algorithm.
"""

from pinocchio.visualize import MeshcatVisualizer
import time

Expand Down
5 changes: 5 additions & 0 deletions examples/example_trajectory.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""
This example shows PyRoboPlan capabilities for trajectory generation giving
various time scaling approaches, such as polynomial and trapezoidal velocity.
"""

import matplotlib.pyplot as plt
import numpy as np
from pinocchio.visualize import MeshcatVisualizer
Expand Down

0 comments on commit caa95ef

Please sign in to comment.