Skip to content

Commit

Permalink
Merge pull request #95 from fletch3555/rename-examples-for-consistency
Browse files Browse the repository at this point in the history
rename example project folder names to match java but hyphenated
  • Loading branch information
virtuald authored Dec 21, 2023
2 parents 9253953 + 715b524 commit 7082531
Show file tree
Hide file tree
Showing 102 changed files with 56 additions and 77 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 0 additions & 21 deletions cscore-quick-vision/robot.py

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

class MyRobot(wpilib.TimedRobot):
"""
This is a good foundation to build your robot code on
This is a demo program showing the use of OpenCV to do vision processing. The image is acquired
from the USB camera, then a rectangle is put on the image and sent to the dashboard. OpenCV has
many methods for different types of processing.
"""

def robotInit(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
#

#
# This is a demo program showing CameraServer usage with OpenCV to do image
# processing. The image is acquired from the USB camera, then a rectangle
# is put on the image and sent to the dashboard. OpenCV has many methods
# for different types of processing.
# This is a demo program showing the use of OpenCV to do vision processing. The image is acquired
# from the USB camera, then a rectangle is put on the image and sent to the dashboard. OpenCV has
# many methods for different types of processing.
#
# NOTE: This code runs in its own process, so we cannot access the robot here,
# nor can we create/use/see wpilib objects
Expand All @@ -26,31 +25,31 @@
def main():
CS.enableLogging()

# Get the UsbCamera from CameraServer
camera = CS.startAutomaticCapture()

camera.setResolution(320, 240)
# Set the resolution
camera.setResolution(640, 480)

# Get a CvSink. This will capture images from the camera
cvSink = CS.getVideo()

# (optional) Setup a CvSource. This will send images back to the Dashboard
outputStream = CS.putVideo("Rectangle", 320, 240)
# Setup a CvSource. This will send images back to the Dashboard
outputStream = CS.putVideo("Rectangle", 640, 480)

# Allocating new images is very expensive, always try to preallocate
img = np.zeros(shape=(240, 320, 3), dtype=np.uint8)
mat = np.zeros(shape=(480, 640, 3), dtype=np.uint8)

while True:
# Tell the CvSink to grab a frame from the camera and put it
# in the source image. If there is an error notify the output.
time, img = cvSink.grabFrame(img)
time, mat = cvSink.grabFrame(mat)
if time == 0:
# Send the output the error.
outputStream.notifyError(cvSink.getError())
# skip the rest of the current iteration
continue

# Put a rectangle on the image
cv2.rectangle(img, (100, 100), (300, 300), (255, 255, 255), 5)
cv2.rectangle(mat, (100, 100), (400, 400), (255, 255, 255), 5)

# Give the output stream a new image to display
outputStream.putFrame(img)
outputStream.putFrame(mat)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
83 changes: 41 additions & 42 deletions run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,65 +5,64 @@ cd "$(dirname $0)"
# Keep this list alphabetically sorted
BASE_TESTS="
addressableled
arcade-drive
arcade-drive-xbox-controller
arm-simulation
arcadedrive
arcadedrivexboxcontroller
armsimulation
canpdp
hatchbot
hatchbot-inlined
cscore-intermediate-vision
cscore-quick-vision
differential-drive-bot
digital-communication
dutycycle-encoder
dutycycle-input
elevator-profiled-pid
elevator-simulation
elevator-trapezoid-profile
differentialdrivebot
digitalcommunication
dutycycleencoder
dutycycleinput
elevatorprofiledpid
elevatorsimulation
elevatortrapezoidprofile
encoder
flywheel-bangbang-controller
game-data
getting-started
flywheelbangbangcontroller
gamedata
gettingstarted
gyro
gyro-mecanum
hid-rumble
i2c-communication
magicbot-simple
mecanum-bot
mecanum-drive
mecanum-driveXbox
gyromecanum
hatchbot
hatchbotinlined
hidrumble
i2ccommunication
intermediatevision
magicbotsimple
mecanumbot
mecanumdrive
mecanumdriveXbox
mechanism2d
motor-control
motorcontrol
physics/src
physics-4wheel/src
physics-mecanum/src
physics-spi/src
potentiometer-pid
quick-vision
ramsete-controller
physics4wheel/src
physicsmecanum/src
physicsspi/src
potentiometerpid
quickvision
ramsetecontroller
relay
shuffleboard
solenoid
stateful-autonomous
state-space-flywheel
tank-drive
tank-drive-xbox-controller
statefulautonomous
statespaceflywheel
tankdrive
tankdrivexboxcontroller
timed/src
ultrasonic
ultrasonic-pid
ultrasonicpid
"

IGNORED_TESTS="
armbot
armbotoffboard
drive-distance-offboard
frisbee-bot
gyro-drive-commands
ramsete
scheduler-event-logging
drivedistanceoffboard
frisbeebot
gyrodrivecommands
ramsetecommand
schedulereventlogging
selectcommand
romi
physics-camsim/src
physicscamsim/src
"

ALL_TESTS="${BASE_TESTS}"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 7082531

Please sign in to comment.