diff --git a/pyproject.toml b/pyproject.toml index ef914b6..2c7852d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,12 @@ name = "frc-apriltags" # Required # # For a discussion on single-sourcing the version, see # https://packaging.python.org/guides/single-sourcing-package-version/ -version = "0.3.0" # Required +version = "0.3.0.b0" # Required +# Pre-releases denotations: +# dev releases (denoted with a “.devN” suffix) +# alpha releases (denoted with a “.aN” suffix) +# beta releases (denoted with a “.bN” suffix) +# release candidates (denoted with a “.rcN” suffix) # This is a one-line description or tagline of what your project does. This # corresponds to the "Summary" metadata field: diff --git a/tests/test.py b/tests/test_all.py similarity index 100% rename from tests/test.py rename to tests/test_all.py diff --git a/tests/test_detection.py b/tests/test_detection.py new file mode 100644 index 0000000..bb25e09 --- /dev/null +++ b/tests/test_detection.py @@ -0,0 +1,32 @@ +# Import Classes +from frc_apriltags.stream import BasicStreaming +from frc_apriltags.camera import USBCamera +from frc_apriltags.apriltags import Detector + +# Defines the camera resolutions (width x height) +tagCamRes = (1280, 720) + +# Creates a USBCamera and calibrates it +camera = USBCamera(camNum = 0, path = "/dev/v4l/by-path/platform-70090000.xusb-usb-0:2.4:1.0-video-index0", resolution = tagCamRes, calibrate = False) +camMatrix = camera.getMatrix() + +# Prealocate space for the detection stream +stream = camera.prealocateSpace(tagCamRes) + +# Instance creation +detector = Detector() + +# Main loop +while (True): + # Gets the stream + stream = camera.getUndistortedStream() + + # Runs April Tag detection on the undistorted image + results, stream = detector.detectTags(stream, camMatrix, 0) + + # Displays the stream + camera.displayStream() + + # Press q to end the program + if ( camera.getEnd() == True ): + break \ No newline at end of file diff --git a/tests/test_stream.py b/tests/test_stream.py new file mode 100644 index 0000000..75bb7b2 --- /dev/null +++ b/tests/test_stream.py @@ -0,0 +1,32 @@ +# Import Classes +from frc_apriltags.stream import BasicStreaming +from frc_apriltags.camera import USBCamera +from frc_apriltags.apriltags import Detector + +# Defines the camera resolutions (width x height) +tagCamRes = (1280, 720) + +# Creates a USBCamera and calibrates it +camera = USBCamera(camNum = 0, path = "/dev/v4l/by-path/platform-70090000.xusb-usb-0:2.4:1.0-video-index0", resolution = tagCamRes, calibrate = False) +camMatrix = camera.getMatrix() + +# Creates a camera for the drivers +driverCam = BasicStreaming(camNum = 1, path = "/dev/v4l/by-path/platform-70090000.xusb-usb-0:2.2:1.0-video-index0") + +# Prealocate space for the detection stream +stream = camera.prealocateSpace(tagCamRes) + +# Instance creation +detector = Detector() + +# Main loop +while (True): + # Gets the stream + stream = camera.getUndistortedStream() + + # Displays the stream + camera.displayStream() + + # Press q to end the program + if ( camera.getEnd() == True ): + break \ No newline at end of file