Update documentation

This commit is contained in:
Joel 2021-01-26 20:40:55 +01:00
parent a7f5dd13c4
commit 0f4f2438cb
No known key found for this signature in database
GPG key ID: BDDDBECD0808290E
15 changed files with 212 additions and 238 deletions

View file

@ -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 &mdash; CompLib 0.0.2 documentation</title>
@ -16,10 +16,13 @@
<!--[if lt IE 9]>
<script src="../_static/js/html5shiv.min.js"></script>
<![endif]-->
@ -50,7 +53,7 @@
<a href="../index.html" class="icon icon-home" alt="Documentation Home"> CompLib
<a href="../index.html" class="icon icon-home"> CompLib
@ -142,6 +145,8 @@
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
@ -153,7 +158,7 @@
<li class="wy-breadcrumbs-aside">
<a href="../_sources/lib/Api.rst.txt" rel="nofollow"> View page source</a>
@ -301,14 +306,14 @@
<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">Seeding</span>
<span class="n">park</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="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;I should move to parking position: </span><span class="si">{</span><span class="n">park</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>
<span class="k">print</span><span class="p">(</span><span class="n">f</span><span class="s2">&quot;I should move to parking position: {park}&quot;</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="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;I can&#39;t move to this position yet :(&quot;</span><span class="p">)</span>
<span class="k">print</span><span class="p">(</span><span class="n">f</span><span class="s2">&quot;I can&#39;t move to this position yet :(&quot;</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="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Moving to position 1!&quot;</span><span class="p">)</span>
<span class="k">print</span><span class="p">(</span><span class="n">f</span><span class="s2">&quot;Moving to position 1!&quot;</span><span class="p">)</span>
<span class="c1"># drive to parking position using Motors module...</span>
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Now hopefully at position 1&quot;</span><span class="p">)</span>
<span class="k">print</span><span class="p">(</span><span class="n">f</span><span class="s2">&quot;Now hopefully at position 1&quot;</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>
@ -317,9 +322,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="k">if</span> <span class="n">success</span><span class="p">:</span>
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;We scored some points!&quot;</span><span class="p">)</span>
<span class="k">print</span><span class="p">(</span><span class="n">f</span><span class="s2">&quot;We scored some points!&quot;</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;We failed :(&quot;</span><span class="p">)</span>
<span class="k">print</span><span class="p">(</span><span class="n">f</span><span class="s2">&quot;We failed :(&quot;</span><span class="p">)</span>
</pre></div>
</div>
</div>
@ -328,10 +333,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="o">=</span> <span class="n">DoubleElim</span><span class="o">.</span><span class="n">get_position</span><span class="p">()</span>
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;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">&quot;</span><span class="p">)</span>
<span class="k">print</span><span class="p">(</span><span class="n">f</span><span class="s2">&quot;Position of my robot is: x={position.x}, y={position.y} and rotation is: {position.degrees}&quot;</span><span class="p">)</span>
<span class="n">goal</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="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;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">&quot;</span><span class="p">)</span>
<span class="k">print</span><span class="p">(</span><span class="n">f</span><span class="s2">&quot;Goal is at: x={goal.x}, y={goal.y}&quot;</span><span class="p">)</span>
</pre></div>
</div>
</div>
@ -343,37 +348,29 @@
</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"></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>
<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>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2021, robo4you
&#169; Copyright 2021, robo4you.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a>
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>

View file

@ -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 &mdash; CompLib 0.0.2 documentation</title>
@ -16,10 +16,13 @@
<!--[if lt IE 9]>
<script src="../_static/js/html5shiv.min.js"></script>
<![endif]-->
@ -50,7 +53,7 @@
<a href="../index.html" class="icon icon-home" alt="Documentation Home"> CompLib
<a href="../index.html" class="icon icon-home"> CompLib
@ -139,6 +142,8 @@
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
@ -150,7 +155,7 @@
<li class="wy-breadcrumbs-aside">
<a href="../_sources/lib/Battery.rst.txt" rel="nofollow"> View page source</a>
@ -195,7 +200,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="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>
<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>
</pre></div>
</div>
</div>
@ -207,37 +212,29 @@
</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"></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>
<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>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2021, robo4you
&#169; Copyright 2021, robo4you.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a>
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>

View file

@ -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 &mdash; CompLib 0.0.2 documentation</title>
@ -16,10 +16,13 @@
<!--[if lt IE 9]>
<script src="../_static/js/html5shiv.min.js"></script>
<![endif]-->
@ -50,7 +53,7 @@
<a href="../index.html" class="icon icon-home" alt="Documentation Home"> CompLib
<a href="../index.html" class="icon icon-home"> CompLib
@ -139,6 +142,8 @@
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
@ -150,7 +155,7 @@
<li class="wy-breadcrumbs-aside">
<a href="../_sources/lib/Buzzer.rst.txt" rel="nofollow"> View page source</a>
@ -193,9 +198,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="kc">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="bp">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="kc">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="bp">False</span><span class="p">)</span>
</pre></div>
</div>
</div>
@ -207,37 +212,29 @@
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="IRSensor.html" class="btn btn-neutral float-right" title="Infrared Sensor" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="Battery.html" class="btn btn-neutral float-left" title="Battery" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></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" 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>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2021, robo4you
&#169; Copyright 2021, robo4you.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a>
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>

View file

@ -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 &mdash; CompLib 0.0.2 documentation</title>
@ -16,10 +16,13 @@
<!--[if lt IE 9]>
<script src="../_static/js/html5shiv.min.js"></script>
<![endif]-->
@ -50,7 +53,7 @@
<a href="../index.html" class="icon icon-home" alt="Documentation Home"> CompLib
<a href="../index.html" class="icon icon-home"> CompLib
@ -132,6 +135,8 @@
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
@ -143,7 +148,7 @@
<li class="wy-breadcrumbs-aside">
<a href="../_sources/lib/IRSensor.rst.txt" rel="nofollow"> View page source</a>
@ -242,37 +247,29 @@
</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"></span></a>
<a href="Buzzer.html" class="btn btn-neutral float-left" title="Buzzer" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
<a href="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>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2021, robo4you
&#169; Copyright 2021, robo4you.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a>
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>

View file

@ -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 &mdash; CompLib 0.0.2 documentation</title>
@ -16,10 +16,13 @@
<!--[if lt IE 9]>
<script src="../_static/js/html5shiv.min.js"></script>
<![endif]-->
@ -50,7 +53,7 @@
<a href="../index.html" class="icon icon-home" alt="Documentation Home"> CompLib
<a href="../index.html" class="icon icon-home"> CompLib
@ -139,6 +142,8 @@
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
@ -150,7 +155,7 @@
<li class="wy-breadcrumbs-aside">
<a href="../_sources/lib/Logging.rst.txt" rel="nofollow"> View page source</a>
@ -214,37 +219,29 @@ 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"></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>
<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>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2021, robo4you
&#169; Copyright 2021, robo4you.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a>
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>

View file

@ -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 &mdash; CompLib 0.0.2 documentation</title>
@ -16,10 +16,13 @@
<!--[if lt IE 9]>
<script src="../_static/js/html5shiv.min.js"></script>
<![endif]-->
@ -50,7 +53,7 @@
<a href="../index.html" class="icon icon-home" alt="Documentation Home"> CompLib
<a href="../index.html" class="icon icon-home"> CompLib
@ -139,6 +142,8 @@
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
@ -150,7 +155,7 @@
<li class="wy-breadcrumbs-aside">
<a href="../_sources/lib/Motor.rst.txt" rel="nofollow"> View page source</a>
@ -217,37 +222,29 @@
</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"></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>
<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>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2021, robo4you
&#169; Copyright 2021, robo4you.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a>
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>

View file

@ -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 &mdash; CompLib 0.0.2 documentation</title>
@ -16,10 +16,13 @@
<!--[if lt IE 9]>
<script src="../_static/js/html5shiv.min.js"></script>
<![endif]-->
@ -50,7 +53,7 @@
<a href="../index.html" class="icon icon-home" alt="Documentation Home"> CompLib
<a href="../index.html" class="icon icon-home"> CompLib
@ -132,6 +135,8 @@
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
@ -143,7 +148,7 @@
<li class="wy-breadcrumbs-aside">
<a href="../_sources/lib/Servo.rst.txt" rel="nofollow"> View page source</a>
@ -192,37 +197,29 @@
</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"></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>
<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>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2021, robo4you
&#169; Copyright 2021, robo4you.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a>
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>

View file

@ -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 &mdash; CompLib 0.0.2 documentation</title>
@ -16,10 +16,13 @@
<!--[if lt IE 9]>
<script src="../_static/js/html5shiv.min.js"></script>
<![endif]-->
@ -49,7 +52,7 @@
<a href="../index.html" class="icon icon-home" alt="Documentation Home"> CompLib
<a href="../index.html" class="icon icon-home"> CompLib
@ -139,6 +142,8 @@
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
@ -150,7 +155,7 @@
<li class="wy-breadcrumbs-aside">
<a href="../_sources/lib/Vision.rst.txt" rel="nofollow"> View page source</a>
@ -221,13 +226,14 @@ 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="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>
<span class="k">while</span> <span class="bp">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>
<span class="c1"># do some processing with the frame.....</span>
<span class="c1"># do some processing with the frame.....</span>
<span class="c1"># publish frame to streaming server</span>
<span class="n">Vision</span><span class="o">.</span><span class="n">Streaming</span><span class="o">.</span><span class="n">publish_frame</span><span class="p">(</span><span class="n">frame</span><span class="p">)</span>
<span class="c1"># publish frame to streaming server</span>
<span class="n">Vision</span><span class="o">.</span><span class="n">Streaming</span><span class="o">.</span><span class="n">publish_frame</span><span class="p">(</span><span class="n">frame</span><span class="p">)</span>
</pre></div>
</div>
<p>Connect the raspberry pi to your internet and view the stream at: “<a class="reference external" href="http://your_raspi_ip:9898/">http://your_raspi_ip:9898/</a>”. This should display
@ -245,22 +251,23 @@ 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="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>
<span class="k">while</span> <span class="bp">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>
<span class="n">criteria</span> <span class="o">=</span> <span class="p">(</span><span class="n">cv2</span><span class="o">.</span><span class="n">TERM_CRITERIA_EPS</span> <span class="o">+</span> <span class="n">cv2</span><span class="o">.</span><span class="n">TERM_CRITERIA_MAX_ITER</span><span class="p">,</span> <span class="mi">30</span><span class="p">,</span> <span class="mf">0.001</span><span class="p">)</span>
<span class="n">criteria</span> <span class="o">=</span> <span class="p">(</span><span class="n">cv2</span><span class="o">.</span><span class="n">TERM_CRITERIA_EPS</span> <span class="o">+</span> <span class="n">cv2</span><span class="o">.</span><span class="n">TERM_CRITERIA_MAX_ITER</span><span class="p">,</span> <span class="mi">30</span><span class="p">,</span> <span class="mf">0.001</span><span class="p">)</span>
<span class="c1"># convert image to grayscale image</span>
<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"># convert image to grayscale image</span>
<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="kc">None</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="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>
<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>
<span class="c1"># publish frame to streaming server</span>
<span class="n">Vision</span><span class="o">.</span><span class="n">Streaming</span><span class="o">.</span><span class="n">publish_frame</span><span class="p">(</span><span class="n">frame</span><span class="p">)</span>
<span class="c1"># publish frame to streaming server</span>
<span class="n">Vision</span><span class="o">.</span><span class="n">Streaming</span><span class="o">.</span><span class="n">publish_frame</span><span class="p">(</span><span class="n">frame</span><span class="p">)</span>
</pre></div>
</div>
<p>Connect the raspberry pi to your internet and view the stream at: “<a class="reference external" href="http://your_raspi_ip:9898/">http://your_raspi_ip:9898/</a>”.</p>
@ -277,35 +284,28 @@ 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"></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" aria-hidden="true"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2021, robo4you
&#169; Copyright 2021, robo4you.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a>
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>