File tree Expand file tree Collapse file tree 4 files changed +35
-3
lines changed Expand file tree Collapse file tree 4 files changed +35
-3
lines changed Original file line number Diff line number Diff line change
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 )``
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change @@ -11,10 +11,11 @@ Table of Contents
11
11
self
12
12
13
13
.. toctree ::
14
- :caption: API Reference
14
+ :caption: Code Documentation
15
15
:maxdepth: 3
16
16
17
17
api
18
+ defaults
18
19
19
20
.. toctree ::
20
21
:caption: Examples
Original file line number Diff line number Diff line change 1
- Simple test
2
- ------------
1
+ Installation Verification
2
+ -------------------------
3
3
4
4
Ensure your device works with this simple test.
5
5
6
6
.. literalinclude :: ../Examples/installation_verification.py
7
7
:caption: Examples/installation_verification.py
8
8
:linenos:
9
+
You can’t perform that action at this time.
0 commit comments