Update documentation
This commit is contained in:
parent
ccd46ee8a7
commit
4c1cfa6735
9 changed files with 466 additions and 7 deletions
125
genindex.html
125
genindex.html
|
@ -159,26 +159,69 @@
|
|||
<h1 id="index">Index</h1>
|
||||
|
||||
<div class="genindex-jumpbox">
|
||||
<a href="#C"><strong>C</strong></a>
|
||||
<a href="#_"><strong>_</strong></a>
|
||||
| <a href="#A"><strong>A</strong></a>
|
||||
| <a href="#C"><strong>C</strong></a>
|
||||
| <a href="#D"><strong>D</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="#W"><strong>W</strong></a>
|
||||
|
||||
</div>
|
||||
<h2 id="C">C</h2>
|
||||
<h2 id="_">_</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="lib/Encoder.html#compLib.Encoder.Encoder.clear">clear() (compLib.Encoder.Encoder static method)</a>
|
||||
<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.active_break">active_break() (compLib.Motor.Motor 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="C">C</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="lib/Display.html#compLib.Display.Display.clear">clear() (compLib.Display.Display static method)</a>
|
||||
|
||||
<ul>
|
||||
<li><a href="lib/Encoder.html#compLib.Encoder.Encoder.clear">(compLib.Encoder.Encoder static method)</a>
|
||||
</li>
|
||||
</ul></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>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="lib/Display.html#compLib.Display.Display">Display (class in compLib.Display)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<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="E">E</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
|
@ -190,7 +233,33 @@
|
|||
<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/Motor.html#compLib.Motor.Motor.get_motor_curve">get_motor_curve() (compLib.Motor.Motor static method)</a>
|
||||
</li>
|
||||
<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>
|
||||
|
@ -203,11 +272,43 @@
|
|||
</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/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>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="lib/Motor.html#compLib.Motor.Motor.power_raw">power_raw() (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>
|
||||
<li><a href="lib/Motor.html#compLib.Motor.Motor.pwm">pwm() (compLib.Motor.Motor static method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
||||
<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/Encoder.html#compLib.Encoder.Encoder.read">read() (compLib.Encoder.Encoder static method)</a>
|
||||
|
||||
<ul>
|
||||
<li><a href="lib/IRSensor.html#compLib.IRSensor.IRSensor.read">(compLib.IRSensor.IRSensor static method)</a>
|
||||
</li>
|
||||
</ul></li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="lib/Encoder.html#compLib.Encoder.Encoder.read_raw">read_raw() (compLib.Encoder.Encoder static method)</a>
|
||||
|
@ -217,8 +318,26 @@
|
|||
|
||||
<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/IRSensor.html#compLib.IRSensor.IRSensor.set">set() (compLib.IRSensor.IRSensor 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/Motor.html#compLib.Motor.Motor.set_motor_curve">set_motor_curve() (compLib.Motor.Motor 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="W">W</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="lib/Display.html#compLib.Display.Display.write">write() (compLib.Display.Display static method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
|
|
130
lib/Api.html
130
lib/Api.html
|
@ -173,12 +173,142 @@
|
|||
<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>
|
||||
|
|
|
@ -170,6 +170,35 @@
|
|||
<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>
|
||||
<dl class="py class">
|
||||
<dt id="compLib.Display.Display">
|
||||
<em class="property">class </em><code class="sig-prename descclassname">compLib.Display.</code><code class="sig-name descname">Display</code><a class="headerlink" href="#compLib.Display.Display" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Access the different IR Sensors of the robot</p>
|
||||
<dl class="py method">
|
||||
<dt id="compLib.Display.Display.clear">
|
||||
<em class="property">static </em><code class="sig-name descname">clear</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#compLib.Display.Display.clear" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Clear the display</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="compLib.Display.Display.write">
|
||||
<em class="property">static </em><code class="sig-name descname">write</code><span class="sig-paren">(</span><em class="sig-param">line: int</em>, <em class="sig-param">text: <module 'string' from '/usr/local/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/string.py'></em><span class="sig-paren">)</span><a class="headerlink" href="#compLib.Display.Display.write" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Write a string of text to the integrated display.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><ul class="simple">
|
||||
<li><p><strong>line</strong> – Line to write. Between 1 and 4</p></li>
|
||||
<li><p><strong>text</strong> – Text to write. Up to 16 characters</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>
|
||||
|
|
|
@ -176,7 +176,7 @@
|
|||
<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 class="field-odd"><p><strong>port</strong> – Port, which the motor is connected to. Between 1 and 4</p>
|
||||
</dd>
|
||||
<dt class="field-even">Raises</dt>
|
||||
<dd class="field-even"><p>IndexError</p>
|
||||
|
@ -196,7 +196,7 @@
|
|||
<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 class="field-odd"><p><strong>port</strong> – Port, which the motor is connected to. Between 1 and 4</p>
|
||||
</dd>
|
||||
<dt class="field-even">Raises</dt>
|
||||
<dd class="field-even"><p>IndexError</p>
|
||||
|
@ -213,7 +213,7 @@
|
|||
<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 class="field-odd"><p><strong>port</strong> – Port, which the motor is connected to. Between 1 and 4</p>
|
||||
</dd>
|
||||
<dt class="field-even">Raises</dt>
|
||||
<dd class="field-even"><p>IndexError</p>
|
||||
|
|
|
@ -167,6 +167,46 @@
|
|||
|
||||
<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 of the robot</p>
|
||||
<dl class="py method">
|
||||
<dt id="compLib.IRSensor.IRSensor.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">sensor</span><span class="p">:</span> <span class="n">int</span></em><span class="sig-paren">)</span> → int<a class="headerlink" href="#compLib.IRSensor.IRSensor.read" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Read one infrared sensor</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><p><strong>sensor</strong> – Which sensor to read. Between 1 and 5</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>Sensor value. 10 bit accuracy</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.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">sensor</span><span class="p">:</span> <span class="n">int</span></em>, <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.IRSensor.IRSensor.set" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Turn on / off a IR emitter</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><p><strong>sensor</strong> – Which sensor to read. Between 1 and 5</p>
|
||||
</dd>
|
||||
<dt class="field-even">Raises</dt>
|
||||
<dd class="field-even"><p>IndexError</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">
|
||||
|
|
106
lib/Motor.html
106
lib/Motor.html
|
@ -170,6 +170,112 @@
|
|||
<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.active_break">
|
||||
<em class="property">static </em><code class="sig-name descname">active_break</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.Motor.Motor.active_break" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Actively break with a specific motor</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</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<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.get_motor_curve">
|
||||
<em class="property">static </em><code class="sig-name descname">get_motor_curve</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#compLib.Motor.Motor.get_motor_curve" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get the currently active motor curve. Check set_motor_curve() for more info.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Returns</dt>
|
||||
<dd class="field-odd"><p>current motor curve</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</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, percentage is linearized
|
||||
so that it’s roughly proportional to the speed</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. 1-4</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>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="compLib.Motor.Motor.power_raw">
|
||||
<em class="property">static </em><code class="sig-name descname">power_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>, <em class="sig-param"><span class="n">percent</span><span class="p">:</span> <span class="n">float</span></em>, <em class="sig-param"><span class="n">log_metric</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="headerlink" href="#compLib.Motor.Motor.power_raw" 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. 1-4</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>
|
||||
|
||||
<dl class="py method">
|
||||
<dt id="compLib.Motor.Motor.pwm">
|
||||
<em class="property">static </em><code class="sig-name descname">pwm</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">pwm</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">mode</span><span class="p">:</span> <span class="n">compLib.Motor.MotorMode</span></em><span class="sig-paren">)</span><a class="headerlink" href="#compLib.Motor.Motor.pwm" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Set specified motor to a specific pwm value and motor mode</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. 1-4 allowed</p></li>
|
||||
<li><p><strong>pwm</strong> – Raw PWM value which the motor should be set to. From 0 to 2^16 - 1</p></li>
|
||||
<li><p><strong>mode</strong> – Motor mode. See enum MotorMode for more info</p></li>
|
||||
</ul>
|
||||
</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.Motor.Motor.set_motor_curve">
|
||||
<em class="property">static </em><code class="sig-name descname">set_motor_curve</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">curve</span></em><span class="sig-paren">)</span><a class="headerlink" href="#compLib.Motor.Motor.set_motor_curve" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Set the global motor curve, must be a float array with exactly 21 elements.
|
||||
[0] = x ticks/s (0% power)
|
||||
[1] = x ticks/s (5% power)
|
||||
[2] = x ticks/s (10% power)
|
||||
…
|
||||
[20] = x ticks/s (100% power)</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><p><strong>curve</strong> – float array with 21 elements</p>
|
||||
</dd>
|
||||
<dt class="field-even">Raises</dt>
|
||||
<dd class="field-even"><p>ValueError</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>
|
||||
|
|
|
@ -180,6 +180,41 @@
|
|||
<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.
File diff suppressed because one or more lines are too long
Reference in a new issue