Skip to content

Commit 1a6877a

Browse files
committed
Added defaults.rst
1 parent c40b3a5 commit 1a6877a

File tree

4 files changed

+35
-3
lines changed

4 files changed

+35
-3
lines changed

docs/defaults.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
XRPLib.defaults
2+
---------------
3+
4+
In addition to you being able to construct any of the classes in XRPLib by
5+
themselves, you are also able to import all of the default objects needed for
6+
normal robot operations, using just one line.
7+
8+
By running ``from XRPLib.defaults import *``, you import all of the
9+
pre-constructed objects, as specified and named below:
10+
11+
.. literalinclude:: ../XRPLib/defaults.py
12+
:caption: ../XRPLib/defaults.py
13+
:linenos:
14+
15+
We use this import in most of the curriculum and example programs,
16+
which is why you will often see the DifferentialDrive class refered to as
17+
just "drivetrain".
18+
19+
Here's an example of that from ``drive_examples.py``:
20+
21+
>>> from XRPLib.defaults import *
22+
>>> # Follow the perimeter of a square with variable sidelength
23+
>>> def square(sidelength):
24+
>>> for sides in range(4):
25+
>>> drivetrain.straight(sidelength, 80)
26+
>>> drivetrain.turn(90)``

docs/defaults.rst.license

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
SPDX-FileCopyrightText: 2023 Kevin Siegall, written for OpenSTEM @ WPI
2+
SPDX-FileCopyrightText: Copyright (c) 2023 Open STEM Authors for WPI
3+
4+
SPDX-License-Identifier: MIT

docs/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ Table of Contents
1111
self
1212

1313
.. toctree::
14-
:caption: API Reference
14+
:caption: Code Documentation
1515
:maxdepth: 3
1616

1717
api
18+
defaults
1819

1920
.. toctree::
2021
:caption: Examples

docs/installation_check.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
Simple test
2-
------------
1+
Installation Verification
2+
-------------------------
33

44
Ensure your device works with this simple test.
55

66
.. literalinclude:: ../Examples/installation_verification.py
77
:caption: Examples/installation_verification.py
88
:linenos:
9+

0 commit comments

Comments
 (0)