From 0f4f2438cb1f712e115c61e58ef11d8910867b19 Mon Sep 17 00:00:00 2001 From: Joel Date: Tue, 26 Jan 2021 20:40:55 +0100 Subject: [PATCH] Update documentation --- _sources/lib/Vision.rst.txt | 34 ++++++++++---------- _static/pygments.css | 7 +---- genindex.html | 22 +++++++------ index.html | 28 ++++++++--------- lib/Api.html | 47 +++++++++++++--------------- lib/Battery.html | 33 +++++++++----------- lib/Buzzer.html | 35 ++++++++++----------- lib/IRSensor.html | 31 +++++++++---------- lib/Logging.html | 31 +++++++++---------- lib/Motor.html | 31 +++++++++---------- lib/Servo.html | 31 +++++++++---------- lib/Vision.html | 62 ++++++++++++++++++------------------- other/usage.html | 33 +++++++++----------- search.html | 23 +++++++------- searchindex.js | 2 +- 15 files changed, 212 insertions(+), 238 deletions(-) diff --git a/_sources/lib/Vision.rst.txt b/_sources/lib/Vision.rst.txt index 736cc60..5c030d9 100644 --- a/_sources/lib/Vision.rst.txt +++ b/_sources/lib/Vision.rst.txt @@ -32,13 +32,14 @@ Using the Vision Module import cv2 from compLib import Vision - # get newest opencv frame from camera - frame = Vision.Streaming.get_frame() + while True: + # get newest opencv frame from camera + frame = Vision.Streaming.get_frame() - # do some processing with the frame..... + # do some processing with the frame..... - # publish frame to streaming server - Vision.Streaming.publish_frame(frame) + # publish frame to streaming server + Vision.Streaming.publish_frame(frame) Connect the raspberry pi to your internet and view the stream at: "http://your_raspi_ip:9898/". This should display your raspberry pi camera. Note: the stream will lag a little bit BUT the processing of the image will be done in @@ -68,22 +69,23 @@ For testing you can point it at this image: import cv2 from compLib import Vision - # get newest opencv frame from camera - frame = Vision.Streaming.get_frame() + while True: + # get newest opencv frame from camera + frame = Vision.Streaming.get_frame() - criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001) + criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001) - # convert image to grayscale image - gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) + # convert image to grayscale image + gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) - # find the chessboard corners - ret, corners = cv2.findChessboardCorners(gray, (6, 9), None) + # find the chessboard corners + ret, corners = cv2.findChessboardCorners(gray, (6, 9), None) - # draw detected chessboard position onto the image - cv2.drawChessboardCorners(frame, (6, 9), corners, ret) + # draw detected chessboard position onto the image + cv2.drawChessboardCorners(frame, (6, 9), corners, ret) - # publish frame to streaming server - Vision.Streaming.publish_frame(frame) + # publish frame to streaming server + Vision.Streaming.publish_frame(frame) Connect the raspberry pi to your internet and view the stream at: "http://your_raspi_ip:9898/". diff --git a/_static/pygments.css b/_static/pygments.css index 13b7243..631bc92 100644 --- a/_static/pygments.css +++ b/_static/pygments.css @@ -1,10 +1,5 @@ -pre { line-height: 125%; } -td.linenos pre { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; } -span.linenos { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; } -td.linenos pre.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } -span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } .highlight .hll { background-color: #ffffcc } -.highlight { background: #f8f8f8; } +.highlight { background: #f8f8f8; } .highlight .c { color: #408080; font-style: italic } /* Comment */ .highlight .err { border: 1px solid #FF0000 } /* Error */ .highlight .k { color: #008000; font-weight: bold } /* Keyword */ diff --git a/genindex.html b/genindex.html index f041b0c..25dd0b1 100644 --- a/genindex.html +++ b/genindex.html @@ -3,9 +3,9 @@ - + - + Index — CompLib 0.0.2 documentation @@ -16,10 +16,13 @@ + + + @@ -48,7 +51,7 @@ - CompLib + CompLib @@ -130,6 +133,8 @@ + +
    @@ -141,7 +146,7 @@
  • - +
  • @@ -316,28 +321,25 @@
