Update documentation
This commit is contained in:
parent
fac9a142a9
commit
dbe08c033a
16 changed files with 253 additions and 641 deletions
|
@ -4,4 +4,19 @@ Infrared Sensor
|
|||
****************
|
||||
|
||||
.. autoclass:: compLib.IRSensor.IRSensor
|
||||
:members:
|
||||
:members:
|
||||
|
||||
Examples
|
||||
=========
|
||||
|
||||
Testing analog sensors
|
||||
-------------------------
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
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()))
|
|
@ -1,5 +1,10 @@
|
|||
pre { line-height: 125%; }
|
||||
td.linenos pre { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; }
|
||||
span.linenos { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; }
|
||||
td.linenos pre.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
|
||||
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
|
||||
.highlight .hll { background-color: #ffffcc }
|
||||
.highlight { background: #f8f8f8; }
|
||||
.highlight { background: #f8f8f8; }
|
||||
.highlight .c { color: #408080; font-style: italic } /* Comment */
|
||||
.highlight .err { border: 1px solid #FF0000 } /* Error */
|
||||
.highlight .k { color: #008000; font-weight: bold } /* Keyword */
|
||||
|
|
150
genindex.html
150
genindex.html
|
@ -3,9 +3,9 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="writer-html5" lang="en" >
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta charset="utf-8">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Index — CompLib 0.0.2 documentation</title>
|
||||
|
||||
|
@ -16,13 +16,10 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="_static/js/html5shiv.min.js"></script>
|
||||
<![endif]-->
|
||||
|
@ -51,7 +48,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="index.html" class="icon icon-home"> CompLib
|
||||
<a href="index.html" class="icon icon-home" alt="Documentation Home"> CompLib
|
||||
|
||||
|
||||
|
||||
|
@ -133,8 +130,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||||
|
||||
<ul class="wy-breadcrumbs">
|
||||
|
@ -146,7 +141,7 @@
|
|||
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
@ -162,89 +157,15 @@
|
|||
<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="#D"><strong>D</strong></a>
|
||||
| <a href="#G"><strong>G</strong></a>
|
||||
| <a href="#I"><strong>I</strong></a>
|
||||
<a href="#G"><strong>G</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="#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/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>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="lib/IRSensor.html#compLib.IRSensor.IRSensor.bottom_middle">bottom_middle() (compLib.IRSensor.IRSensor 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/Buzzer.html#compLib.Buzzer.Buzzer">Buzzer (class in compLib.Buzzer)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="D">D</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>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<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>
|
||||
</tr></table>
|
||||
|
@ -257,62 +178,10 @@
|
|||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<h2 id="M">M</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>
|
||||
</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>
|
||||
</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>
|
||||
|
@ -323,25 +192,28 @@
|
|||
|
||||
</div>
|
||||
<footer>
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2021, robo4you.
|
||||
|
||||
© Copyright 2021, robo4you
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
||||
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
|
||||
|
||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</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>
|
||||
|
||||
|
|
36
index.html
36
index.html
|
@ -3,9 +3,9 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="writer-html5" lang="en" >
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta charset="utf-8">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Robo4you Competition Library — CompLib 0.0.2 documentation</title>
|
||||
|
||||
|
@ -16,13 +16,10 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="_static/js/html5shiv.min.js"></script>
|
||||
<![endif]-->
|
||||
|
@ -52,7 +49,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="#" class="icon icon-home"> CompLib
|
||||
<a href="#" class="icon icon-home" alt="Documentation Home"> CompLib
|
||||
|
||||
|
||||
|
||||
|
@ -134,8 +131,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||||
|
||||
<ul class="wy-breadcrumbs">
|
||||
|
@ -147,7 +142,7 @@
|
|||
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
|
||||
|
||||
<a href="_sources/index.rst.txt" rel="nofollow"> View page source</a>
|
||||
|
||||
|
||||
|
@ -199,7 +194,13 @@
|
|||
</li>
|
||||
</ul>
|
||||
</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/IRSensor.html">Infrared Sensor</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="lib/IRSensor.html#examples">Examples</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="lib/IRSensor.html#testing-analog-sensors">Testing analog sensors</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="lib/Logging.html">Logging</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="lib/Logging.html#class-documentation">Class Documentation</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="lib/Logging.html#examples">Examples</a><ul>
|
||||
|
@ -236,28 +237,35 @@
|
|||
|
||||
</div>
|
||||
<footer>
|
||||
|
||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
||||
<a href="other/usage.html" class="btn btn-neutral float-right" title="Usage" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
||||
|
||||
<a href="other/usage.html" class="btn btn-neutral float-right" title="Usage" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2021, robo4you.
|
||||
|
||||
© Copyright 2021, robo4you
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
||||
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
|
||||
|
||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</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>
|
||||
|
||||
|
|
179
lib/Api.html
179
lib/Api.html
|
@ -3,9 +3,9 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="writer-html5" lang="en" >
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta charset="utf-8">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Api — CompLib 0.0.2 documentation</title>
|
||||
|
||||
|
@ -16,13 +16,10 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="../_static/js/html5shiv.min.js"></script>
|
||||
<![endif]-->
|
||||
|
@ -53,7 +50,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../index.html" class="icon icon-home"> CompLib
|
||||
<a href="../index.html" class="icon icon-home" alt="Documentation Home"> CompLib
|
||||
|
||||
|
||||
|
||||
|
@ -145,8 +142,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||||
|
||||
<ul class="wy-breadcrumbs">
|
||||
|
@ -158,7 +153,7 @@
|
|||
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
|
||||
|
||||
<a href="../_sources/lib/Api.rst.txt" rel="nofollow"> View page source</a>
|
||||
|
||||
|
||||
|
@ -176,142 +171,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>
|
||||
|
@ -321,17 +186,17 @@
|
|||
|
||||
<span class="n">park</span><span class="p">,</span> <span class="n">code</span> <span class="o">=</span> <span class="n">Seeding</span><span class="o">.</span><span class="n">get_park</span><span class="p">()</span>
|
||||
<span class="k">if</span> <span class="n">code</span> <span class="o">==</span> <span class="mi">403</span><span class="p">:</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="n">f</span><span class="s2">"I am not in the correct zone to make that request!"</span><span class="p">)</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">"I am not in the correct zone to make that request!"</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">park</span> <span class="o">=</span> <span class="n">park</span><span class="p">[</span><span class="s2">"id"</span><span class="p">]</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="n">f</span><span class="s2">"I should move to parking position: {park}"</span><span class="p">)</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">"I should move to parking position: </span><span class="si">{</span><span class="n">park</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">park</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="n">f</span><span class="s2">"I can't move to this position yet :("</span><span class="p">)</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">"I can't move to this position yet :("</span><span class="p">)</span>
|
||||
<span class="k">elif</span> <span class="n">park</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="n">f</span><span class="s2">"Moving to position 1!"</span><span class="p">)</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Moving to position 1!"</span><span class="p">)</span>
|
||||
<span class="c1"># drive to parking position using Motors module...</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="n">f</span><span class="s2">"Now hopefully at position 1"</span><span class="p">)</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Now hopefully at position 1"</span><span class="p">)</span>
|
||||
<span class="c1"># drive back using Motors module...</span>
|
||||
<span class="k">elif</span> <span class="n">park</span> <span class="o">==</span> <span class="mi">2</span><span class="p">:</span>
|
||||
<span class="c1"># do something similar to park == 1..</span>
|
||||
|
@ -341,9 +206,9 @@
|
|||
<span class="n">success</span> <span class="o">=</span> <span class="n">Seeding</span><span class="o">.</span><span class="n">pay_park</span><span class="p">()</span>
|
||||
<span class="c1"># check which code the api returned</span>
|
||||
<span class="k">if</span> <span class="n">success</span> <span class="o">==</span> <span class="mi">204</span><span class="p">:</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="n">f</span><span class="s2">"We scored some points!"</span><span class="p">)</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">"We scored some points!"</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="n">f</span><span class="s2">"We failed :("</span><span class="p">)</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">"We failed :("</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -352,10 +217,10 @@
|
|||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">compLib.Api</span> <span class="kn">import</span> <span class="n">DoubleElim</span>
|
||||
|
||||
<span class="n">position</span><span class="p">,</span> <span class="n">status</span> <span class="o">=</span> <span class="n">DoubleElim</span><span class="o">.</span><span class="n">get_position</span><span class="p">()</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="n">f</span><span class="s2">"Position of my robot is: x={position.x}, y={position.y} and rotation is: {position.degrees}, the server responded with status code: {status}"</span><span class="p">)</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Position of my robot is: x=</span><span class="si">{</span><span class="n">position</span><span class="o">.</span><span class="n">x</span><span class="si">}</span><span class="s2">, y=</span><span class="si">{</span><span class="n">position</span><span class="o">.</span><span class="n">y</span><span class="si">}</span><span class="s2"> and rotation is: </span><span class="si">{</span><span class="n">position</span><span class="o">.</span><span class="n">degrees</span><span class="si">}</span><span class="s2">, the server responded with status code: </span><span class="si">{</span><span class="n">status</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
|
||||
|
||||
<span class="n">goal</span><span class="p">,</span> <span class="n">status</span> <span class="o">=</span> <span class="n">DoubleElim</span><span class="o">.</span><span class="n">get_goal</span><span class="p">()</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="n">f</span><span class="s2">"Goal is at: x={goal.x}, y={goal.y}, the server responded with status code: {status}"</span><span class="p">)</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Goal is at: x=</span><span class="si">{</span><span class="n">goal</span><span class="o">.</span><span class="n">x</span><span class="si">}</span><span class="s2">, y=</span><span class="si">{</span><span class="n">goal</span><span class="o">.</span><span class="n">y</span><span class="si">}</span><span class="s2">, the server responded with status code: </span><span class="si">{</span><span class="n">status</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -367,29 +232,37 @@
|
|||
|
||||
</div>
|
||||
<footer>
|
||||
|
||||
<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" aria-hidden="true"></span></a>
|
||||
<a href="../other/usage.html" class="btn btn-neutral float-left" title="Usage" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
||||
|
||||
<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="../other/usage.html" class="btn btn-neutral float-left" title="Usage" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2021, robo4you.
|
||||
|
||||
© Copyright 2021, robo4you
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
||||
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
|
||||
|
||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</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>
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="writer-html5" lang="en" >
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta charset="utf-8">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Battery — CompLib 0.0.2 documentation</title>
|
||||
|
||||
|
@ -16,13 +16,10 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="../_static/js/html5shiv.min.js"></script>
|
||||
<![endif]-->
|
||||
|
@ -53,7 +50,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../index.html" class="icon icon-home"> CompLib
|
||||
<a href="../index.html" class="icon icon-home" alt="Documentation Home"> CompLib
|
||||
|
||||
|
||||
|
||||
|
@ -142,8 +139,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||||
|
||||
<ul class="wy-breadcrumbs">
|
||||
|
@ -155,7 +150,7 @@
|
|||
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
|
||||
|
||||
<a href="../_sources/lib/Battery.rst.txt" rel="nofollow"> View page source</a>
|
||||
|
||||
|
||||
|
@ -173,26 +168,6 @@
|
|||
<span id="lib-battery"></span><h1>Battery<a class="headerlink" href="#battery" 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.Battery.Battery">
|
||||
<em class="property">class </em><code class="sig-prename descclassname">compLib.Battery.</code><code class="sig-name descname">Battery</code><a class="headerlink" href="#compLib.Battery.Battery" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Used to interact with the battery</p>
|
||||
<dl class="py method">
|
||||
<dt id="compLib.Battery.Battery.percent">
|
||||
<em class="property">static </em><code class="sig-name descname">percent</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → int<a class="headerlink" href="#compLib.Battery.Battery.percent" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get battery 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>
|
||||
<div class="section" id="examples">
|
||||
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
|
||||
|
@ -200,7 +175,7 @@
|
|||
<h3>Printing percentage<a class="headerlink" href="#printing-percentage" 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.Battery</span> <span class="kn">import</span> <span class="n">Battery</span>
|
||||
|
||||
<span class="k">print</span><span class="p">(</span><span class="n">Battery</span><span class="o">.</span><span class="n">percent</span><span class="p">())</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">Battery</span><span class="o">.</span><span class="n">percent</span><span class="p">())</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -212,29 +187,37 @@
|
|||
|
||||
</div>
|
||||
<footer>
|
||||
|
||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
||||
<a href="Buzzer.html" class="btn btn-neutral float-right" title="Buzzer" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></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" aria-hidden="true"></span> Previous</a>
|
||||
|
||||
<a href="Buzzer.html" class="btn btn-neutral float-right" title="Buzzer" 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>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2021, robo4you.
|
||||
|
||||
© Copyright 2021, robo4you
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
||||
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
|
||||
|
||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</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>
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="writer-html5" lang="en" >
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta charset="utf-8">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Buzzer — CompLib 0.0.2 documentation</title>
|
||||
|
||||
|
@ -16,13 +16,10 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="../_static/js/html5shiv.min.js"></script>
|
||||
<![endif]-->
|
||||
|
@ -53,7 +50,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../index.html" class="icon icon-home"> CompLib
|
||||
<a href="../index.html" class="icon icon-home" alt="Documentation Home"> CompLib
|
||||
|
||||
|
||||
|
||||
|
@ -142,8 +139,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||||
|
||||
<ul class="wy-breadcrumbs">
|
||||
|
@ -155,7 +150,7 @@
|
|||
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
|
||||
|
||||
<a href="../_sources/lib/Buzzer.rst.txt" rel="nofollow"> View page source</a>
|
||||
|
||||
|
||||
|
@ -173,23 +168,6 @@
|
|||
<span id="lib-buzzer"></span><h1>Buzzer<a class="headerlink" href="#buzzer" 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.Buzzer.Buzzer">
|
||||
<em class="property">class </em><code class="sig-prename descclassname">compLib.Buzzer.</code><code class="sig-name descname">Buzzer</code><a class="headerlink" href="#compLib.Buzzer.Buzzer" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Used to interact with the buzzer</p>
|
||||
<dl class="py method">
|
||||
<dt id="compLib.Buzzer.Buzzer.set">
|
||||
<em class="property">static </em><code class="sig-name descname">set</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">on</span><span class="p">:</span> <span class="n">bool</span></em><span class="sig-paren">)</span><a class="headerlink" href="#compLib.Buzzer.Buzzer.set" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Turn the buzzer on / off</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><p><strong>on</strong> – True if on, False if off</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>
|
||||
|
@ -198,9 +176,9 @@
|
|||
<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.Buzzer</span> <span class="kn">import</span> <span class="n">Buzzer</span>
|
||||
|
||||
<span class="n">Buzzer</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="bp">True</span><span class="p">)</span>
|
||||
<span class="n">Buzzer</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="kc">True</span><span class="p">)</span>
|
||||
<span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
|
||||
<span class="n">Buzzer</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="bp">False</span><span class="p">)</span>
|
||||
<span class="n">Buzzer</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="kc">False</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -212,29 +190,37 @@
|
|||
|
||||
</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" aria-hidden="true"></span></a>
|
||||
<a href="Battery.html" class="btn btn-neutral float-left" title="Battery" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
||||
|
||||
<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="Battery.html" class="btn btn-neutral float-left" title="Battery" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2021, robo4you.
|
||||
|
||||
© Copyright 2021, robo4you
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
||||
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
|
||||
|
||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</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>
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="writer-html5" lang="en" >
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta charset="utf-8">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Infrared Sensor — CompLib 0.0.2 documentation</title>
|
||||
|
||||
|
@ -16,13 +16,10 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="../_static/js/html5shiv.min.js"></script>
|
||||
<![endif]-->
|
||||
|
@ -53,7 +50,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../index.html" class="icon icon-home"> CompLib
|
||||
<a href="../index.html" class="icon icon-home" alt="Documentation Home"> CompLib
|
||||
|
||||
|
||||
|
||||
|
@ -90,7 +87,13 @@
|
|||
<li class="toctree-l1"><a class="reference internal" href="Api.html">Api</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 current"><a class="current reference internal" href="#">Infrared Sensor</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>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</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>
|
||||
|
@ -135,8 +138,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||||
|
||||
<ul class="wy-breadcrumbs">
|
||||
|
@ -148,7 +149,7 @@
|
|||
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
|
||||
|
||||
<a href="../_sources/lib/IRSensor.rst.txt" rel="nofollow"> View page source</a>
|
||||
|
||||
|
||||
|
@ -164,82 +165,20 @@
|
|||
|
||||
<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>
|
||||
<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>
|
||||
|
||||
<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_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.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>
|
||||
<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>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -247,29 +186,37 @@
|
|||
|
||||
</div>
|
||||
<footer>
|
||||
|
||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
||||
<a href="Logging.html" class="btn btn-neutral float-right" title="Logging" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></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" aria-hidden="true"></span> Previous</a>
|
||||
|
||||
<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="Buzzer.html" class="btn btn-neutral float-left" title="Buzzer" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2021, robo4you.
|
||||
|
||||
© Copyright 2021, robo4you
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
||||
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
|
||||
|
||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</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>
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="writer-html5" lang="en" >
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta charset="utf-8">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Logging — CompLib 0.0.2 documentation</title>
|
||||
|
||||
|
@ -16,13 +16,10 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="../_static/js/html5shiv.min.js"></script>
|
||||
<![endif]-->
|
||||
|
@ -53,7 +50,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../index.html" class="icon icon-home"> CompLib
|
||||
<a href="../index.html" class="icon icon-home" alt="Documentation Home"> CompLib
|
||||
|
||||
|
||||
|
||||
|
@ -142,8 +139,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||||
|
||||
<ul class="wy-breadcrumbs">
|
||||
|
@ -155,7 +150,7 @@
|
|||
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
|
||||
|
||||
<a href="../_sources/lib/Logging.rst.txt" rel="nofollow"> View page source</a>
|
||||
|
||||
|
||||
|
@ -219,29 +214,37 @@ Competition organizers</p>
|
|||
|
||||
</div>
|
||||
<footer>
|
||||
|
||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
||||
<a href="Motor.html" class="btn btn-neutral float-right" title="Motor" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></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" aria-hidden="true"></span> Previous</a>
|
||||
|
||||
<a href="Motor.html" class="btn btn-neutral float-right" title="Motor" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></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>
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2021, robo4you.
|
||||
|
||||
© Copyright 2021, robo4you
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
||||
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
|
||||
|
||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</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>
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="writer-html5" lang="en" >
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta charset="utf-8">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Motor — CompLib 0.0.2 documentation</title>
|
||||
|
||||
|
@ -16,13 +16,10 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="../_static/js/html5shiv.min.js"></script>
|
||||
<![endif]-->
|
||||
|
@ -53,7 +50,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../index.html" class="icon icon-home"> CompLib
|
||||
<a href="../index.html" class="icon icon-home" alt="Documentation Home"> CompLib
|
||||
|
||||
|
||||
|
||||
|
@ -142,8 +139,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||||
|
||||
<ul class="wy-breadcrumbs">
|
||||
|
@ -155,7 +150,7 @@
|
|||
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
|
||||
|
||||
<a href="../_sources/lib/Motor.rst.txt" rel="nofollow"> View page source</a>
|
||||
|
||||
|
||||
|
@ -173,35 +168,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>
|
||||
|
@ -222,29 +188,37 @@
|
|||
|
||||
</div>
|
||||
<footer>
|
||||
|
||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
||||
<a href="Servo.html" class="btn btn-neutral float-right" title="Servo" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
||||
<a href="Logging.html" class="btn btn-neutral float-left" title="Logging" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
||||
|
||||
<a href="Servo.html" class="btn btn-neutral float-right" title="Servo" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
|
||||
|
||||
|
||||
<a href="Logging.html" class="btn btn-neutral float-left" title="Logging" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2021, robo4you.
|
||||
|
||||
© Copyright 2021, robo4you
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
||||
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
|
||||
|
||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</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>
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="writer-html5" lang="en" >
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta charset="utf-8">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Servo — CompLib 0.0.2 documentation</title>
|
||||
|
||||
|
@ -16,13 +16,10 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="../_static/js/html5shiv.min.js"></script>
|
||||
<![endif]-->
|
||||
|
@ -53,7 +50,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../index.html" class="icon icon-home"> CompLib
|
||||
<a href="../index.html" class="icon icon-home" alt="Documentation Home"> CompLib
|
||||
|
||||
|
||||
|
||||
|
@ -135,8 +132,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||||
|
||||
<ul class="wy-breadcrumbs">
|
||||
|
@ -148,7 +143,7 @@
|
|||
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
|
||||
|
||||
<a href="../_sources/lib/Servo.rst.txt" rel="nofollow"> View page source</a>
|
||||
|
||||
|
||||
|
@ -164,32 +159,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>
|
||||
|
||||
|
||||
|
@ -197,29 +166,37 @@
|
|||
|
||||
</div>
|
||||
<footer>
|
||||
|
||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
||||
<a href="Vision.html" class="btn btn-neutral float-right" title="Vision" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
||||
<a href="Motor.html" class="btn btn-neutral float-left" title="Motor" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
||||
|
||||
<a href="Vision.html" class="btn btn-neutral float-right" title="Vision" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
|
||||
|
||||
|
||||
<a href="Motor.html" class="btn btn-neutral float-left" title="Motor" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2021, robo4you.
|
||||
|
||||
© Copyright 2021, robo4you
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
||||
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
|
||||
|
||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</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>
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="writer-html5" lang="en" >
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta charset="utf-8">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Vision — CompLib 0.0.2 documentation</title>
|
||||
|
||||
|
@ -16,13 +16,10 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="../_static/js/html5shiv.min.js"></script>
|
||||
<![endif]-->
|
||||
|
@ -52,7 +49,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../index.html" class="icon icon-home"> CompLib
|
||||
<a href="../index.html" class="icon icon-home" alt="Documentation Home"> CompLib
|
||||
|
||||
|
||||
|
||||
|
@ -142,8 +139,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||||
|
||||
<ul class="wy-breadcrumbs">
|
||||
|
@ -155,7 +150,7 @@
|
|||
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
|
||||
|
||||
<a href="../_sources/lib/Vision.rst.txt" rel="nofollow"> View page source</a>
|
||||
|
||||
|
||||
|
@ -183,41 +178,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>
|
||||
|
@ -226,7 +186,7 @@ an instance of this class!</p>
|
|||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">cv2</span>
|
||||
<span class="kn">from</span> <span class="nn">compLib</span> <span class="kn">import</span> <span class="n">Vision</span>
|
||||
|
||||
<span class="k">while</span> <span class="bp">True</span><span class="p">:</span>
|
||||
<span class="k">while</span> <span class="kc">True</span><span class="p">:</span>
|
||||
<span class="c1"># get newest opencv frame from camera</span>
|
||||
<span class="n">frame</span> <span class="o">=</span> <span class="n">Vision</span><span class="o">.</span><span class="n">Streaming</span><span class="o">.</span><span class="n">get_frame</span><span class="p">()</span>
|
||||
|
||||
|
@ -251,7 +211,7 @@ point your raspberry pi camera to a chessboard and it should be detected.</p>
|
|||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">cv2</span>
|
||||
<span class="kn">from</span> <span class="nn">compLib</span> <span class="kn">import</span> <span class="n">Vision</span>
|
||||
|
||||
<span class="k">while</span> <span class="bp">True</span><span class="p">:</span>
|
||||
<span class="k">while</span> <span class="kc">True</span><span class="p">:</span>
|
||||
<span class="c1"># get newest opencv frame from camera</span>
|
||||
<span class="n">frame</span> <span class="o">=</span> <span class="n">Vision</span><span class="o">.</span><span class="n">Streaming</span><span class="o">.</span><span class="n">get_frame</span><span class="p">()</span>
|
||||
|
||||
|
@ -261,7 +221,7 @@ point your raspberry pi camera to a chessboard and it should be detected.</p>
|
|||
<span class="n">gray</span> <span class="o">=</span> <span class="n">cv2</span><span class="o">.</span><span class="n">cvtColor</span><span class="p">(</span><span class="n">frame</span><span class="p">,</span> <span class="n">cv2</span><span class="o">.</span><span class="n">COLOR_BGR2GRAY</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># find the chessboard corners</span>
|
||||
<span class="n">ret</span><span class="p">,</span> <span class="n">corners</span> <span class="o">=</span> <span class="n">cv2</span><span class="o">.</span><span class="n">findChessboardCorners</span><span class="p">(</span><span class="n">gray</span><span class="p">,</span> <span class="p">(</span><span class="mi">6</span><span class="p">,</span> <span class="mi">9</span><span class="p">),</span> <span class="bp">None</span><span class="p">)</span>
|
||||
<span class="n">ret</span><span class="p">,</span> <span class="n">corners</span> <span class="o">=</span> <span class="n">cv2</span><span class="o">.</span><span class="n">findChessboardCorners</span><span class="p">(</span><span class="n">gray</span><span class="p">,</span> <span class="p">(</span><span class="mi">6</span><span class="p">,</span> <span class="mi">9</span><span class="p">),</span> <span class="kc">None</span><span class="p">)</span>
|
||||
|
||||
<span class="c1"># draw detected chessboard position onto the image</span>
|
||||
<span class="n">cv2</span><span class="o">.</span><span class="n">drawChessboardCorners</span><span class="p">(</span><span class="n">frame</span><span class="p">,</span> <span class="p">(</span><span class="mi">6</span><span class="p">,</span> <span class="mi">9</span><span class="p">),</span> <span class="n">corners</span><span class="p">,</span> <span class="n">ret</span><span class="p">)</span>
|
||||
|
@ -284,28 +244,35 @@ point your raspberry pi camera to a chessboard and it should be detected.</p>
|
|||
|
||||
</div>
|
||||
<footer>
|
||||
|
||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
||||
<a href="Servo.html" class="btn btn-neutral float-left" title="Servo" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
||||
|
||||
|
||||
<a href="Servo.html" class="btn btn-neutral float-left" title="Servo" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2021, robo4you.
|
||||
|
||||
© Copyright 2021, robo4you
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
||||
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
|
||||
|
||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</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>
|
||||
|
||||
|
|
BIN
objects.inv
BIN
objects.inv
Binary file not shown.
|
@ -3,9 +3,9 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="writer-html5" lang="en" >
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta charset="utf-8">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Usage — CompLib 0.0.2 documentation</title>
|
||||
|
||||
|
@ -16,13 +16,10 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="../_static/js/html5shiv.min.js"></script>
|
||||
<![endif]-->
|
||||
|
@ -53,7 +50,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../index.html" class="icon icon-home"> CompLib
|
||||
<a href="../index.html" class="icon icon-home" alt="Documentation Home"> CompLib
|
||||
|
||||
|
||||
|
||||
|
@ -135,8 +132,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||||
|
||||
<ul class="wy-breadcrumbs">
|
||||
|
@ -148,7 +143,7 @@
|
|||
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
|
||||
|
||||
<a href="../_sources/other/usage.rst.txt" rel="nofollow"> View page source</a>
|
||||
|
||||
|
||||
|
@ -176,7 +171,7 @@
|
|||
<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="o">-</span><span class="mi">30</span><span class="p">);</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">main</span><span class="p">():</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="s2">"hallo ich bin ein roboter beep buup"</span><span class="p">)</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"hallo ich bin ein roboter beep buup"</span><span class="p">)</span>
|
||||
|
||||
<span class="n">forward</span><span class="p">()</span>
|
||||
<span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
|
||||
|
@ -194,29 +189,37 @@
|
|||
|
||||
</div>
|
||||
<footer>
|
||||
|
||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
||||
<a href="../lib/Api.html" class="btn btn-neutral float-right" title="Api" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
||||
<a href="../index.html" class="btn btn-neutral float-left" title="Robo4you Competition Library" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
||||
|
||||
<a href="../lib/Api.html" class="btn btn-neutral float-right" title="Api" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
|
||||
|
||||
|
||||
<a href="../index.html" class="btn btn-neutral float-left" title="Robo4you Competition Library" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2021, robo4you.
|
||||
|
||||
© Copyright 2021, robo4you
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
||||
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
|
||||
|
||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</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>
|
||||
|
||||
|
|
23
search.html
23
search.html
|
@ -3,9 +3,9 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="writer-html5" lang="en" >
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta charset="utf-8">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Search — CompLib 0.0.2 documentation</title>
|
||||
|
||||
|
@ -16,13 +16,10 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="_static/js/html5shiv.min.js"></script>
|
||||
|
@ -38,7 +35,6 @@
|
|||
|
||||
|
||||
<script type="text/javascript" src="_static/searchtools.js"></script>
|
||||
<script type="text/javascript" src="_static/language_data.js"></script>
|
||||
<link rel="index" title="Index" href="genindex.html" />
|
||||
<link rel="search" title="Search" href="#" />
|
||||
</head>
|
||||
|
@ -54,7 +50,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="index.html" class="icon icon-home"> CompLib
|
||||
<a href="index.html" class="icon icon-home" alt="Documentation Home"> CompLib
|
||||
|
||||
|
||||
|
||||
|
@ -136,8 +132,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||||
|
||||
<ul class="wy-breadcrumbs">
|
||||
|
@ -149,6 +143,8 @@
|
|||
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
@ -176,25 +172,28 @@
|
|||
|
||||
</div>
|
||||
<footer>
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© Copyright 2021, robo4you.
|
||||
|
||||
© Copyright 2021, robo4you
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
||||
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
|
||||
|
||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</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>
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
Reference in a new issue