Update documentation
This commit is contained in:
parent
dbe08c033a
commit
cf7d60f002
9 changed files with 360 additions and 6 deletions
100
genindex.html
100
genindex.html
|
@ -157,15 +157,73 @@
|
|||
<h1 id="index">Index</h1>
|
||||
|
||||
<div class="genindex-jumpbox">
|
||||
<a href="#G"><strong>G</strong></a>
|
||||
<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="#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>
|
||||
|
||||
</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>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<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>
|
||||
|
@ -178,10 +236,50 @@
|
|||
</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>
|
||||
|
|
130
lib/Api.html
130
lib/Api.html
|
@ -171,12 +171,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>
|
||||
|
|
|
@ -168,6 +168,26 @@
|
|||
<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>
|
||||
|
|
|
@ -168,6 +168,23 @@
|
|||
<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>
|
||||
|
|
|
@ -168,6 +168,35 @@
|
|||
<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>
|
||||
|
|
|
@ -159,6 +159,32 @@
|
|||
|
||||
<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>
|
||||
|
||||
|
||||
|
|
|
@ -178,6 +178,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>
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
# Project: CompLib
|
||||
# Version:
|
||||
# The remainder of this file is compressed using zlib.
|
||||
xΪ<EFBFBD>”ΑnΓ †ο}
|
||||
¤ξ<EFBFBD>N•vκmΫ©R'U¶+JK<>’R-}ϊ<>
<01>j•v<E280A2>1ίo\<5C>ΠR¶ύA›ƒ¬”ΞUmΎ•θ<E280A2><CEB8>ϋ’~Ϊ•M®Ω’FΟ~»Φm³~"Ω<>ό[Ώ©Έ¦<CE88>‰ω`Kµ\Χ’ύ·–2µ/Ζκq©<71>wΆcό‡(ΝvM^π†d[β³ΐ‘½
Wc²΄PD<50>d!_&9’wΣΧBΩΣα<CEA3>ΣΚ<CEA3>ϋΪ‹XκR(60oΉΦ|<7C>–<EFBFBD>K#λΘ<>Χ«™Φ‡¬£!x:σNΙάηύ/ύ6-sF0Ή<30>F¶Ζ“$nό‡Τ·Η@Y<08><σα"—$$‘„Θ/΅μD(f‘ΕΨΒ4w³<77>έ<EFBFBD>§½6‹Μnκ΄<CEBA>¦<EFBFBD>(βΉƒΚ“‘΄¤βΰj‘†P1¨`HΆM,υΜήρ<1E>χ'©“άu[Ζ“‘[΄<>έJ΄Α/P"5;GΥμ\Ά
|
||||
ή<EFBFBD>
|
||||
©ΩEz .&²ΘGΠ9ΞYΪJvη…φSζ7όµbcΓέ[•ΊζΓσ¨ς<C2A8>Η—&J£θΣ†HΣ@Ο‡,ω5$2$Qυρ Αγdώ‡Ί΄OΕσ΅¬S!ζό€ύ£=ιφaσR
|
||||
xз²TMo°0╫С+,╔в%┼тSnЩ:DJ╔UVМу20╚[╤IK~}Яь,╩│╫`ЦyoЛ≥73%oе3-Р/┌Фъy_0Ьаh▀дПX2╒z@▄ВфзХ√щ}B┤╛\╔Д5h\sб╥щПj'≥jhумl.О═с7;\QMywЁUr ;8FnJЖ ═╒]╫О╒#РоЖ╖╕ ц█LE[чaE├█ ЫJ╢9└uc0дкхr╜
|
||||
.;ХъъAЗЕЛZg╪Nй╛эw│Ылk╔┴jф╣6yРКРБ`чй╥ЁqОbH·╡шв╝═ХКМ╝~rм╔Ш.Cq╕k▄°0├ЫККыu╗┌Ъ] ЫЯР█╩ОР∙нt█aсrqHlЦВb╥┤ъT█ХЦ⌠√@з∙ZЯ┬
L[%╞▓╢pvШ'b°zT5упя╝┌HИЙ▒▒:<═pjqХиlЁVЯр─"д/ЬГ│ВХшЬ.п.┐ЦШ$▒CФ┤JL█Г7Y4√╦x4 Ъ⌠м=|÷;╧╫?╫°═SЭнC╓cж$TхfQS-┴q╞!Ъ⌠Mе╫Dо▐Л6⌡Jj┴°Кыm6╚╤└FZ"╥7`L|╝'5⌠╘>ЧбgQжF2▓
+ #
p1k░▓ёЫj╧7┌╘TЁ 7▒д╡'Л┼>v╛}?и44n2R╥⌠Z 7 P├ИP⌠rXMй%╛hF√CM*Б╥Yе└В╓Аy°≈╢ЕуJ┤┼А║╛╙·│ОU╝░В╫"5дE;р/Ёuh<ё╖K√Ь;{ppHг█чЯа▐ц8├╨Т²
|
||||
┬,⌡■ХнBXШяэТщ╓
|
|
@ -1 +1 @@
|
|||
Search.setIndex({docnames:["index","lib/Api","lib/Battery","lib/Buzzer","lib/IRSensor","lib/Logging","lib/Motor","lib/Servo","lib/Vision","other/usage"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,sphinx:56},filenames:["index.rst","lib/Api.rst","lib/Battery.rst","lib/Buzzer.rst","lib/IRSensor.rst","lib/Logging.rst","lib/Motor.rst","lib/Servo.rst","lib/Vision.rst","other/usage.rst"],objects:{"compLib.LogstashLogging":{Logging:[5,0,1,""]},"compLib.LogstashLogging.Logging":{get_logger:[5,1,1,""],set_debug:[5,1,1,""]}},objnames:{"0":["py","class","Python class"],"1":["py","method","Python method"]},objtypes:{"0":"py:class","1":"py:method"},terms:{"001":8,"2021":0,"204":1,"403":1,"9898":8,"class":0,"import":[1,2,3,4,5,6,8,9],"return":[1,5],"static":5,"true":[3,4,8],"while":[4,8],BUT:8,For:8,The:8,Using:0,__main__:9,__name__:9,analog:0,api:0,back:1,backward:9,batteri:0,becaus:8,beep:9,bin:9,bit:8,bottom_left_analog:4,bottom_middle_analog:4,bottom_right_analog:4,browser:8,buffer:8,buup:9,buzzer:0,call:0,cam:8,camera:8,can:[1,5,8],captur:8,check:1,chessboard:0,code:1,color_bgr2grai:8,come:8,commun:5,competit:5,complib:[0,1,2,3,4,5,6,8,9],connect:8,convert:8,corner:8,correct:1,criteria:8,cv2:8,cvtcolor:8,debug:5,def:9,degre:1,detect:0,displai:8,document:[0,8],done:8,doubl:0,doubleelim:1,draw:8,drawchessboardcorn:8,drive:[0,1],ein:9,elif:1,elimin:0,els:1,exampl:0,fail:1,fals:3,find:8,findchessboardcorn:8,format:4,forward:9,frame:8,from:[1,2,3,4,5,6,8,9],get:[5,8],get_fram:8,get_goal:1,get_logg:5,get_park:1,get_posit:1,goal:1,grab:8,grai:8,grayscal:8,hallo:9,here:8,hopefulli:1,how:8,http:8,ich:9,imag:8,infrar:0,interfac:8,internet:8,irsensor:4,lag:8,left:4,level:5,librari:5,like:8,littl:8,log:0,logger:5,logstash:5,logstashlog:5,look:8,main:9,make:1,manual:5,mayb:0,middl:4,might:8,modul:[0,1],motor:[0,1,9],move:1,need:8,newest:8,none:8,note:8,now:1,object:5,off:0,onto:8,opencv:0,organ:5,output:8,own:8,park:1,pay_park:1,percent:2,percentag:0,point:[1,8],port:[6,9],posit:[0,8],power:[6,9],print:[0,1,4,9],process:8,provid:8,publish:8,publish_fram:8,python:5,rang:[6,9],raspberri:8,realtim:8,record:8,request:1,respond:1,ret:8,right:4,robot:[1,9],rotat:1,rtmp:8,run:8,score:1,screenshot:8,second:8,seed:0,sensor:0,server:[1,8],servo:0,set:3,set_debug:5,should:[1,5,8],show:8,similar:1,sleep:[3,9],some:[1,8],someth:1,statu:1,straight:0,stream:0,success:1,take:8,term_criteria_ep:8,term_criteria_max_it:8,test:[0,8],thi:[1,5,8],time:[3,9],turn:0,type:5,usag:0,use:[5,8],used:[0,5],using:[1,8],view:8,vision:0,wait:8,want:8,web:8,websit:8,whatev:8,when:5,which:1,yet:1,you:8,your:8,your_raspi_ip:8,zone:1},titles:["Robo4you Competition Library","Api","Battery","Buzzer","Infrared Sensor","Logging","Motor","Servo","Vision","Usage"],titleterms:{"class":[2,3,5,6],Using:8,analog:4,api:1,batteri:2,buzzer:3,call:1,chessboard:8,competit:0,content:0,detect:8,document:[2,3,5,6],doubl:1,drive:6,elimin:1,exampl:[1,2,3,4,5,6,8],infrar:4,librari:0,log:5,mayb:6,modul:8,motor:6,off:3,opencv:8,percentag:2,posit:1,print:2,robo4y:0,seed:1,sensor:4,servo:7,straight:6,stream:8,test:4,turn:[3,5],usag:9,vision:8}})
|
||||
Search.setIndex({docnames:["index","lib/Api","lib/Battery","lib/Buzzer","lib/IRSensor","lib/Logging","lib/Motor","lib/Servo","lib/Vision","other/usage"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,sphinx:56},filenames:["index.rst","lib/Api.rst","lib/Battery.rst","lib/Buzzer.rst","lib/IRSensor.rst","lib/Logging.rst","lib/Motor.rst","lib/Servo.rst","lib/Vision.rst","other/usage.rst"],objects:{"compLib.Api":{DoubleElim:[1,0,1,""],Position:[1,0,1,""],Seeding:[1,0,1,""]},"compLib.Api.DoubleElim":{get_goal:[1,1,1,""],get_items:[1,1,1,""],get_opponent:[1,1,1,""],get_position:[1,1,1,""],get_scores:[1,1,1,""]},"compLib.Api.Seeding":{get_park:[1,1,1,""],pay_park:[1,1,1,""],simon_says:[1,1,1,""]},"compLib.Battery":{Battery:[2,0,1,""]},"compLib.Battery.Battery":{percent:[2,1,1,""]},"compLib.Buzzer":{Buzzer:[3,0,1,""]},"compLib.Buzzer.Buzzer":{set:[3,1,1,""]},"compLib.LogstashLogging":{Logging:[5,0,1,""]},"compLib.LogstashLogging.Logging":{get_logger:[5,1,1,""],set_debug:[5,1,1,""]},"compLib.Motor":{Motor:[6,0,1,""]},"compLib.Motor.Motor":{all_off:[6,1,1,""],power:[6,1,1,""]},"compLib.Servo":{Servo:[7,0,1,""]},"compLib.Servo.Servo":{set_position:[7,1,1,""],setup_position:[7,1,1,""]},"compLib.Vision":{__Streaming:[8,0,1,""]},"compLib.Vision.__Streaming":{get_frame:[8,1,1,""],publish_frame:[8,1,1,""]}},objnames:{"0":["py","class","Python class"],"1":["py","method","Python method"]},objtypes:{"0":"py:class","1":"py:method"},terms:{"001":8,"100":[2,6],"2021":0,"204":1,"403":1,"9898":8,"class":[0,1,7,8],"float":[6,7],"import":[1,2,3,4,5,6,8,9],"int":[1,2,6,7],"return":[1,2,5,8],"static":[1,2,3,5,6,7],"true":[3,4,8],"while":[4,8],BUT:8,For:8,NOT:8,The:8,Use:8,Used:[2,3],Using:0,__main__:9,__name__:9,__stream:8,all:[1,6],all_off:6,alwai:1,analog:0,angl:7,api:0,automat:8,back:1,backward:9,batteri:0,becaus:8,beep:9,between:[2,6,7],bin:9,bit:8,bool:3,bottom_left_analog:4,bottom_middle_analog:4,bottom_right_analog:4,browser:8,buffer:8,buup:9,buzzer:0,call:0,cam:8,camera:8,can:[1,5,8],captur:8,channel:7,check:1,chessboard:0,code:1,color_bgr2grai:8,come:8,commun:[1,5],competit:5,complib:[0,1,2,3,4,5,6,7,8,9],connect:[6,7,8],control:[6,7],convert:8,coordin:1,corner:8,correct:1,creat:8,criteria:8,current:1,cv2:8,cvtcolor:8,datastructur:1,debug:5,def:9,degre:1,detect:0,dict:1,dictionari:1,displai:8,document:[0,8],done:8,doubl:0,doubleelim:1,draw:8,drawchessboardcorn:8,drive:[0,1],dure:7,ein:9,elif:1,elimin:0,els:1,exampl:0,fail:1,fals:3,field:1,find:8,findchessboardcorn:8,format:4,forward:9,frame:8,from:[1,2,3,4,5,6,8,9],game:1,get:[1,2,5,8],get_fram:8,get_goal:1,get_item:1,get_logg:5,get_oppon:1,get_park:1,get_posit:1,get_scor:1,goal:1,grab:8,grai:8,grayscal:8,hallo:9,handl:8,here:8,hold:1,hopefulli:1,how:8,http:8,ich:9,imag:8,includ:1,indexerror:6,infrar:0,instanc:8,interact:[2,3],interfac:8,internet:8,irsensor:4,item:1,json:1,lag:8,left:[4,6],level:5,librari:5,like:[1,8],list:1,littl:8,log:0,logger:5,logstash:5,logstashlog:5,look:[1,8],main:9,make:1,manual:5,max:6,mayb:0,middl:4,might:8,modul:[0,1],motor:[0,1,9],move:1,need:8,newest:8,next:1,none:8,note:8,now:1,object:[1,5],off:0,offset:7,onto:8,opencv:0,oppon:1,organ:5,output:8,own:8,pai:1,paramet:[3,6,7,8],park:1,parkingsapc:1,pay_park:1,percent:[2,6],percentag:[0,6],point:[1,8],port:[6,7,9],posit:[0,7,8],power:[6,9],print:[0,1,4,9],process:[7,8],provid:8,publish:8,publish_fram:8,python:5,rais:6,rang:[6,9],raspberri:8,realtim:8,record:8,request:1,respond:1,ret:8,right:[4,6],robot:[1,7,9],rotat:1,rtmp:8,run:8,sai:1,score:1,screenshot:8,second:8,seed:0,self:1,sensor:0,server:[1,8],servo:0,set:[3,6,7],set_debug:5,set_posit:7,setup:7,setup_posit:7,should:[1,5,8],show:8,similar:1,simon:1,simon_sai:1,sleep:[3,9],some:[1,8],someth:1,specifi:6,speed:6,statu:1,straight:0,stream:0,success:1,take:8,term_criteria_ep:8,term_criteria_max_it:8,test:[0,8],thi:[1,5,8],time:[3,9],top:6,tupl:1,turn:[0,6],type:[1,2,5],usag:0,use:[5,8],used:[0,1,5,6,7],using:[1,8],view:8,vision:0,wait:8,want:8,web:8,webserv:8,websit:8,whatev:8,when:[5,8],which:[1,6,8],yet:1,you:8,your:8,your_raspi_ip:8,yourself:8,zone:1},titles:["Robo4you Competition Library","Api","Battery","Buzzer","Infrared Sensor","Logging","Motor","Servo","Vision","Usage"],titleterms:{"class":[2,3,5,6],Using:8,analog:4,api:1,batteri:2,buzzer:3,call:1,chessboard:8,competit:0,content:0,detect:8,document:[2,3,5,6],doubl:1,drive:6,elimin:1,exampl:[1,2,3,4,5,6,8],infrar:4,librari:0,log:5,mayb:6,modul:8,motor:6,off:3,opencv:8,percentag:2,posit:1,print:2,robo4y:0,seed:1,sensor:4,servo:7,straight:6,stream:8,test:4,turn:[3,5],usag:9,vision:8}})
|
Reference in a new issue