Update documentation
This commit is contained in:
parent
527965ac0f
commit
ccd46ee8a7
20 changed files with 623 additions and 543 deletions
23
_sources/lib/Display.rst.txt
Normal file
23
_sources/lib/Display.rst.txt
Normal file
|
@ -0,0 +1,23 @@
|
|||
.. _lib_display:
|
||||
|
||||
Display
|
||||
*******
|
||||
|
||||
Class Documentation
|
||||
====================
|
||||
|
||||
.. autoclass:: compLib.Display.Display
|
||||
:members:
|
||||
|
||||
Examples
|
||||
=========
|
||||
|
||||
Write a line to the display
|
||||
---------------------------
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import time
|
||||
from compLib.Display import Display
|
||||
|
||||
Display.write(1, "Hello World!")
|
10
_sources/lib/Encoder.rst.txt
Normal file
10
_sources/lib/Encoder.rst.txt
Normal file
|
@ -0,0 +1,10 @@
|
|||
.. _lib_encoder:
|
||||
|
||||
Encoder
|
||||
*******
|
||||
|
||||
Class Documentation
|
||||
====================
|
||||
|
||||
.. autoclass:: compLib.Encoder.Encoder
|
||||
:members:
|
|
@ -16,7 +16,5 @@ Testing analog sensors
|
|||
|
||||
from compLib import IRSensor
|
||||
|
||||
ir = IRSensor.IRSensor()
|
||||
|
||||
while True:
|
||||
print ("left: {} middle: {} right: {}".format(ir.bottom_left_analog(), ir.bottom_middle_analog(), ir.bottom_right_analog()))
|
||||
print ("left: {} middle: {} right: {}".format(IRSensor.read(1), IRSensor.read(3), IRSensor.read(5)))
|
|
@ -19,5 +19,5 @@ Driving straight (maybe)
|
|||
|
||||
from compLib.Motor import Motor
|
||||
|
||||
for port in range(0, 4):
|
||||
Motor.power(port, 50)
|
||||
Motor.power(1, 50)
|
||||
Motor.power(2, 50)
|
151
genindex.html
151
genindex.html
|
@ -84,10 +84,9 @@
|
|||
<li class="toctree-l1"><a class="reference internal" href="other/usage.html">Usage</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Api.html">Api</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Aruco.html">Aruco</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Battery.html">Battery</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Buzzer.html">Buzzer</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Display.html">Display</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Encoder.html">Encoder</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/IRSensor.html">Infrared Sensor</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/IRWrapper.html">Infrared Wrapper</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Linefollower.html">Linefollower Examples</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Logging.html">Logging</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Motor.html">Motor</a></li>
|
||||
|
@ -160,82 +159,30 @@
|
|||
<h1 id="index">Index</h1>
|
||||
|
||||
<div class="genindex-jumpbox">
|
||||
<a href="#_"><strong>_</strong></a>
|
||||
| <a href="#A"><strong>A</strong></a>
|
||||
| <a href="#B"><strong>B</strong></a>
|
||||
| <a href="#C"><strong>C</strong></a>
|
||||
| <a href="#D"><strong>D</strong></a>
|
||||
<a href="#C"><strong>C</strong></a>
|
||||
| <a href="#E"><strong>E</strong></a>
|
||||
| <a href="#G"><strong>G</strong></a>
|
||||
| <a href="#I"><strong>I</strong></a>
|
||||
| <a href="#L"><strong>L</strong></a>
|
||||
| <a href="#M"><strong>M</strong></a>
|
||||
| <a href="#P"><strong>P</strong></a>
|
||||
| <a href="#R"><strong>R</strong></a>
|
||||
| <a href="#S"><strong>S</strong></a>
|
||||
| <a href="#T"><strong>T</strong></a>
|
||||
|
||||
</div>
|
||||
<h2 id="_">_</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="lib/Vision.html#compLib.Vision.__Streaming">__Streaming (class in compLib.Vision)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="A">A</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="lib/IRWrapper.html#compLib.IRWrapper.IRWrapper.adjust_for_calibration">adjust_for_calibration() (compLib.IRWrapper.IRWrapper static method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="lib/Motor.html#compLib.Motor.Motor.all_off">all_off() (compLib.Motor.Motor static method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="B">B</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="lib/Battery.html#compLib.Battery.Battery">Battery (class in compLib.Battery)</a>
|
||||
</li>
|
||||
<li><a href="lib/IRSensor.html#compLib.IRSensor.IRSensor.bottom_left">bottom_left() (compLib.IRSensor.IRSensor static method)</a>
|
||||
</li>
|
||||
<li><a href="lib/IRSensor.html#compLib.IRSensor.IRSensor.bottom_left_analog">bottom_left_analog() (compLib.IRSensor.IRSensor static method)</a>
|
||||
</li>
|
||||
<li><a href="lib/IRWrapper.html#compLib.IRWrapper.IRWrapper.bottom_left_calibrated">bottom_left_calibrated() (compLib.IRWrapper.IRWrapper static method)</a>
|
||||
</li>
|
||||
<li><a href="lib/IRSensor.html#compLib.IRSensor.IRSensor.bottom_middle">bottom_middle() (compLib.IRSensor.IRSensor static method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="lib/IRSensor.html#compLib.IRSensor.IRSensor.bottom_middle_analog">bottom_middle_analog() (compLib.IRSensor.IRSensor static method)</a>
|
||||
</li>
|
||||
<li><a href="lib/IRWrapper.html#compLib.IRWrapper.IRWrapper.bottom_middle_calibrated">bottom_middle_calibrated() (compLib.IRWrapper.IRWrapper static method)</a>
|
||||
</li>
|
||||
<li><a href="lib/IRSensor.html#compLib.IRSensor.IRSensor.bottom_right">bottom_right() (compLib.IRSensor.IRSensor static method)</a>
|
||||
</li>
|
||||
<li><a href="lib/IRSensor.html#compLib.IRSensor.IRSensor.bottom_right_analog">bottom_right_analog() (compLib.IRSensor.IRSensor static method)</a>
|
||||
</li>
|
||||
<li><a href="lib/IRWrapper.html#compLib.IRWrapper.IRWrapper.bottom_right_calibrated">bottom_right_calibrated() (compLib.IRWrapper.IRWrapper static method)</a>
|
||||
</li>
|
||||
<li><a href="lib/Buzzer.html#compLib.Buzzer.Buzzer">Buzzer (class in compLib.Buzzer)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="C">C</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="lib/IRWrapper.html#compLib.IRWrapper.IRWrapper.calibrate">calibrate() (compLib.IRWrapper.IRWrapper static method)</a>
|
||||
<li><a href="lib/Encoder.html#compLib.Encoder.Encoder.clear">clear() (compLib.Encoder.Encoder static method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="lib/Encoder.html#compLib.Encoder.Encoder.clear_all">clear_all() (compLib.Encoder.Encoder static method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="D">D</h2>
|
||||
<h2 id="E">E</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="lib/Api.html#compLib.Api.DoubleElim">DoubleElim (class in compLib.Api)</a>
|
||||
<li><a href="lib/Encoder.html#compLib.Encoder.Encoder">Encoder (class in compLib.Encoder)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
@ -243,35 +190,7 @@
|
|||
<h2 id="G">G</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="lib/Vision.html#compLib.Vision.__Streaming.get_frame">get_frame() (compLib.Vision.__Streaming method)</a>
|
||||
</li>
|
||||
<li><a href="lib/Api.html#compLib.Api.DoubleElim.get_goal">get_goal() (compLib.Api.DoubleElim static method)</a>
|
||||
</li>
|
||||
<li><a href="lib/Api.html#compLib.Api.DoubleElim.get_items">get_items() (compLib.Api.DoubleElim static method)</a>
|
||||
</li>
|
||||
<li><a href="lib/Logging.html#compLib.LogstashLogging.Logging.get_logger">get_logger() (compLib.LogstashLogging.Logging static method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="lib/Api.html#compLib.Api.DoubleElim.get_opponent">get_opponent() (compLib.Api.DoubleElim static method)</a>
|
||||
</li>
|
||||
<li><a href="lib/Api.html#compLib.Api.Seeding.get_park">get_park() (compLib.Api.Seeding static method)</a>
|
||||
</li>
|
||||
<li><a href="lib/Api.html#compLib.Api.DoubleElim.get_position">get_position() (compLib.Api.DoubleElim static method)</a>
|
||||
</li>
|
||||
<li><a href="lib/Api.html#compLib.Api.DoubleElim.get_scores">get_scores() (compLib.Api.DoubleElim static method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="I">I</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="lib/IRSensor.html#compLib.IRSensor.IRSensor">IRSensor (class in compLib.IRSensor)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="lib/IRWrapper.html#compLib.IRWrapper.IRWrapper">IRWrapper (class in compLib.IRWrapper)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
@ -284,62 +203,22 @@
|
|||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="M">M</h2>
|
||||
<h2 id="R">R</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="lib/Motor.html#compLib.Motor.Motor">Motor (class in compLib.Motor)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="P">P</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="lib/Api.html#compLib.Api.Seeding.pay_park">pay_park() (compLib.Api.Seeding static method)</a>
|
||||
</li>
|
||||
<li><a href="lib/Battery.html#compLib.Battery.Battery.percent">percent() (compLib.Battery.Battery static method)</a>
|
||||
<li><a href="lib/Encoder.html#compLib.Encoder.Encoder.read">read() (compLib.Encoder.Encoder static method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="lib/Api.html#compLib.Api.Position">Position (class in compLib.Api)</a>
|
||||
</li>
|
||||
<li><a href="lib/Motor.html#compLib.Motor.Motor.power">power() (compLib.Motor.Motor static method)</a>
|
||||
</li>
|
||||
<li><a href="lib/Vision.html#compLib.Vision.__Streaming.publish_frame">publish_frame() (compLib.Vision.__Streaming method)</a>
|
||||
<li><a href="lib/Encoder.html#compLib.Encoder.Encoder.read_raw">read_raw() (compLib.Encoder.Encoder static method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="S">S</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="lib/Api.html#compLib.Api.Seeding">Seeding (class in compLib.Api)</a>
|
||||
</li>
|
||||
<li><a href="lib/Servo.html#compLib.Servo.Servo">Servo (class in compLib.Servo)</a>
|
||||
</li>
|
||||
<li><a href="lib/Buzzer.html#compLib.Buzzer.Buzzer.set">set() (compLib.Buzzer.Buzzer static method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="lib/Logging.html#compLib.LogstashLogging.Logging.set_debug">set_debug() (compLib.LogstashLogging.Logging static method)</a>
|
||||
</li>
|
||||
<li><a href="lib/Servo.html#compLib.Servo.Servo.set_position">set_position() (compLib.Servo.Servo static method)</a>
|
||||
</li>
|
||||
<li><a href="lib/Servo.html#compLib.Servo.Servo.setup_position">setup_position() (compLib.Servo.Servo static method)</a>
|
||||
</li>
|
||||
<li><a href="lib/Api.html#compLib.Api.Seeding.simon_says">simon_says() (compLib.Api.Seeding static method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="T">T</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="lib/IRSensor.html#compLib.IRSensor.IRSensor.top_left_percent">top_left_percent() (compLib.IRSensor.IRSensor static method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="lib/IRSensor.html#compLib.IRSensor.IRSensor.top_right_percent">top_right_percent() (compLib.IRSensor.IRSensor static method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
|
28
index.html
28
index.html
|
@ -85,10 +85,9 @@
|
|||
<li class="toctree-l1"><a class="reference internal" href="other/usage.html">Usage</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Api.html">Api</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Aruco.html">Aruco</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Battery.html">Battery</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Buzzer.html">Buzzer</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Display.html">Display</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Encoder.html">Encoder</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/IRSensor.html">Infrared Sensor</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/IRWrapper.html">Infrared Wrapper</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Linefollower.html">Linefollower Examples</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Logging.html">Logging</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Motor.html">Motor</a></li>
|
||||
|
@ -188,20 +187,16 @@
|
|||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Battery.html">Battery</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="lib/Battery.html#class-documentation">Class Documentation</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="lib/Battery.html#examples">Examples</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="lib/Battery.html#printing-percentage">Printing percentage</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Display.html">Display</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="lib/Display.html#class-documentation">Class Documentation</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="lib/Display.html#examples">Examples</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="lib/Display.html#write-a-line-to-the-display">Write a line to the display</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Buzzer.html">Buzzer</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="lib/Buzzer.html#class-documentation">Class Documentation</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="lib/Buzzer.html#examples">Examples</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="lib/Buzzer.html#turning-buzzer-on-and-off">Turning buzzer on and off</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Encoder.html">Encoder</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="lib/Encoder.html#class-documentation">Class Documentation</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/IRSensor.html">Infrared Sensor</a><ul>
|
||||
|
@ -211,13 +206,6 @@
|
|||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/IRWrapper.html">Infrared Wrapper</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="lib/IRWrapper.html#examples">Examples</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="lib/IRWrapper.html#calibrating-analog-sensors">Calibrating analog sensors</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Linefollower.html">Linefollower Examples</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="lib/Linefollower.html#simple-linefollower">Simple Linefollower</a></li>
|
||||
</ul>
|
||||
|
|
135
lib/Api.html
135
lib/Api.html
|
@ -96,10 +96,9 @@
|
|||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Aruco.html">Aruco</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Battery.html">Battery</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Buzzer.html">Buzzer</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Display.html">Display</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Encoder.html">Encoder</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="IRSensor.html">Infrared Sensor</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="IRWrapper.html">Infrared Wrapper</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Linefollower.html">Linefollower Examples</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Logging.html">Logging</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
|
||||
|
@ -174,142 +173,12 @@
|
|||
<span id="lib-api"></span><h1>Api<a class="headerlink" href="#api" title="Permalink to this headline">¶</a></h1>
|
||||
<div class="section" id="seeding">
|
||||
<h2>Seeding<a class="headerlink" href="#seeding" title="Permalink to this headline">¶</a></h2>
|
||||
<dl class="py class">
|
||||
<dt id="compLib.Api.Seeding">
|
||||
<em class="property">class </em><code class="sig-prename descclassname">compLib.Api.</code><code class="sig-name descname">Seeding</code><a class="headerlink" href="#compLib.Api.Seeding" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Class used for communicating with seeding api</p>
|
||||
<dl class="py method">
|
||||
<dt id="compLib.Api.Seeding.get_park">
|
||||
<em class="property">static </em><code class="sig-name descname">get_park</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → Tuple<span class="p">[</span>Dict<span class="p">, </span>int<span class="p">]</span><a class="headerlink" href="#compLib.Api.Seeding.get_park" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get a parkingsapce from the api.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Returns</dt>
|
||||
<dd class="field-odd"><p>Json Object and status code as returned by the api.</p>
|
||||
</dd>
|
||||
<dt class="field-even">Return type</dt>
|
||||
<dd class="field-even"><p>Tuple[Dict, int]</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="compLib.Api.Seeding.pay_park">
|
||||
<em class="property">static </em><code class="sig-name descname">pay_park</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → int<a class="headerlink" href="#compLib.Api.Seeding.pay_park" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Pay for parking.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Returns</dt>
|
||||
<dd class="field-odd"><p>Status code as returned by the api.</p>
|
||||
</dd>
|
||||
<dt class="field-even">Return type</dt>
|
||||
<dd class="field-even"><p>int</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="compLib.Api.Seeding.simon_says">
|
||||
<em class="property">static </em><code class="sig-name descname">simon_says</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → Tuple<span class="p">[</span>Dict<span class="p">, </span>int<span class="p">]</span><a class="headerlink" href="#compLib.Api.Seeding.simon_says" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get next simon says zone from the api.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Returns</dt>
|
||||
<dd class="field-odd"><p>Json Object and status code as returned by the api.</p>
|
||||
</dd>
|
||||
<dt class="field-even">Return type</dt>
|
||||
<dd class="field-even"><p>Tuple[Dict, int]</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
<div class="section" id="double-elimination">
|
||||
<h2>Double Elimination<a class="headerlink" href="#double-elimination" title="Permalink to this headline">¶</a></h2>
|
||||
<dl class="py class">
|
||||
<dt id="compLib.Api.DoubleElim">
|
||||
<em class="property">class </em><code class="sig-prename descclassname">compLib.Api.</code><code class="sig-name descname">DoubleElim</code><a class="headerlink" href="#compLib.Api.DoubleElim" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Class used for communicating with double elimination api</p>
|
||||
<dl class="py method">
|
||||
<dt id="compLib.Api.DoubleElim.get_goal">
|
||||
<em class="property">static </em><code class="sig-name descname">get_goal</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → Tuple<span class="p">[</span><a class="reference internal" href="#compLib.Api.Position" title="compLib.Api.Position">compLib.Api.Position</a><span class="p">, </span>int<span class="p">]</span><a class="headerlink" href="#compLib.Api.DoubleElim.get_goal" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get position of the goal</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Returns</dt>
|
||||
<dd class="field-odd"><p>A Position object with x and y coordinates of the goal, rotation is always -1</p>
|
||||
</dd>
|
||||
<dt class="field-even">Return type</dt>
|
||||
<dd class="field-even"><p>Tuple[<a class="reference internal" href="#compLib.Api.Position" title="compLib.Api.Position">Position</a>, int]</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="compLib.Api.DoubleElim.get_items">
|
||||
<em class="property">static </em><code class="sig-name descname">get_items</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → Tuple<span class="p">[</span>List<span class="p">[</span>Dict<span class="p">]</span><span class="p">, </span>int<span class="p">]</span><a class="headerlink" href="#compLib.Api.DoubleElim.get_items" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get a list with all current items</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Returns</dt>
|
||||
<dd class="field-odd"><p>A list will all items currently on the game field. Items are dictionaries that look like: {“id”: 0, “x”: 0, “y”: 0}</p>
|
||||
</dd>
|
||||
<dt class="field-even">Return type</dt>
|
||||
<dd class="field-even"><p>Tuple[List[Dict], int]</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="compLib.Api.DoubleElim.get_opponent">
|
||||
<em class="property">static </em><code class="sig-name descname">get_opponent</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → Tuple<span class="p">[</span><a class="reference internal" href="#compLib.Api.Position" title="compLib.Api.Position">compLib.Api.Position</a><span class="p">, </span>int<span class="p">]</span><a class="headerlink" href="#compLib.Api.DoubleElim.get_opponent" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get position of the opponents robot</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Returns</dt>
|
||||
<dd class="field-odd"><p>A Position object with opponents robot position</p>
|
||||
</dd>
|
||||
<dt class="field-even">Return type</dt>
|
||||
<dd class="field-even"><p>Tuple[<a class="reference internal" href="#compLib.Api.Position" title="compLib.Api.Position">Position</a>, int]</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="compLib.Api.DoubleElim.get_position">
|
||||
<em class="property">static </em><code class="sig-name descname">get_position</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → Tuple<span class="p">[</span><a class="reference internal" href="#compLib.Api.Position" title="compLib.Api.Position">compLib.Api.Position</a><span class="p">, </span>int<span class="p">]</span><a class="headerlink" href="#compLib.Api.DoubleElim.get_position" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get position of the robot</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Returns</dt>
|
||||
<dd class="field-odd"><p>A Position object with robot position</p>
|
||||
</dd>
|
||||
<dt class="field-even">Return type</dt>
|
||||
<dd class="field-even"><p>Tuple[<a class="reference internal" href="#compLib.Api.Position" title="compLib.Api.Position">Position</a>, int]</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="compLib.Api.DoubleElim.get_scores">
|
||||
<em class="property">static </em><code class="sig-name descname">get_scores</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → Tuple<span class="p">[</span>Dict<span class="p">, </span>int<span class="p">]</span><a class="headerlink" href="#compLib.Api.DoubleElim.get_scores" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get the current scores</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Returns</dt>
|
||||
<dd class="field-odd"><p>A dictionary with all scores included like: {“self”:2,”opponent”:0}</p>
|
||||
</dd>
|
||||
<dt class="field-even">Return type</dt>
|
||||
<dd class="field-even"><p>Tuple[Dict, int]</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
<div class="section" id="position">
|
||||
<h2>Position<a class="headerlink" href="#position" title="Permalink to this headline">¶</a></h2>
|
||||
<dl class="py class">
|
||||
<dt id="compLib.Api.Position">
|
||||
<em class="property">class </em><code class="sig-prename descclassname">compLib.Api.</code><code class="sig-name descname">Position</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">x</span></em>, <em class="sig-param"><span class="n">y</span></em>, <em class="sig-param"><span class="n">degrees</span></em><span class="sig-paren">)</span><a class="headerlink" href="#compLib.Api.Position" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Datastructure for holding a position</p>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
<div class="section" id="examples">
|
||||
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
<link rel="index" title="Index" href="../genindex.html" />
|
||||
<link rel="search" title="Search" href="../search.html" />
|
||||
<link rel="next" title="Battery" href="Battery.html" />
|
||||
<link rel="next" title="Display" href="Display.html" />
|
||||
<link rel="prev" title="Api" href="Api.html" />
|
||||
</head>
|
||||
|
||||
|
@ -92,10 +92,9 @@
|
|||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Battery.html">Battery</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Buzzer.html">Buzzer</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Display.html">Display</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Encoder.html">Encoder</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="IRSensor.html">Infrared Sensor</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="IRWrapper.html">Infrared Wrapper</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Linefollower.html">Linefollower Examples</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Logging.html">Logging</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
|
||||
|
@ -254,7 +253,7 @@ This way it is quite simple to act on the position of the tag.</p>
|
|||
|
||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
||||
|
||||
<a href="Battery.html" class="btn btn-neutral float-right" title="Battery" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
|
||||
<a href="Display.html" class="btn btn-neutral float-right" title="Display" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
|
||||
|
||||
|
||||
<a href="Api.html" class="btn btn-neutral float-left" title="Api" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
|
||||
|
|
244
lib/Display.html
Normal file
244
lib/Display.html
Normal file
|
@ -0,0 +1,244 @@
|
|||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html class="writer-html5" lang="en" >
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Display — CompLib 0.0.2 documentation</title>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="../_static/js/html5shiv.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
|
||||
<script src="../_static/jquery.js"></script>
|
||||
<script src="../_static/underscore.js"></script>
|
||||
<script src="../_static/doctools.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<link rel="index" title="Index" href="../genindex.html" />
|
||||
<link rel="search" title="Search" href="../search.html" />
|
||||
<link rel="next" title="Encoder" href="Encoder.html" />
|
||||
<link rel="prev" title="Aruco" href="Aruco.html" />
|
||||
</head>
|
||||
|
||||
<body class="wy-body-for-nav">
|
||||
|
||||
|
||||
<div class="wy-grid-for-nav">
|
||||
|
||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
||||
<div class="wy-side-scroll">
|
||||
<div class="wy-side-nav-search" >
|
||||
|
||||
|
||||
|
||||
<a href="../index.html" class="icon icon-home" alt="Documentation Home"> CompLib
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="search">
|
||||
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
|
||||
<input type="text" name="q" placeholder="Search docs" />
|
||||
<input type="hidden" name="check_keywords" value="yes" />
|
||||
<input type="hidden" name="area" value="default" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="current">
|
||||
<li class="toctree-l1"><a class="reference internal" href="../index.html">Robo4you Competition Library</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../other/usage.html">Usage</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Api.html">Api</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Aruco.html">Aruco</a></li>
|
||||
<li class="toctree-l1 current"><a class="current reference internal" href="#">Display</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#class-documentation">Class Documentation</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#examples">Examples</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#write-a-line-to-the-display">Write a line to the display</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Encoder.html">Encoder</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="IRSensor.html">Infrared Sensor</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Linefollower.html">Linefollower Examples</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Logging.html">Logging</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Servo.html">Servo</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Vision.html">Vision</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
||||
|
||||
|
||||
<nav class="wy-nav-top" aria-label="top navigation">
|
||||
|
||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||||
<a href="../index.html">CompLib</a>
|
||||
|
||||
</nav>
|
||||
|
||||
|
||||
<div class="wy-nav-content">
|
||||
|
||||
<div class="rst-content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||||
|
||||
<ul class="wy-breadcrumbs">
|
||||
|
||||
<li><a href="../index.html" class="icon icon-home"></a> »</li>
|
||||
|
||||
<li>Display</li>
|
||||
|
||||
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
|
||||
<a href="../_sources/lib/Display.rst.txt" rel="nofollow"> View page source</a>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<hr/>
|
||||
</div>
|
||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
||||
<div itemprop="articleBody">
|
||||
|
||||
<div class="section" id="display">
|
||||
<span id="lib-display"></span><h1>Display<a class="headerlink" href="#display" title="Permalink to this headline">¶</a></h1>
|
||||
<div class="section" id="class-documentation">
|
||||
<h2>Class Documentation<a class="headerlink" href="#class-documentation" title="Permalink to this headline">¶</a></h2>
|
||||
</div>
|
||||
<div class="section" id="examples">
|
||||
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
|
||||
<div class="section" id="write-a-line-to-the-display">
|
||||
<h3>Write a line to the display<a class="headerlink" href="#write-a-line-to-the-display" title="Permalink to this headline">¶</a></h3>
|
||||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">time</span>
|
||||
<span class="kn">from</span> <span class="nn">compLib.Display</span> <span class="kn">import</span> <span class="n">Display</span>
|
||||
|
||||
<span class="n">Display</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="s2">"Hello World!"</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
|
||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
||||
|
||||
<a href="Encoder.html" class="btn btn-neutral float-right" title="Encoder" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
|
||||
|
||||
|
||||
<a href="Aruco.html" class="btn btn-neutral float-left" title="Aruco" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
|
||||
© Copyright 2021, robo4you
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
|
||||
|
||||
<a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a>
|
||||
|
||||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
||||
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
SphinxRtdTheme.Navigation.enable(true);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
288
lib/Encoder.html
Normal file
288
lib/Encoder.html
Normal file
|
@ -0,0 +1,288 @@
|
|||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html class="writer-html5" lang="en" >
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Encoder — CompLib 0.0.2 documentation</title>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="../_static/js/html5shiv.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
|
||||
<script src="../_static/jquery.js"></script>
|
||||
<script src="../_static/underscore.js"></script>
|
||||
<script src="../_static/doctools.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<link rel="index" title="Index" href="../genindex.html" />
|
||||
<link rel="search" title="Search" href="../search.html" />
|
||||
<link rel="next" title="Infrared Sensor" href="IRSensor.html" />
|
||||
<link rel="prev" title="Display" href="Display.html" />
|
||||
</head>
|
||||
|
||||
<body class="wy-body-for-nav">
|
||||
|
||||
|
||||
<div class="wy-grid-for-nav">
|
||||
|
||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
||||
<div class="wy-side-scroll">
|
||||
<div class="wy-side-nav-search" >
|
||||
|
||||
|
||||
|
||||
<a href="../index.html" class="icon icon-home" alt="Documentation Home"> CompLib
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="search">
|
||||
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
|
||||
<input type="text" name="q" placeholder="Search docs" />
|
||||
<input type="hidden" name="check_keywords" value="yes" />
|
||||
<input type="hidden" name="area" value="default" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="current">
|
||||
<li class="toctree-l1"><a class="reference internal" href="../index.html">Robo4you Competition Library</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../other/usage.html">Usage</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Api.html">Api</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Aruco.html">Aruco</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Display.html">Display</a></li>
|
||||
<li class="toctree-l1 current"><a class="current reference internal" href="#">Encoder</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#class-documentation">Class Documentation</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="IRSensor.html">Infrared Sensor</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Linefollower.html">Linefollower Examples</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Logging.html">Logging</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Servo.html">Servo</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Vision.html">Vision</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
||||
|
||||
|
||||
<nav class="wy-nav-top" aria-label="top navigation">
|
||||
|
||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||||
<a href="../index.html">CompLib</a>
|
||||
|
||||
</nav>
|
||||
|
||||
|
||||
<div class="wy-nav-content">
|
||||
|
||||
<div class="rst-content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||||
|
||||
<ul class="wy-breadcrumbs">
|
||||
|
||||
<li><a href="../index.html" class="icon icon-home"></a> »</li>
|
||||
|
||||
<li>Encoder</li>
|
||||
|
||||
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
|
||||
<a href="../_sources/lib/Encoder.rst.txt" rel="nofollow"> View page source</a>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<hr/>
|
||||
</div>
|
||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
||||
<div itemprop="articleBody">
|
||||
|
||||
<div class="section" id="encoder">
|
||||
<span id="lib-encoder"></span><h1>Encoder<a class="headerlink" href="#encoder" title="Permalink to this headline">¶</a></h1>
|
||||
<div class="section" id="class-documentation">
|
||||
<h2>Class Documentation<a class="headerlink" href="#class-documentation" title="Permalink to this headline">¶</a></h2>
|
||||
<dl class="py class">
|
||||
<dt id="compLib.Encoder.Encoder">
|
||||
<em class="property">class </em><code class="sig-prename descclassname">compLib.Encoder.</code><code class="sig-name descname">Encoder</code><a class="headerlink" href="#compLib.Encoder.Encoder" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Class used to read the encoders</p>
|
||||
<dl class="py method">
|
||||
<dt id="compLib.Encoder.Encoder.clear">
|
||||
<em class="property">static </em><code class="sig-name descname">clear</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">port</span><span class="p">:</span> <span class="n">int</span></em><span class="sig-paren">)</span><a class="headerlink" href="#compLib.Encoder.Encoder.clear" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Reset encoder position to 0</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><p><strong>port</strong> – Port, which the motor is connected to. 1-4 allowed</p>
|
||||
</dd>
|
||||
<dt class="field-even">Raises</dt>
|
||||
<dd class="field-even"><p>IndexError</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="compLib.Encoder.Encoder.clear_all">
|
||||
<em class="property">static </em><code class="sig-name descname">clear_all</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#compLib.Encoder.Encoder.clear_all" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Reset all encoder positions to 0</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="compLib.Encoder.Encoder.read">
|
||||
<em class="property">static </em><code class="sig-name descname">read</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">port</span><span class="p">:</span> <span class="n">int</span></em><span class="sig-paren">)</span> → int<a class="headerlink" href="#compLib.Encoder.Encoder.read" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Read encoder from a specified port</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><p><strong>port</strong> – Port, which the motor is connected to. 1-4 allowed</p>
|
||||
</dd>
|
||||
<dt class="field-even">Raises</dt>
|
||||
<dd class="field-even"><p>IndexError</p>
|
||||
</dd>
|
||||
<dt class="field-odd">Returns</dt>
|
||||
<dd class="field-odd"><p>Current encoder position</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="compLib.Encoder.Encoder.read_raw">
|
||||
<em class="property">static </em><code class="sig-name descname">read_raw</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">port</span><span class="p">:</span> <span class="n">int</span></em><span class="sig-paren">)</span> → int<a class="headerlink" href="#compLib.Encoder.Encoder.read_raw" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Read raw encoder from a specified port. Will not be reset to 0 at start.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><p><strong>port</strong> – Port, which the motor is connected to. 1-4 allowed</p>
|
||||
</dd>
|
||||
<dt class="field-even">Raises</dt>
|
||||
<dd class="field-even"><p>IndexError</p>
|
||||
</dd>
|
||||
<dt class="field-odd">Returns</dt>
|
||||
<dd class="field-odd"><p>Current encoder position</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
|
||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
||||
|
||||
<a href="IRSensor.html" class="btn btn-neutral float-right" title="Infrared Sensor" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
|
||||
|
||||
|
||||
<a href="Display.html" class="btn btn-neutral float-left" title="Display" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
|
||||
© Copyright 2021, robo4you
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
|
||||
|
||||
<a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a>
|
||||
|
||||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
||||
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
SphinxRtdTheme.Navigation.enable(true);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -35,8 +35,8 @@
|
|||
|
||||
<link rel="index" title="Index" href="../genindex.html" />
|
||||
<link rel="search" title="Search" href="../search.html" />
|
||||
<link rel="next" title="Infrared Wrapper" href="IRWrapper.html" />
|
||||
<link rel="prev" title="Buzzer" href="Buzzer.html" />
|
||||
<link rel="next" title="Linefollower Examples" href="Linefollower.html" />
|
||||
<link rel="prev" title="Encoder" href="Encoder.html" />
|
||||
</head>
|
||||
|
||||
<body class="wy-body-for-nav">
|
||||
|
@ -86,8 +86,8 @@
|
|||
<li class="toctree-l1"><a class="reference internal" href="../other/usage.html">Usage</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Api.html">Api</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Aruco.html">Aruco</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Battery.html">Battery</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Buzzer.html">Buzzer</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Display.html">Display</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Encoder.html">Encoder</a></li>
|
||||
<li class="toctree-l1 current"><a class="current reference internal" href="#">Infrared Sensor</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#examples">Examples</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#testing-analog-sensors">Testing analog sensors</a></li>
|
||||
|
@ -95,7 +95,6 @@
|
|||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="IRWrapper.html">Infrared Wrapper</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Linefollower.html">Linefollower Examples</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Logging.html">Logging</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
|
||||
|
@ -168,134 +167,14 @@
|
|||
|
||||
<div class="section" id="infrared-sensor">
|
||||
<span id="lib-irsensor"></span><h1>Infrared Sensor<a class="headerlink" href="#infrared-sensor" title="Permalink to this headline">¶</a></h1>
|
||||
<dl class="py class">
|
||||
<dt id="compLib.IRSensor.IRSensor">
|
||||
<em class="property">class </em><code class="sig-prename descclassname">compLib.IRSensor.</code><code class="sig-name descname">IRSensor</code><a class="headerlink" href="#compLib.IRSensor.IRSensor" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Access the different IR Sensors at top / bottom of the robot</p>
|
||||
<dl class="py method">
|
||||
<dt id="compLib.IRSensor.IRSensor.bottom_left">
|
||||
<em class="property">static </em><code class="sig-name descname">bottom_left</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → bool<a class="headerlink" href="#compLib.IRSensor.IRSensor.bottom_left" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get bottom left infrared sensor status</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Returns</dt>
|
||||
<dd class="field-odd"><p>True, if sensor detects IR signals</p>
|
||||
</dd>
|
||||
<dt class="field-even">Return type</dt>
|
||||
<dd class="field-even"><p>bool</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="compLib.IRSensor.IRSensor.bottom_left_analog">
|
||||
<em class="property">static </em><code class="sig-name descname">bottom_left_analog</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → int<a class="headerlink" href="#compLib.IRSensor.IRSensor.bottom_left_analog" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get bottom left infrared sensor value: ranges from 0 to 1023</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Returns</dt>
|
||||
<dd class="field-odd"><p>10-bit brightness value</p>
|
||||
</dd>
|
||||
<dt class="field-even">Return type</dt>
|
||||
<dd class="field-even"><p>int</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="compLib.IRSensor.IRSensor.bottom_middle">
|
||||
<em class="property">static </em><code class="sig-name descname">bottom_middle</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → bool<a class="headerlink" href="#compLib.IRSensor.IRSensor.bottom_middle" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get bottom middle infrared sensor status</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Returns</dt>
|
||||
<dd class="field-odd"><p>True, if sensor detects IR signals</p>
|
||||
</dd>
|
||||
<dt class="field-even">Return type</dt>
|
||||
<dd class="field-even"><p>bool</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="compLib.IRSensor.IRSensor.bottom_middle_analog">
|
||||
<em class="property">static </em><code class="sig-name descname">bottom_middle_analog</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → int<a class="headerlink" href="#compLib.IRSensor.IRSensor.bottom_middle_analog" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get bottom middle infrared sensor value: ranges from 0 to 1023</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Returns</dt>
|
||||
<dd class="field-odd"><p>10-bit brightness value</p>
|
||||
</dd>
|
||||
<dt class="field-even">Return type</dt>
|
||||
<dd class="field-even"><p>int</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="compLib.IRSensor.IRSensor.bottom_right">
|
||||
<em class="property">static </em><code class="sig-name descname">bottom_right</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → bool<a class="headerlink" href="#compLib.IRSensor.IRSensor.bottom_right" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get bottom right infrared sensor status</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Returns</dt>
|
||||
<dd class="field-odd"><p>True, if sensor detects IR signals</p>
|
||||
</dd>
|
||||
<dt class="field-even">Return type</dt>
|
||||
<dd class="field-even"><p>bool</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="compLib.IRSensor.IRSensor.bottom_right_analog">
|
||||
<em class="property">static </em><code class="sig-name descname">bottom_right_analog</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → int<a class="headerlink" href="#compLib.IRSensor.IRSensor.bottom_right_analog" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get bottom right infrared sensor value: ranges from 0 to 1023</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Returns</dt>
|
||||
<dd class="field-odd"><p>10-bit brightness value</p>
|
||||
</dd>
|
||||
<dt class="field-even">Return type</dt>
|
||||
<dd class="field-even"><p>int</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="compLib.IRSensor.IRSensor.top_left_percent">
|
||||
<em class="property">static </em><code class="sig-name descname">top_left_percent</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → int<a class="headerlink" href="#compLib.IRSensor.IRSensor.top_left_percent" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get top left infrared sensor percentage</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Returns</dt>
|
||||
<dd class="field-odd"><p>Percentage between 0 and 100</p>
|
||||
</dd>
|
||||
<dt class="field-even">Return type</dt>
|
||||
<dd class="field-even"><p>int</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="compLib.IRSensor.IRSensor.top_right_percent">
|
||||
<em class="property">static </em><code class="sig-name descname">top_right_percent</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → int<a class="headerlink" href="#compLib.IRSensor.IRSensor.top_right_percent" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get top right infrared sensor percentage</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Returns</dt>
|
||||
<dd class="field-odd"><p>Percentage between 0 and 100</p>
|
||||
</dd>
|
||||
<dt class="field-even">Return type</dt>
|
||||
<dd class="field-even"><p>int</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<div class="section" id="examples">
|
||||
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
|
||||
<div class="section" id="testing-analog-sensors">
|
||||
<h3>Testing analog sensors<a class="headerlink" href="#testing-analog-sensors" title="Permalink to this headline">¶</a></h3>
|
||||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">compLib</span> <span class="kn">import</span> <span class="n">IRSensor</span>
|
||||
|
||||
<span class="n">ir</span> <span class="o">=</span> <span class="n">IRSensor</span><span class="o">.</span><span class="n">IRSensor</span><span class="p">()</span>
|
||||
|
||||
<span class="k">while</span> <span class="kc">True</span><span class="p">:</span>
|
||||
<span class="nb">print</span> <span class="p">(</span><span class="s2">"left: </span><span class="si">{}</span><span class="s2"> middle: </span><span class="si">{}</span><span class="s2"> right: </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">ir</span><span class="o">.</span><span class="n">bottom_left_analog</span><span class="p">(),</span> <span class="n">ir</span><span class="o">.</span><span class="n">bottom_middle_analog</span><span class="p">(),</span> <span class="n">ir</span><span class="o">.</span><span class="n">bottom_right_analog</span><span class="p">()))</span>
|
||||
<span class="nb">print</span> <span class="p">(</span><span class="s2">"left: </span><span class="si">{}</span><span class="s2"> middle: </span><span class="si">{}</span><span class="s2"> right: </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">IRSensor</span><span class="o">.</span><span class="n">read</span><span class="p">(</span><span class="mi">1</span><span class="p">),</span> <span class="n">IRSensor</span><span class="o">.</span><span class="n">read</span><span class="p">(</span><span class="mi">3</span><span class="p">),</span> <span class="n">IRSensor</span><span class="o">.</span><span class="n">read</span><span class="p">(</span><span class="mi">5</span><span class="p">)))</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -310,10 +189,10 @@
|
|||
|
||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
||||
|
||||
<a href="IRWrapper.html" class="btn btn-neutral float-right" title="Infrared Wrapper" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
|
||||
<a href="Linefollower.html" class="btn btn-neutral float-right" title="Linefollower Examples" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
|
||||
|
||||
|
||||
<a href="Buzzer.html" class="btn btn-neutral float-left" title="Buzzer" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
|
||||
<a href="Encoder.html" class="btn btn-neutral float-left" title="Encoder" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<link rel="index" title="Index" href="../genindex.html" />
|
||||
<link rel="search" title="Search" href="../search.html" />
|
||||
<link rel="next" title="Logging" href="Logging.html" />
|
||||
<link rel="prev" title="Infrared Wrapper" href="IRWrapper.html" />
|
||||
<link rel="prev" title="Infrared Sensor" href="IRSensor.html" />
|
||||
</head>
|
||||
|
||||
<body class="wy-body-for-nav">
|
||||
|
@ -86,10 +86,9 @@
|
|||
<li class="toctree-l1"><a class="reference internal" href="../other/usage.html">Usage</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Api.html">Api</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Aruco.html">Aruco</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Battery.html">Battery</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Buzzer.html">Buzzer</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Display.html">Display</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Encoder.html">Encoder</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="IRSensor.html">Infrared Sensor</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="IRWrapper.html">Infrared Wrapper</a></li>
|
||||
<li class="toctree-l1 current"><a class="current reference internal" href="#">Linefollower Examples</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#simple-linefollower">Simple Linefollower</a></li>
|
||||
</ul>
|
||||
|
@ -262,7 +261,7 @@
|
|||
<a href="Logging.html" class="btn btn-neutral float-right" title="Logging" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
|
||||
|
||||
|
||||
<a href="IRWrapper.html" class="btn btn-neutral float-left" title="Infrared Wrapper" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
|
||||
<a href="IRSensor.html" class="btn btn-neutral float-left" title="Infrared Sensor" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -86,10 +86,9 @@
|
|||
<li class="toctree-l1"><a class="reference internal" href="../other/usage.html">Usage</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Api.html">Api</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Aruco.html">Aruco</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Battery.html">Battery</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Buzzer.html">Buzzer</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Display.html">Display</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Encoder.html">Encoder</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="IRSensor.html">Infrared Sensor</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="IRWrapper.html">Infrared Wrapper</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Linefollower.html">Linefollower Examples</a></li>
|
||||
<li class="toctree-l1 current"><a class="current reference internal" href="#">Logging</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#class-documentation">Class Documentation</a></li>
|
||||
|
|
|
@ -86,10 +86,9 @@
|
|||
<li class="toctree-l1"><a class="reference internal" href="../other/usage.html">Usage</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Api.html">Api</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Aruco.html">Aruco</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Battery.html">Battery</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Buzzer.html">Buzzer</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Display.html">Display</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Encoder.html">Encoder</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="IRSensor.html">Infrared Sensor</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="IRWrapper.html">Infrared Wrapper</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Linefollower.html">Linefollower Examples</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Logging.html">Logging</a></li>
|
||||
<li class="toctree-l1 current"><a class="current reference internal" href="#">Motor</a><ul>
|
||||
|
@ -171,35 +170,6 @@
|
|||
<span id="lib-motor"></span><h1>Motor<a class="headerlink" href="#motor" title="Permalink to this headline">¶</a></h1>
|
||||
<div class="section" id="class-documentation">
|
||||
<h2>Class Documentation<a class="headerlink" href="#class-documentation" title="Permalink to this headline">¶</a></h2>
|
||||
<dl class="py class">
|
||||
<dt id="compLib.Motor.Motor">
|
||||
<em class="property">class </em><code class="sig-prename descclassname">compLib.Motor.</code><code class="sig-name descname">Motor</code><a class="headerlink" href="#compLib.Motor.Motor" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Class used to control the motors</p>
|
||||
<dl class="py method">
|
||||
<dt id="compLib.Motor.Motor.all_off">
|
||||
<em class="property">static </em><code class="sig-name descname">all_off</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#compLib.Motor.Motor.all_off" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Turns of all motors</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="compLib.Motor.Motor.power">
|
||||
<em class="property">static </em><code class="sig-name descname">power</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">port</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">percent</span><span class="p">:</span> <span class="n">float</span></em><span class="sig-paren">)</span><a class="headerlink" href="#compLib.Motor.Motor.power" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Set specified motor to percentage power</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><ul class="simple">
|
||||
<li><p><strong>port</strong> – Port, which the motor is connected to. 0-3, 0 -> top left, 3 -> top right</p></li>
|
||||
<li><p><strong>percent</strong> – Percentage of max speed. between -100 and 100</p></li>
|
||||
</ul>
|
||||
</dd>
|
||||
<dt class="field-even">Raises</dt>
|
||||
<dd class="field-even"><p>IndexError</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
<div class="section" id="examples">
|
||||
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
|
||||
|
@ -207,8 +177,8 @@
|
|||
<h3>Driving straight (maybe)<a class="headerlink" href="#driving-straight-maybe" title="Permalink to this headline">¶</a></h3>
|
||||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">compLib.Motor</span> <span class="kn">import</span> <span class="n">Motor</span>
|
||||
|
||||
<span class="k">for</span> <span class="n">port</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">4</span><span class="p">):</span>
|
||||
<span class="n">Motor</span><span class="o">.</span><span class="n">power</span><span class="p">(</span><span class="n">port</span><span class="p">,</span> <span class="mi">50</span><span class="p">)</span>
|
||||
<span class="n">Motor</span><span class="o">.</span><span class="n">power</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">50</span><span class="p">)</span>
|
||||
<span class="n">Motor</span><span class="o">.</span><span class="n">power</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">50</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -86,10 +86,9 @@
|
|||
<li class="toctree-l1"><a class="reference internal" href="../other/usage.html">Usage</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Api.html">Api</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Aruco.html">Aruco</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Battery.html">Battery</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Buzzer.html">Buzzer</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Display.html">Display</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Encoder.html">Encoder</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="IRSensor.html">Infrared Sensor</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="IRWrapper.html">Infrared Wrapper</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Linefollower.html">Linefollower Examples</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Logging.html">Logging</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
|
||||
|
@ -162,32 +161,6 @@
|
|||
|
||||
<div class="section" id="servo">
|
||||
<span id="lib-servo"></span><h1>Servo<a class="headerlink" href="#servo" title="Permalink to this headline">¶</a></h1>
|
||||
<dl class="py class">
|
||||
<dt id="compLib.Servo.Servo">
|
||||
<em class="property">class </em><code class="sig-prename descclassname">compLib.Servo.</code><code class="sig-name descname">Servo</code><a class="headerlink" href="#compLib.Servo.Servo" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Control the servo ports on the robot</p>
|
||||
<dl class="py method">
|
||||
<dt id="compLib.Servo.Servo.set_position">
|
||||
<em class="property">static </em><code class="sig-name descname">set_position</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">channel</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">angle</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">offset</span><span class="p">:</span> <span class="n">float</span> <span class="o">=</span> <span class="default_value">90</span></em><span class="sig-paren">)</span><a class="headerlink" href="#compLib.Servo.Servo.set_position" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Set position of servo connected to port</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><ul class="simple">
|
||||
<li><p><strong>channel</strong> – channel between 0 and 7</p></li>
|
||||
<li><p><strong>angle</strong> – Angle of servo</p></li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="compLib.Servo.Servo.setup_position">
|
||||
<em class="property">static </em><code class="sig-name descname">setup_position</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#compLib.Servo.Servo.setup_position" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Set position of servos to the position used during the setup process</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -85,10 +85,9 @@
|
|||
<li class="toctree-l1"><a class="reference internal" href="../other/usage.html">Usage</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Api.html">Api</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Aruco.html">Aruco</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Battery.html">Battery</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Buzzer.html">Buzzer</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Display.html">Display</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Encoder.html">Encoder</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="IRSensor.html">Infrared Sensor</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="IRWrapper.html">Infrared Wrapper</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Linefollower.html">Linefollower Examples</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Logging.html">Logging</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
|
||||
|
@ -181,41 +180,6 @@
|
|||
<h2>Opencv Stream<a class="headerlink" href="#opencv-stream" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Because of the rtmp stream needing to buffer some frames and waiting for P-Frames, importing this module might take up
|
||||
to 5 Seconds.</p>
|
||||
<dl class="py class">
|
||||
<dt id="compLib.Vision.__Streaming">
|
||||
<em class="property">class </em><code class="sig-prename descclassname">compLib.Vision.</code><code class="sig-name descname">__Streaming</code><a class="headerlink" href="#compLib.Vision.__Streaming" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Class that handles rtmp streaming for opencv.</p>
|
||||
<p>DO NOT CREATE AN INSTANCE OF THIS CLASS YOURSELF!</p>
|
||||
<p>This is automatically done when importing this module. Use Vision.Streaming which is
|
||||
an instance of this class!</p>
|
||||
<p>grab frames -> do your own processing -> publish frame -> view on http server</p>
|
||||
<dl class="py method">
|
||||
<dt id="compLib.Vision.__Streaming.get_frame">
|
||||
<code class="sig-name descname">get_frame</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#compLib.Vision.__Streaming.get_frame" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Grab the newest frame from the rtmp stream.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Returns</dt>
|
||||
<dd class="field-odd"><p>An opencv frame</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="compLib.Vision.__Streaming.publish_frame">
|
||||
<code class="sig-name descname">publish_frame</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">image</span></em><span class="sig-paren">)</span><a class="headerlink" href="#compLib.Vision.__Streaming.publish_frame" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Publish an opencv frame to the http webserver.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><p><strong>image</strong> – Opencv frame that will be published</p>
|
||||
</dd>
|
||||
<dt class="field-even">Returns</dt>
|
||||
<dd class="field-even"><p>None</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
<div class="section" id="examples">
|
||||
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
|
||||
|
|
BIN
objects.inv
BIN
objects.inv
Binary file not shown.
|
@ -86,10 +86,9 @@
|
|||
<li class="toctree-l1 current"><a class="current reference internal" href="#">Usage</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../lib/Api.html">Api</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../lib/Aruco.html">Aruco</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../lib/Battery.html">Battery</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../lib/Buzzer.html">Buzzer</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../lib/Display.html">Display</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../lib/Encoder.html">Encoder</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../lib/IRSensor.html">Infrared Sensor</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../lib/IRWrapper.html">Infrared Wrapper</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../lib/Linefollower.html">Linefollower Examples</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../lib/Logging.html">Logging</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../lib/Motor.html">Motor</a></li>
|
||||
|
|
|
@ -86,10 +86,9 @@
|
|||
<li class="toctree-l1"><a class="reference internal" href="other/usage.html">Usage</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Api.html">Api</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Aruco.html">Aruco</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Battery.html">Battery</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Buzzer.html">Buzzer</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Display.html">Display</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Encoder.html">Encoder</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/IRSensor.html">Infrared Sensor</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/IRWrapper.html">Infrared Wrapper</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Linefollower.html">Linefollower Examples</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Logging.html">Logging</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Motor.html">Motor</a></li>
|
||||
|
|
File diff suppressed because one or more lines are too long
Reference in a new issue