- diff --git a/index.html b/index.html index b763e64..aa9bb4b 100644 --- a/index.html +++ b/index.html @@ -3,9 +3,9 @@ - + - + Robo4you Competition Library — CompLib 0.0.2 documentation @@ -16,10 +16,13 @@ + + + @@ -49,7 +52,7 @@ - CompLib + CompLib @@ -131,6 +134,8 @@ + +
- diff --git a/lib/Api.html b/lib/Api.html index 3a8f2b3..35a9f60 100644 --- a/lib/Api.html +++ b/lib/Api.html @@ -3,9 +3,9 @@ - + - + Api — CompLib 0.0.2 documentation @@ -16,10 +16,13 @@ + + + @@ -50,7 +53,7 @@ - CompLib + CompLib @@ -142,6 +145,8 @@ + +
@@ -328,10 +333,10 @@
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}")
+print(f"Position of my robot is: x={position.x}, y={position.y} and rotation is: {position.degrees}")
 
 goal = DoubleElim.get_goal()
-print(f"Goal is at: x={goal.x}, y={goal.y}")
+print(f"Goal is at: x={goal.x}, y={goal.y}")
 
@@ -343,37 +348,29 @@ - diff --git a/lib/Battery.html b/lib/Battery.html index f1f2603..8f783cb 100644 --- a/lib/Battery.html +++ b/lib/Battery.html @@ -3,9 +3,9 @@ - + - + Battery — CompLib 0.0.2 documentation @@ -16,10 +16,13 @@ + + + @@ -50,7 +53,7 @@ - CompLib + CompLib @@ -139,6 +142,8 @@ + +
@@ -207,37 +212,29 @@ - diff --git a/lib/Buzzer.html b/lib/Buzzer.html index f8fe6ae..61ce7e4 100644 --- a/lib/Buzzer.html +++ b/lib/Buzzer.html @@ -3,9 +3,9 @@ - + - + Buzzer — CompLib 0.0.2 documentation @@ -16,10 +16,13 @@ + + + @@ -50,7 +53,7 @@ - CompLib + CompLib @@ -139,6 +142,8 @@ + +
@@ -207,37 +212,29 @@ - diff --git a/lib/IRSensor.html b/lib/IRSensor.html index ebf7f89..ecc25d9 100644 --- a/lib/IRSensor.html +++ b/lib/IRSensor.html @@ -3,9 +3,9 @@ - + - + Infrared Sensor — CompLib 0.0.2 documentation @@ -16,10 +16,13 @@ + + + @@ -50,7 +53,7 @@ - CompLib + CompLib @@ -132,6 +135,8 @@ + +
- diff --git a/lib/Logging.html b/lib/Logging.html index 69c2b5e..809c3e6 100644 --- a/lib/Logging.html +++ b/lib/Logging.html @@ -3,9 +3,9 @@ - + - + Logging — CompLib 0.0.2 documentation @@ -16,10 +16,13 @@ + + + @@ -50,7 +53,7 @@ - CompLib + CompLib @@ -139,6 +142,8 @@ + +
- diff --git a/lib/Motor.html b/lib/Motor.html index b55ec44..ad36309 100644 --- a/lib/Motor.html +++ b/lib/Motor.html @@ -3,9 +3,9 @@ - + - + Motor — CompLib 0.0.2 documentation @@ -16,10 +16,13 @@ + + + @@ -50,7 +53,7 @@ - CompLib + CompLib @@ -139,6 +142,8 @@ + +
- diff --git a/lib/Servo.html b/lib/Servo.html index 93c079e..3e3183f 100644 --- a/lib/Servo.html +++ b/lib/Servo.html @@ -3,9 +3,9 @@ - + - + Servo — CompLib 0.0.2 documentation @@ -16,10 +16,13 @@ + + + @@ -50,7 +53,7 @@ - CompLib + CompLib @@ -132,6 +135,8 @@ + +
- diff --git a/lib/Vision.html b/lib/Vision.html index 03a4c84..f8f9ad0 100644 --- a/lib/Vision.html +++ b/lib/Vision.html @@ -3,9 +3,9 @@ - + - + Vision — CompLib 0.0.2 documentation @@ -16,10 +16,13 @@ + + + @@ -49,7 +52,7 @@ - CompLib + CompLib @@ -139,6 +142,8 @@ + +
- diff --git a/other/usage.html b/other/usage.html index 68810c8..cb0cffe 100644 --- a/other/usage.html +++ b/other/usage.html @@ -3,9 +3,9 @@ - + - + Usage — CompLib 0.0.2 documentation @@ -16,10 +16,13 @@ + + + @@ -50,7 +53,7 @@ - CompLib + CompLib @@ -132,6 +135,8 @@ + +
- diff --git a/search.html b/search.html index dc9c708..f005a84 100644 --- a/search.html +++ b/search.html @@ -3,9 +3,9 @@ - + - + Search — CompLib 0.0.2 documentation @@ -16,10 +16,13 @@ + + +