Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Sphinx docs * Document node.py * Fix C extension documentation * Document init, shutdown, and spinning * Document Publisher and Subscription * Document Client and Service * Add warnings to constructors of client and service * Document executors and callback groups * Use typing,TYPE_CHECKING variable for condition imports used by annotations. * Fix mypy errors * Add instructions for building docs to README * Clarify doc briefs for graph discovery functions Signed-off-by: Jacob Perron <jacob@openrobotics.org>
- Loading branch information
1 parent
0184628
commit e9cc80c
Showing
30 changed files
with
1,211 additions
and
229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,16 @@ | ||
# rclpy | ||
ROS Client Library for the Python language. | ||
|
||
## Building documentation | ||
|
||
Documentation can be built for `rclpy` using [Sphinx](http://www.sphinx-doc.org/en/master/). | ||
|
||
#### Install dependencies | ||
|
||
sudo apt install python3-sphinx python3-pip | ||
sudo -H pip3 install sphinx_autodoc_typehints | ||
|
||
#### Build | ||
|
||
cd rclpy/docs | ||
make html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line. | ||
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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% | ||
goto end | ||
|
||
:help | ||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% | ||
|
||
:end | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
About | ||
===== | ||
|
||
The canonical Python API for `ROS 2 <https://index.ros.org/doc/ros2>`_. | ||
|
||
*rclpy* is built on the common C-API provided by `rcl <https://github.com/ros2/rcl>`_. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
API | ||
=== | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Contents: | ||
|
||
api/init_shutdown | ||
api/node | ||
api/topics | ||
api/services | ||
api/actions | ||
api/timers | ||
api/parameters | ||
api/logging | ||
api/context | ||
api/execution_and_callbacks | ||
api/utilities | ||
api/qos | ||
|
||
.. TODO(jacobperron): Document remaining API | ||
api/time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Actions | ||
======= | ||
|
||
Action Client | ||
------------- | ||
|
||
.. automodule:: rclpy.action.client | ||
|
||
Action Server | ||
------------- | ||
.. automodule:: rclpy.action.server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Context | ||
======= | ||
|
||
.. automodule:: rclpy.context |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Execution and Callbacks | ||
======================= | ||
|
||
There are two components that control the execution of callbacks: **executors** and **callback groups**. | ||
|
||
Executors are responsible for the actual execution of callbacks and should extend the :class:`.Executor` class. | ||
|
||
Callback groups are used to enforce concurrency rules for callbacks and should extend the :class:`.CallbackGroup` class. | ||
|
||
Executors | ||
--------- | ||
|
||
.. automodule:: rclpy.executors | ||
|
||
|
||
Callback Groups | ||
--------------- | ||
.. automodule:: rclpy.callback_groups |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Initialization, Shutdown, and Spinning | ||
====================================== | ||
|
||
.. automodule:: rclpy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Logging | ||
======= | ||
|
||
.. automodule:: rclpy.logging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Node | ||
==== | ||
|
||
.. automodule:: rclpy.node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Parameters | ||
========== | ||
|
||
Parameter | ||
--------- | ||
|
||
.. automodule:: rclpy.parameter | ||
|
||
Parameter Service | ||
----------------- | ||
|
||
.. automodule:: rclpy.parameter_service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Quality of Service | ||
================== | ||
|
||
.. automodule:: rclpy.qos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Services | ||
======== | ||
|
||
Client | ||
------ | ||
|
||
.. automodule:: rclpy.client | ||
|
||
Service | ||
------- | ||
|
||
.. automodule:: rclpy.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Timer | ||
===== | ||
|
||
.. automodule:: rclpy.timer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Topics | ||
====== | ||
|
||
Publisher | ||
--------- | ||
|
||
.. automodule:: rclpy.publisher | ||
|
||
Subscription | ||
------------ | ||
|
||
.. automodule:: rclpy.subscription |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Utilities | ||
========= | ||
|
||
.. automodule:: rclpy.utilities |
Oops, something went wrong.