Fixed documentation build script
This commit is contained in:
parent
aa6fb2fc8b
commit
e5c9f277b6
70 changed files with 194 additions and 19315 deletions
343
lib/Api.html
Normal file
343
lib/Api.html
Normal file
|
@ -0,0 +1,343 @@
|
|||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html class="writer-html5" lang="en" >
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
<title>Api — CompLib 0.0.2 documentation</title>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="../_static/js/html5shiv.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
|
||||
<script src="../_static/jquery.js"></script>
|
||||
<script src="../_static/underscore.js"></script>
|
||||
<script src="../_static/doctools.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<link rel="index" title="Index" href="../genindex.html" />
|
||||
<link rel="search" title="Search" href="../search.html" />
|
||||
<link rel="next" title="Battery" href="Battery.html" />
|
||||
<link rel="prev" title="Usage" href="../other/usage.html" />
|
||||
</head>
|
||||
|
||||
<body class="wy-body-for-nav">
|
||||
|
||||
|
||||
<div class="wy-grid-for-nav">
|
||||
|
||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
||||
<div class="wy-side-scroll">
|
||||
<div class="wy-side-nav-search" >
|
||||
|
||||
|
||||
|
||||
<a href="../index.html" class="icon icon-home"> CompLib
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="search">
|
||||
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
|
||||
<input type="text" name="q" placeholder="Search docs" />
|
||||
<input type="hidden" name="check_keywords" value="yes" />
|
||||
<input type="hidden" name="area" value="default" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="current">
|
||||
<li class="toctree-l1"><a class="reference internal" href="../index.html">Robo4you Competition Library</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../other/usage.html">Usage</a></li>
|
||||
<li class="toctree-l1 current"><a class="current reference internal" href="#">Api</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#seeding">Seeding</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#double-elimination">Double Elimination</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#position">Position</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#examples">Examples</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#calling-seeding-api">Calling Seeding API</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#calling-double-elimination-api">Calling Double Elimination API</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Battery.html">Battery</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Buzzer.html">Buzzer</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="IRSensor.html">Infrared Sensor</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Servo.html">Servo</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
||||
|
||||
|
||||
<nav class="wy-nav-top" aria-label="top navigation">
|
||||
|
||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||||
<a href="../index.html">CompLib</a>
|
||||
|
||||
</nav>
|
||||
|
||||
|
||||
<div class="wy-nav-content">
|
||||
|
||||
<div class="rst-content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||||
|
||||
<ul class="wy-breadcrumbs">
|
||||
|
||||
<li><a href="../index.html" class="icon icon-home"></a> »</li>
|
||||
|
||||
<li>Api</li>
|
||||
|
||||
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
|
||||
<a href="../_sources/lib/Api.rst.txt" rel="nofollow"> View page source</a>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<hr/>
|
||||
</div>
|
||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
||||
<div itemprop="articleBody">
|
||||
|
||||
<div class="section" id="api">
|
||||
<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> → int<a class="headerlink" href="#compLib.Api.Seeding.get_park" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get a parkingsapce from the api.
|
||||
:return: An int between 0 and 3</p>
|
||||
</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> → bool<a class="headerlink" href="#compLib.Api.Seeding.pay_park" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Pay for parking.
|
||||
:return: True if successful, False if not successful</p>
|
||||
</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> → int<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.
|
||||
:return: An int between 0 and 3 or -1 after making this request 5 times.</p>
|
||||
</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> → <a class="reference internal" href="#compLib.Api.Position" title="compLib.Api.Position">compLib.Api.Position</a><a class="headerlink" href="#compLib.Api.DoubleElim.get_goal" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get position of the goal
|
||||
:return: A Position object with x and y coordinates of the goal, rotation is always -1</p>
|
||||
</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> → list<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
|
||||
:return: A list will all items currently on the game field. Items are dictionaries that look like: {“id”: 0}</p>
|
||||
</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> → <a class="reference internal" href="#compLib.Api.Position" title="compLib.Api.Position">compLib.Api.Position</a><a class="headerlink" href="#compLib.Api.DoubleElim.get_opponent" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get position of the opponents robot
|
||||
:return: A Position object with opponents robot position</p>
|
||||
</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> → <a class="reference internal" href="#compLib.Api.Position" title="compLib.Api.Position">compLib.Api.Position</a><a class="headerlink" href="#compLib.Api.DoubleElim.get_position" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get position of the robot
|
||||
:return: A Position object with robot position</p>
|
||||
</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>
|
||||
<div class="section" id="calling-seeding-api">
|
||||
<h3>Calling Seeding API<a class="headerlink" href="#calling-seeding-api" 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.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="k">print</span><span class="p">(</span><span class="n">f</span><span class="s2">"I should move to parking position: {park}"</span><span class="p">)</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">park</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="n">f</span><span class="s2">"I can't move to this position yet :("</span><span class="p">)</span>
|
||||
<span class="k">elif</span> <span class="n">park</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="n">f</span><span class="s2">"Moving to position 1!"</span><span class="p">)</span>
|
||||
<span class="c1"># drive to parking position using Motors module...</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="n">f</span><span class="s2">"Now hopefully at position 1"</span><span class="p">)</span>
|
||||
<span class="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>
|
||||
<span class="k">elif</span> <span class="n">park</span> <span class="o">==</span> <span class="mi">3</span><span class="p">:</span>
|
||||
<span class="c1"># do something similar to park == 1..</span>
|
||||
|
||||
<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="k">print</span><span class="p">(</span><span class="n">f</span><span class="s2">"We scored some points!"</span><span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="n">f</span><span class="s2">"We failed :("</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="calling-double-elimination-api">
|
||||
<h3>Calling Double Elimination API<a class="headerlink" href="#calling-double-elimination-api" 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.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="k">print</span><span class="p">(</span><span class="n">f</span><span class="s2">"Position of my robot is: x={position.x}, y={position.y} and rotation is: {position.degrees}"</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="k">print</span><span class="p">(</span><span class="n">f</span><span class="s2">"Goal is at: x={goal.x}, y={goal.y}"</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
||||
<a href="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>
|
||||
© Copyright 2021, robo4you.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using 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>
|
||||
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
SphinxRtdTheme.Navigation.enable(true);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
Reference in a new issue