|
- read_raw() (compLib.Encoder.Encoder static method)
@@ -217,8 +318,26 @@
S
+
+W
+
diff --git a/lib/Api.html b/lib/Api.html
index 0324736..e534725 100644
--- a/lib/Api.html
+++ b/lib/Api.html
@@ -173,12 +173,142 @@
Api
Seeding
+
+-
+class
compLib.Api. Seeding
+Class used for communicating with seeding api
+
+-
+static
get_park () → Tuple[Dict, int]
+Get a parkingsapce from the api.
+
+- Returns
+Json Object and status code as returned by the api.
+
+- Return type
+Tuple[Dict, int]
+
+
+
+
+
+-
+static
pay_park () → int
+Pay for parking.
+
+- Returns
+Status code as returned by the api.
+
+- Return type
+int
+
+
+
+
+
+-
+static
simon_says () → Tuple[Dict, int]
+Get next simon says zone from the api.
+
+- Returns
+Json Object and status code as returned by the api.
+
+- Return type
+Tuple[Dict, int]
+
+
+
+
+
+
Double Elimination
+
+-
+class
compLib.Api. DoubleElim
+Class used for communicating with double elimination api
+
+-
+static
get_goal () → Tuple[compLib.Api.Position, int]
+Get position of the goal
+
+- Returns
+A Position object with x and y coordinates of the goal, rotation is always -1
+
+- Return type
+Tuple[Position, int]
+
+
+
+
+
+-
+static
get_items () → Tuple[List[Dict], int]
+Get a list with all current items
+
+- Returns
+A list will all items currently on the game field. Items are dictionaries that look like: {“id”: 0, “x”: 0, “y”: 0}
+
+- Return type
+Tuple[List[Dict], int]
+
+
+
+
+
+-
+static
get_opponent () → Tuple[compLib.Api.Position, int]
+Get position of the opponents robot
+
+- Returns
+A Position object with opponents robot position
+
+- Return type
+Tuple[Position, int]
+
+
+
+
+
+-
+static
get_position () → Tuple[compLib.Api.Position, int]
+Get position of the robot
+
+- Returns
+A Position object with robot position
+
+- Return type
+Tuple[Position, int]
+
+
+
+
+
+-
+static
get_scores () → Tuple[Dict, int]
+Get the current scores
+
+- Returns
+A dictionary with all scores included like: {“self”:2,”opponent”:0}
+
+- Return type
+Tuple[Dict, int]
+
+
+
+
+
+
Position
+
+-
+class
compLib.Api. Position (x, y, degrees)
+Datastructure for holding a position
+
+
Examples
diff --git a/lib/Display.html b/lib/Display.html
index e2fb24b..b5c5910 100644
--- a/lib/Display.html
+++ b/lib/Display.html
@@ -170,6 +170,35 @@
Display
Class Documentation
+
+-
+class
compLib.Display. Display
+Access the different IR Sensors of the robot
+
+-
+static
clear ()
+Clear the display
+
+
+
+-
+static
write (line: int, text: <module 'string' from '/usr/local/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/string.py'>)
+Write a string of text to the integrated display.
+
+- Parameters
+-
+
+- Raises
+IndexError
+
+
+
+
+
+
Examples
diff --git a/lib/Encoder.html b/lib/Encoder.html
index a1163cd..f71104c 100644
--- a/lib/Encoder.html
+++ b/lib/Encoder.html
@@ -176,7 +176,7 @@
Reset encoder position to 0
- Parameters
-port – Port, which the motor is connected to. 1-4 allowed
+port – Port, which the motor is connected to. Between 1 and 4
- Raises
IndexError
@@ -196,7 +196,7 @@
Read encoder from a specified port
- Parameters
-port – Port, which the motor is connected to. 1-4 allowed
+port – Port, which the motor is connected to. Between 1 and 4
- Raises
IndexError
@@ -213,7 +213,7 @@
Read raw encoder from a specified port. Will not be reset to 0 at start.
- Parameters
-port – Port, which the motor is connected to. 1-4 allowed
+port – Port, which the motor is connected to. Between 1 and 4
- Raises
IndexError
diff --git a/lib/IRSensor.html b/lib/IRSensor.html
index 90fc546..623679d 100644
--- a/lib/IRSensor.html
+++ b/lib/IRSensor.html
@@ -167,6 +167,46 @@
Infrared Sensor
+
+-
+class
compLib.IRSensor. IRSensor
+Access the different IR Sensors of the robot
+
+-
+static
read (sensor: int) → int
+Read one infrared sensor
+
+- Parameters
+sensor – Which sensor to read. Between 1 and 5
+
+- Raises
+IndexError
+
+- Returns
+Sensor value. 10 bit accuracy
+
+- Return type
+int
+
+
+
+
+
+-
+static
set (sensor: int, on: bool)
+Turn on / off a IR emitter
+
+- Parameters
+sensor – Which sensor to read. Between 1 and 5
+
+- Raises
+IndexError
+
+
+
+
+
+
Examples
diff --git a/lib/Motor.html b/lib/Motor.html
index c25095e..dbb2589 100644
--- a/lib/Motor.html
+++ b/lib/Motor.html
@@ -170,6 +170,112 @@
Motor
Class Documentation
+
+-
+class
compLib.Motor. Motor
+Class used to control the motors
+
+-
+static
active_break (port: int)
+Actively break with a specific motor
+
+- Parameters
+port – Port, which the motor is connected to. 1-4
+
+
+
+
+
+-
+static
all_off ()
+Turns of all motors
+
+
+
+-
+static
get_motor_curve ()
+Get the currently active motor curve. Check set_motor_curve() for more info.
+
+- Returns
+current motor curve
+
+
+
+
+
+-
+static
power (port: int, percent: float)
+Set specified motor to percentage power, percentage is linearized
+so that it’s roughly proportional to the speed
+
+- Parameters
+
+port – Port, which the motor is connected to. 1-4
+percent – Percentage of max speed. between -100 and 100
+
+
+- Raises
+IndexError
+
+
+
+
+
+-
+static
power_raw (port: int, percent: float, log_metric=True)
+Set specified motor to percentage power
+
+- Parameters
+
+port – Port, which the motor is connected to. 1-4
+percent – Percentage of max speed. between -100 and 100
+
+
+- Raises
+IndexError
+
+
+
+
+
+-
+static
pwm (port: int, pwm: int, mode: compLib.Motor.MotorMode)
+Set specified motor to a specific pwm value and motor mode
+
+- Parameters
+
+port – Port, which the motor is connected to. 1-4 allowed
+pwm – Raw PWM value which the motor should be set to. From 0 to 2^16 - 1
+mode – Motor mode. See enum MotorMode for more info
+
+
+- Raises
+IndexError
+
+
+
+
+
+-
+static
set_motor_curve (curve)
+Set the global motor curve, must be a float array with exactly 21 elements.
+[0] = x ticks/s (0% power)
+[1] = x ticks/s (5% power)
+[2] = x ticks/s (10% power)
+…
+[20] = x ticks/s (100% power)
+
+- Parameters
+curve – float array with 21 elements
+
+- Raises
+ValueError
+
+
+
+
+
+
Examples
diff --git a/lib/Vision.html b/lib/Vision.html
index 2abae1f..3b18d12 100644
--- a/lib/Vision.html
+++ b/lib/Vision.html
@@ -180,6 +180,41 @@
Opencv Stream
Because of the rtmp stream needing to buffer some frames and waiting for P-Frames, importing this module might take up
to 5 Seconds.
+
+-
+class
compLib.Vision. __Streaming
+Class that handles rtmp streaming for opencv.
+DO NOT CREATE AN INSTANCE OF THIS CLASS YOURSELF!
+This is automatically done when importing this module. Use Vision.Streaming which is
+an instance of this class!
+grab frames -> do your own processing -> publish frame -> view on http server
+
+-
+
get_frame ()
+Grab the newest frame from the rtmp stream.
+
+- Returns
+An opencv frame
+
+
+
+
+
+-
+
publish_frame (image)
+Publish an opencv frame to the http webserver.
+
+- Parameters
+image – Opencv frame that will be published
+
+- Returns
+None
+
+
+
+
+
+
Examples
diff --git a/objects.inv b/objects.inv
index f9811ef..9e191b0 100644
Binary files a/objects.inv and b/objects.inv differ
diff --git a/searchindex.js b/searchindex.js
index 4bb9dfd..3e1dc95 100644
--- a/searchindex.js
+++ b/searchindex.js
@@ -1 +1 @@
-Search.setIndex({docnames:["index","lib/Api","lib/Aruco","lib/Display","lib/Encoder","lib/IRSensor","lib/Linefollower","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/Aruco.rst","lib/Display.rst","lib/Encoder.rst","lib/IRSensor.rst","lib/Linefollower.rst","lib/Logging.rst","lib/Motor.rst","lib/Servo.rst","lib/Vision.rst","other/usage.rst"],objects:{"compLib.Encoder":{Encoder:[4,0,1,""]},"compLib.Encoder.Encoder":{clear:[4,1,1,""],clear_all:[4,1,1,""],read:[4,1,1,""],read_raw:[4,1,1,""]},"compLib.LogstashLogging":{Logging:[7,0,1,""]},"compLib.LogstashLogging.Logging":{get_logger:[7,1,1,""],set_debug:[7,1,1,""]}},objnames:{"0":["py","class","Python class"],"1":["py","method","Python method"]},objtypes:{"0":"py:class","1":"py:method"},terms:{"001":[6,10],"100":6,"2021":0,"204":1,"403":1,"480":2,"500":6,"640":2,"750":6,"9898":10,"break":6,"class":0,"function":2,"import":[1,2,3,5,6,7,8,10,11],"int":4,"return":[1,2,4,7],"static":[4,7],"true":[2,5,6,10],"while":[2,5,6,10],BUT:10,For:10,The:[2,10],Using:0,Will:4,With:2,__main__:[2,6,11],__name__:[2,6,11],act:2,active_break:6,all:4,allow:4,analog:0,api:0,aruco:0,aruco_dict:2,aruco_paramet:2,back:1,back_mult:6,backward:11,base:2,becaus:10,beep:11,bin:11,bit:10,black:6,bot:6,bottom:2,bottom_left_calibr:6,bottom_middle_calibr:6,bottom_right_calibr:6,browser:10,buffer:10,buup:11,calibr:6,call:0,cam:10,camera:10,can:[1,2,7,10],captur:10,center:2,check:1,chessboard:0,clear:4,clear_al:4,code:1,color_bgr2grai:[2,10],color_break:6,come:10,commun:7,competit:7,complib:[0,1,2,3,4,5,6,7,8,10,11],connect:[4,10],convert:10,coordin:2,copi:2,corner:[2,10],correct:1,criteria:10,current:4,cv2:[2,10],cvtcolor:[2,10],debug:7,def:[2,6,11],degre:1,desiredid:2,detect:0,detectmark:2,detectorparameters_cr:2,dict_6x6_250:2,dictionary_get:2,displai:[0,10],document:[0,10],doesn:6,done:10,doubl:0,doubleelim:1,draw:10,drawchessboardcorn:10,drawdetectedmark:2,drive:[0,1,6],easi:2,ein:11,elif:[1,6],elimin:0,els:[1,2,6],encod:0,exampl:0,fail:1,fals:6,find:10,findchessboardcorn:10,follow:6,follow_till_lin:6,format:[5,6],forward:11,found:2,frame:[2,10],from:[1,2,3,4,5,6,7,8,10,11],get:[2,7,10],get_fram:[2,10],get_goal:1,get_logg:7,get_park:1,get_posit:1,getnormalizedtagposit:2,gettagcenterfromfram:2,gettagposit:2,goal:1,grab:10,grai:[2,10],grayscal:10,hallo:11,height:2,hello:3,here:10,hopefulli:1,how:[2,10],http:10,ich:11,ids:2,imag:10,indexerror:4,infrar:0,initi:6,instantli:6,interfac:10,internet:10,irsensor:5,irwrapp:6,lag:10,left:[2,5,6],level:7,librari:7,like:10,line:[0,6],linefollow:0,littl:10,log:0,logger:7,logstash:7,logstashlog:7,look:10,main:11,make:1,manual:7,max:6,mayb:0,middl:[5,6],might:10,min:6,modul:[0,1],motor:[0,1,4,6,11],move:1,need:10,newest:10,none:[2,10],normal:2,note:10,now:1,object:7,off:6,onto:[6,10],opencv:0,organ:7,output:10,own:10,paramet:[2,4],park:1,pass:6,pay_park:1,pixel:2,point:[1,10],port:[4,11],posit:[0,2,4,10],power:[6,8,11],print:[1,2,5,6,11],process:10,provid:10,publish:10,publish_fram:[2,10],put:6,python:7,quit:2,rais:4,rang:[2,11],raspberri:10,raw:4,read:[4,5],read_raw:4,realtim:10,recogn:0,record:10,rejectedimgpoint:2,request:1,reset:4,respond:1,ret:10,right:[2,5,6],robot:[1,11],rotat:1,rtmp:10,run:10,same:2,score:1,screen:2,screenshot:10,second:10,seed:0,sensor:[0,6],server:[1,10],servo:0,set_debug:7,shape:2,should:[1,7,10],show:[2,10],similar:1,simpl:[0,2],sleep:[6,11],some:[1,10],someth:1,specifi:[2,4],speed:6,start:4,statu:1,straight:0,straight_spe:6,stream:[0,2],success:1,tag:0,tag_id:2,take:10,term_criteria_ep:10,term_criteria_max_it:10,test:[0,10],thi:[1,2,7,10],till:6,time:[2,3,6,11],top:2,turn:0,turn_spe:6,type:7,usag:0,use:[2,7,10],used:[0,4,7],using:[1,10],veri:2,view:10,vision:[0,2],wai:2,wait:10,want:[2,10],web:10,websit:10,whatev:10,when:7,which:[1,4],width:2,world:3,write:0,yet:1,you:[2,10],your:10,your_raspi_ip:10,zip:2,zone:1},titles:["Robo4you Competition Library","Api","Aruco","Display","Encoder","Infrared Sensor","Linefollower Examples","Logging","Motor","Servo","Vision","Usage"],titleterms:{"class":[3,4,7,8],Using:10,analog:5,api:1,aruco:2,call:1,chessboard:10,competit:0,content:0,detect:10,displai:3,document:[3,4,7,8],doubl:1,drive:8,elimin:1,encod:4,exampl:[1,2,3,5,6,7,8,10],infrar:5,librari:0,line:3,linefollow:6,log:7,mayb:8,modul:10,motor:8,opencv:10,posit:1,recogn:2,robo4y:0,seed:1,sensor:5,servo:9,simpl:6,straight:8,stream:10,tag:2,test:5,turn:7,usag:11,vision:10,write:3}})
\ No newline at end of file
+Search.setIndex({docnames:["index","lib/Api","lib/Aruco","lib/Display","lib/Encoder","lib/IRSensor","lib/Linefollower","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/Aruco.rst","lib/Display.rst","lib/Encoder.rst","lib/IRSensor.rst","lib/Linefollower.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.Display":{Display:[3,0,1,""]},"compLib.Display.Display":{clear:[3,1,1,""],write:[3,1,1,""]},"compLib.Encoder":{Encoder:[4,0,1,""]},"compLib.Encoder.Encoder":{clear:[4,1,1,""],clear_all:[4,1,1,""],read:[4,1,1,""],read_raw:[4,1,1,""]},"compLib.IRSensor":{IRSensor:[5,0,1,""]},"compLib.IRSensor.IRSensor":{read:[5,1,1,""],set:[5,1,1,""]},"compLib.LogstashLogging":{Logging:[7,0,1,""]},"compLib.LogstashLogging.Logging":{get_logger:[7,1,1,""],set_debug:[7,1,1,""]},"compLib.Motor":{Motor:[8,0,1,""]},"compLib.Motor.Motor":{active_break:[8,1,1,""],all_off:[8,1,1,""],get_motor_curve:[8,1,1,""],power:[8,1,1,""],power_raw:[8,1,1,""],pwm:[8,1,1,""],set_motor_curve:[8,1,1,""]},"compLib.Vision":{__Streaming:[10,0,1,""]},"compLib.Vision.__Streaming":{get_frame:[10,1,1,""],publish_frame:[10,1,1,""]}},objnames:{"0":["py","class","Python class"],"1":["py","method","Python method"]},objtypes:{"0":"py:class","1":"py:method"},terms:{"001":[6,10],"100":[6,8],"2021":0,"204":1,"403":1,"480":2,"500":6,"640":2,"750":6,"9898":10,"break":[6,8],"class":[0,1,5,10],"enum":8,"float":8,"function":2,"import":[1,2,3,5,6,7,8,10,11],"int":[1,3,4,5,8],"return":[1,2,4,5,7,8,10],"static":[1,3,4,5,7,8],"true":[2,5,6,8,10],"while":[2,5,6,10],BUT:10,For:10,NOT:10,The:[2,10],Use:10,Using:0,Will:4,With:2,__main__:[2,6,11],__name__:[2,6,11],__stream:10,access:[3,5],accuraci:5,act:2,activ:8,active_break:[6,8],all:[1,4,8],all_off:8,allow:8,alwai:1,analog:0,api:0,arrai:8,aruco:0,aruco_dict:2,aruco_paramet:2,automat:10,back:1,back_mult:6,backward:11,base:2,becaus:10,beep:11,between:[3,4,5,8],bin:11,bit:[5,10],black:6,bool:5,bot:6,bottom:2,bottom_left_calibr:6,bottom_middle_calibr:6,bottom_right_calibr:6,browser:10,buffer:10,buup:11,calibr:6,call:0,cam:10,camera:10,can:[1,2,7,10],captur:10,cellar:3,center:2,charact:3,check:[1,8],chessboard:0,clear:[3,4],clear_al:4,code:1,color_bgr2grai:[2,10],color_break:6,come:10,commun:[1,7],competit:7,complib:[0,1,2,3,4,5,6,7,8,10,11],connect:[4,8,10],control:8,convert:10,coordin:[1,2],copi:2,corner:[2,10],correct:1,creat:10,criteria:10,current:[1,4,8],curv:8,cv2:[2,10],cvtcolor:[2,10],datastructur:1,debug:7,def:[2,6,11],degre:1,desiredid:2,detect:0,detectmark:2,detectorparameters_cr:2,dict:1,dict_6x6_250:2,dictionari:1,dictionary_get:2,differ:[3,5],displai:[0,10],document:[0,10],doesn:6,done:10,doubl:0,doubleelim:1,draw:10,drawchessboardcorn:10,drawdetectedmark:2,drive:[0,1,6],easi:2,ein:11,element:8,elif:[1,6],elimin:0,els:[1,2,6],emitt:5,encod:0,exactli:8,exampl:0,fail:1,fals:6,field:1,find:10,findchessboardcorn:10,follow:6,follow_till_lin:6,format:[5,6],forward:11,found:2,frame:[2,10],framework:3,from:[1,2,3,4,5,6,7,8,10,11],game:1,get:[1,2,7,8,10],get_fram:[2,10],get_goal:1,get_item:1,get_logg:7,get_motor_curv:8,get_oppon:1,get_park:1,get_posit:1,get_scor:1,getnormalizedtagposit:2,gettagcenterfromfram:2,gettagposit:2,global:8,goal:1,grab:10,grai:[2,10],grayscal:10,hallo:11,handl:10,height:2,hello:3,here:10,hold:1,hopefulli:1,how:[2,10],http:10,ich:11,ids:2,imag:10,includ:1,indexerror:[3,4,5,8],info:8,infrar:0,initi:6,instanc:10,instantli:6,integr:3,interfac:10,internet:10,irsensor:5,irwrapp:6,item:1,json:1,lag:10,left:[2,5,6],level:7,lib:3,librari:7,like:[1,10],line:[0,6],linear:8,linefollow:0,list:1,littl:10,local:3,log:0,log_metr:8,logger:7,logstash:7,logstashlog:7,look:[1,10],main:11,make:1,manual:7,max:[6,8],mayb:0,middl:[5,6],might:10,min:6,mode:8,modul:[0,1,3],more:8,motor:[0,1,4,6,11],motormod:8,move:1,must:8,need:10,newest:10,next:1,none:[2,10],normal:2,note:10,now:1,object:[1,7],off:[5,6],one:5,onto:[6,10],opencv:0,oppon:1,organ:7,output:10,own:10,pai:1,paramet:[2,3,4,5,8,10],park:1,parkingsapc:1,pass:6,pay_park:1,percent:8,percentag:8,pixel:2,point:[1,10],port:[4,8,11],posit:[0,2,4,10],power:[6,8,11],power_raw:8,print:[1,2,5,6,11],process:10,proport:8,provid:10,publish:10,publish_fram:[2,10],put:6,pwm:8,python3:3,python:[3,7],quit:2,rais:[3,4,5,8],rang:[2,11],raspberri:10,raw:[4,8],read:[4,5],read_raw:4,realtim:10,recogn:0,record:10,rejectedimgpoint:2,request:1,reset:4,respond:1,ret:10,right:[2,5,6],robot:[1,3,5,11],rotat:1,roughli:8,rtmp:10,run:10,sai:1,same:2,score:1,screen:2,screenshot:10,second:10,see:8,seed:0,self:1,sensor:[0,3,6],server:[1,10],servo:0,set:[5,8],set_debug:7,set_motor_curv:8,shape:2,should:[1,7,8,10],show:[2,10],similar:1,simon:1,simon_sai:1,simpl:[0,2],sleep:[6,11],some:[1,10],someth:1,specif:8,specifi:[2,4,8],speed:[6,8],start:4,statu:1,straight:0,straight_spe:6,stream:[0,2],string:3,success:1,tag:0,tag_id:2,take:10,term_criteria_ep:10,term_criteria_max_it:10,test:[0,10],text:3,thi:[1,2,7,10],tick:8,till:6,time:[2,3,6,11],top:2,tupl:1,turn:[0,5,8],turn_spe:6,type:[1,5,7],usag:0,use:[2,7,10],used:[0,1,4,7,8],using:[1,10],usr:3,valu:[5,8],valueerror:8,veri:2,version:3,view:10,vision:[0,2],wai:2,wait:10,want:[2,10],web:10,webserv:10,websit:10,whatev:10,when:[7,10],which:[1,4,5,8,10],width:2,world:3,write:0,yet:1,you:[2,10],your:10,your_raspi_ip:10,yourself:10,zip:2,zone:1},titles:["Robo4you Competition Library","Api","Aruco","Display","Encoder","Infrared Sensor","Linefollower Examples","Logging","Motor","Servo","Vision","Usage"],titleterms:{"class":[3,4,7,8],Using:10,analog:5,api:1,aruco:2,call:1,chessboard:10,competit:0,content:0,detect:10,displai:3,document:[3,4,7,8],doubl:1,drive:8,elimin:1,encod:4,exampl:[1,2,3,5,6,7,8,10],infrar:5,librari:0,line:3,linefollow:6,log:7,mayb:8,modul:10,motor:8,opencv:10,posit:1,recogn:2,robo4y:0,seed:1,sensor:5,servo:9,simpl:6,straight:8,stream:10,tag:2,test:5,turn:7,usag:11,vision:10,write:3}})
\ No newline at end of file
|