Sphinx docs generation (#22697)
* add sphinx * switch theme * Experiment: sphinx docs generation updated (#22708) * moved build to root gitignore, added .gitkeep * Improved makefile doc build process - Removed auto-generated docs from source control - Moved apidoc.sh into Makefile - Removed make.bat (can add back if Windows support desired) - Added sphinx viewcode and markdown extensions - Added feature to source /docs in build, so any .rst file in /docs will override the respective file during the build process - Added feature to copy all markdown/rst files from source into /build/ during build process so they can be easily referenced while writing docs (see examples in index.md) - Wrote basic starter index.md file TODO: Add new dependencies to Pipfile [dev-packages] * Revert accidental modification to Pipfile * fix command substitution * exclude xx * improve docs * dont include all docs in release build * Add dockerfile * update title * include normal readme * build container in CI * use buildkit * add login Co-authored-by: Chad Bailey <chadbailey904@gmail.com>pull/22720/head
parent
efb5abec41
commit
b816b5b644
18 changed files with 387 additions and 79 deletions
@ -0,0 +1,58 @@ |
||||
# Limitations |
||||
## Limitations of openpilot ALC and LDW |
||||
|
||||
openpilot ALC and openpilot LDW do not automatically drive the vehicle or reduce the amount of attention that must be paid to operate your vehicle. The driver must always keep control of the steering wheel and be ready to correct the openpilot ALC action at all times. |
||||
|
||||
While changing lanes, openpilot is not capable of looking next to you or checking your blind spot. Only nudge the wheel to initiate a lane change after you have confirmed it's safe to do so. |
||||
|
||||
Many factors can impact the performance of openpilot ALC and openpilot LDW, causing them to be unable to function as intended. These include, but are not limited to: |
||||
|
||||
* Poor visibility (heavy rain, snow, fog, etc.) or weather conditions that may interfere with sensor operation. |
||||
* The road facing camera is obstructed, covered or damaged by mud, ice, snow, etc. |
||||
* Obstruction caused by applying excessive paint or adhesive products (such as wraps, stickers, rubber coating, etc.) onto the vehicle. |
||||
* The device is mounted incorrectly. |
||||
* When in sharp curves, like on-off ramps, intersections etc...; openpilot is designed to be limited in the amount of steering torque it can produce. |
||||
* In the presence of restricted lanes or construction zones. |
||||
* When driving on highly banked roads or in presence of strong cross-wind. |
||||
* Extremely hot or cold temperatures. |
||||
* Bright light (due to oncoming headlights, direct sunlight, etc.). |
||||
* Driving on hills, narrow, or winding roads. |
||||
|
||||
The list above does not represent an exhaustive list of situations that may interfere with proper operation of openpilot components. It is the driver's responsibility to be in control of the vehicle at all times. |
||||
|
||||
## Limitations of openpilot ACC and FCW |
||||
|
||||
openpilot ACC and openpilot FCW are not systems that allow careless or inattentive driving. It is still necessary for the driver to pay close attention to the vehicle’s surroundings and to be ready to re-take control of the gas and the brake at all times. |
||||
|
||||
Many factors can impact the performance of openpilot ACC and openpilot FCW, causing them to be unable to function as intended. These include, but are not limited to: |
||||
|
||||
* Poor visibility (heavy rain, snow, fog, etc.) or weather conditions that may interfere with sensor operation. |
||||
* The road facing camera or radar are obstructed, covered, or damaged by mud, ice, snow, etc. |
||||
* Obstruction caused by applying excessive paint or adhesive products (such as wraps, stickers, rubber coating, etc.) onto the vehicle. |
||||
* The device is mounted incorrectly. |
||||
* Approaching a toll booth, a bridge or a large metal plate. |
||||
* When driving on roads with pedestrians, cyclists, etc... |
||||
* In presence of traffic signs or stop lights, which are not detected by openpilot at this time. |
||||
* When the posted speed limit is below the user selected set speed. openpilot does not detect speed limits at this time. |
||||
* In presence of vehicles in the same lane that are not moving. |
||||
* When abrupt braking maneuvers are required. openpilot is designed to be limited in the amount of deceleration and acceleration that it can produce. |
||||
* When surrounding vehicles perform close cut-ins from neighbor lanes. |
||||
* Driving on hills, narrow, or winding roads. |
||||
* Extremely hot or cold temperatures. |
||||
* Bright light (due to oncoming headlights, direct sunlight, etc.). |
||||
* Interference from other equipment that generates radar waves. |
||||
|
||||
The list above does not represent an exhaustive list of situations that may interfere with proper operation of openpilot components. It is the driver's responsibility to be in control of the vehicle at all times. |
||||
|
||||
## Limitations of openpilot DM |
||||
|
||||
openpilot DM should not be considered an exact measurement of the alertness of the driver. |
||||
|
||||
Many factors can impact the performance of openpilot DM, causing it to be unable to function as intended. These include, but are not limited to: |
||||
|
||||
* Low light conditions, such as driving at night or in dark tunnels. |
||||
* Bright light (due to oncoming headlights, direct sunlight, etc.). |
||||
* The driver's face is partially or completely outside field of view of the driver facing camera. |
||||
* The driver facing camera is obstructed, covered, or damaged. |
||||
|
||||
The list above does not represent an exhaustive list of situations that may interfere with proper operation of openpilot components. A driver should not rely on openpilot DM to assess their level of attention. |
@ -0,0 +1,53 @@ |
||||
# Minimal makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
OPENPILOT_ROOT = `git rev-parse --show-toplevel`
|
||||
|
||||
# You can set these variables from the command line, and also
|
||||
# from the environment for the first two.
|
||||
SPHINXOPTS ?=
|
||||
SPHINXBUILD ?= sphinx-build
|
||||
DOCSDIR = "$(OPENPILOT_ROOT)/docs"
|
||||
SOURCEDIR = "$(OPENPILOT_ROOT)/build/docs"
|
||||
DOCSBUILDDIR = "$(OPENPILOT_ROOT)/build/docs"
|
||||
BUILDDIR = "$(OPENPILOT_ROOT)/build"
|
||||
|
||||
# Put it first so that "make" without argument is like "make help".
|
||||
help: |
||||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(DOCSBUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
|
||||
clean: |
||||
@echo "Cleaning build folder..."
|
||||
rm -rf "$(BUILDDIR)"
|
||||
|
||||
.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 |
||||
@echo "Cleaning build folder..."
|
||||
rm -rf "$(BUILDDIR)"
|
||||
mkdir -p "$(DOCSBUILDDIR)"
|
||||
|
||||
@echo "Copying docs & config to build folder..."
|
||||
cp -a "$(DOCSDIR)" "$(BUILDDIR)"
|
||||
cd "$(OPENPILOT_ROOT)" && \
|
||||
find . -type f \( -name "*.md" -o -name "*.rst" \) \
|
||||
-not -path "*/.*" \
|
||||
-not -path "./build/*" \
|
||||
-not -path "./docs/*" \
|
||||
-not -path "./xx/*" \
|
||||
-exec cp --parents "{}" ./build/docs/ \;
|
||||
|
||||
@echo "Building rst files..."
|
||||
sphinx-apidoc -o "$(DOCSBUILDDIR)" ../ \
|
||||
../xx ../laika_repo ../rednose_repo ../pyextra ../notebooks ../panda_jungle \
|
||||
../third_party \
|
||||
../panda/examples \
|
||||
../scripts \
|
||||
../selfdrive/modeld \
|
||||
../selfdrive/debug \
|
||||
$(shell find .. -type d -name "*test*")
|
||||
|
||||
@echo "Building html files..."
|
||||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(DOCSBUILDDIR)" $(SPHINXOPTS) $(O)
|
@ -0,0 +1,61 @@ |
||||
# type: ignore |
||||
# pylint: skip-file |
||||
|
||||
# Configuration file for the Sphinx documentation builder. |
||||
# |
||||
# This file only contains a selection of the most common options. For a full |
||||
# list see the documentation: |
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html |
||||
|
||||
# -- Path setup -------------------------------------------------------------- |
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory, |
||||
# add these directories to sys.path here. If the directory is relative to the |
||||
# documentation root, use os.path.abspath to make it absolute, like shown here. |
||||
# |
||||
import os |
||||
import sys |
||||
sys.path.insert(0, os.path.abspath('.')) |
||||
sys.path.insert(0, os.path.abspath('..')) |
||||
|
||||
|
||||
|
||||
# -- Project information ----------------------------------------------------- |
||||
|
||||
project = 'openpilot' |
||||
copyright = '2021, comma.ai' |
||||
author = 'comma.ai' |
||||
|
||||
|
||||
# -- General configuration --------------------------------------------------- |
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be |
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
||||
# ones. |
||||
extensions = [ |
||||
'sphinx.ext.autodoc', # Auto-generate docs |
||||
'sphinx.ext.viewcode', # Add view code link to modules |
||||
'sphinx_rtd_theme', # Read The Docs theme |
||||
'myst_parser', # Markdown parsing |
||||
] |
||||
|
||||
# Add any paths that contain templates here, relative to this directory. |
||||
templates_path = ['_templates'] |
||||
|
||||
# List of patterns, relative to source directory, that match files and |
||||
# directories to ignore when looking for source files. |
||||
# This pattern also affects html_static_path and html_extra_path. |
||||
exclude_patterns = [] |
||||
|
||||
|
||||
# -- Options for HTML output ------------------------------------------------- |
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for |
||||
# a list of builtin themes. |
||||
# |
||||
html_theme = 'sphinx_rtd_theme' |
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here, |
||||
# relative to this directory. They are copied after the builtin static files, |
||||
# so a file named "default.css" will overwrite the builtin "default.css". |
||||
html_static_path = ['_static'] |
@ -0,0 +1,46 @@ |
||||
FROM ghcr.io/commaai/openpilot-base:latest |
||||
|
||||
ENV PYTHONUNBUFFERED 1 |
||||
|
||||
ENV OPENPILOT_PATH /home/batman/openpilot/ |
||||
ENV PYTHONPATH ${OPENPILOT_PATH}:${PYTHONPATH} |
||||
|
||||
RUN mkdir -p ${OPENPILOT_PATH} |
||||
WORKDIR ${OPENPILOT_PATH} |
||||
|
||||
COPY Pipfile Pipfile.lock $OPENPILOT_PATH |
||||
RUN pip install --no-cache-dir pipenv==2020.8.13 && \ |
||||
pipenv install --system --deploy --dev --clear && \ |
||||
pip uninstall -y pipenv |
||||
|
||||
|
||||
# TODO: add to pipfile |
||||
RUN pip install sphinx-rtd-theme==1.0.0 sphinx==4.2.0 myst-parser==0.15.2 |
||||
|
||||
COPY SConstruct ${OPENPILOT_PATH} |
||||
|
||||
COPY ./pyextra ${OPENPILOT_PATH}/pyextra |
||||
COPY ./third_party ${OPENPILOT_PATH}/third_party |
||||
COPY ./site_scons ${OPENPILOT_PATH}/site_scons |
||||
COPY ./laika ${OPENPILOT_PATH}/laika |
||||
COPY ./laika_repo ${OPENPILOT_PATH}/laika_repo |
||||
COPY ./rednose ${OPENPILOT_PATH}/rednose |
||||
COPY ./rednose_repo ${OPENPILOT_PATH}/rednose_repo |
||||
COPY ./tools ${OPENPILOT_PATH}/tools |
||||
COPY ./release ${OPENPILOT_PATH}/release |
||||
COPY ./common ${OPENPILOT_PATH}/common |
||||
COPY ./opendbc ${OPENPILOT_PATH}/opendbc |
||||
COPY ./cereal ${OPENPILOT_PATH}/cereal |
||||
COPY ./panda ${OPENPILOT_PATH}/panda |
||||
COPY ./selfdrive ${OPENPILOT_PATH}/selfdrive |
||||
|
||||
RUN scons -j$(nproc) |
||||
|
||||
COPY ./docs ${OPENPILOT_PATH}/docs |
||||
RUN git init . |
||||
WORKDIR ${OPENPILOT_PATH}/docs |
||||
RUN make html |
||||
|
||||
FROM nginx:1.21 |
||||
COPY --from=0 /home/batman/openpilot/build/docs/html /usr/share/nginx/html |
||||
COPY ./docs/docker/nginx.conf /etc/nginx/conf.d/default.conf |
@ -0,0 +1,15 @@ |
||||
server { |
||||
listen 80; |
||||
listen [::]:80; |
||||
server_name localhost; |
||||
|
||||
gzip on; |
||||
gzip_types text/html text/plain text/css text/xml text/javascript application/javascript application/x-javascript; |
||||
gzip_min_length 1024; |
||||
gzip_vary on; |
||||
|
||||
root /usr/share/nginx/html; |
||||
location / { |
||||
try_files $uri $uri/ /index.html; |
||||
} |
||||
} |
@ -0,0 +1,35 @@ |
||||
# openpilot Documentation |
||||
|
||||
```{include} README.md |
||||
``` |
||||
|
||||
```{toctree} |
||||
:caption: 'General' |
||||
:maxdepth: 4 |
||||
|
||||
CARS.md |
||||
CONTRIBUTING.md |
||||
INTEGRATION.md |
||||
LIMITATIONS.md |
||||
SAFETY.md |
||||
``` |
||||
|
||||
```{toctree} |
||||
:caption: 'Overview' |
||||
:maxdepth: 2 |
||||
|
||||
overview.rst |
||||
``` |
||||
|
||||
## API Documentation |
||||
|
||||
- {ref}`genindex` |
||||
- {ref}`modindex` |
||||
- {ref}`search` |
||||
|
||||
```{toctree} |
||||
:caption: 'Modules' |
||||
:maxdepth: 2 |
||||
|
||||
modules.rst |
||||
``` |
@ -0,0 +1,79 @@ |
||||
openpilot |
||||
========= |
||||
|
||||
.. toctree:: |
||||
:maxdepth: 4 |
||||
|
||||
Debugging <selfdrive/debug/README.md> |
||||
selfdrive/loggerd/README.md |
||||
Driver Monitoring <selfdrive/monitoring/README.md> |
||||
Process Replay <selfdrive/test/process_replay/README.md> |
||||
|
||||
cereal |
||||
========= |
||||
|
||||
.. toctree:: |
||||
:maxdepth: 4 |
||||
|
||||
cereal/README.md |
||||
cereal/messaging/msgq.md |
||||
|
||||
laika |
||||
========= |
||||
|
||||
.. toctree:: |
||||
:maxdepth: 4 |
||||
|
||||
laika_repo/README.md |
||||
|
||||
models |
||||
========= |
||||
|
||||
.. toctree:: |
||||
:maxdepth: 4 |
||||
|
||||
models/README.md |
||||
|
||||
opendbc |
||||
========= |
||||
|
||||
.. toctree:: |
||||
:maxdepth: 4 |
||||
|
||||
opendbc/README.md |
||||
|
||||
panda |
||||
========= |
||||
|
||||
.. toctree:: |
||||
:maxdepth: 4 |
||||
|
||||
panda/README.md |
||||
panda/UPDATING.md |
||||
panda/board/README.md |
||||
panda/drivers/linux/README.md |
||||
panda/drivers/windows/README.md |
||||
|
||||
|
||||
rednose |
||||
========= |
||||
.. toctree:: |
||||
:maxdepth: 4 |
||||
|
||||
rednose_repo/README.md |
||||
|
||||
|
||||
tools |
||||
========= |
||||
.. toctree:: |
||||
:maxdepth: 4 |
||||
|
||||
tools/CTF.md |
||||
tools/joystick/README.md |
||||
tools/lib/README.md |
||||
tools/plotjuggler/README.md |
||||
tools/replay/README.md |
||||
tools/serial/README.md |
||||
Simulator <tools/sim/README.md> |
||||
tools/ssh/README.md |
||||
Webcam <tools/webcam/README.md> |
Loading…
Reference in new issue