Skip to content

Commit

Permalink
Updated to a beta release
Browse files Browse the repository at this point in the history
As this release is not stable, or properly formatted, it has been marked as a beta release
Renamed test files to be more specific

Signed-off-by: Alex Pereira <[email protected]>
  • Loading branch information
Mario13546 committed Feb 24, 2023
1 parent c0bd3be commit 3a2c9ae
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
File renamed without changes.
32 changes: 32 additions & 0 deletions tests/test_detection.py
Original file line number Diff line number Diff line change
@@ -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
32 changes: 32 additions & 0 deletions tests/test_stream.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 3a2c9ae

Please sign in to comment.