From cf7d60f0027d08894b4dacedf658530d09154ef7 Mon Sep 17 00:00:00 2001 From: Konstantin Lampalzer Date: Fri, 19 Mar 2021 15:22:50 +0100 Subject: [PATCH] Update documentation --- genindex.html | 100 +++++++++++++++++++++++++++++++++++- lib/Api.html | 130 +++++++++++++++++++++++++++++++++++++++++++++++ lib/Battery.html | 20 ++++++++ lib/Buzzer.html | 17 +++++++ lib/Motor.html | 29 +++++++++++ lib/Servo.html | 26 ++++++++++ lib/Vision.html | 35 +++++++++++++ objects.inv | 7 ++- searchindex.js | 2 +- 9 files changed, 360 insertions(+), 6 deletions(-) diff --git a/genindex.html b/genindex.html index c91cea5..067b4c0 100644 --- a/genindex.html +++ b/genindex.html @@ -157,15 +157,73 @@

Index

- G + _ + | A + | B + | D + | G | L + | M + | P | S
+

_

+ + +
+ +

A

+ + +
+ +

B

+ + + +
+ +

D

+ + +
+

G

+
@@ -178,10 +236,50 @@ +

M

+ + +
+ +

P

+ + + +
+

S

+
diff --git a/lib/Api.html b/lib/Api.html index b04b240..cc76751 100644 --- a/lib/Api.html +++ b/lib/Api.html @@ -171,12 +171,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/Battery.html b/lib/Battery.html index 3919495..f1f2603 100644 --- a/lib/Battery.html +++ b/lib/Battery.html @@ -168,6 +168,26 @@

Battery

Class Documentation

+
+
+class compLib.Battery.Battery
+

Used to interact with the battery

+
+
+static percent() → int
+

Get battery percentage

+
+
Returns
+

Percentage between 0 and 100

+
+
Return type
+

int

+
+
+
+ +
+

Examples

diff --git a/lib/Buzzer.html b/lib/Buzzer.html index 7caf230..f8fe6ae 100644 --- a/lib/Buzzer.html +++ b/lib/Buzzer.html @@ -168,6 +168,23 @@

Buzzer

Class Documentation

+
+
+class compLib.Buzzer.Buzzer
+

Used to interact with the buzzer

+
+
+static set(on: bool)
+

Turn the buzzer on / off

+
+
Parameters
+

on – True if on, False if off

+
+
+
+ +
+

Examples

diff --git a/lib/Motor.html b/lib/Motor.html index a15d264..b55ec44 100644 --- a/lib/Motor.html +++ b/lib/Motor.html @@ -168,6 +168,35 @@

Motor

Class Documentation

+
+
+class compLib.Motor.Motor
+

Class used to control the motors

+
+
+static all_off()
+

Turns of all motors

+
+ +
+
+static power(port: int, percent: float)
+

Set specified motor to percentage power

+
+
Parameters
+
    +
  • port – Port, which the motor is connected to. 0-3, 0 -> top left, 3 -> top right

  • +
  • percent – Percentage of max speed. between -100 and 100

  • +
+
+
Raises
+

IndexError

+
+
+
+ +
+

Examples

diff --git a/lib/Servo.html b/lib/Servo.html index 3619e9d..63268b6 100644 --- a/lib/Servo.html +++ b/lib/Servo.html @@ -159,6 +159,32 @@

Servo

+
+
+class compLib.Servo.Servo
+

Control the servo ports on the robot

+
+
+static set_position(channel: int, angle: int, offset: float = 90)
+

Set position of servo connected to port

+
+
Parameters
+
    +
  • channel – channel between 0 and 7

  • +
  • angle – Angle of servo

  • +
+
+
+
+ +
+
+static setup_position()
+

Set position of servos to the position used during the setup process

+
+ +
+
diff --git a/lib/Vision.html b/lib/Vision.html index 58bef60..574dcd3 100644 --- a/lib/Vision.html +++ b/lib/Vision.html @@ -178,6 +178,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 e2d89b3..b23b578 100644 --- a/objects.inv +++ b/objects.inv @@ -2,7 +2,6 @@ # Project: CompLib # Version: # The remainder of this file is compressed using zlib. -xڝn } -Nvm۩R'U+JKR-} jv1o\RAUm認~ڕMْF~m~"٪[`K\ג2/qwc(vM^d[ WcPDd!_&9wB ʞڋXR(60o|K#ȏ׫!x:N/6-sF0FƓ$nԷ@Y<"$$/D(f4w݌6n괈(⹃ʓj P1`HM,'u[Ɠ[J/P"5;G\ -ށ -Ez .&G9YJvS7bc[Ǘ&JӆH@χ,5$2$QdOS! =aR \ No newline at end of file +xڝTMo0+,%Sn:DJUV20[IK~},`yo73%o3-/y_0hX2z@}B\5h\s j'jhl.7;\QMywUr ;8FnJ ]# ÍLE[aE J9uc0r +.;AZgNwkjƵ6y`ʷqbH~rͥ.Cqk0u] tarqHlbT㓖@ڕZ L[%pv'bzT5ѮHꑑ: gQF2 + # p1kj7 T 7IJ'>v}?44n2R Z 7PPrXM%hFCM*YńyJ U"5E;/uh