Update documentation
This commit is contained in:
parent
0c9976565c
commit
f517ae1b42
3 changed files with 18 additions and 18 deletions
|
@ -65,8 +65,8 @@ Calling Double Elimination API
|
|||
|
||||
from compLib.Api import DoubleElim
|
||||
|
||||
position = DoubleElim.get_position()
|
||||
print(f"Position of my robot is: x={position.x}, y={position.y} and rotation is: {position.degrees}")
|
||||
position, status = DoubleElim.get_position()
|
||||
print(f"Position of my robot is: x={position.x}, y={position.y} and rotation is: {position.degrees}, the server responded with status code: {status}")
|
||||
|
||||
goal = DoubleElim.get_goal()
|
||||
print(f"Goal is at: x={goal.x}, y={goal.y}")
|
||||
goal, status = DoubleElim.get_goal()
|
||||
print(f"Goal is at: x={goal.x}, y={goal.y}, the server responded with status code: {status}")
|
||||
|
|
26
lib/Api.html
26
lib/Api.html
|
@ -233,56 +233,56 @@
|
|||
<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>
|
||||
<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><a class="reference internal" href="#compLib.Api.Position" title="compLib.Api.Position">Position</a></p>
|
||||
<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> → list<a class="headerlink" href="#compLib.Api.DoubleElim.get_items" title="Permalink to this definition">¶</a></dt>
|
||||
<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}</p>
|
||||
<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>list</p>
|
||||
<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> → <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>
|
||||
<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><a class="reference internal" href="#compLib.Api.Position" title="compLib.Api.Position">Position</a></p>
|
||||
<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> → <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>
|
||||
<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><a class="reference internal" href="#compLib.Api.Position" title="compLib.Api.Position">Position</a></p>
|
||||
<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>
|
||||
|
@ -337,11 +337,11 @@
|
|||
<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">position</span><span class="p">,</span> <span class="n">status</span> <span class="o">=</span> <span class="n">DoubleElim</span><span class="o">.</span><span class="n">get_position</span><span class="p">()</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="n">f</span><span class="s2">"Position of my robot is: x={position.x}, y={position.y} and rotation is: {position.degrees}, the server responded with status code: {status}"</span><span class="p">)</span>
|
||||
|
||||
<span class="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>
|
||||
<span class="n">goal</span><span class="p">,</span> <span class="n">status</span> <span class="o">=</span> <span class="n">DoubleElim</span><span class="o">.</span><span class="n">get_goal</span><span class="p">()</span>
|
||||
<span class="k">print</span><span class="p">(</span><span class="n">f</span><span class="s2">"Goal is at: x={goal.x}, y={goal.y}, the server responded with status code: {status}"</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -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.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,""]},"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.IRSensor":{IRSensor:[4,0,1,""]},"compLib.IRSensor.IRSensor":{bottom_left:[4,1,1,""],bottom_middle:[4,1,1,""],bottom_right:[4,1,1,""],top_left_percent:[4,1,1,""],top_right_percent:[4,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,4,6],"2021":0,"204":1,"403":1,"9898":8,"class":[0,1,4,7,8],"float":[6,7],"import":[1,2,3,5,6,8,9],"int":[1,2,4,6,7],"return":[1,2,4,5,8],"static":[1,2,3,4,5,6,7],"true":[3,4,8],"while":8,BUT:8,For:8,NOT:8,The:8,Use:8,Used:[2,3],Using:0,__main__:9,__name__:9,__stream:8,access:4,all:[1,6],all_off:6,alwai:1,angl:7,api:0,automat:8,back:1,backward:9,batteri:0,becaus:8,beep:9,between:[2,4,6,7],bin:9,bit:8,bool:[3,4],bottom:4,bottom_left:4,bottom_middl:4,bottom_right: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,4],dict:1,dictionari:1,differ:4,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,forward:9,frame:8,from:[1,2,3,5,6,8,9],game:1,get:[1,2,4,5,8],get_fram:8,get_goal:1,get_item:1,get_logg:5,get_oppon:1,get_park:1,get_posit: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,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,4,6],point:[1,8],port:[6,7,9],posit:[0,7,8],power:[6,9],print:[0,1,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,ret:8,right:[4,6],robot:[1,4,7,9],rotat:1,rtmp:8,run:8,sai:1,score:1,screenshot:8,second:8,seed:0,sensor:0,server:8,servo:0,set:[3,6,7],set_debug:5,set_posit:7,setup:7,setup_posit:7,should:[1,5,8],show:8,signal:4,similar:1,simon:1,simon_sai:1,sleep:[3,9],some:[1,8],someth:1,specifi:6,speed:6,statu:[1,4],straight:0,stream:0,success:1,take:8,term_criteria_ep:8,term_criteria_max_it:8,test:8,thi:[1,5,8],time:[3,9],top:[4,6],top_left_perc:4,top_right_perc:4,tupl:1,turn:[0,6],type:[1,2,4,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,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,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,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,""]},"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.IRSensor":{IRSensor:[4,0,1,""]},"compLib.IRSensor.IRSensor":{bottom_left:[4,1,1,""],bottom_middle:[4,1,1,""],bottom_right:[4,1,1,""],top_left_percent:[4,1,1,""],top_right_percent:[4,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,4,6],"2021":0,"204":1,"403":1,"9898":8,"class":[0,1,4,7,8],"float":[6,7],"import":[1,2,3,5,6,8,9],"int":[1,2,4,6,7],"return":[1,2,4,5,8],"static":[1,2,3,4,5,6,7],"true":[3,4,8],"while":8,BUT:8,For:8,NOT:8,The:8,Use:8,Used:[2,3],Using:0,__main__:9,__name__:9,__stream:8,access:4,all:[1,6],all_off:6,alwai:1,angl:7,api:0,automat:8,back:1,backward:9,batteri:0,becaus:8,beep:9,between:[2,4,6,7],bin:9,bit:8,bool:[3,4],bottom:4,bottom_left:4,bottom_middl:4,bottom_right: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,4],dict:1,dictionari:1,differ:4,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,forward:9,frame:8,from:[1,2,3,5,6,8,9],game:1,get:[1,2,4,5,8],get_fram:8,get_goal:1,get_item:1,get_logg:5,get_oppon:1,get_park:1,get_posit: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,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,4,6],point:[1,8],port:[6,7,9],posit:[0,7,8],power:[6,9],print:[0,1,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,4,7,9],rotat:1,rtmp:8,run:8,sai:1,score:1,screenshot:8,second:8,seed:0,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,signal:4,similar:1,simon:1,simon_sai:1,sleep:[3,9],some:[1,8],someth:1,specifi:6,speed:6,statu:[1,4],straight:0,stream:0,success:1,take:8,term_criteria_ep:8,term_criteria_max_it:8,test:8,thi:[1,5,8],time:[3,9],top:[4,6],top_left_perc:4,top_right_perc:4,tupl:1,turn:[0,6],type:[1,2,4,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,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,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,turn:[3,5],usag:9,vision:8}})
|
Reference in a new issue